Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336162

Summary: [plan] [ITIT] Import reference to an intertype inner type in the target type causes spurious reconciling error
Product: [Tools] AJDT Reporter: Andrew Eisenberg <andrew.eisenberg>
Component: CoreAssignee: AJDT-inbox <AJDT-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3    
Version: 2.1.1   
Target Milestone: 2.1.2   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:

Description Andrew Eisenberg CLA 2011-02-02 16:25:40 EST
Given the folliowing:

package p;
privileged aspect City_Roo_Op4j {    
    public static class City.Keys {
        public static final Function<Object, City> CITY = null;
    }
}


package p;

import p.City.Keys;
import static p.City.Keys.CITY;

public class City {  
  void x() { CITY.toString(); }
}

The two import statements as well as the reference to CITY give reconciling errors even though ajc accepts the code.  

This is caused by how CompilationUnitScope.findSingleImport() tries to resolve the import, but can't.  This will be tricky to fix since I will likely need to use some more weaving.

Note that the following class works just fine in AJDT because it resolves the import statements using an ITDAwareSourceTypeRequestor:

package p;
mport p.City.Keys;
import static p.City.Keys.CITY;
class Test {
  void x() { CITY.toString(); }
}
Comment 1 Andrew Eisenberg CLA 2011-02-04 17:43:35 EST
Fixed.  The problem was that we weren't properly creating TypeBindings for the synthetic intertype innertypes that wree pushed into the target type.