From 15e62ab314f7c108a198436ad21796203c844774 Mon Sep 17 00:00:00 2001 From: Rob Stryker Date: Wed, 8 May 2024 16:59:51 -0400 Subject: [PATCH] Fix for ASTConverterTest2.test0610 - return type for constructor not initialized in some cases Signed-off-by: Rob Stryker --- .../src/org/eclipse/jdt/core/dom/JavacConverter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java index 0e6312fbbd0..c02ae2c765e 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java @@ -725,13 +725,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);