#285 Parse error when parsing valid Java code (2.0b4)

open
nobody
Parsing (77)
5
2007-02-12
2007-02-12
Anonymous
No

Submitter e-mail: christian [dot] glodt [at] uni [dot] lu

The attached Java code fails to parse in Beanshell 2.0b4 even though it compiles and runs correctly when using Sun's Java.

The test() method in the example is adapted from computer-generated code, that's why there are some redundant parentheses.

Using Sun's Java, the result of the example is:
$ javac BshTest.java
Note: BshTest.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
$ java BshTest
BshTest$SomeClass@130c19b

With Beanshell, the result is:

$ bsh BshTest.java
Evaluation Error: Parse error at line 16, column 45. Encountered: (

Discussion

  • Test case illustrating the parsing problem

     
    Attachments