@Override public boolean isSameType(TypeMirror t1, TypeMirror t2) { if (t1.getKind() == TypeKind.WILDCARD || t2.getKind() == TypeKind.WILDCARD) { // Wildcard types are never equal, according to the spec of this method return false; } if (t1 == t2) { return true; } if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) { return false; } Binding b1 = ((TypeMirrorImpl)t1).binding(); Binding b2 = ((TypeMirrorImpl)t2).binding(); return b1 == b2; }
@Override public boolean isSameType(TypeMirror t1, TypeMirror t2) { if (t1.getKind() == TypeKind.WILDCARD || t2.getKind() == TypeKind.WILDCARD) { // Wildcard types are never equal, according to the spec of this method return false; } if (t1 == t2) { return true; } if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) { return false; } Binding b1 = ((TypeMirrorImpl)t1).binding(); Binding b2 = ((TypeMirrorImpl)t2).binding(); return b1 == b2; }
@Override public boolean isSameType(TypeMirror t1, TypeMirror t2) { if (t1.getKind() == TypeKind.WILDCARD || t2.getKind() == TypeKind.WILDCARD) { // Wildcard types are never equal, according to the spec of this method return false; } if (t1 == t2) { return true; } if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) { return false; } Binding b1 = ((TypeMirrorImpl)t1).binding(); Binding b2 = ((TypeMirrorImpl)t2).binding(); return b1 == b2; }
@Override public Element asElement(TypeMirror t) { switch(t.getKind()) { case DECLARED : case TYPEVAR : return _env.getFactory().newElement(((TypeMirrorImpl)t).binding()); default: break; } return null; }
@Override public Element asElement(TypeMirror t) { switch(t.getKind()) { case DECLARED : case TYPEVAR : return _env.getFactory().newElement(((TypeMirrorImpl)t).binding()); default: break; } return null; }
@Override public Element asElement(TypeMirror t) { switch(t.getKind()) { case DECLARED : case TYPEVAR : return _env.getFactory().newElement(((TypeMirrorImpl)t).binding()); } return null; }
@Override public Element asElement(TypeMirror t) { switch(t.getKind()) { case DECLARED : case TYPEVAR : return _env.getFactory().newElement(((TypeMirrorImpl)t).binding()); default: break; } return null; }
@Override public Element asElement(TypeMirror t) { switch(t.getKind()) { case DECLARED : case TYPEVAR : return _env.getFactory().newElement(((TypeMirrorImpl)t).binding()); default: break; } return null; }
@Override public Element asElement(TypeMirror t) { switch(t.getKind()) { case DECLARED : case TYPEVAR : return _env.getFactory().newElement(((TypeMirrorImpl)t).binding()); default: break; } return null; }
@Override public boolean isAssignable(TypeMirror t1, TypeMirror t2) { if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) { return false; } Binding b1 = ((TypeMirrorImpl)t1).binding(); Binding b2 = ((TypeMirrorImpl)t2).binding(); if (!(b1 instanceof TypeBinding) || !(b2 instanceof TypeBinding)) { // package, method, import, etc. throw new IllegalArgumentException(); } if (((TypeBinding)b1).isCompatibleWith((TypeBinding)b2)) { return true; } TypeBinding convertedType = _env.getLookupEnvironment().computeBoxingType((TypeBinding)b1); return null != convertedType && convertedType.isCompatibleWith((TypeBinding)b2); }
@Override public boolean isAssignable(TypeMirror t1, TypeMirror t2) { if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) { return false; } Binding b1 = ((TypeMirrorImpl)t1).binding(); Binding b2 = ((TypeMirrorImpl)t2).binding(); if (!(b1 instanceof TypeBinding) || !(b2 instanceof TypeBinding)) { // package, method, import, etc. throw new IllegalArgumentException(); } if (((TypeBinding)b1).isCompatibleWith((TypeBinding)b2)) { return true; } TypeBinding convertedType = _env.getLookupEnvironment().computeBoxingType((TypeBinding)b1); return null != convertedType && convertedType.isCompatibleWith((TypeBinding)b2); }
/** * @return true if a value of type t1 can be assigned to a variable of type t2, i.e., t2 = t1. */ @Override public boolean isAssignable(TypeMirror t1, TypeMirror t2) { if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) { return false; } Binding b1 = ((TypeMirrorImpl)t1).binding(); Binding b2 = ((TypeMirrorImpl)t2).binding(); if (!(b1 instanceof TypeBinding) || !(b2 instanceof TypeBinding)) { // package, method, import, etc. throw new IllegalArgumentException(); } if (((TypeBinding)b1).isCompatibleWith((TypeBinding)b2)) { return true; } TypeBinding convertedType = _env.getLookupEnvironment().computeBoxingType((TypeBinding)b1); return null != convertedType && convertedType.isCompatibleWith((TypeBinding)b2); }
/** * @return true if a value of type t1 can be assigned to a variable of type t2, i.e., t2 = t1. */ @Override public boolean isAssignable(TypeMirror t1, TypeMirror t2) { if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) { return false; } Binding b1 = ((TypeMirrorImpl)t1).binding(); Binding b2 = ((TypeMirrorImpl)t2).binding(); if (!(b1 instanceof TypeBinding) || !(b2 instanceof TypeBinding)) { // package, method, import, etc. throw new IllegalArgumentException(); } if (((TypeBinding)b1).isCompatibleWith((TypeBinding)b2)) { return true; } TypeBinding convertedType = _env.getLookupEnvironment().computeBoxingType((TypeBinding)b1); return null != convertedType && convertedType.isCompatibleWith((TypeBinding)b2); }
/** * @return true if a value of type t1 can be assigned to a variable of type t2, i.e., t2 = t1. */ @Override public boolean isAssignable(TypeMirror t1, TypeMirror t2) { if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) { return false; } Binding b1 = ((TypeMirrorImpl)t1).binding(); Binding b2 = ((TypeMirrorImpl)t2).binding(); if (!(b1 instanceof TypeBinding) || !(b2 instanceof TypeBinding)) { // package, method, import, etc. throw new IllegalArgumentException(); } if (((TypeBinding)b1).isCompatibleWith((TypeBinding)b2)) { return true; } TypeBinding convertedType = _env.getLookupEnvironment().computeBoxingType((TypeBinding)b1); return null != convertedType && convertedType.isCompatibleWith((TypeBinding)b2); }
@Override public boolean isSameType(TypeMirror t1, TypeMirror t2) { if (t1.getKind() == TypeKind.WILDCARD || t2.getKind() == TypeKind.WILDCARD) { // Wildcard types are never equal, according to the spec of this method return false; } if (t1 == t2) { return true; } if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) { return false; } Binding b1 = ((TypeMirrorImpl)t1).binding(); Binding b2 = ((TypeMirrorImpl)t2).binding(); if (b1 == b2) { return true; } if (!(b1 instanceof TypeBinding) || !(b2 instanceof TypeBinding)) { return false; } TypeBinding type1 = ((TypeBinding) b1); TypeBinding type2 = ((TypeBinding) b2); if (TypeBinding.equalsEquals(type1, type2)) return true; return CharOperation.equals(type1.computeUniqueKey(), type2.computeUniqueKey()); }
@Override public boolean isSameType(TypeMirror t1, TypeMirror t2) { if (t1.getKind() == TypeKind.WILDCARD || t2.getKind() == TypeKind.WILDCARD) { // Wildcard types are never equal, according to the spec of this method return false; } if (t1 == t2) { return true; } if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) { return false; } Binding b1 = ((TypeMirrorImpl)t1).binding(); Binding b2 = ((TypeMirrorImpl)t2).binding(); if (b1 == b2) { return true; } if (!(b1 instanceof TypeBinding) || !(b2 instanceof TypeBinding)) { return false; } TypeBinding type1 = ((TypeBinding) b1); TypeBinding type2 = ((TypeBinding) b2); if (TypeBinding.equalsEquals(type1, type2)) return true; return CharOperation.equals(type1.computeUniqueKey(), type2.computeUniqueKey()); }
@Override public boolean isAssignable(TypeMirror t1, TypeMirror t2) { validateRealTypes(t1, t2); if (!(t1 instanceof TypeMirrorImpl) || !(t2 instanceof TypeMirrorImpl)) { return false; } Binding b1 = ((TypeMirrorImpl)t1).binding(); Binding b2 = ((TypeMirrorImpl)t2).binding(); if (!(b1 instanceof TypeBinding) || !(b2 instanceof TypeBinding)) { // package, method, import, etc. throw new IllegalArgumentException(); } if (((TypeBinding)b1).isCompatibleWith((TypeBinding)b2)) { return true; } TypeBinding convertedType = _env.getLookupEnvironment().computeBoxingType((TypeBinding)b1); return null != convertedType && convertedType.isCompatibleWith((TypeBinding)b2); }