|
|
@ -429,37 +429,38 @@ public class ClassInterfacesType extends ReferenceType { |
|
|
|
return sb.append("}").toString(); |
|
|
|
return sb.append("}").toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
/** |
|
|
|
// * Checks if we need to cast to a middle type, before we can cast from
|
|
|
|
* Checks if we need to cast to a middle type, before we can cast from |
|
|
|
// * fromType to this type.
|
|
|
|
* fromType to this type. |
|
|
|
// * @return the middle type, or null if it is not necessary.
|
|
|
|
* @return the middle type, or null if it is not necessary. |
|
|
|
// */
|
|
|
|
*/ |
|
|
|
// public Type getCastHelper(Type fromType) {
|
|
|
|
public Type getCastHelper(Type fromType) { |
|
|
|
// Type topType = fromType.getTop();
|
|
|
|
Type hintType = fromType.getHint(); |
|
|
|
// switch (topType.getTypeCode()) {
|
|
|
|
switch (hintType.getTypeCode()) { |
|
|
|
// case TC_ARRAY:
|
|
|
|
case TC_ARRAY: |
|
|
|
// if (clazz == null
|
|
|
|
if (clazz == null |
|
|
|
// && ArrayType.implementsAllIfaces(this.ifaces))
|
|
|
|
&& implementsAllIfaces(null, ArrayType.arrayIfaces, |
|
|
|
// return null;
|
|
|
|
this.ifaces)) |
|
|
|
// else
|
|
|
|
return null; |
|
|
|
// return tObject;
|
|
|
|
else |
|
|
|
// case TC_CLASS:
|
|
|
|
return tObject; |
|
|
|
// ClassInterfacesType top = (ClassInterfacesType) topType;
|
|
|
|
case TC_CLASS: |
|
|
|
// if (top.clazz == null || clazz == null
|
|
|
|
ClassInterfacesType hint = (ClassInterfacesType) hintType; |
|
|
|
// || clazz.superClassOf(top.clazz)
|
|
|
|
if (hint.clazz == null || clazz == null |
|
|
|
// || top.clazz.superClassOf(clazz))
|
|
|
|
|| clazz.superClassOf(hint.clazz) |
|
|
|
// return null;
|
|
|
|
|| hint.clazz.superClassOf(clazz)) |
|
|
|
// ClassInfo superClazz = clazz.getSuperclass();
|
|
|
|
return null; |
|
|
|
// while (superClazz != null
|
|
|
|
ClassInfo superClazz = clazz.getSuperclass(); |
|
|
|
// && !superClazz.superClassOf(top.clazz)) {
|
|
|
|
while (superClazz != null |
|
|
|
// superClazz = superClazz.getSuperclass();
|
|
|
|
&& !superClazz.superClassOf(hint.clazz)) { |
|
|
|
// }
|
|
|
|
superClazz = superClazz.getSuperclass(); |
|
|
|
// return tClass(superClazz.getName());
|
|
|
|
} |
|
|
|
// case TC_UNKNOWN:
|
|
|
|
return tClass(superClazz.getName()); |
|
|
|
// return null;
|
|
|
|
case TC_UNKNOWN: |
|
|
|
// }
|
|
|
|
return null; |
|
|
|
// return tObject;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
return tObject; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Checks if this type represents a valid type instead of a list |
|
|
|
* Checks if this type represents a valid type instead of a list |
|
|
|