diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.java index 9f78a2909d..c317d5f935 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2017 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. @@ -42,7 +42,7 @@ public class Problem { /** * Create a new instance of the {@link Problem} class. - * @param message a message detailing the problem + * @param message a message detailing the problem * @param location the location within a bean configuration source that triggered the error */ public Problem(String message, Location location) { @@ -51,7 +51,7 @@ public class Problem { /** * Create a new instance of the {@link Problem} class. - * @param message a message detailing the problem + * @param message a message detailing the problem * @param parseState the {@link ParseState} at the time of the error * @param location the location within a bean configuration source that triggered the error */ @@ -61,8 +61,8 @@ public class Problem { /** * Create a new instance of the {@link Problem} class. - * @param message a message detailing the problem - * @param rootCause the underlying expection that caused the error (may be {@code null}) + * @param message a message detailing the problem + * @param rootCause the underlying exception that caused the error (may be {@code null}) * @param parseState the {@link ParseState} at the time of the error * @param location the location within a bean configuration source that triggered the error */ @@ -107,7 +107,7 @@ public class Problem { } /** - * Get the underlying expection that caused the error (may be {@code null}). + * Get the underlying exception that caused the error (may be {@code null}). */ public Throwable getRootCause() { return this.rootCause; diff --git a/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java b/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java index a1c29a837e..520661f574 100644 --- a/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java +++ b/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java @@ -125,8 +125,10 @@ public abstract class AbstractResource implements Resource { } /** - * This implementation returns {@link Channels#newChannel(InputStream)} with the result of - * {@link #getInputStream()}. + * This implementation returns {@link Channels#newChannel(InputStream)} + * with the result of {@link #getInputStream()}. + *
This is the same as in {@link Resource}'s corresponding default method
+ * but mirrored here for efficient JVM-level dispatching in a class hierarchy.
*/
@Override
public ReadableByteChannel readableChannel() throws IOException {
@@ -138,7 +140,6 @@ public abstract class AbstractResource implements Resource {
* content length. Subclasses will almost always be able to provide
* a more optimal version of this, e.g. checking a File length.
* @see #getInputStream()
- * @throws IllegalStateException if {@link #getInputStream()} returns null.
*/
@Override
public long contentLength() throws IOException {
diff --git a/spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java b/spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java
index 01d1ca6e86..a3b80bfb32 100644
--- a/spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java
+++ b/spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java
@@ -28,6 +28,7 @@ import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
import org.springframework.core.io.UrlResource;
import org.springframework.util.Assert;
@@ -60,10 +61,6 @@ import org.springframework.util.StringUtils;
*/
public abstract class SpringFactoriesLoader {
- private static final Log logger = LogFactory.getLog(SpringFactoriesLoader.class);
-
- private static Map Can be present in multiple JAR files.
@@ -71,10 +68,15 @@ public abstract class SpringFactoriesLoader {
public static final String FACTORIES_RESOURCE_LOCATION = "META-INF/spring.factories";
+ private static final Log logger = LogFactory.getLog(SpringFactoriesLoader.class);
+
+ private static final Map The returned factories are sorted in accordance with the {@link AnnotationAwareOrderComparator}.
+ * The returned factories are sorted through {@link AnnotationAwareOrderComparator}.
* If a custom instantiation strategy is required, use {@link #loadFactoryNames}
* to obtain all registered factory names.
* @param factoryClass the interface or abstract class representing the factory
@@ -113,19 +115,17 @@ public abstract class SpringFactoriesLoader {
*/
public static List