Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] Iajc task dies updating JAR on its classpath


I have another problem now. I just upgraded to aspectj 1.5 and am trying
to use iajc Ant task. Iajc classpath includes the jar, which also the
destJar of the task. So, the jar file is build by a "build" target
before execution iajc task. In 1.5 iajc task throws an error:
Internal compiler error
org.aspectj.weaver.BCException: Can't open archive: sequencer.jar:
java.util.zip.ZipException: error in opening zip file
	at
org.aspectj.weaver.bcel.ClassPathManager$ZipFileEntry.ensureOpen(ClassPa
thManager.java:253)
	at
org.aspectj.weaver.bcel.ClassPathManager$ZipFileEntry.find(ClassPathMana
ger.java:225)
	at
org.aspectj.weaver.bcel.ClassPathManager.find(ClassPathManager.java:92)
	at
org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:222)
	at
org.aspectj.weaver.bcel.BcelWorld.resolveObjectType(BcelWorld.java:203)
	at org.aspectj.weaver.World.resolveObjectType(World.java:150)
	at org.aspectj.weaver.World.resolve(World.java:129)
	at
org.aspectj.weaver.patterns.WildTypePattern.resolveBindings(WildTypePatt
ern.java:436)

Where sequencer.jar is the jar file, which iajc is creating.

This used to work in 1.2. Is this the new expected behavior or a bug?

Thanks.

Oleg 

-----Original Message-----
From: aspectj-dev-bounces@xxxxxxxxxxx
[mailto:aspectj-dev-bounces@xxxxxxxxxxx] On Behalf Of Alexandre Vasseur
Sent: Friday, July 22, 2005 2:49 AM
To: AspectJ developer discussions
Subject: Re: [aspectj-dev] disabling aspects


Hi

You can use an if pointcut and a boolean "isEnable" field in the aspect:
aspect A {
  boolean isEnable = false;
  toggle() {
    isEnable = !isEnable;
  }// write deploy / undeploy instead perhaps for clarity
  ... // advice / pointcut using if(isEnable)
}
Then you can use A.aspectOf().toggle() to turn it on and off.

You can use the very same patterns using @AspectJ syntax since if()
pointcut is supported there as well.

There has been a discussion at last AOSD about that. Perhaps someone has
the notes or a link to share.

Alex

On 7/22/05, Oleg Lebedev <oleglebedev@xxxxxxxxxxxxx> wrote:
>  
> Greetings.
>   
> Is there a way to disable aspects at runtime. Say, I know that an 
> aspect is weaved in somewhere in class MangledClass, which class 
> MyClass is going to instanciate. I don't want this aspect instructions

> to trigger when MyClass instanciates and then uses MangledClass.
>   
> Also, is there a way to access an aspect from a Java class and modify 
> it's public members?
>   
> Thanks.
>   
>  
> Oleg Lebedev
> Software Architect 
> Waterford Research Institute 
> Phone: 801.938.1724 
> Cell: 801.209.6706 
>   
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx 
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> 
> 
>
_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
If you have questions about this email, please
contact the IT Help Desk.

Mail



Back to the top