Bug 112615 - -XhasMember is not processed correctly when passed from AJDT
Summary: -XhasMember is not processed correctly when passed from AJDT
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0M4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Helen Beeken CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-14 08:26 EDT by Sian January CLA
Modified: 2012-04-03 15:52 EDT (History)
0 users

See Also:


Attachments
patch containing fix (880 bytes, patch)
2005-10-25 04:20 EDT, Helen Beeken CLA
aclement: iplog+
Details | Diff
patch containing test (1.05 KB, patch)
2005-10-25 04:21 EDT, Helen Beeken CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sian January CLA 2005-10-14 08:26:11 EDT
To test this in AJDT install the bean example, add a new interface called I 
and then add the following line to BoundPoint.aj:

declare parents: hasmethod(* set*(..)) implements I;

Now open the AspectJ Compiler preference page and select "Has Member" on the 
advanced tab.  Click OK, rebuild and if the option was working the project 
would build correctly.  As it stands there is an error:

the type pattern hasmethod(* set*(..)) can only be used when the -XhasMember 
option is set
Comment 1 Andrew Clement CLA 2005-10-14 08:41:28 EDT
Some hints perhaps ...

I would follow through another option that you know gets through, when the path
is identified, do the same for hasMember.  It is the kind of option that is set
on the world and then accessed throughout the weaver - I think possibly
notReweavable or lazyTjp might behave in a similar way, so try tracing those.

You *could* create a testcase for this - it probably won't look like a normal
one though because the option needs passing in the same way AJDT passes it,
since if you pass it in the standard testcase way it works (see entries in
ajc150.xml).  As a base for the testcase you could do something like
MultiProjectIncrementalTests.testPr92837() - but you'll need to puzzle through
how to get the option passed.  Or look at some of the subtypes of AjdeTestcase -
which are also confusing ;)
Comment 2 Helen Beeken CLA 2005-10-25 03:45:27 EDT
A simplified testcase is the following:

--------------------------------------------------------------------
public class PR102479 {

	public void myMethod1() {
	}
	
}

interface I {	
}

aspect A {
	declare parents: hasmethod(* myMethod*(..)) implements I;
}
-----------------------------------------------------------------

The fix is to set -XhasMember in the AjBuildConfig.installGlobals(..) method in
the same way that -XlazyTjp is set. 

Currently writing a testcase to fit in with the aspectj testsuite before
attaching a patch.
Comment 3 Helen Beeken CLA 2005-10-25 04:20:36 EDT
Created attachment 28738 [details]
patch containing fix

This is a patch containing the fix and should be applied to the
org.aspectj.ajdt.core project
Comment 4 Helen Beeken CLA 2005-10-25 04:21:34 EDT
Created attachment 28739 [details]
patch containing test

This is a patch containing the test and should be applied to the ajde project.
Comment 5 Andrew Clement CLA 2005-10-25 08:40:46 EDT
fix committed waiting on build.
Comment 6 Andrew Clement CLA 2005-10-26 09:59:30 EDT
fix available