Community
Participate
Working Groups
Build Identifier: 20110301-1815 Having two plugins in an RCP project one containing RCP and the other containing aspects for the first plugin. If using @AspectJ notation in a RCP class that extends one of the aspects described in the Aspects plugin (using "perthis" modifier) it causes a StackOver flow error. Reproducible: Always Steps to Reproduce: 1.Create a RCP plugin application and add AspectJ nature to it 2. Create another RCP plugin (with an activator) with Aspects for the first plugin: 3.Create a ThreadSafetyAspects.aj in this last Aspectj plugin /** * Reusable aspect for implementing the thread safety through a mutex. */ @Aspect( "perthis( readOperations() || writeOperations() )" ) public abstract class ThreadSafetyAspect { /** * Defines the read operations (operations that do not change the locked stuff). */ @Pointcut( "" ) protected abstract void readOperations(); /** * Defines the write operations (operations that do change the locked stuff). */ @Pointcut( "" ) protected abstract void writeOperations(); private ReadWriteLock _lock = new ReentrantReadWriteLock(); @Before( "readOperations()" ) public void beforeRead() { _lock.readLock().lock(); } @After( "readOperations()" ) public void afterRead() { _lock.readLock().unlock(); } @Before( "writeOperations()" ) public void beforeWrite() { _lock.writeLock().lock(); } @After( "writeOperations()" ) public void afterWrite() { _lock.writeLock().unlock(); } } 4. create a Main class in the first RCP plugin and add this aspect: @Aspect public static class OwnThreadSafety extends ThreadSafetyAspect { @Pointcut( "") protected void readOperations() {} @Pointcut( "" ) protected void writeOperations() {} }
Created attachment 191215 [details] workspace Eclipse example which gives the error
5. Add the Aspect plugin project in the Aspect Path of the RCP "Hello World" plugin application. Then comes the error described...
unsetting the target field which is currently set for something already released