From 2d84c0b6038ca90cfff8e3ab08b25597848e021a Mon Sep 17 00:00:00 2001 From: Rob Stryker Date: Fri, 3 May 2024 01:23:20 -0400 Subject: [PATCH] Partial fix for ASTConverter15JLS8Test.test0024 - type arguments in ClassInstanceCreation were skipped Signed-off-by: Rob Stryker --- .../src/org/eclipse/jdt/core/dom/JavacConverter.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 ef6639d5df4..84cb9d8314e 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 @@ -1130,6 +1130,15 @@ private Expression convertExpression(JCExpression javac) { if (newClass.encl != null) { res.setExpression(convertExpression(newClass.encl)); } + if( newClass.getTypeArguments() != null && this.ast.apiLevel != AST.JLS2_INTERNAL) { + Iterator it = newClass.getTypeArguments().iterator(); + while(it.hasNext()) { + Type e = convertToType(it.next()); + if( e != null ) { + res.typeArguments().add(e); + } + } + } return res; } if (javac instanceof JCErroneous error) {