Browse Source

Support parsing 'byte[] a = new byte[]{};'

tags/rel_3_27_0_ga
cjw 4 years ago
parent
commit
4f8e274703
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/main/javassist/compiler/Parser.java

+ 4
- 0
src/main/javassist/compiler/Parser.java View File

@@ -681,6 +681,10 @@ public final class Parser implements TokenId {
throws CompileError
{
lex.get(); // '{'
if(lex.lookAhead() == '}'){
lex.get();
return new ArrayInit(new IntConst(0,TokenId.IntConstant));
}
ASTree expr = parseExpression(tbl);
ArrayInit init = new ArrayInit(expr);
while (lex.lookAhead() == ',') {

Loading…
Cancel
Save