[abc-users] weaver sensitive to class order in .jar ?

From: Alex Villazon <alex.villazon_at_lu.unisi.ch>
Date: Thu, 8 May 2008 12:10:47 +0200

Hi,
     While trying to weave JDK classes, I found a curious behavior of
the weaver...

     It fails depending on the order of the classes in the jar... In
this example, if Object is in second position it fails, but if it's in
first position it works fine.

     Is there a workaround for this issue? This time, as proposed by
Pavel, I was able to weave with -ext abc.ja independently of the
order, but the extension fails when I try to weave bigger subsets of
the JDK...

  Many thanks,

Alex

villazon_at_villazon-desktop:~/JDK$ jar cvf ../myrt.jar java/lang/
Number.class java/lang/Object.class
added manifest
adding: java/lang/Number.class(in = 529) (out= 336)(deflated 36%)
adding: java/lang/Object.class(in = 1493) (out= 812)(deflated 45%)
villazon_at_villazon-desktop:~/JDK$ cd ..
villazon_at_villazon-desktop:~/$ java -cp /home/villazon/abc/lib/abc-ja-
complete.jar abc.main.Main -verbose -injars myrt.jar -sourceroots
simpleabc/ -outjar abcaspect.jar -debug dontCheckExceptions
abc started on Thu May 08 10:55:30 GMT+01:00 2008
Exception in thread "main" polyglot.util.InternalCompilerError:
unhandled exception during weaving/optimisation
         at abc.main.CompileSequence.runSequence(CompileSequence.java:
142)
         at abc.main.Main.run(Main.java:406)
         at abc.main.Main.main(Main.java:144)
Caused by: java.lang.NullPointerException
         at
abc.aspectj.visit.PCStructure.getClassTypes(PCStructure.java:120)
         at
abc
.aspectj.visit.PCStructure.updateWithAllSootClasses(PCStructure.java:
178)
         at
abc
.aspectj
.visit.PatternMatcher.updateWithAllSootClasses(PatternMatcher.java:126)
         at abc.main.CompileSequence.weave(CompileSequence.java:429)
         at abc.main.CompileSequence.runSequence(CompileSequence.java:
115)
         ... 2 more
villazon_at_villazon-desktop:~/$ cd JDK/
villazon_at_villazon-desktop:~/JDK$ jar cvf ../myrt.jar java/lang/
Object.class java/lang/Number.class
added manifest
adding: java/lang/Object.class(in = 1493) (out= 812)(deflated 45%)
adding: java/lang/Number.class(in = 529) (out= 336)(deflated 36%)
villazon_at_villazon-desktop:~/JDK$ cd ..
villazon_at_villazon-desktop:~/$ java -cp /home/villazon/abc/lib/abc-ja-
complete.jar abc.main.Main -verbose -injars myrt.jar -sourceroots
simpleabc/ -outjar abcaspect.jar -debug dontCheckExceptions
abc started on Thu May 08 10:55:57 GMT+01:00 2008
Transforming java.lang.Object...
Transforming java.lang.Number...
Transforming Dummy...
Writing to java/lang/Object.class
Writing to java/lang/Number.class
Writing to Dummy.class
abc finished on Thu May 08 10:56:00 GMT+01:00 2008. ( 0 min. 2 sec. )
Received on Thu May 08 2008 - 11:11:09 BST

This archive was generated by hypermail 2.2.0 : Thu May 08 2008 - 11:50:11 BST