diff --git a/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java b/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java index 5ae532a..acc2849 100644 --- a/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java +++ b/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java @@ -27,7 +27,6 @@ import org.jetbrains.java.decompiler.modules.decompiler.stats.RootStatement; import org.jetbrains.java.decompiler.modules.decompiler.vars.VarProcessor; import org.jetbrains.java.decompiler.modules.decompiler.vars.VarVersionPair; import org.jetbrains.java.decompiler.struct.StructClass; -import org.jetbrains.java.decompiler.struct.StructField; import org.jetbrains.java.decompiler.struct.StructMethod; import org.jetbrains.java.decompiler.struct.attr.StructLocalVariableTableAttribute; import org.jetbrains.java.decompiler.struct.gen.MethodDescriptor; @@ -56,12 +55,6 @@ public class ClassWrapper { DecompilerContext.setProperty(DecompilerContext.CURRENT_CLASS_WRAPPER, this); DecompilerContext.getLogger().startClass(classStruct.qualifiedName); - // collect field names - Set setFieldNames = new HashSet<>(); - for (StructField fd : classStruct.getFields()) { - setFieldNames.add(fd.getName()); - } - int maxSec = Integer.parseInt(DecompilerContext.getProperty(IFernflowerPreferences.MAX_PROCESSING_METHOD).toString()); boolean testMode = DecompilerContext.getOption(IFernflowerPreferences.UNIT_TEST_MODE); @@ -160,7 +153,9 @@ public class ClassWrapper { if (!isError) { // rename vars so that no one has the same name as a field - varProc.refreshVarNames(new VarNamesCollector(setFieldNames)); + VarNamesCollector namesCollector = new VarNamesCollector(); + classStruct.getFields().forEach(f -> namesCollector.addName(f.getName())); + varProc.refreshVarNames(namesCollector); // if debug information present and should be used if (DecompilerContext.getOption(IFernflowerPreferences.USE_DEBUG_VAR_NAMES)) {