Browse Source

Polishing

pull/1864/merge
Sam Brannen 6 years ago
parent
commit
cafb5033e2
  1. 2
      spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultBeanDefinitionDocumentReader.java
  2. 1
      spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java

2
spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultBeanDefinitionDocumentReader.java

@ -135,6 +135,8 @@ public class DefaultBeanDefinitionDocumentReader implements BeanDefinitionDocume @@ -135,6 +135,8 @@ public class DefaultBeanDefinitionDocumentReader implements BeanDefinitionDocume
if (StringUtils.hasText(profileSpec)) {
String[] specifiedProfiles = StringUtils.tokenizeToStringArray(
profileSpec, BeanDefinitionParserDelegate.MULTI_VALUE_ATTRIBUTE_DELIMITERS);
// We cannot use Profiles.of(...) since profile expressions are not supported
// in XML config. See SPR-12458 for details.
if (!getReaderContext().getEnvironment().acceptsProfiles(specifiedProfiles)) {
if (logger.isInfoEnabled()) {
logger.info("Skipped XML bean definition file due to specified profiles [" + profileSpec +

1
spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java vendored

@ -38,6 +38,7 @@ import static org.springframework.core.env.AbstractEnvironment.*; @@ -38,6 +38,7 @@ import static org.springframework.core.env.AbstractEnvironment.*;
* @author Chris Beams
* @author Juergen Hoeller
*/
@SuppressWarnings("deprecation")
public class StandardEnvironmentTests {
private static final String ALLOWED_PROPERTY_NAME = "theanswer";

Loading…
Cancel
Save