Skip to content

Commit 4658269

Browse files
authored
Merge pull request #374 from xdev-software/develop
Release
2 parents 529e8d9 + 176ae97 commit 4658269

4 files changed

Lines changed: 11 additions & 72 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 2.5.2
2+
* Fix ``AnnotatedClassFinder`` returning the annotation and not the annotated class #373
3+
14
# 2.5.1
25
* Use timeout in ``SafeNamedContainerStarter#tryCleanupContainerAfterStartFail`` to prevent app/thread hang #370
36

db-jdbc-spring-orm/src/main/java/software/xdev/tci/db/persistence/SpringEntityManagerControllerFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
public abstract class SpringEntityManagerControllerFactory<SELF extends SpringEntityManagerControllerFactory<SELF>>
3434
extends EntityManagerControllerFactory<SELF, MutablePersistenceUnitInfo>
3535
{
36-
public SpringEntityManagerControllerFactory()
36+
protected SpringEntityManagerControllerFactory()
3737
{
3838
}
3939

40-
public SpringEntityManagerControllerFactory(final Supplier<Set<String>> entityClassesFinder)
40+
protected SpringEntityManagerControllerFactory(final Supplier<Set<String>> entityClassesFinder)
4141
{
4242
super(entityClassesFinder);
4343
}

db-jdbc-spring-orm/src/main/java/software/xdev/tci/db/persistence/classfinder/AnnotatedClassFinder.java

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@
3535

3636
public class AnnotatedClassFinder
3737
{
38-
@SuppressWarnings({"java:S1452", "java:S4968"}) // Returned so by stream
39-
public List<? extends Class<?>> find(
40-
final String basePackage,
41-
final Class<? extends Annotation> annotationClazz)
42-
{
43-
return this.find(Set.of(basePackage), Set.of(annotationClazz));
44-
}
45-
4638
@SuppressWarnings({"java:S1452", "java:S4968"}) // Returned so by stream
4739
public List<? extends Class<?>> find(
4840
final Set<String> basePackages,
@@ -101,12 +93,13 @@ protected Class<?> getIfIsCandidate(
10193
try
10294
{
10395
final Class<?> clazz = Class.forName(metadataReader.getClassMetadata().getClassName());
104-
return annotationClasses.stream()
105-
.filter(annotation -> clazz.getAnnotation(annotation) != null)
106-
.findFirst()
107-
.orElse(null);
96+
if(annotationClasses.stream().anyMatch(annotation ->
97+
clazz.getAnnotation(annotation) != null))
98+
{
99+
return clazz;
100+
}
108101
}
109-
catch(final Exception e)
102+
catch(final Exception ignored)
110103
{
111104
// Nothing
112105
}

db-jdbc-spring-orm/src/main/java/software/xdev/tci/db/persistence/classfinder/CachedEntityAnnotatedClassNameFinder.java

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)