Bug 336147 - Inconsistency with ITITs
Summary: Inconsistency with ITITs
Status: RESOLVED INVALID
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.6.11   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-02 15:31 EST by Andrew Eisenberg CLA
Modified: 2011-02-03 00:29 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 Andrew Eisenberg CLA 2011-02-02 15:31:04 EST
It is possible to define a public static final method in an ITIT, but references to that method are an error.  

Consider this:


privileged aspect City_Roo_Op4j {
    public static class City.Keys {
        public static final int x() { return 9; } 
    }
}

class City { }

This compiles fine, but create this class and there is a compile error on the reference to x():

public class Test {
	public static void main(String[] args) { 
		City.Keys.x();   
	}
}
Comment 1 Andrew Clement CLA 2011-02-02 19:53:02 EST
I've considered it... but am having real trouble getting it to fail.

Are the aspect and City in the same file or in different files? (I've tried both options, didn't make a difference)

Where you say 'create this class' - are you creating it and then performing an incremental compile with what was already compiled or are you compiling them altogether?

Maybe attach a failing project with instructions (if this was done in AJDT, which I presume it was)
Comment 2 Andrew Eisenberg CLA 2011-02-03 00:29:12 EST
Strange...can't reproduce this now.  I'll re-open if I see it again.