File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
spring-boot-project/spring-boot/src/main/java/org/springframework/boot Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2012-2020 the original author or authors.
2
+ * Copyright 2012-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
20
20
import java .lang .reflect .Constructor ;
21
21
import java .util .HashSet ;
22
22
import java .util .Set ;
23
+ import java .util .regex .Pattern ;
23
24
24
25
import groovy .lang .Closure ;
25
26
@@ -63,6 +64,8 @@ class BeanDefinitionLoader {
63
64
// Static final field to facilitate code removal by Graal
64
65
private static final boolean XML_ENABLED = !SpringProperties .getFlag ("spring.xml.ignore" );
65
66
67
+ private static final Pattern GROOVY_CLOSURE_PATTERN = Pattern .compile (".*\\ $_.*closure.*" );
68
+
66
69
private final Object [] sources ;
67
70
68
71
private final AnnotatedBeanDefinitionReader annotatedReader ;
@@ -296,7 +299,7 @@ private boolean isEligible(Class<?> type) {
296
299
}
297
300
298
301
private boolean isGroovyClosure (Class <?> type ) {
299
- return type .getName ().matches (".* \\ $_.*closure.*" );
302
+ return GROOVY_CLOSURE_PATTERN . matcher ( type .getName ()) .matches ();
300
303
}
301
304
302
305
private boolean hasNoConstructors (Class <?> type ) {
You can’t perform that action at this time.
0 commit comments