Skip to content

Commit

Permalink
Fix for ASTConverterTest2.test0610 - return type for constructor not …
Browse files Browse the repository at this point in the history
…initialized in some cases

Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed May 8, 2024
1 parent 4be3364 commit cbfc40e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -724,13 +724,13 @@ private MethodDeclaration convertMethodDecl(JCMethodDecl javac, ASTNode parent)
}
}

if( retType != null ) {
if( retType != null || isConstructor) {
if( this.ast.apiLevel != AST.JLS2_INTERNAL) {
res.setReturnType2(retType);
} else {
res.internalSetReturnType(retType);
}
}
}

javac.getParameters().stream().map(this::convertVariableDeclaration).forEach(res.parameters()::add);

Expand Down

0 comments on commit cbfc40e

Please sign in to comment.