Bug 265053 - [reconciling] Incorrect error reported for ITD called from advice
Summary: [reconciling] Incorrect error reported for ITD called from advice
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: 1.6.4   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-16 15:08 EST by Andrew Clement CLA
Modified: 2009-03-13 16:59 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2009-02-16 15:08:54 EST
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)
Comment 1 Andrew Eisenberg CLA 2009-02-16 17:19:30 EST
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.
Comment 2 Andrew Eisenberg CLA 2009-02-16 17:42:26 EST
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.
Comment 3 Andrew Eisenberg CLA 2009-02-16 19:13:06 EST
Fix for this has been committed.
Comment 4 Andrew Eisenberg CLA 2009-03-13 16:59:12 EDT
Fix has been committed with regression test.