From 5b4592a8159c150bc731cdbe48b92d59be3fac90 Mon Sep 17 00:00:00 2001 From: Rob Stryker Date: Tue, 9 Apr 2024 11:21:57 -0400 Subject: [PATCH] Avoid Thread[] var[][] situation Signed-off-by: Rob Stryker --- .../src/org/eclipse/jdt/core/dom/JavacConverter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 be77e4242ec..f6e5f70007f 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 @@ -592,16 +592,20 @@ private VariableDeclaration convertVariableDeclaration(JCVariableDecl javac) { // The array dimensions are part of the variable name if (jcatt.getType() != null) { int dims = countDimensions(jcatt); - res.setType(convertToType(jcatt.getType())); if( this.ast.apiLevel < AST.JLS8_INTERNAL) { res.setExtraDimensions(dims); + res.setType(convertToType(jcatt.getType())); } else { // TODO might be buggy for( int i = 0; i < dims; i++ ) { Dimension d = this.ast.newDimension(); d.setSourceRange(jcatt.pos, 2); res.extraDimensions().add(d); + if( jcatt.getType() instanceof JCArrayTypeTree jcatt2) { + jcatt = jcatt2; + } } + res.setType(convertToType(jcatt.getType())); } } } else if ( (javac.mods.flags & VARARGS) != 0) {