Community
Participate
Working Groups
Created attachment 241601 [details] aspectj plugin to reproduce the bug In case an aspect is defined as privileged and the variable thisJoindPoint is used in an advice you get the compile error: The local variable thisJoinPoint may not have been initialized
This is due to some new variable usage flow checking in the Eclipse Java8 compiler. Fixed. Thanks for the test case!
Great, when will there be a new build so i can test together with the fix for Bug 431541? We want to Switch our master development branch to Java8 but to do this a Need a working Aspectj & AJDT
I have a few other bugs to try and wrap up before I build a new AspectJ+AJDT, so maybe wednesday.
I checked the fix and found another case where thisJoinPoint is not initialized. if thisJointPoint is used within an if Statement in the pointcut Definition it is also marked as not initilialized. Just modify the example attached the following way to reproduce it: void around(): execution(boolean Control.forceFocus ()) && if(thisJoinPoint.getTarget().getClass().getName().equals("org.eclipse.swt.widgets.Control")) { thisJoinPoint.getThis(); }
Hi Andy, I'm seeing this issue when building Spring Framework master (i.e. 4.1) with the latest Spring Tool Suite build: spring-tool-suite-3.6.0.CI-B1887973-e4.4-macosx-cocoa-x86_64-installer.dmg Specifically: The local variable thisJoinPoint may not have been initialized AbstractDependencyInjectionAspect.aj /spring-aspects/src/main/java/org/springframework/beans/factory/aspectj line 57 Java Problem When do think a fix will be available in STS builds? Or... is there a patch that can be applied to STS nightly builds? Cheers, Sam
Created attachment 244115 [details] Spring's AbstractDependencyInjectionAspect Attached source code for Spring's AbstractDependencyInjectionAspect.
I just fixed another variant where thisEnclosingJoinPointStaticPart was a problem too. @Sam the AJDT builds for 4.4 are failing is the problem, I think that is part of the problem so the fix isn't available in something installable right now. We'll get it sorted soon. @Reto I'll take a look at your variants I will likely do an upgrade to the latest JDT very soon (as eclipse 4.4 is being finished up) and put out a 1.8.1 with all these changes in.
Ok, the AJDT for 4.4 builds are in better shape now (one running at the moment). I've fixed all the variants of this I am aware of. The latest one Reto showed was the variable being used in an if() clause. The previous fix dealt with it occurring in an advice so I expanded that fix to cover ifs. The next build should be good, it is also available as a 1.8.1.BUILD-SNAPSHOT in the Spring maven repo. When the build https://build.spring.io/browse/AJDT-AE44-65 completes, you should be able to install it and try it out Sam.
@Andy: Build #65 failed. I see you that triggered another one, and I'm watching that build plan now. So I'll hopefully get to try it out soon.
I installed an update from https://build.spring.io/browse/AJDT-AE44-66/artifact/shared/update-site/, and that seems to have done the trick. Thanks!
My open case seems also to be solved Thanks
thanks for confirming the fix.