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 CtClass fixByUppers(List<TypeData> users, ClassPool cp, Set<TypeData> 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(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 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(); } }
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(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(); } }