Community
Participate
Working Groups
public aspect ProfilingAspect { private long AccessTracked.lastAccessedTime; public void AccessTracked.updateLastAccessedTime() { lastAccessedTime = System.nanoTime(); } public long AccessTracked.getLastAccessedTime() { return lastAccessedTime; } before(AccessTracked accessTracked) : execution(* AccessTracked+.*(..)) && !execution(* AccessTracked.*(..)) && this(accessTracked){ accessTracked.updateLastAccessedTime(); // ERROR reported here } } interface AccessTracked {} --- exception in error log that occurred around same time: Java Model Exception: java.lang.NullPointerException at org.eclipse.ajdt.core.parserbridge.AJCompilationUnitProblemFinder.processAJ(AJCompilationUnitProblemFinder.java:295) at org.eclipse.ajdt.core.parserbridge.AJCompilationUnitProblemFinder.processAJ(AJCompilationUnitProblemFinder.java:175) at org.eclipse.ajdt.core.reconcile.AJReconcileWorkingCopyOperation.makeConsistent(AJReconcileWorkingCopyOperation.java:244) at org.eclipse.ajdt.core.reconcile.AJReconcileWorkingCopyOperation.executeOperation(AJReconcileWorkingCopyOperation.java:112) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:709) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:770) at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.reconcile(AJCompilationUnit.java:611) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:124) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89)
I can't reproduce the NPE, but that exception might be fixed by a change I added earlier. However, I do see the spurious error. Will look into that.
Yes, we are not properly handling references in advice to ITDs on interfaces declared in the same file. If AccessTracked is changed to class, or moved to a separate file, then this does not occur. I'll be able to fix this.
Fix for this has been committed.
Fix has been committed with regression test.