File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
spring-modulith-core/src/main/java/org/springframework/modulith/core Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -341,7 +341,7 @@ public ArchitecturallyEvidentType getArchitecturallyEvidentType(Class<?> type) {
341
341
* @param type must not be {@literal null}.
342
342
*/
343
343
public boolean contains (JavaClass type ) {
344
- return contains (type . getName () );
344
+ return classes . contains (type );
345
345
}
346
346
347
347
/**
@@ -350,7 +350,7 @@ public boolean contains(JavaClass type) {
350
350
* @param type must not be {@literal null}.
351
351
*/
352
352
public boolean contains (Class <?> type ) {
353
- return contains (type . getName () );
353
+ return classes . contains (type );
354
354
}
355
355
356
356
/**
Original file line number Diff line number Diff line change @@ -412,7 +412,10 @@ public Optional<ApplicationModule> getModuleByType(String candidate) {
412
412
* @return will never be {@literal null}.
413
413
*/
414
414
public Optional <ApplicationModule > getModuleByType (Class <?> candidate ) {
415
- return getModuleByType (candidate .getName ());
415
+
416
+ return allModules ()
417
+ .filter (it -> it .contains (candidate ))
418
+ .findFirst ();
416
419
}
417
420
418
421
/**
Original file line number Diff line number Diff line change @@ -172,7 +172,11 @@ Optional<JavaClass> toOptional() {
172
172
}
173
173
174
174
boolean contains (JavaClass type ) {
175
- return !that (new SameClass (type )).isEmpty ();
175
+ return classes .contains (type );
176
+ }
177
+
178
+ boolean contains (Class <?> type ) {
179
+ return classes .stream ().anyMatch (it -> it .isEquivalentTo (type ));
176
180
}
177
181
178
182
boolean contains (String className ) {
You can’t perform that action at this time.
0 commit comments