Summary: | [grammar] compiler allows package name containing "aspect" keyword | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Julie Waterhouse <juliew> | ||||
Component: | Compiler | Assignee: | Adrian Colyer <adrian.colyer> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | minor | ||||||
Priority: | P5 | CC: | aclement, neale, wes | ||||
Version: | unspecified | ||||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Windows 2000 | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Julie Waterhouse
2003-04-29 15:40:11 EDT
Created attachment 4756 [details]
Trivial aspect in a package that has the keyword "aspect" in its name.
This bug merits some more work to understand the details after the 1.1 release. In order to be compatible with existing Java code bases, we've tried to not add any new keywords to the AspectJ grammar. Instead, words like 'aspect' are treated as pseudo-keywords that are also allowed to be used in most identifier positions. This means that code which has a field called 'aspect' is legal, whereas code with a field called 'class' is not. We should probably look at the grammar more closely to understand any places where this liberalness breaks down and at least document that behavior. Ceratinly, having a top-level package named aspect is the kind of thing that might lead to trouble. However, we definitely want to support package names like 'com.parc.mycode.aspect' which are easier to imagine in large-scale existing code bases. *** Bug 41785 has been marked as a duplicate of this bug. *** Version: 1.6.5.200903301249 AspectJ version: 1.6.4.20090329215800 This is more curious than it seems... I just tried this. -- src/aspect/Aspect.aj package aspect; // after build, error marker here, and aspect is bold as keyword public aspect Aspect { } However, if I look in my bin directory I get: /bin - /aspect - /Aspect.class When I should see /bin - /aspect - /aspect/Aspect.class The package folder is created, but the generated class is not in it. |