Skip to content

Commit

Permalink
Partial fix for ASTConverter15JLS8Test.test0026 - enums and records c…
Browse files Browse the repository at this point in the history
…annot be created in early jls versions

Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed May 3, 2024
1 parent 2d84c0b commit 46ca67d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ private AbstractTypeDeclaration convertClassDecl(JCClassDecl javacClassDecl, AST
if( javacClassDecl.getKind() == Kind.ANNOTATION_TYPE && this.ast.apiLevel == AST.JLS2_INTERNAL) {
return null;
}
if( javacClassDecl.getKind() == Kind.ENUM && this.ast.apiLevel == AST.JLS2_INTERNAL) {
return null;
}
if( javacClassDecl.getKind() == Kind.RECORD && this.ast.apiLevel < AST.JLS16_INTERNAL) {
return null;
}
AbstractTypeDeclaration res = switch (javacClassDecl.getKind()) {
case ANNOTATION_TYPE -> this.ast.newAnnotationTypeDeclaration();
case ENUM -> this.ast.newEnumDeclaration();
Expand Down

0 comments on commit 46ca67d

Please sign in to comment.