diff --git a/spring-core/src/main/java/org/springframework/core/ReactiveAdapter.java b/spring-core/src/main/java/org/springframework/core/ReactiveAdapter.java index c3af380b808..0356f47f59e 100644 --- a/spring-core/src/main/java/org/springframework/core/ReactiveAdapter.java +++ b/spring-core/src/main/java/org/springframework/core/ReactiveAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,17 +84,17 @@ public class ReactiveAdapter { } /** - * Shortcut for {@code getDescriptor().supportsEmpty()}. + * Shortcut for {@code getDescriptor().isNoValue()}. */ - public boolean supportsEmpty() { - return getDescriptor().supportsEmpty(); + public boolean isNoValue() { + return getDescriptor().isNoValue(); } /** - * Shortcut for {@code getDescriptor().isNoValue()}. + * Shortcut for {@code getDescriptor().supportsEmpty()}. */ - public boolean isNoValue() { - return getDescriptor().isNoValue(); + public boolean supportsEmpty() { + return getDescriptor().supportsEmpty(); } diff --git a/spring-core/src/main/java/org/springframework/core/ReactiveTypeDescriptor.java b/spring-core/src/main/java/org/springframework/core/ReactiveTypeDescriptor.java index 9dbf2308721..0c0183845f6 100644 --- a/spring-core/src/main/java/org/springframework/core/ReactiveTypeDescriptor.java +++ b/spring-core/src/main/java/org/springframework/core/ReactiveTypeDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import org.springframework.util.Assert; /** * Describes the semantics of a reactive type including boolean checks for - * {@link #isMultiValue()}, {@link #supportsEmpty()}, and {@link #isNoValue()}. + * {@link #isMultiValue()}, {@link #isNoValue()}, and {@link #supportsEmpty()}. * * @author Rossen Stoyanchev * @since 5.0 @@ -32,25 +32,25 @@ public final class ReactiveTypeDescriptor { private final Class reactiveType; - @Nullable - private final Supplier emptyValueSupplier; - private final boolean multiValue; private final boolean noValue; + @Nullable + private final Supplier emptyValueSupplier; + /** * Private constructor. See static factory methods. */ - private ReactiveTypeDescriptor(Class reactiveType, @Nullable Supplier emptySupplier, - boolean multiValue, boolean noValue) { + private ReactiveTypeDescriptor(Class reactiveType, boolean multiValue, boolean noValue, + @Nullable Supplier emptySupplier) { Assert.notNull(reactiveType, "'reactiveType' must not be null"); this.reactiveType = reactiveType; - this.emptyValueSupplier = emptySupplier; this.multiValue = multiValue; this.noValue = noValue; + this.emptyValueSupplier = emptySupplier; } @@ -71,13 +71,6 @@ public final class ReactiveTypeDescriptor { return this.multiValue; } - /** - * Return {@code true} if the reactive type can complete with no values. - */ - public boolean supportsEmpty() { - return (this.emptyValueSupplier != null); - } - /** * Return {@code true} if the reactive type does not produce any values and * only provides completion and error signals. @@ -86,6 +79,13 @@ public final class ReactiveTypeDescriptor { return this.noValue; } + /** + * Return {@code true} if the reactive type can complete with no values. + */ + public boolean supportsEmpty() { + return (this.emptyValueSupplier != null); + } + /** * Return an empty-value instance for the underlying reactive or async type. * Use of this type implies {@link #supportsEmpty()} is true. @@ -119,7 +119,7 @@ public final class ReactiveTypeDescriptor { * @param emptySupplier a supplier of an empty-value instance of the reactive type */ public static ReactiveTypeDescriptor multiValue(Class type, Supplier emptySupplier) { - return new ReactiveTypeDescriptor(type, emptySupplier, true, false); + return new ReactiveTypeDescriptor(type, true, false, emptySupplier); } /** @@ -128,7 +128,7 @@ public final class ReactiveTypeDescriptor { * @param emptySupplier a supplier of an empty-value instance of the reactive type */ public static ReactiveTypeDescriptor singleOptionalValue(Class type, Supplier emptySupplier) { - return new ReactiveTypeDescriptor(type, emptySupplier, false, false); + return new ReactiveTypeDescriptor(type, false, false, emptySupplier); } /** @@ -136,7 +136,7 @@ public final class ReactiveTypeDescriptor { * @param type the reactive type */ public static ReactiveTypeDescriptor singleRequiredValue(Class type) { - return new ReactiveTypeDescriptor(type, null, false, false); + return new ReactiveTypeDescriptor(type, false, false, null); } /** @@ -145,7 +145,7 @@ public final class ReactiveTypeDescriptor { * @param emptySupplier a supplier of an empty-value instance of the reactive type */ public static ReactiveTypeDescriptor noValue(Class type, Supplier emptySupplier) { - return new ReactiveTypeDescriptor(type, emptySupplier, false, true); + return new ReactiveTypeDescriptor(type, false, true, emptySupplier); } } diff --git a/spring-web/spring-web.gradle b/spring-web/spring-web.gradle index dfac2ecd57f..354b65f771d 100644 --- a/spring-web/spring-web.gradle +++ b/spring-web/spring-web.gradle @@ -38,7 +38,7 @@ dependencies { exclude group: "javax.servlet", module: "javax.servlet-api" } optional("org.eclipse.jetty:jetty-reactive-httpclient:1.0.3") - optional("com.squareup.okhttp3:okhttp:3.14.1") + optional("com.squareup.okhttp3:okhttp:3.14.2") optional("org.apache.httpcomponents:httpclient:4.5.8") { exclude group: "commons-logging", module: "commons-logging" } @@ -75,7 +75,7 @@ dependencies { testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}") testCompile("org.eclipse.jetty:jetty-server") testCompile("org.eclipse.jetty:jetty-servlet") - testCompile("com.squareup.okhttp3:mockwebserver:3.14.1") + testCompile("com.squareup.okhttp3:mockwebserver:3.14.2") testCompile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}") testCompile("org.skyscreamer:jsonassert:1.5.0") testCompile("org.xmlunit:xmlunit-matchers:2.6.2") diff --git a/spring-webflux/spring-webflux.gradle b/spring-webflux/spring-webflux.gradle index 987189c19a1..e252fe3e39e 100644 --- a/spring-webflux/spring-webflux.gradle +++ b/spring-webflux/spring-webflux.gradle @@ -54,12 +54,12 @@ dependencies { testCompile("org.eclipse.jetty:jetty-server") testCompile("org.eclipse.jetty:jetty-servlet") testCompile("org.eclipse.jetty:jetty-reactive-httpclient:1.0.3") - testCompile("com.squareup.okhttp3:mockwebserver:3.14.1") + testCompile("com.squareup.okhttp3:mockwebserver:3.14.2") testCompile("org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}") testCompile(project(":spring-core-coroutines")) testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}") testRuntime("org.jetbrains.kotlin:kotlin-compiler-embeddable:${kotlinVersion}") - testRuntime("org.jruby:jruby:9.2.6.0") + testRuntime("org.jruby:jruby:9.2.7.0") testRuntime("org.python:jython-standalone:2.7.1") testRuntime("org.synchronoss.cloud:nio-multipart-parser:1.1.0") testRuntime("org.webjars:underscorejs:1.8.3") diff --git a/spring-webmvc/spring-webmvc.gradle b/spring-webmvc/spring-webmvc.gradle index 8358b322c4e..9baf62c6b40 100644 --- a/spring-webmvc/spring-webmvc.gradle +++ b/spring-webmvc/spring-webmvc.gradle @@ -23,7 +23,7 @@ dependencies { optional("javax.xml.bind:jaxb-api:2.3.1") optional("org.webjars:webjars-locator-core:0.37") optional("com.rometools:rome:1.12.0") - optional("com.github.librepdf:openpdf:1.2.16") + optional("com.github.librepdf:openpdf:1.2.17") optional("org.apache.poi:poi-ooxml:4.1.0") optional("org.freemarker:freemarker:${freemarkerVersion}") optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}") @@ -55,7 +55,7 @@ dependencies { } testCompile("commons-fileupload:commons-fileupload:1.4") testCompile("commons-io:commons-io:2.5") - testCompile("joda-time:joda-time:2.10.1") + testCompile("joda-time:joda-time:2.10.2") testCompile("org.mozilla:rhino:1.7.10") testCompile("dom4j:dom4j:1.6.1") { exclude group: "xml-apis", module: "xml-apis" @@ -74,7 +74,7 @@ dependencies { testCompile("org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}") testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}") testRuntime("org.jetbrains.kotlin:kotlin-compiler-embeddable:${kotlinVersion}") - testRuntime("org.jruby:jruby:9.2.6.0") + testRuntime("org.jruby:jruby:9.2.7.0") testRuntime("org.python:jython-standalone:2.7.1") testRuntime("org.webjars:underscorejs:1.8.3") testRuntime("org.glassfish:javax.el:3.0.1-b08")