private String fixTypes2(List<TypeData> scc, Set<String> lowersSet, ClassPool cp) throws NotFoundException { Iterator<String> it = lowersSet.iterator(); if (lowersSet.size() == 0) return null; // only NullType else if (lowersSet.size() == 1) return it.next(); else { CtClass cc = cp.get(it.next()); while (it.hasNext()) cc = commonSuperClassEx(cc, cp.get(it.next())); if (cc.getSuperclass() == null || isObjectArray(cc)) cc = fixByUppers(scc, cp, new HashSet<TypeData>(), cc); if (cc.isArray()) return Descriptor.toJvmName(cc); return cc.getName(); } }
String typeName = fixTypes2(scc, lowersSet, cp); for (int i = 0; i < size; i++) { TypeVar cv = (TypeVar)scc.get(i);
String typeName = fixTypes2(scc, lowersSet, cp); for (int i = 0; i < size; i++) { TypeVar cv = (TypeVar)scc.get(i);
String typeName = fixTypes2(scc, lowersSet, cp); for (int i = 0; i < size; i++) { TypeVar cv = (TypeVar)scc.get(i);
private CtClass fixByUppers(ArrayList users, ClassPool cp, HashSet visited, CtClass type) throws NotFoundException { if (users == null) return type; int size = users.size(); for (int i = 0; i < size; i++) { TypeVar t = (TypeVar)users.get(i); if (!visited.add(t)) return type; if (t.uppers != null) { int s = t.uppers.size(); for (int k = 0; k < s; k++) { CtClass cc = cp.get((String)t.uppers.get(k)); if (cc.subtypeOf(type)) type = cc; } } type = fixByUppers(t.usedBy, cp, visited, type); } return type; } }
private CtClass fixByUppers(ArrayList users, ClassPool cp, HashSet visited, CtClass type) throws NotFoundException { if (users == null) return type; int size = users.size(); for (int i = 0; i < size; i++) { TypeVar t = (TypeVar)users.get(i); if (!visited.add(t)) return type; if (t.uppers != null) { int s = t.uppers.size(); for (int k = 0; k < s; k++) { CtClass cc = cp.get((String)t.uppers.get(k)); if (cc.subtypeOf(type)) type = cc; } } type = fixByUppers(t.usedBy, cp, visited, type); } return type; } }
private CtClass fixByUppers(ArrayList users, ClassPool cp, HashSet visited, CtClass type) throws NotFoundException { if (users == null) return type; int size = users.size(); for (int i = 0; i < size; i++) { TypeVar t = (TypeVar)users.get(i); if (!visited.add(t)) return type; if (t.uppers != null) { int s = t.uppers.size(); for (int k = 0; k < s; k++) { CtClass cc = cp.get((String)t.uppers.get(k)); if (cc.subtypeOf(type)) type = cc; } } type = fixByUppers(t.usedBy, cp, visited, type); } return type; } }
private String fixTypes2(ArrayList scc, HashSet lowersSet, ClassPool cp) throws NotFoundException { Iterator it = lowersSet.iterator(); if (lowersSet.size() == 0) return null; // only NullType else if (lowersSet.size() == 1) return (String)it.next(); else { CtClass cc = cp.get((String)it.next()); while (it.hasNext()) cc = commonSuperClassEx(cc, cp.get((String)it.next())); if (cc.getSuperclass() == null || isObjectArray(cc)) cc = fixByUppers(scc, cp, new HashSet(), cc); if (cc.isArray()) return Descriptor.toJvmName(cc); else return cc.getName(); } }
private String fixTypes2(ArrayList scc, HashSet lowersSet, ClassPool cp) throws NotFoundException { Iterator it = lowersSet.iterator(); if (lowersSet.size() == 0) return null; // only NullType else if (lowersSet.size() == 1) return (String)it.next(); else { CtClass cc = cp.get((String)it.next()); while (it.hasNext()) cc = commonSuperClassEx(cc, cp.get((String)it.next())); if (cc.getSuperclass() == null || isObjectArray(cc)) cc = fixByUppers(scc, cp, new HashSet(), cc); if (cc.isArray()) return Descriptor.toJvmName(cc); else return cc.getName(); } }
public TypeData join() { return new TypeVar(this); }
private String fixTypes2(ArrayList scc, HashSet lowersSet, ClassPool cp) throws NotFoundException { Iterator it = lowersSet.iterator(); if (lowersSet.size() == 0) return null; // only NullType else if (lowersSet.size() == 1) return (String)it.next(); else { CtClass cc = cp.get((String)it.next()); while (it.hasNext()) cc = commonSuperClassEx(cc, cp.get((String)it.next())); if (cc.getSuperclass() == null || isObjectArray(cc)) cc = fixByUppers(scc, cp, new HashSet(), cc); if (cc.isArray()) return Descriptor.toJvmName(cc); else return cc.getName(); } }
public TypeData join() { return new TypeVar(this); }
public TypeData join() { return new TypeVar(this); }
public TypeVar(TypeData t) { uppers = null; lowers = new ArrayList(2); usedBy = new ArrayList(2); merge(t); fixedType = null; is2WordType = t.is2WordType(); }
public TypeData join() { if (initialized) return new TypeVar(new ClassName(getName())); else return new UninitTypeVar(copy()); }