Skip to content

Commit 5331938

Browse files
committed
Polishing
(cherry picked from commit c873a59)
1 parent e1e7fa4 commit 5331938

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

spring-context/src/main/java/org/springframework/context/event/ApplicationListenerMethodAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ protected Object doInvoke(Object... args) {
367367
* Return the target bean instance to use.
368368
*/
369369
protected Object getTargetBean() {
370-
Assert.notNull(this.applicationContext, "ApplicationContext must no be null");
370+
Assert.notNull(this.applicationContext, "ApplicationContext must not be null");
371371
return this.applicationContext.getBean(this.beanName);
372372
}
373373

spring-core/src/main/java/org/springframework/core/env/Environment.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,25 @@ public interface Environment extends PropertyResolver {
9696
*/
9797
String[] getDefaultProfiles();
9898

99+
/**
100+
* Determine whether one of the given profile expressions matches the
101+
* {@linkplain #getActiveProfiles() active profiles} — or in the case
102+
* of no explicit active profiles, whether one of the given profile expressions
103+
* matches the {@linkplain #getDefaultProfiles() default profiles}.
104+
* <p>Profile expressions allow for complex, boolean profile logic to be
105+
* expressed &mdash; for example {@code "p1 & p2"}, {@code "(p1 & p2) | p3"},
106+
* etc. See {@link Profiles#of(String...)} for details on the supported
107+
* expression syntax.
108+
* <p>This method is a convenient shortcut for
109+
* {@code env.acceptsProfiles(Profiles.of(profileExpressions))}.
110+
* @since 5.3.28
111+
* @see Profiles#of(String...)
112+
* @see #acceptsProfiles(Profiles)
113+
*/
114+
default boolean matchesProfiles(String... profileExpressions) {
115+
return acceptsProfiles(Profiles.of(profileExpressions));
116+
}
117+
99118
/**
100119
* Determine whether one or more of the given profiles is active &mdash; or
101120
* in the case of no explicit {@linkplain #getActiveProfiles() active profiles},
@@ -118,25 +137,6 @@ public interface Environment extends PropertyResolver {
118137
@Deprecated
119138
boolean acceptsProfiles(String... profiles);
120139

121-
/**
122-
* Determine whether one of the given profile expressions matches the
123-
* {@linkplain #getActiveProfiles() active profiles} &mdash; or in the case
124-
* of no explicit active profiles, whether one of the given profile expressions
125-
* matches the {@linkplain #getDefaultProfiles() default profiles}.
126-
* <p>Profile expressions allow for complex, boolean profile logic to be
127-
* expressed &mdash; for example {@code "p1 & p2"}, {@code "(p1 & p2) | p3"},
128-
* etc. See {@link Profiles#of(String...)} for details on the supported
129-
* expression syntax.
130-
* <p>This method is a convenient shortcut for
131-
* {@code env.acceptsProfiles(Profiles.of(profileExpressions))}.
132-
* @since 5.3.28
133-
* @see Profiles#of(String...)
134-
* @see #acceptsProfiles(Profiles)
135-
*/
136-
default boolean matchesProfiles(String... profileExpressions) {
137-
return acceptsProfiles(Profiles.of(profileExpressions));
138-
}
139-
140140
/**
141141
* Determine whether the given {@link Profiles} predicate matches the
142142
* {@linkplain #getActiveProfiles() active profiles} &mdash; or in the case

0 commit comments

Comments
 (0)