Skip to content

Commit

Permalink
Fix dimensions
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 Mar 8, 2024
1 parent f43dee2 commit f4ee15b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,17 @@ private VariableDeclaration convertVariableDeclaration(JCVariableDecl javac) {
if( javac.getType() instanceof JCArrayTypeTree jcatt && javac.vartype.pos > javac.pos ) {
// 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(countDimensions(jcatt));
res.setExtraDimensions(dims);
} else {
// TODO might be buggy
res.setExtraDimensions(countDimensions(jcatt));
for( int i = 0; i < dims; i++ ) {
Dimension d = this.ast.newDimension();
d.setSourceRange(jcatt.pos, 2);
res.extraDimensions().add(d);
}
}
}
} else if ( (javac.mods.flags & VARARGS) != 0) {
Expand Down

0 comments on commit f4ee15b

Please sign in to comment.