|
|
@ -44,17 +44,45 @@ public class ClassBundle { |
|
|
|
basePackage.setPreserved(); |
|
|
|
basePackage.setPreserved(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///#ifdef JDK12
|
|
|
|
|
|
|
|
/// private static final Map aliasesHash = new WeakHashMap();
|
|
|
|
|
|
|
|
///#else
|
|
|
|
|
|
|
|
private static final Hashtable aliasesHash = new Hashtable(); |
|
|
|
|
|
|
|
///#endif
|
|
|
|
|
|
|
|
public Reference getReferenceAlias(Reference ref) { |
|
|
|
|
|
|
|
Reference alias = (Reference) aliasesHash.get(ref); |
|
|
|
|
|
|
|
if (alias == null) { |
|
|
|
|
|
|
|
Identifier ident = getIdentifier(ref); |
|
|
|
|
|
|
|
String newType = getTypeAlias(ref.getType()); |
|
|
|
|
|
|
|
if (ident == null) |
|
|
|
|
|
|
|
alias = Reference.getReference |
|
|
|
|
|
|
|
(ref.getClazz(), ref.getName(), newType); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
alias = Reference.getReference |
|
|
|
|
|
|
|
("L"+ident.getParent().getFullAlias().replace('.','/')+';', |
|
|
|
|
|
|
|
ident.getAlias(), newType); |
|
|
|
|
|
|
|
aliasesHash.put(ref, alias); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return alias; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getTypeAlias(String typeSig) { |
|
|
|
public String getTypeAlias(String typeSig) { |
|
|
|
StringBuffer newSig = new StringBuffer(); |
|
|
|
String alias = (String) aliasesHash.get(typeSig); |
|
|
|
int index = 0, nextindex; |
|
|
|
if (alias == null) { |
|
|
|
while ((nextindex = typeSig.indexOf('L', index)) != -1) { |
|
|
|
StringBuffer newSig = new StringBuffer(); |
|
|
|
newSig.append(typeSig.substring(index, nextindex+1)); |
|
|
|
int index = 0, nextindex; |
|
|
|
index = typeSig.indexOf(';', nextindex); |
|
|
|
while ((nextindex = typeSig.indexOf('L', index)) != -1) { |
|
|
|
String alias = basePackage.findAlias |
|
|
|
newSig.append(typeSig.substring(index, nextindex+1)); |
|
|
|
(typeSig.substring(nextindex+1, index).replace('/','.')); |
|
|
|
index = typeSig.indexOf(';', nextindex); |
|
|
|
newSig.append(alias.replace('.', '/')); |
|
|
|
String typeAlias = basePackage.findAlias |
|
|
|
|
|
|
|
(typeSig.substring(nextindex+1, index).replace('/','.')); |
|
|
|
|
|
|
|
newSig.append(typeAlias.replace('.', '/')); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
alias = newSig.append(typeSig.substring(index)) |
|
|
|
|
|
|
|
.toString().intern(); |
|
|
|
|
|
|
|
aliasesHash.put(typeSig, alias); |
|
|
|
} |
|
|
|
} |
|
|
|
return newSig.append(typeSig.substring(index)).toString(); |
|
|
|
return alias; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ClassIdentifier getClassIdentifier(String name) { |
|
|
|
public ClassIdentifier getClassIdentifier(String name) { |
|
|
|