File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
spring-core/src/test/java/org/springframework/core/annotation Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 24
24
import java .lang .annotation .RetentionPolicy ;
25
25
import java .lang .annotation .Target ;
26
26
import java .lang .reflect .Method ;
27
- import java .util .Arrays ;
28
27
import java .util .Collections ;
29
28
import java .util .List ;
30
29
import java .util .Map ;
@@ -160,9 +159,8 @@ void findMethodAnnotationOnBridgeMethod() throws Exception {
160
159
assertThat (getAnnotation (bridgeMethod , Order .class )).isNull ();
161
160
assertThat (findAnnotation (bridgeMethod , Order .class )).isNotNull ();
162
161
163
- boolean runningInEclipse = Arrays .stream (new Exception ().getStackTrace ())
164
- .anyMatch (element -> element .getClassName ().startsWith ("org.eclipse.jdt" ));
165
-
162
+ boolean runningInEclipse = StackWalker .getInstance ().walk (stream ->
163
+ stream .anyMatch (stackFrame -> stackFrame .getClassName ().startsWith ("org.eclipse.jdt" )));
166
164
// As of JDK 8, invoking getAnnotation() on a bridge method actually finds an
167
165
// annotation on its 'bridged' method [1]; however, the Eclipse compiler will not
168
166
// support this until Eclipse 4.9 [2]. Thus, we effectively ignore the following
You can’t perform that action at this time.
0 commit comments