|
|
@ -15,7 +15,6 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package org.jetbrains.java.decompiler.main.collectors; |
|
|
|
package org.jetbrains.java.decompiler.main.collectors; |
|
|
|
|
|
|
|
|
|
|
|
import org.jetbrains.java.decompiler.main.ClassesProcessor; |
|
|
|
|
|
|
|
import org.jetbrains.java.decompiler.main.ClassesProcessor.ClassNode; |
|
|
|
import org.jetbrains.java.decompiler.main.ClassesProcessor.ClassNode; |
|
|
|
import org.jetbrains.java.decompiler.main.DecompilerContext; |
|
|
|
import org.jetbrains.java.decompiler.main.DecompilerContext; |
|
|
|
import org.jetbrains.java.decompiler.main.TextBuffer; |
|
|
|
import org.jetbrains.java.decompiler.main.TextBuffer; |
|
|
@ -49,20 +48,16 @@ public class ImportCollector { |
|
|
|
currentPackagePoint = ""; |
|
|
|
currentPackagePoint = ""; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Map<String, ClassNode> mapRootCases = DecompilerContext.getClassProcessor().getMapRootClasses(); |
|
|
|
Map<String, StructClass> classes = DecompilerContext.getStructContext().getClasses(); |
|
|
|
for(StructClass sClass = root.classStruct; |
|
|
|
StructClass currentClass = root.classStruct; |
|
|
|
sClass!=null; |
|
|
|
while (currentClass != null) { |
|
|
|
){ |
|
|
|
// all field names for the current class ..
|
|
|
|
// all field names for current class ..
|
|
|
|
for (StructField f : currentClass.getFields()) { |
|
|
|
for(StructField f: sClass.getFields()) { |
|
|
|
|
|
|
|
setFieldNames.add(f.getName()); |
|
|
|
setFieldNames.add(f.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// .. and traverse through parent.
|
|
|
|
// .. and traverse through parent.
|
|
|
|
ClassNode classNode; |
|
|
|
currentClass = currentClass.superClass != null ? classes.get(currentClass.superClass.getString()) : null; |
|
|
|
if(sClass.superClass==null || (classNode = (mapRootCases.get(sClass.superClass.getString())))==null) |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
sClass = classNode.classStruct; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -76,7 +71,8 @@ public class ImportCollector { |
|
|
|
String shortName = getShortName(classToName); |
|
|
|
String shortName = getShortName(classToName); |
|
|
|
if (setFieldNames.contains(shortName)) { |
|
|
|
if (setFieldNames.contains(shortName)) { |
|
|
|
return classToName; |
|
|
|
return classToName; |
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
return shortName; |
|
|
|
return shortName; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|