Bug 116755 - PointcutParser is not configurable
Summary: PointcutParser is not configurable
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Library (show other bugs)
Version: 1.5.0M4   Edit
Hardware: PC Windows XP
: P2 critical (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-16 20:19 EST by James Gan CLA
Modified: 2005-11-21 07:09 EST (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 James Gan CLA 2005-11-16 20:19:54 EST
I'm testing the reflection and weaver tools APIs. When I using following code:

PointcutParser parse = new PointcutParser();
String expr = "call(public * main.hello(..)";
PointcutExpression pex = parse.parsePointcutExpression(expr);

Whenever I use a full qualified class name in pointcut expression, an 
exception is throwed out:
java.lang.IllegalArgumentException: warning no match for this type name: obj 
[Xlint:invalidAbsoluteTypeName]

I try to turn off this Lint exception. But it seems I must access to world 
field of PointcutParser. This is inconvenient because world field is not 
exposed by PointcutParser. 

The existing PointcutParser interface implicitly creates a World and does not 
allow any configuration including classpath or lint. But developers may need 
this kind of control.
Comment 1 Andrew Clement CLA 2005-11-17 03:28:50 EST
look at for RC1.
Comment 2 Matthew Webster CLA 2005-11-17 06:13:58 EST
See also Bug 116229.
Comment 3 Adrian Colyer CLA 2005-11-19 11:56:37 EST
I've extended the PointcutParser to support 

public void setLintProperties(Properties p)

and

public void setLintProperties(String lintPropertiesResourceFileOnClasspath)

The following extract shows how to turn of the warning you are seeing:

Properties props = new Properties();
props.add("invalidAbsoluteType","ignore");
parser.setLintProperties(props);

Will close this bug report when fix available in a published build.
Comment 4 Matthew Webster CLA 2005-11-20 07:21:34 EST
While this is a nice workaround it is a little cumbersome. Lint already loads 
XlintDefault.properties as a resource why not allow the user to define "META-
INF/Xlint.properties" which would contain overrides. This would work well in 
both a batch and LTW environment.
Comment 5 Adrian Colyer CLA 2005-11-21 07:09:06 EST
For the second case, you can always do:

parser.setLintProperties("META-INF/Xlint.properties");

A "magic  location" would have to work in all modes, and we'd have to figure out it's interaction with the existing command-line options etc.. That's more work than I want to get into right now. If we get lots of user angst about having to add the above call we could consider defaulting post 1.5.0...

Fix now available in published build.