Skip to content

Commit

Permalink
Partial Fix for test0321 - new Object[][] has off-by-one error in dim…
Browse files Browse the repository at this point in the history
…ensions

Signed-off-by: Rob Stryker <[email protected]>
  • Loading branch information
Rob Stryker committed May 10, 2024
1 parent 8d18367 commit 1f15516
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,16 @@ private Expression convertExpression(JCExpression javac) {
} else {
arrayType = this.ast.newArrayType(childArrayType);
}
} else if(jcNewArray.dims != null && jcNewArray.dims.size() > 0 ){
arrayType = this.ast.newArrayType(type);
int dims = jcNewArray.dims.size();
for( int i = 0; i < dims - 1; i++ ) {
if( this.ast.apiLevel >= AST.JLS8_INTERNAL) {
arrayType.dimensions().addFirst(this.ast.newDimension());
} else {
arrayType = this.ast.newArrayType(arrayType);
}
}
} else {
arrayType = this.ast.newArrayType(type);
}
Expand Down

0 comments on commit 1f15516

Please sign in to comment.