Skip to content

Commit 6e9bd4c

Browse files
committed
Polish JpaJandexScavenger
1 parent 8b505d6 commit 6e9bd4c

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/JpaJandexScavenger.java

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -429,24 +429,13 @@ private void enlistPotentialCdiBeanClasses(Collector collector, DotName dotName)
429429

430430
for (AnnotationInstance annotation : jpaAnnotations) {
431431
AnnotationTarget target = annotation.target();
432-
ClassInfo beanType;
433-
switch (target.kind()) {
434-
case CLASS:
435-
beanType = target.asClass();
436-
break;
437-
case FIELD:
438-
beanType = target.asField().declaringClass();
439-
break;
440-
case METHOD:
441-
beanType = target.asMethod().declaringClass();
442-
break;
443-
case METHOD_PARAMETER:
444-
case TYPE:
445-
case RECORD_COMPONENT:
446-
default:
447-
throw new IllegalArgumentException(
448-
"Annotation " + dotName + " was not expected on a target of kind " + target.kind());
449-
}
432+
ClassInfo beanType = switch (target.kind()) {
433+
case CLASS -> target.asClass();
434+
case FIELD -> target.asField().declaringClass();
435+
case METHOD -> target.asMethod().declaringClass();
436+
default -> throw new IllegalArgumentException(
437+
"Annotation " + dotName + " was not expected on a target of kind " + target.kind());
438+
};
450439
DotName beanTypeDotName = beanType.name();
451440
collector.potentialCdiBeanTypes.add(beanTypeDotName);
452441
}

0 commit comments

Comments
 (0)