Menu

#26 Eight bugs in 1.0.9

closed-fixed
5
2004-01-04
2004-01-03
No

Sorry for not breaking these bugs out individually, but
they will be easy to duplicate using the attached test
cases.

The first bug is caused by compiling MiscTests.java:

1) test0(net.janino.testcode.Harness1)
java.lang.IllegalAccessError: class
net.janino.targetcode.MiscTests cannot access its
superinterface net.janino.targetcode.Constants

Probably a directory error of some kind in SimpleCompiler.

The other seven bugs are illustrated in MiscTests2.java.

I've added package names and a directory structure to
the JUnit test code. Test code is in one directory,
and "target" code is in another. This keeps things
cleaner. It also makes it easier for multiple developers to
add test cases. Run AllTests.java to get started.

I've also run into a bug when compiling a number of my
files, but can't duplicate it for the test suite. Will try
again after the next release. Here's the stack trace:

java.lang.RuntimeException: Operand stack inconsistent
at offset 38: Previous size 0, now 1
at
net.janino.ClassFile$CodeAttribute.flowAnalysis
(ClassFile.java:904)
at
net.janino.ClassFile$CodeAttribute.flowAnalysis
(ClassFile.java:1034)
at
net.janino.ClassFile$CodeAttribute.flowAnalysis
(ClassFile.java:1034)
at
net.janino.ClassFile$CodeAttribute.flowAnalysis
(ClassFile.java:841)
at net.janino.Java$FunctionDeclarator.compile
(Java.java:783)
at net.janino.Java$ClassDeclaration.compile
(Java.java:518)
at net.janino.Java$CompilationUnit.compile
(Java.java:162)
at net.janino.Java$CompilationUnit.compile
(Java.java:151)
at net.janino.Compiler.compile
(Compiler.java:273)

Discussion

  • Chris Cleveland

    Chris Cleveland - 2004-01-03
     
  • Arno Unkrig

    Arno Unkrig - 2004-01-04

    Logged In: YES
    user_id=865893

    Bug #1 "IllegalAccessError": Fixed
    "ByteArrayClassLoader.defineClass()" did not work if base
    and derived classes were defined in reverse order.
    Bug #2 "Native method must (not) have a body": Fixed
    Native methods must not have a body, same as abstract ones.

    Bug #3 "Duplicate imports lead to CompileExceptions": Fixed
    Before complaining about duplicate import, check for
    identical import.
    Bug #4 "Initializer of non-static field cannot access
    non-static fields of same class": Fixed
    Implemented.

    Bug #5 "continue with label NYI": Fixed
    Weird... NYI was still reported while the feature is
    actually available!? NYI removed.

    Bug #6 "Inconsistent expression types": Fixed
    The type of a conditional expression was determined incorrectly.

    Bugs #7 and following not worked on yet.

     
  • Arno Unkrig

    Arno Unkrig - 2004-01-04
    • status: open --> closed-fixed
     
  • Arno Unkrig

    Arno Unkrig - 2004-01-04

    Logged In: YES
    user_id=865893

    Bugs #1...6: Fixed

    Bug #7 "If statement with constant condition leads to
    unexamined code": Fixed
    Implemented the very, very special behavior of if statements
    with a constant condition as specified by JLS 14.20.

    Bug #8 "Narrowing reference conversion from Array to base
    array broken": Fixed
    Implemented JLS 5.1.4.5 thru 5.1.4.9.
    Will release with 1.0.10.

     

Log in to post a comment.

MongoDB Logo MongoDB