Bug 336147

Summary: Inconsistency with ITITs
Product: [Tools] AspectJ Reporter: Andrew Eisenberg <andrew.eisenberg>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: aclement
Version: 1.6.11   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

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.