Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339750

Summary: The editor warns for private method not use but the method is used...
Product: [Tools] AJDT Reporter: Jorelia <jorelia>
Component: CoreAssignee: AJDT-inbox <AJDT-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: aclement
Version: DEVELOPMENT   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Screen capture of the editor that reports the false warning
none
The verbatim AspectJ source code involved none

Description Jorelia CLA 2011-03-11 14:10:46 EST
Build Identifier: Build id: 20110301-1815

A private method inside an AspectJ classe is underlined as "Method not use" but the method is really called inside the class.

Reproducible: Always
Comment 1 Jorelia CLA 2011-03-11 14:11:48 EST
Created attachment 191019 [details]
Screen capture of the editor that reports the false warning
Comment 2 Jorelia CLA 2011-03-11 14:13:15 EST
Created attachment 191020 [details]
The verbatim AspectJ source code involved
Comment 3 Andrew Clement CLA 2011-04-26 18:34:13 EDT
Distilled it down to this:

===
package com.ubeker.bv.server.aspects;

import org.aspectj.lang.JoinPoint;

public aspect LoggingBehavior {

	pointcut daoLogger() : execution(* *(..));
	
	before() : daoLogger() {
		buildParameters(thisJoinPoint.getArgs());
    }
	
	private void buildParameters(Object[] ps) {
		
	}
}
===
which shows the same problem.

The error only appears in the editor, not in the problems view.  That indicates it is a reconciling issue and not a compiler issue.  Reassigning this to AJDT.
Comment 4 Andrew Eisenberg CLA 2011-04-26 22:09:55 EDT
This problem is arising because of the way that we do reconciling in the AJ editor. We use the Java reconciler, but pass it AJ code.  This means that we need to massage a few things.  For instance, references to thisJoinPoint need to be ignored by the reconciler, but by doing this, we also ignore the call to the private method that you declared.  Thus, the reconciler thinks that there are no calls to the private method.