From 1899fb37c1f0dbb3aab3c7ae3d9905b9fd837e32 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 22 Feb 2016 23:26:41 +0100 Subject: [PATCH] Polishing --- .../core/io/support/EncodedResource.java | 8 ++++---- .../core/io/support/PropertiesLoaderUtils.java | 4 ++-- .../springframework/test/context/ActiveProfiles.java | 10 +--------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/io/support/EncodedResource.java b/spring-core/src/main/java/org/springframework/core/io/support/EncodedResource.java index 638af8ebe5e..73c9b158b29 100644 --- a/spring-core/src/main/java/org/springframework/core/io/support/EncodedResource.java +++ b/spring-core/src/main/java/org/springframework/core/io/support/EncodedResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -52,7 +52,7 @@ public class EncodedResource implements InputStreamSource { /** * Create a new {@code EncodedResource} for the given {@code Resource}, * not specifying an explicit encoding or {@code Charset}. - * @param resource the {@code Resource} to hold; never {@code null} + * @param resource the {@code Resource} to hold (never {@code null}) */ public EncodedResource(Resource resource) { this(resource, null, null); @@ -61,7 +61,7 @@ public class EncodedResource implements InputStreamSource { /** * Create a new {@code EncodedResource} for the given {@code Resource}, * using the specified {@code encoding}. - * @param resource the {@code Resource} to hold; never {@code null} + * @param resource the {@code Resource} to hold (never {@code null}) * @param encoding the encoding to use for reading from the resource */ public EncodedResource(Resource resource, String encoding) { @@ -71,7 +71,7 @@ public class EncodedResource implements InputStreamSource { /** * Create a new {@code EncodedResource} for the given {@code Resource}, * using the specified {@code Charset}. - * @param resource the {@code Resource} to hold; never {@code null} + * @param resource the {@code Resource} to hold (never {@code null}) * @param charset the {@code Charset} to use for reading from the resource */ public EncodedResource(Resource resource, Charset charset) { diff --git a/spring-core/src/main/java/org/springframework/core/io/support/PropertiesLoaderUtils.java b/spring-core/src/main/java/org/springframework/core/io/support/PropertiesLoaderUtils.java index c501a52fe6a..a9fa5d6db58 100644 --- a/spring-core/src/main/java/org/springframework/core/io/support/PropertiesLoaderUtils.java +++ b/spring-core/src/main/java/org/springframework/core/io/support/PropertiesLoaderUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 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. @@ -183,7 +183,7 @@ public abstract class PropertiesLoaderUtils { ResourceUtils.useCachesIfNecessary(con); InputStream is = con.getInputStream(); try { - if (resourceName != null && resourceName.endsWith(XML_FILE_EXTENSION)) { + if (resourceName.endsWith(XML_FILE_EXTENSION)) { props.loadFromXML(is); } else { diff --git a/spring-test/src/main/java/org/springframework/test/context/ActiveProfiles.java b/spring-test/src/main/java/org/springframework/test/context/ActiveProfiles.java index a90b93a071a..fc259102edd 100644 --- a/spring-test/src/main/java/org/springframework/test/context/ActiveProfiles.java +++ b/spring-test/src/main/java/org/springframework/test/context/ActiveProfiles.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -51,7 +51,6 @@ public @interface ActiveProfiles { /** * Alias for {@link #profiles}. - * *

This attribute may not be used in conjunction with * {@link #profiles}, but it may be used instead of {@link #profiles}. */ @@ -60,7 +59,6 @@ public @interface ActiveProfiles { /** * The bean definition profiles to activate. - * *

This attribute may not be used in conjunction with * {@link #value}, but it may be used instead of {@link #value}. */ @@ -70,7 +68,6 @@ public @interface ActiveProfiles { /** * The type of {@link ActiveProfilesResolver} to use for resolving the active * bean definition profiles programmatically. - * * @since 4.0 * @see ActiveProfilesResolver */ @@ -79,18 +76,15 @@ public @interface ActiveProfiles { /** * Whether or not bean definition profiles from superclasses should be * inherited. - * *

The default value is {@code true}, which means that a test * class will inherit bean definition profiles defined by a * test superclass. Specifically, the bean definition profiles for a test * class will be appended to the list of bean definition profiles * defined by a test superclass. Thus, subclasses have the option of * extending the list of bean definition profiles. - * *

If {@code inheritProfiles} is set to {@code false}, the bean * definition profiles for the test class will shadow and * effectively replace any bean definition profiles defined by a superclass. - * *

In the following example, the {@code ApplicationContext} for * {@code BaseTest} will be loaded using only the "base" * bean definition profile; beans defined in the "extended" profile @@ -110,11 +104,9 @@ public @interface ActiveProfiles { * // ... * } * - * *

Note: {@code @ActiveProfiles} can be used when loading an * {@code ApplicationContext} from path-based resource locations or * annotated classes. - * * @see ContextConfiguration#locations * @see ContextConfiguration#classes * @see ContextConfiguration#inheritLocations