File tree Expand file tree Collapse file tree 6 files changed +14
-14
lines changed
src/main/java/io/avaje/inject/test Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 5
5
<parent >
6
6
<artifactId >avaje-inject-parent</artifactId >
7
7
<groupId >io.avaje</groupId >
8
- <version >8.3 </version >
8
+ <version >8.4 </version >
9
9
</parent >
10
10
<modelVersion >4.0.0</modelVersion >
11
11
Original file line number Diff line number Diff line change 4
4
<parent >
5
5
<groupId >io.avaje</groupId >
6
6
<artifactId >avaje-inject-parent</artifactId >
7
- <version >8.3 </version >
7
+ <version >8.4 </version >
8
8
</parent >
9
9
10
10
<artifactId >avaje-inject-generator</artifactId >
16
16
<dependency >
17
17
<groupId >io.avaje</groupId >
18
18
<artifactId >avaje-inject</artifactId >
19
- <version >8.3 </version >
19
+ <version >8.4 </version >
20
20
</dependency >
21
21
22
22
<!-- test dependencies -->
Original file line number Diff line number Diff line change 4
4
<parent >
5
5
<groupId >io.avaje</groupId >
6
6
<artifactId >avaje-inject-parent</artifactId >
7
- <version >8.3 </version >
7
+ <version >8.4 </version >
8
8
</parent >
9
9
10
10
<artifactId >avaje-inject-test</artifactId >
124
124
<path >
125
125
<groupId >io.avaje</groupId >
126
126
<artifactId >avaje-inject-generator</artifactId >
127
- <version >8.3 </version >
127
+ <version >8.4 </version >
128
128
</path >
129
129
</annotationProcessorPaths >
130
130
</configuration >
Original file line number Diff line number Diff line change 9
9
import java .io .InputStreamReader ;
10
10
import java .io .LineNumberReader ;
11
11
import java .net .URL ;
12
- import java .util .ArrayList ;
13
- import java .util .Enumeration ;
14
- import java .util .List ;
15
- import java .util .ServiceLoader ;
12
+ import java .util .*;
16
13
import java .util .concurrent .locks .ReentrantLock ;
17
14
18
15
/**
@@ -83,15 +80,18 @@ private BeanScope buildFromModules(List<TestModule> testModules) {
83
80
@ Nullable
84
81
private BeanScope buildFromResources () {
85
82
try {
86
- List < TestModule > testModules = new ArrayList <>();
83
+ Set < Class <?>> testModuleClasses = new LinkedHashSet <>();
87
84
Enumeration <URL > urls = ClassLoader .getSystemResources ("META-INF/services/io.avaje.inject.test.TestModule" );
88
85
while (urls .hasMoreElements ()) {
89
86
String className = readServiceClassName (urls .nextElement ());
90
87
if (className != null ) {
91
- Class <?> cls = Class .forName (className );
92
- testModules .add ((TestModule ) cls .getDeclaredConstructor ().newInstance ());
88
+ testModuleClasses .add (Class .forName (className ));
93
89
}
94
90
}
91
+ List <TestModule > testModules = new ArrayList <>();
92
+ for (Class <?> cls : testModuleClasses ) {
93
+ testModules .add ((TestModule ) cls .getDeclaredConstructor ().newInstance ());
94
+ }
95
95
return testModules .isEmpty () ? null : buildFromModules (testModules );
96
96
} catch (Throwable e ) {
97
97
throw new RuntimeException ("Error trying to create TestModule" , e );
Original file line number Diff line number Diff line change 4
4
<parent >
5
5
<groupId >io.avaje</groupId >
6
6
<artifactId >avaje-inject-parent</artifactId >
7
- <version >8.3 </version >
7
+ <version >8.4 </version >
8
8
</parent >
9
9
10
10
<artifactId >avaje-inject</artifactId >
Original file line number Diff line number Diff line change 9
9
10
10
<groupId >io.avaje</groupId >
11
11
<artifactId >avaje-inject-parent</artifactId >
12
- <version >8.3 </version >
12
+ <version >8.4 </version >
13
13
<packaging >pom</packaging >
14
14
<name >avaje inject parent</name >
15
15
<description >parent pom for avaje inject library</description >
You can’t perform that action at this time.
0 commit comments