comparison truffle/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java @ 22516:687bc1dda125

Truffle-DSL: fix wrong resolution when multiple public static methods are imported from a cached type.
author Christian Humer <christian.humer@oracle.com>
date Fri, 18 Dec 2015 14:41:06 +0100
parents dc83cc1f94f2
children
comparison
equal deleted inserted replaced
22515:d51cc0af8612 22516:687bc1dda125
1053 return 1; 1053 return 1;
1054 } 1054 }
1055 return 0; 1055 return 0;
1056 } 1056 }
1057 1057
1058 public static int compareByTypeHierarchy(TypeMirror t1, Set<String> t1SuperSet, TypeMirror t2, Set<String> t2SuperSet) {
1059 if (typeEquals(t1, t2)) {
1060 return 0;
1061 }
1062 if (t1SuperSet.contains(getQualifiedName(t2))) {
1063 return -1;
1064 }
1065
1066 if (t2SuperSet.contains(getQualifiedName(t1))) {
1067 return 1;
1068 }
1069 return 0;
1070 }
1071
1058 public static boolean canThrowType(List<? extends TypeMirror> thrownTypes, TypeMirror exceptionType) { 1072 public static boolean canThrowType(List<? extends TypeMirror> thrownTypes, TypeMirror exceptionType) {
1059 if (ElementUtils.containsType(thrownTypes, exceptionType)) { 1073 if (ElementUtils.containsType(thrownTypes, exceptionType)) {
1060 return true; 1074 return true;
1061 } 1075 }
1062 1076