Browse Source

Upgrade JiBX (and BCEL) towards support of 1.8 bytecode level

Issue: SPR-10423
pull/1196/head
Juergen Hoeller 10 years ago
parent
commit
da3e8611e1
  1. 15
      build.gradle
  2. 30
      spring-oxm/oxm.gradle
  3. 3
      spring-oxm/src/test/java/org/springframework/oxm/jibx/Flights.java
  4. 4
      spring-oxm/src/test/resources/org/springframework/oxm/jibx/binding.xml

15
build.gradle

@ -556,13 +556,6 @@ project("spring-oxm") {
description = "Spring Object/XML Marshalling" description = "Spring Object/XML Marshalling"
apply from: "oxm.gradle" apply from: "oxm.gradle"
compileTestJava {
// necessary to avoid java.lang.VerifyError on jibx compilation
// see http://jira.codehaus.org/browse/JIBX-465
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
dependencies { dependencies {
compile(project(":spring-beans")) compile(project(":spring-beans"))
compile(project(":spring-core")) compile(project(":spring-core"))
@ -584,11 +577,9 @@ project("spring-oxm") {
testCompile("org.codehaus.jettison:jettison:1.3.7") { testCompile("org.codehaus.jettison:jettison:1.3.7") {
exclude group: 'stax', module: 'stax-api' exclude group: 'stax', module: 'stax-api'
} }
if (compileTestJava.enabled) { testCompile(files(genCastor.classesDir).builtBy(genCastor))
testCompile(files(genCastor.classesDir).builtBy(genCastor)) testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
testCompile(files(genJaxb.classesDir).builtBy(genJaxb)) testCompile(files(genXmlbeans.classesDir).builtBy(genXmlbeans))
testCompile(files(genXmlbeans.classesDir).builtBy(genXmlbeans))
}
} }
} }

30
spring-oxm/oxm.gradle

@ -7,6 +7,7 @@ configurations {
dependencies { dependencies {
castor "org.codehaus.castor:castor-anttasks:1.4.1" castor "org.codehaus.castor:castor-anttasks:1.4.1"
jibx "org.jibx:jibx-bind:1.2.6" jibx "org.jibx:jibx-bind:1.2.6"
jibx "org.apache.bcel:bcel:6.0"
xjc "com.sun.xml.bind:jaxb-xjc:2.1.17" xjc "com.sun.xml.bind:jaxb-xjc:2.1.17"
xmlbeans "org.apache.xmlbeans:xmlbeans:2.6.0" xmlbeans "org.apache.xmlbeans:xmlbeans:2.6.0"
} }
@ -108,23 +109,18 @@ task genXmlbeans {
} }
} }
// add jibx binding to the normal test compilation process compileTestJava {
// INCOMPATIBLE WITH OPENJDK 8 b89+ def bindingXml = "${projectDir}/src/test/resources/org/springframework/oxm/jibx/binding.xml"
def jibxEnabled = project.properties.get("testGroups")?.toLowerCase()?.split(",")?.contains("custom_compilation")
if (jibxEnabled) { doLast() {
compileTestJava { project.ant {
def bindingXml = "${projectDir}/src/test/resources/org/springframework/oxm/jibx/binding.xml" taskdef(name: "jibx",
classname: "org.jibx.binding.ant.CompileTask",
doLast() { classpath: configurations.jibx.asPath)
project.ant {
taskdef(name: "jibx", jibx(verbose: true, load: true, binding: bindingXml) {
classname: "org.jibx.binding.ant.CompileTask", classpathset(dir: sourceSets.test.output.classesDir) {
classpath: configurations.jibx.asPath) include(name: "**/jibx/**/*")
jibx(verbose: true, load: true, binding: bindingXml) {
classpathset(dir: sourceSets.test.output.classesDir) {
include(name: "**/jibx/**/*")
}
} }
} }
} }

3
spring-oxm/src/test/java/org/springframework/oxm/jibx/Flights.java

@ -17,11 +17,10 @@
package org.springframework.oxm.jibx; package org.springframework.oxm.jibx;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
public class Flights { public class Flights {
protected List<FlightType> flightList = new ArrayList<FlightType>(); protected ArrayList<FlightType> flightList = new ArrayList<FlightType>();
public void addFlight(FlightType flight) { public void addFlight(FlightType flight) {
flightList.add(flight); flightList.add(flight);

4
spring-oxm/src/test/resources/org/springframework/oxm/jibx/binding.xml

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<binding> <binding>
<mapping name="flights" class="org.springframework.oxm.jibx.Flights"> <mapping name="flights" class="org.springframework.oxm.jibx.Flights">
<namespace uri="http://samples.springframework.org/flight" default="elements"/> <namespace uri="http://www.springframework.org/flight" default="elements"/>
<collection field="flightList"> <collection field="flightList">
<structure map-as="org.springframework.oxm.jibx.FlightType"/> <structure map-as="org.springframework.oxm.jibx.FlightType"/>
</collection> </collection>
</mapping> </mapping>
<mapping name="flight" class="org.springframework.oxm.jibx.FlightType"> <mapping name="flight" class="org.springframework.oxm.jibx.FlightType">
<namespace uri="http://samples.springframework.org/flight" default="elements"/> <namespace uri="http://www.springframework.org/flight" default="elements"/>
<value name="airline" field="airline" usage="optional"/> <value name="airline" field="airline" usage="optional"/>
<value name="number" field="number" usage="required"/> <value name="number" field="number" usage="required"/>
</mapping> </mapping>

Loading…
Cancel
Save