diff --git a/build.gradle b/build.gradle index 392123ca3ae..1851be43f7e 100644 --- a/build.gradle +++ b/build.gradle @@ -68,7 +68,7 @@ configure(allprojects) { project -> ext.jodaVersion = "2.9.9" ext.jpaVersion = "2.1.1" ext.jsfVersion = "2.2" - ext.jsonBindingVersion = "1.0.0-RC2" + ext.jsonBindingVersion = "1.0" ext.jspVersion = "2.3.2-b02" ext.jtaVersion = "1.2" ext.junitVersion = "4.12" @@ -86,7 +86,7 @@ configure(allprojects) { project -> ext.romeVersion = "1.7.3" ext.rxjavaVersion = '1.3.0' ext.rxjavaAdapterVersion = '1.2.1' - ext.rxjava2Version = '2.1.0' + ext.rxjava2Version = '2.1.1' ext.rxnettyVersion = '0.5.2' ext.servletVersion = "3.1.0" ext.slf4jVersion = "1.7.25" @@ -322,7 +322,7 @@ project("spring-core") { // further transformed by the JarJar task to depend on org.springframework.asm; this // avoids including two different copies of asm unnecessarily. def cglibVersion = "3.2.5" - def objenesisVersion = "2.5.1" + def objenesisVersion = "2.6" configurations { jarjar @@ -597,6 +597,7 @@ project("spring-messaging") { testCompile("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}") testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}") testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}") + testRuntime("javax.activation:activation:${activationApiVersion}") } } @@ -779,67 +780,6 @@ project("spring-web") { } } -project("spring-webflux") { - description = "Spring WebFlux" - - dependencies { - compile(project(":spring-core")) - compile(project(":spring-web")) - compile("org.reactivestreams:reactive-streams") - compile("io.projectreactor:reactor-core") - optional(project(":spring-context-support")) // for FreeMarker support - provided "javax.servlet:javax.servlet-api:${servletVersion}" - optional("javax.xml.bind:jaxb-api:${jaxbVersion}") - optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}") - optional("org.freemarker:freemarker:${freemarkerVersion}") - optional("org.apache.httpcomponents:httpclient:${httpclientVersion}") { - exclude group: "commons-logging", module: "commons-logging" - } - optional('org.webjars:webjars-locator:0.32-1') - optional("io.projectreactor.ipc:reactor-netty") - optional("io.reactivex:rxjava:${rxjavaVersion}") - optional("io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}") - optional("javax.websocket:javax.websocket-api:${websocketVersion}") - optional("org.apache.tomcat:tomcat-websocket:${tomcatVersion}") { - exclude group: "org.apache.tomcat", module: "tomcat-websocket-api" - exclude group: "org.apache.tomcat", module: "tomcat-servlet-api" - } - optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") { - exclude group: "javax.servlet", module: "javax.servlet" - } - optional("io.undertow:undertow-websockets-jsr:${undertowVersion}") { - exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec" - } - optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}") - optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}") - testCompile("io.projectreactor:reactor-test") - testCompile("javax.validation:validation-api:${beanvalVersion}") - testCompile("org.hibernate:hibernate-validator:${hibvalVersion}") - testCompile("org.apache.tomcat:tomcat-util:${tomcatVersion}") - testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}") - testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") - testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") - testCompile "io.reactivex.rxjava2:rxjava:${rxjava2Version}" - testCompile("io.undertow:undertow-core:${undertowVersion}") - testCompile("io.reactivex:rxnetty-http:${rxnettyVersion}") { - exclude group: 'io.reactivex', module: 'rxjava' - } - testCompile("com.fasterxml:aalto-xml:1.0.0") - testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}") - testCompile("com.squareup.okhttp3:mockwebserver:${okhttp3Version}") - testCompile("org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}") - testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}") - testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}") - testRuntime("org.jruby:jruby:9.1.9.0") - testRuntime("org.python:jython-standalone:2.5.3") - testRuntime("org.webjars:underscorejs:1.8.3") - testRuntime("org.glassfish:javax.el:3.0.1-b08") - testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}") - testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}") - testRuntime("org.synchronoss.cloud:nio-multipart-parser:${niomultipartVersion}") - } -} - project("spring-orm") { description = "Spring Object/Relational Mapping" @@ -948,6 +888,7 @@ project("spring-webmvc") { testRuntime("org.glassfish:javax.el:3.0.1-b08") testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}") testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}") + testRuntime("javax.activation:activation:${activationApiVersion}") } } @@ -995,6 +936,68 @@ project("spring-websocket") { } } +project("spring-webflux") { + description = "Spring WebFlux" + + dependencies { + compile(project(":spring-core")) + compile(project(":spring-web")) + compile("org.reactivestreams:reactive-streams") + compile("io.projectreactor:reactor-core") + optional(project(":spring-context-support")) // for FreeMarker support + provided "javax.servlet:javax.servlet-api:${servletVersion}" + optional("javax.xml.bind:jaxb-api:${jaxbVersion}") + optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}") + optional("org.freemarker:freemarker:${freemarkerVersion}") + optional("org.apache.httpcomponents:httpclient:${httpclientVersion}") { + exclude group: "commons-logging", module: "commons-logging" + } + optional('org.webjars:webjars-locator:0.32-1') + optional("io.projectreactor.ipc:reactor-netty") + optional("io.reactivex:rxjava:${rxjavaVersion}") + optional("io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}") + optional("javax.websocket:javax.websocket-api:${websocketVersion}") + optional("org.apache.tomcat:tomcat-websocket:${tomcatVersion}") { + exclude group: "org.apache.tomcat", module: "tomcat-websocket-api" + exclude group: "org.apache.tomcat", module: "tomcat-servlet-api" + } + optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") { + exclude group: "javax.servlet", module: "javax.servlet" + } + optional("io.undertow:undertow-websockets-jsr:${undertowVersion}") { + exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec" + } + optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}") + optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}") + testCompile("io.projectreactor:reactor-test") + testCompile("javax.validation:validation-api:${beanvalVersion}") + testCompile("org.hibernate:hibernate-validator:${hibvalVersion}") + testCompile("org.apache.tomcat:tomcat-util:${tomcatVersion}") + testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}") + testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") + testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") + testCompile "io.reactivex.rxjava2:rxjava:${rxjava2Version}" + testCompile("io.undertow:undertow-core:${undertowVersion}") + testCompile("io.reactivex:rxnetty-http:${rxnettyVersion}") { + exclude group: 'io.reactivex', module: 'rxjava' + } + testCompile("com.fasterxml:aalto-xml:1.0.0") + testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}") + testCompile("com.squareup.okhttp3:mockwebserver:${okhttp3Version}") + testCompile("org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}") + testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}") + testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}") + testRuntime("org.jruby:jruby:9.1.9.0") + testRuntime("org.python:jython-standalone:2.5.3") + testRuntime("org.synchronoss.cloud:nio-multipart-parser:${niomultipartVersion}") + testRuntime("org.webjars:underscorejs:1.8.3") + testRuntime("org.glassfish:javax.el:3.0.1-b08") + testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}") + testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}") + testRuntime("javax.activation:activation:${activationApiVersion}") + } +} + project("spring-test") { description = "Spring TestContext Framework" @@ -1074,6 +1077,7 @@ project("spring-test") { testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}") // Java Util Logging for JUnit 5 testRuntime("org.ehcache:ehcache:${ehcache3Version}") testRuntime("org.terracotta:management-model:2.0.0") + testRuntime("javax.annotation:javax.annotation-api:${annotationApiVersion}") testRuntime("javax.el:javax.el-api:${elApiVersion}") testRuntime("org.glassfish:javax.el:3.0.1-b08") testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}") @@ -1251,7 +1255,7 @@ configure(rootProject) { task wrapper(type: Wrapper) { description = "Generates gradlew[.bat] scripts" - gradleVersion = '3.5' + gradleVersion = '3.5.1' doLast() { def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index edb8a3b0004..9e54d4019e9 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 730b6868465..8bb8730b670 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Apr 10 21:20:52 CEST 2017 +#Mon Jun 26 15:28:23 CEST 2017 +distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-bin.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip +zipStoreBase=GRADLE_USER_HOME diff --git a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java index 73702b67cec..d5a24687c3e 100644 --- a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java +++ b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java @@ -448,6 +448,7 @@ public abstract class ReflectionUtils { * @param field the field to make accessible * @see java.lang.reflect.Field#setAccessible */ + @SuppressWarnings("deprecation") // on JDK 9 public static void makeAccessible(Field field) { if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) || @@ -464,6 +465,7 @@ public abstract class ReflectionUtils { * @param method the method to make accessible * @see java.lang.reflect.Method#setAccessible */ + @SuppressWarnings("deprecation") // on JDK 9 public static void makeAccessible(Method method) { if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) && !method.isAccessible()) { @@ -479,6 +481,7 @@ public abstract class ReflectionUtils { * @param ctor the constructor to make accessible * @see java.lang.reflect.Constructor#setAccessible */ + @SuppressWarnings("deprecation") // on JDK 9 public static void makeAccessible(Constructor> ctor) { if ((!Modifier.isPublic(ctor.getModifiers()) || !Modifier.isPublic(ctor.getDeclaringClass().getModifiers())) && !ctor.isAccessible()) { diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java b/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java index 346fc2aa19f..848696e6ab4 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java @@ -581,13 +581,9 @@ public class ReflectivePropertyAccessor implements PropertyAccessor { private final TypeDescriptor typeDescriptor; - private final boolean needsToBeMadeAccessible; - OptimalPropertyAccessor(InvokerPair target) { this.member = target.member; this.typeDescriptor = target.typeDescriptor; - this.needsToBeMadeAccessible = (!Modifier.isPublic(this.member.getModifiers()) || - !Modifier.isPublic(this.member.getDeclaringClass().getModifiers())); } @Override @@ -625,9 +621,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor { if (this.member instanceof Method) { Method method = (Method) this.member; try { - if (this.needsToBeMadeAccessible && !method.isAccessible()) { - method.setAccessible(true); - } + ReflectionUtils.makeAccessible(method); Object value = method.invoke(target); return new TypedValue(value, this.typeDescriptor.narrow(value)); } @@ -638,9 +632,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor { else { Field field = (Field) this.member; try { - if (this.needsToBeMadeAccessible && !field.isAccessible()) { - field.setAccessible(true); - } + ReflectionUtils.makeAccessible(field); Object value = field.get(target); return new TypedValue(value, this.typeDescriptor.narrow(value)); } diff --git a/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java b/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java index a632294738d..1493c894b16 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java +++ b/spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java @@ -18,10 +18,10 @@ package org.springframework.http.codec.xml; import java.io.InputStream; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.function.Function; -import javax.xml.stream.XMLEventReader; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.events.XMLEvent; @@ -46,14 +46,16 @@ import org.springframework.util.MimeType; import org.springframework.util.MimeTypeUtils; /** - * Decodes a {@link DataBuffer} stream into a stream of {@link XMLEvent}s. That is, given - * the following XML: + * Decodes a {@link DataBuffer} stream into a stream of {@link XMLEvent}s. + * That is, given the following XML: + * *
{@code
*
* foo
* bar
* }
*
+ *
* this method with result in a flux with the following events:
*