# HG changeset patch # User Thomas Wuerthinger # Date 1381952691 -7200 # Node ID ce82cdbffe47624e7f015339684e295b75868078 # Parent f1b7b7d2dad57f36e864b2cfdc7894996934b5c1# Parent ce4836e0212d05f3f0b4ec3a6fbe711fc3eaff26 Merge. diff -r f1b7b7d2dad5 -r ce82cdbffe47 graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/Utils.java --- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/Utils.java Wed Oct 16 17:26:51 2013 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/Utils.java Wed Oct 16 21:44:51 2013 +0200 @@ -400,7 +400,19 @@ } public static String getQualifiedName(TypeElement element) { - return element.getQualifiedName().toString(); + String qualifiedName = element.getQualifiedName().toString(); + if (qualifiedName.contains("$")) { + /* + * If a class gets loaded in its binary form by the ECJ compiler it fails to produce the + * proper canonical class name. It leaves the $ in the qualified name of the class. So + * one instance of a TypeElement may be loaded in binary and one in source form. The + * current type comparison in #typeEquals compares by the qualified name so the + * qualified name must match. This is basically a hack to fix the returned qualified + * name of eclipse. + */ + qualifiedName = qualifiedName.replace('$', '.'); + } + return qualifiedName; } public static String getQualifiedName(TypeMirror mirror) { @@ -866,6 +878,8 @@ return true; } else if (type1 == null || type2 == null) { return false; + } else if (type1 == type2) { + return true; } String qualified1 = getQualifiedName(type1); String qualified2 = getQualifiedName(type2); diff -r f1b7b7d2dad5 -r ce82cdbffe47 graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/typesystem/ImplicitCastData.java --- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/typesystem/ImplicitCastData.java Wed Oct 16 17:26:51 2013 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/typesystem/ImplicitCastData.java Wed Oct 16 21:44:51 2013 +0200 @@ -45,13 +45,14 @@ @Override public int compareTo(TemplateMethod o) { - if (o instanceof ImplicitCastData) { + if (o instanceof ImplicitCastData && sourceType != null) { // implicit casts are ordered by source type since // its also the order in which they are checked. TypeData otherSourceType = ((ImplicitCastData) o).getSourceType(); - return this.sourceType.compareTo(otherSourceType); + if (otherSourceType != null) { + return this.sourceType.compareTo(otherSourceType); + } } return super.compareTo(o); } - }