Community
Participate
Working Groups
HEAD When one tries to query a ParameterizedTypeBinding using the method Scope.isDefinedInSameUnit(ReferenceBinding) , the return value is false even if the ParameterizedBinding was indeed defined in the same unit. This is because the comparison in the method occurs at line 3046 between the top level types obtained from the compilation unit and the queried type. Since the top level types are always a SourceTypeBinding, the comparison with a parameterized type binding will fail even if it is actually the same type. Hence, for Parameterized types we should compare as follows: if (enclosingType instanceof ParameterizedTypeBinding) if (topLevelTypes[i] == ((ParameterizedTypeBinding)enclosingType).type) return true;
(In reply to comment #0) > if (enclosingType instanceof ParameterizedTypeBinding) > if (topLevelTypes[i] == ((ParameterizedTypeBinding)enclosingType).type) > return true; Actually, using enclosingType.original() should suffice.
Created attachment 205028 [details] proposed fix
Released in HEAD for 3.8M3 via commit 21098f5e40f4c2eaaad3e643b94e7cf0a54113c9.
Verified for 3.8 M3 via code inspection.