Skip to content

Commit 0f6e182

Browse files
committed
Fix possible ClassCastException.
1 parent c142eb4 commit 0f6e182

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

components/sbm-core/src/main/java/org/springframework/sbm/java/impl/OpenRewriteMember.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public Annotation getAnnotation(String annotation) {
8282
} else if (type1.getClass().isAssignableFrom(JavaType.Class.class)) {
8383
JavaType.Class type = (JavaType.Class) a.getType();
8484
if (type == null) {
85-
String simpleName = ((J.Identifier) a.getAnnotationType()).getSimpleName();
85+
String simpleName = a.getSimpleName();
8686
log.error("Could not get Type for annotation: '" + simpleName + "' while comparing with '" + annotation + "'.");
8787
return false;
8888
}

components/sbm-core/src/main/java/org/springframework/sbm/java/impl/OpenRewriteType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private List<J.Annotation> findORAnnotations(String annotation) {
178178
.stream()
179179
.filter(a -> {
180180
Object typeObject = a.getAnnotationType().getType();
181-
String simpleName = ((J.Identifier) a.getAnnotationType()).getSimpleName();
181+
String simpleName = a.getSimpleName();
182182
if (JavaType.Unknown.class.isInstance(typeObject)) {
183183
log.warn("Could not resolve Type for annotation: '" + simpleName + "' while comparing with '" + annotation + "'.");
184184
return false;

0 commit comments

Comments
 (0)