public String makeUniqueName(String prefix) { HashMap table = new HashMap(); makeMemberList(table); Set keys = table.keySet(); String[] methods = new String[keys.size()]; keys.toArray(methods); if (notFindInArray(prefix, methods)) return prefix; int i = 100; String name; do { if (i > 999) throw new RuntimeException("too many unique name"); name = prefix + i++; } while (!notFindInArray(name, methods)); return name; }
@Override public String makeUniqueName(String prefix) { Map<Object,CtClassType> table = new HashMap<Object,CtClassType>(); makeMemberList(table); Set<Object> keys = table.keySet(); String[] methods = new String[keys.size()]; keys.toArray(methods); if (notFindInArray(prefix, methods)) return prefix; int i = 100; String name; do { if (i > 999) throw new RuntimeException("too many unique name"); name = prefix + i++; } while (!notFindInArray(name, methods)); return name; }
CtClass ic =ifs[i]; if (ic != null && ic instanceof CtClassType) ((CtClassType)ic).makeMemberList(table); CtClass s = getSuperclass(); if (s != null && s instanceof CtClassType) ((CtClassType)s).makeMemberList(table);
private void makeMemberList(Map<Object,CtClassType> table) { int mod = getModifiers(); if (Modifier.isAbstract(mod) || Modifier.isInterface(mod)) try { CtClass[] ifs = getInterfaces(); for (CtClass ic : ifs) if (ic != null && ic instanceof CtClassType) ((CtClassType)ic).makeMemberList(table); } catch (NotFoundException e) {} try { CtClass s = getSuperclass(); if (s != null && s instanceof CtClassType) ((CtClassType)s).makeMemberList(table); } catch (NotFoundException e) {} List<MethodInfo> methods = getClassFile2().getMethods(); for (MethodInfo minfo:methods) table.put(minfo.getName(), this); List<FieldInfo> fields = getClassFile2().getFields(); for (FieldInfo finfo:fields) table.put(finfo.getName(), this); } }
public String makeUniqueName(String prefix) { HashMap table = new HashMap(); makeMemberList(table); Set keys = table.keySet(); String[] methods = new String[keys.size()]; keys.toArray(methods); if (notFindInArray(prefix, methods)) return prefix; int i = 100; String name; do { if (i > 999) throw new RuntimeException("too many unique name"); name = prefix + i++; } while (!notFindInArray(name, methods)); return name; }
public String makeUniqueName(String prefix) { HashMap table = new HashMap(); makeMemberList(table); Set keys = table.keySet(); String[] methods = new String[keys.size()]; keys.toArray(methods); if (notFindInArray(prefix, methods)) return prefix; int i = 100; String name; do { if (i > 999) throw new RuntimeException("too many unique name"); name = prefix + i++; } while (!notFindInArray(name, methods)); return name; }
public String makeUniqueName(String prefix) { HashMap table = new HashMap(); makeMemberList(table); Set keys = table.keySet(); String[] methods = new String[keys.size()]; keys.toArray(methods); if (notFindInArray(prefix, methods)) return prefix; int i = 100; String name; do { if (i > 999) throw new RuntimeException("too many unique name"); name = prefix + i++; } while (!notFindInArray(name, methods)); return name; }
public String makeUniqueName(String prefix) { HashMap table = new HashMap(); makeMemberList(table); Set keys = table.keySet(); String[] methods = new String[keys.size()]; keys.toArray(methods); if (notFindInArray(prefix, methods)) return prefix; int i = 100; String name; do { if (i > 999) throw new RuntimeException("too many unique name"); name = prefix + i++; } while (!notFindInArray(name, methods)); return name; }
public String makeUniqueName(String prefix) { HashMap table = new HashMap(); makeMemberList(table); Set keys = table.keySet(); String[] methods = new String[keys.size()]; keys.toArray(methods); if (notFindInArray(prefix, methods)) return prefix; int i = 100; String name; do { if (i > 999) throw new RuntimeException("too many unique name"); name = prefix + i++; } while (!notFindInArray(name, methods)); return name; }
CtClass ic =ifs[i]; if (ic != null && ic instanceof CtClassType) ((CtClassType)ic).makeMemberList(table); CtClass s = getSuperclass(); if (s != null && s instanceof CtClassType) ((CtClassType)s).makeMemberList(table);
CtClass ic =ifs[i]; if (ic != null && ic instanceof CtClassType) ((CtClassType)ic).makeMemberList(table); CtClass s = getSuperclass(); if (s != null && s instanceof CtClassType) ((CtClassType)s).makeMemberList(table);
CtClass ic =ifs[i]; if (ic != null && ic instanceof CtClassType) ((CtClassType)ic).makeMemberList(table); CtClass s = getSuperclass(); if (s != null && s instanceof CtClassType) ((CtClassType)s).makeMemberList(table);
CtClass ic =ifs[i]; if (ic != null && ic instanceof CtClassType) ((CtClassType)ic).makeMemberList(table); CtClass s = getSuperclass(); if (s != null && s instanceof CtClassType) ((CtClassType)s).makeMemberList(table);
CtClass ic =ifs[i]; if (ic != null && ic instanceof CtClassType) ((CtClassType)ic).makeMemberList(table); CtClass s = getSuperclass(); if (s != null && s instanceof CtClassType) ((CtClassType)s).makeMemberList(table);