-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
Dave Syer opened SPR-11093 and commented
The !profile selector in AbstractEnvironment causes premature termination of loop.
Here's the code:
@Override
public boolean acceptsProfiles(String... profiles) {
Assert.notEmpty(profiles, "Must specify at least one profile");
for (String profile : profiles) {
if (profile != null && profile.length() > 0 && profile.charAt(0) == '!') {
return !isProfileActive(profile.substring(1));
}
if (isProfileActive(profile)) {
return true;
}
}
return false;
}
So with <beans profile="!foo,bar"/>
even if the "bar" profile is active the method returns false when "foo" is also active. Maybe that was intentional, but it doesn't match what I read in the Javadocs (and XSD docs).
Affects: 4.0 RC1
Backported to: 3.2.6
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug