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

Bug 325619

Summary: getWithinTypeName() reported as undefined in a pertypewithin Aspect
Product: [Tools] AJDT Reporter: jeitemgie
Component: UIAssignee: AJDT-inbox <AJDT-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: aclement, andrew.eisenberg
Version: 2.1.1   
Target Milestone: 2.1.2   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description jeitemgie CLA 2010-09-17 12:16:59 EDT
Build Identifier: 20100617-1415

Version: 2.1.1.e36x-20100908-0800
AspectJ version: 1.6.10.20100825080500

In a pertypewithin Aspect, the getWithinTypeName() is reported to be unexistent while it works perfectly under Ganymede


public aspect StaticEntityInitAspect pertypewithin(net.p3consulting.entity.*) {

	pointcut atentity(javax.persistence.Table table) : staticinitialization(*) && @annotation(table);
	
	after(javax.persistence.Table tableAnn) returning : atentity(tableAnn) {
		String schema = tableAnn.schema() ;
		
		if (schema.equals("")) schema = "public" ;
		
		// TODO why getWithinTypeName doesn't work with Helios ?????? the following line was Ok under Ganymede !
		// System.out.println( "*********** " + getWithinTypeName() + " " + schema + "." + tableAnn.name()) ;		
		// have to fail back to 
		System.out.println( "*********** " + thisJoinPointStaticPart.getSignature().getDeclaringTypeName() + " " + schema + "." + tableAnn.name()) ;		

	}
}


Reproducible: Always

Steps to Reproduce:
see code in Details
Comment 1 Andrew Clement CLA 2010-09-17 12:54:43 EDT
When you say it is reported to be non-existent - Do you only get an error in the editor, or does a real error also appear in the problems view?  Do you have JDT weaving turned on?

I just tried it on my setup and it worked fine - i do have jdt weaving on.
Comment 2 jeitemgie CLA 2010-09-17 13:12:37 EDT
(In reply to comment #1)
> When you say it is reported to be non-existent - Do you only get an error in
> the editor, or does a real error also appear in the problems view?  Do you have
> JDT weaving turned on?
> 
> I just tried it on my setup and it worked fine - i do have jdt weaving on.

Indeed, there is nothing in the "Problems" view, the error is only in the editor and 
Yes ! disabling JDT makes the false error message to disappear…

Thanks, I would have never have thought about this one since of course under Ganymede I never turn it on…
Comment 3 Andrew Eisenberg CLA 2010-11-23 19:35:54 EST
My understanding is that by enabling JDT weaving, this problem has gone away (you don't quite say that in your comment).  Is this correct?  Are there any problems still left to solve?
Comment 4 jeitemgie CLA 2010-11-24 02:42:09 EST
(In reply to comment #3)
> My understanding is that by enabling JDT weaving, this problem has gone away
> (you don't quite say that in your comment).  Is this correct?  Are there any
> problems still left to solve?

Enabling JDT weaving creates the problem, when it's disabled there is no more problem, so there is a workaround but the problem is still there.
Comment 5 Andrew Eisenberg CLA 2010-11-24 12:19:44 EST
OK...I just tried it out in my setting and I could reproduce the problem.  You should not be running with JDT weaving disabled.  It is not a recommended way to go.

I should be able to have a fix out later today.
Comment 6 Andrew Eisenberg CLA 2010-11-24 13:09:09 EST
OK. Fixed locally with regression tests.  Also added some more tests for aspectOf and hasAspect.

You will not be able to get content assist for this method when inside of the aspect, when referencing the aspect in another compilation unit, the method will be available.
Comment 7 Andrew Eisenberg CLA 2010-11-24 16:33:47 EST
Fix committed with regression tests.