[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[aspectj-users] AJ Internal Compiler Error
|
Hi!
Disclaimer: I am still facing problems accessing Bugzilla, so the following might already have been
reported.
Consider the following:
[code]
package bar;
public class TargetITDClass {}
package foo;
import bar.TargetClass;
public aspect ITDWithACall {
public void TargetClass.doSomething(String param) {
String changedParam= changeParam(param);
}
<modifiers> String changeParam(String param) { /// <= HERE
return param + "-modified";
}
}
[/code]
So when changing the modifiers of the changeParam() method the following behavior is seen:
1/ non-static modifier: correctly reported that you cannot make a static reference to the non-static
method changeParam
2/ public static modifiers: everything works as expected
3/ !public (anything else than public) static modifiers: results in the following exception:
[stack]
java.lang.NullPointerException
at
org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend.manageSyntheticAccessIfNecessary(MessageSend.java:230)
at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:60)
at
org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:49)
at
org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:84)
at
org.aspectj.ajdt.internal.compiler.ast.InterTypeMethodDeclaration.analyseCode(InterTypeMethodDeclaration.java:79)
at
org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.internalAnalyseCode(TypeDeclaration.java:732)
at
org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode(TypeDeclaration.java:271)
at
org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:80)
at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:517)
at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:329)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:810)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:254)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:163)
at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:117)
at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191)
NullPointerException thrown: null
[/stack]
IMO this should result in a compilation error with the error changeParam is not accessible from the
context (or something like this).
cheers,
./alex
--
.w( the_mindstorm )p.