Bug 137203

Summary: [1.5][compiler] enclosing parameterized types seem to confuse eclipse's build process
Product: [Eclipse Project] JDT Reporter: Tobias Riemenschneider <tobys>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Tobias Riemenschneider CLA 2006-04-18 09:04:31 EDT
This bug reprot is closely connected with 129190.

3.2RC1 now accepts to three mentioned scenarios, but when splitting the scenarios into two source files and changing the method definition with an generic argument type into a method with a non-generic argument type, eclipse produces a compile time error mentioning the method is not applicable for the given argument. The only way to get rid of this error is to clear and build the complete project [simply (re)building the project has no effect].

For the sake of completeness I will provide a listing of the mentioned scenario. Guess we have two source files
> Outer.java >>>
public class Outer<O> {
  public class Inner {}

  public static void method(Outer<?>.Inner x) {}
}
< Outer.java <<<
> ExtendedOuter.java >>>
class ExtendedOuter<E> extends Outer<E> {
  class ExtendedInner extends Inner {
    {
      Outer.method(this);
    }
  }
}
< ExtendedOuter.java <<<
in the default package of a Java project. When the argument type of method is changed from Outer<?>.Inner to Outer.Inner and the file Outer.java is saved (automatic build activated),
> Outer.java >>>
public class Outer<O> {
  public class Inner {}

  public static void method(Outer.Inner x) {}
}
< Outer.java <<<
> ExtendedOuter.java >>>
class ExtendedOuter<E> extends Outer<E> {
  class ExtendedInner extends Inner {
    {
      Outer.method(this);
    }
  }
}
< ExtendedOuter.java <<<
a compile time error is introduced to ExtendedOuter.java mentioning method is not applicable for the given argument. The compile time error appears every time, the method with parameterized argument types is changed into a method with non-parameterized argument types (independent of the parameterized argument type's definition, e.g. , "static void method(Outer<?>.Inner inner)" or "static <I> void method(Outer<I>.Inner inner)"). When changing one parameterized argument type definition to the other one, everything's fine.
Comment 1 Philipe Mulet CLA 2006-04-18 09:45:08 EDT
Reproduced.
Added GenericTypeTest#test0972-0973
Comment 2 Philipe Mulet CLA 2006-04-18 09:45:34 EDT
Reproduced.
Added GenericTypeTest#test0972-0974.
Note that there is no need to create first version of Outer.java. The second version can directly be created; issue only comes from compiling source for ExtendedOuter against binary version of Outer.
Comment 3 Philipe Mulet CLA 2006-04-20 03:38:18 EDT
Problem comes from ambiguous conversion from generic to parameterized/raw type. When resolving unresolved binary reference, the latter is intended (raw).

Fixed
Comment 4 Olivier Thomann CLA 2006-04-28 14:33:26 EDT
Verified with I20060427-1600 for 3.2RC2