Skip to content

Commit c873a59

Browse files
committed
Polishing
1 parent 4dc93bc commit c873a59

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
@@ -371,7 +371,7 @@ protected Object doInvoke(Object... args) {
371371
* Return the target bean instance to use.
372372
*/
373373
protected Object getTargetBean() {
374-
Assert.notNull(this.applicationContext, "ApplicationContext must no be null");
374+
Assert.notNull(this.applicationContext, "ApplicationContext must not be null");
375375
return this.applicationContext.getBean(this.beanName);
376376
}
377377

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
@@ -95,6 +95,25 @@ public interface Environment extends PropertyResolver {
9595
*/
9696
String[] getDefaultProfiles();
9797

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

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

0 commit comments

Comments
 (0)