Skip to content

Commit

Permalink
Merge pull request #294 from junwen12221/master
Browse files Browse the repository at this point in the history
Supports parsing 'byte[] a = new byte[]{};'.  Only parsing is supported.  Javassist reports a not-supported error.
  • Loading branch information
chibash committed Dec 23, 2019
2 parents 9f1f605 + 4f8e274 commit afe124f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/javassist/compiler/Parser.java
Expand Up @@ -681,6 +681,10 @@ private ArrayInit parseArrayInitializer(SymbolTable tbl)
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() == ',') {
Expand Down

0 comments on commit afe124f

Please sign in to comment.