diff --git a/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/DeclarationHandler.kt b/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/DeclarationHandler.kt index 4f6a965def..e8119feac9 100644 --- a/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/DeclarationHandler.kt +++ b/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/DeclarationHandler.kt @@ -354,6 +354,9 @@ open class DeclarationHandler(lang: JavaLanguageFrontend) : is ClassOrInterfaceDeclaration -> { frontend.scopeManager.addDeclaration(handle(decl)) } + is com.github.javaparser.ast.body.EnumDeclaration -> { + frontend.scopeManager.addDeclaration(handle(decl)) + } is InitializerDeclaration -> { val initializerBlock = frontend.statementHandler.handleBlockStatement(decl.body) diff --git a/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/JavaLanguageFrontend.kt b/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/JavaLanguageFrontend.kt index f06178d123..ad108ff396 100644 --- a/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/JavaLanguageFrontend.kt +++ b/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/JavaLanguageFrontend.kt @@ -468,7 +468,7 @@ open class JavaLanguageFrontend(language: Language, ctx: T val member = newAnnotationMember( ANNOTATION_MEMBER_VALUE, - expressionHandler.handle(value.asLiteralExpr()) as Expression, + expressionHandler.handle(value) as Expression, rawNode = value ) members.add(member)