[abc-dev] Fwd:

From: Chris Allan <mrchrisallan_at_googlemail.com>
Date: Thu, 4 Sep 2008 16:54:55 +0100

Hi again,

Thanks for the quick response. I tried with the latest version from SVN,
and you're right, the problem seems to have been fixed.

Unfortunately I've hit a couple more issues with the latest branch, again
when using .class files as input to abc.

Using the same options as described below, both of the following classes
compile fine from Java source, but errors are generated when trying to weave
into the outputted .class files. (Is this the right place to be reporting
these errors?)

public class Test1
{
   public interface IF{};
   public IF test(){return null;}
}

results in:

Exception in thread "main" polyglot.util.InternalCompilerError: unhandled
exception during
 compilation
        at abc.main.CompileSequence.runSequence(CompileSequence.java:110)
        at abc.main.Main.run(Main.java:406)
        at abc.main.Main.main(Main.java:144)
Caused by: java.lang.RuntimeException: couldn't find class: IF (is your
soot-class-path se
t properly?)
        at soot.SootResolver.bringToHierarchy(SootResolver.java:184)
        at soot.SootResolver.bringToSignatures(SootResolver.java:219)
        at soot.SootResolver.bringToBodies(SootResolver.java:260)
        at soot.SootResolver.processResolveWorklist(SootResolver.java:138)
        at soot.SootResolver.resolveClass(SootResolver.java:124)
        at soot.Scene.loadClass(Scene.java:390)
        at
abc.ja.jrag.TypeDecl.refined_AspectJCodegen_TypeDecl_getSootClassDecl(TypeDecl.
java:1648)
        at abc.ja.jrag.TypeDecl.getSootClassDecl_compute(TypeDecl.java:4417)
        at abc.ja.jrag.TypeDecl.getSootClassDecl(TypeDecl.java:4410)
        at
abc.ja.jrag.InterfaceDecl.abcClass_compute(InterfaceDecl.java:1339)
        at abc.ja.jrag.InterfaceDecl.abcClass(InterfaceDecl.java:1333)
        at abc.ja.jrag.InterfaceDecl.jimplify1phase1(InterfaceDecl.java:353)
        at abc.ja.jrag.ASTNode.jimplify1phase1(ASTNode.java:593)
        at abc.ja.jrag.ASTNode.jimplify1phase1(ASTNode.java:593)
        at abc.ja.jrag.Program.jimplify1(Program.java:742)
        at abc.ja.CompileSequence.compile(CompileSequence.java:190)
        at abc.main.CompileSequence.runSequence(CompileSequence.java:100)
        ... 2 more

The second error is with:

public class Test
{
  @B
  int i;
}

public @interface B
{
}

Which gives:

Exception in thread "main" polyglot.util.InternalCompilerError: unhandled
exception during
 compilation
        at abc.main.CompileSequence.runSequence(CompileSequence.java:110)
        at abc.main.Main.run(Main.java:406)
        at abc.main.Main.main(Main.java:144)
Caused by: java.lang.NullPointerException
        at
abc.ja.jrag.FieldDeclaration.addAttributes(FieldDeclaration.java:365)
        at
abc.ja.jrag.FieldDeclaration.jimplify1phase2(FieldDeclaration.java:346)
        at abc.ja.jrag.TypeDecl.jimplify1phase2(TypeDecl.java:1061)
        at abc.ja.jrag.ClassDecl.jimplify1phase2(ClassDecl.java:430)
        at abc.ja.jrag.ASTNode.jimplify1phase2(ASTNode.java:601)
        at abc.ja.jrag.ASTNode.jimplify1phase2(ASTNode.java:601)
        at abc.ja.jrag.Program.jimplify1(Program.java:747)
        at abc.ja.CompileSequence.compile(CompileSequence.java:190)
        at abc.main.CompileSequence.runSequence(CompileSequence.java:100)
        ... 2 more

I hope these bug reports are of some use!

-- 
Chris
Hi.
I cannot reproduce the first error. I guess it was fixed after the
1.3.0 release. Could you check the SVN version?
The enum problem however seems odd and I can reproduce it. What I
don't understand is that the error seems to be caused by the JastAdd
frontend adding a constructor to the enum class. I don't see why
JastAdd should at all be processing this class though, because it is
loaded from a binary .class file.
Maybe Torbjorn can tell us more?
I have attached a JAR file A.jar and the command line is:
-ext abc.ja -injars A.jar
Eric
2008/9/3 Chris Allan <mrchrisallan_at_googlemail.com>:
*> [I'm resending this message as I don't think it got through the first
time *
*> as I wasn't subscribed to the mailing list - apologies if anyone gets it
*
*> twice] *
*> *
*> Hi, *
*> *
*> I've recently been experimenting using abc and Tracematches for some work
*
*> I'm doing, and I ran into a couple of issues which are stopping me from *
*> successfully weaving into my code. I don't know whether they're issues in
*
*> abc, in one of the components it uses, or just that I'm doing something *
*> wrong, but I thought you guys might be interested in knowing about them
(and *
*> any help working around them would be very useful!). *
*> *
*> Both are problems seen when using the abc-ja extension to weave into
class *
*> files (as opposed to source files), using release 1.3.0. *
*> *
*> The first is to do with anonymous inner classes. If I take the following
*
*> class, compile it to a .class file (or a jar file), and then feed it to
abc *
*> (using options -ext abc.ja -source 1.5) , I get an error. *
*> *
*> public class Test *
*> { *
*> public Object t = new Object(){}; *
*> } *
*> *
*> The error is *
*> *
*> Exception in thread "main" polyglot.util. *
*> InternalCompilerError: unhandled exception during compilation *
*> at abc.main.CompileSequence.runSequence(CompileSequence.java:110) *
*> at abc.main.Main.run(Main.java:406) *
*> at abc.main.Main.main(Main.java:144) *
*> Caused by: java.lang.RuntimeException: couldn't find class: Test.1 (is
your *
*> soot-class-path set properly?) *
*> at soot.SootResolver.bringToHierarchy(SootResolver.java:133) *
*> at soot.SootResolver.bringToSignatures(SootResolver.java:166) *
*> at soot.SootResolver.bringToBodies(SootResolver.java:207) *
*> at soot.SootResolver.processResolveWorklist(SootResolver.java:97) *
*> at soot.SootResolver.resolveClass(SootResolver.java:83) *
*> at soot.Scene.loadClass(Scene.java:390) *
*> at *
*>
abc.ja.jrag.TypeDecl.refined_AspectJCodegen_getSootClassDecl(TypeDecl.java:1593)
*
*> at abc.ja.jrag.TypeDecl.getSootClassDecl_compute(TypeDecl.java:4337) *
*> at abc.ja.jrag.TypeDecl.getSootClassDecl(TypeDecl.java:4331) *
*> at abc.ja.jrag.ClassDecl.abcClass_compute(ClassDecl.java:1879) *
*> at abc.ja.jrag.ClassDecl.abcClass(ClassDecl.java:1873) *
*> at abc.ja.jrag.ClassDecl.jimplify1phase1(ClassDecl.java:431) *
*> at abc.ja.jrag.ASTNode.jimplify1phase1(ASTNode.java:601) *
*> at abc.ja.jrag.ASTNode.jimplify1phase1(ASTNode.java:601) *
*> at abc.ja.jrag.Program.jimplify1(Program.java:940) *
*> at abc.ja.CompileSequence.compile(CompileSequence.java:189) *
*> at abc.main.CompileSequence.runSequence(CompileSequence.java:100) *
*> ... 2 more *
*> *
*> I also got a similar error when compiling against my code-base, but have
*
*> been unable to reproduce it exactly using smaller test input: *
*> *
*> Exception in thread "main" polyglot.util.InternalCompilerError: unhandled
*
*> exception during *
*> compilation *
*> at abc.main.CompileSequence.runSequence(CompileSequence.java:110) *
*> at abc.main.Main.run(Main.java:406) *
*> at abc.main.Main.main(Main.java:144) *
*> Caused by: java.lang.NullPointerException *
*> at abc.ja.CompileSequence.compile(CompileSequence.java:147) *
*> at abc.main.CompileSequence.runSequence(CompileSequence.java:100) *
*> ... 2 more *
*> *
*> (a debugger shows that CompileSequence.compile() calls *
*> *
*> CompilationUnit u = program.getCompilationUnit(name); *
*> *
*> where name is an anonymous inner class or interface, and gets a null
pointer *
*> returned.) *
*> *
*> The second problem I'm seeing is to do with enumerations. When I compile
a *
*> Java enum via javac (version 1.6.0_02), and then run abc on the output
with *
*> the same options as above, I get the error *
*> *
*> Exception in thread "main" polyglot.util.InternalCompilerError: unhandled
*
*> exception during compilation *
*> at abc.main.CompileSequence.runSequence(CompileSequence.java:110) *
*> at abc.main.Main.run(Main.java:406) *
*> at abc.main.Main.main(Main.java:144) *
*> Caused by: java.lang.RuntimeException: Attempting to add method void *
*> <clinit>() to class A, but the class already has a method with that *
*> signature. *
*> at soot.SootClass.addMethod(SootClass.java:580) *
*> at abc.ja.tm.jrag.TypeDecl.jimplify2(TypeDecl.java:1058) *
*> at abc.ja.tm.jrag.ASTNode.jimplify2(ASTNode.java:616) *
*> at abc.ja.tm.jrag.ASTNode.jimplify2(ASTNode.java:616) *
*> at abc.ja.tm.jrag.Program.jimplify2(Program.java:956) *
*> at abc.ja.tm.CompileSequence.compile(CompileSequence.java:163) *
*> at abc.main.CompileSequence.runSequence(CompileSequence.java:100) *
*> ... 2 more *
*> *
*> Example input that causes the problem: *
*> *
*> public enum A{A,B,C} *
*> *
*> As I say, if anyone can point me in the direction of fixing or working *
*> around these problems, that'd be great! *
*> *
*> Thanks, *
*> *
*> Chris *
-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada
Received on Thu Sep 04 2008 - 16:55:00 BST

This archive was generated by hypermail 2.2.0 : Wed Sep 10 2008 - 13:50:10 BST