Skip to content

Commit

Permalink
Avoid Thread[] var[][] situation
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Apr 9, 2024
1 parent 898166c commit 5b4592a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5b4592a

Please sign in to comment.