private static Map<String, List<VarFieldPair>> getMaskLocalVars(ClassWrapper wrapper) { Map<String, List<VarFieldPair>> mapMasks = new HashMap<>(); StructClass cl = wrapper.getClassStruct(); // iterate over constructors for (StructMethod mt : cl.getMethods()) { if (CodeConstants.INIT_NAME.equals(mt.getName())) { MethodDescriptor md = MethodDescriptor.parseDescriptor(mt.getDescriptor()); MethodWrapper method = wrapper.getMethodWrapper(CodeConstants.INIT_NAME, mt.getDescriptor()); DirectGraph graph = method.getOrBuildGraph(); if (graph != null) { // something gone wrong, should not be null List<VarFieldPair> fields = new ArrayList<>(md.params.length); int varIndex = 1; for (int i = 0; i < md.params.length; i++) { // no static methods allowed String keyField = getEnclosingVarField(cl, method, graph, varIndex); fields.add(keyField == null ? null : new VarFieldPair(keyField, new VarVersionPair(-1, 0))); // TODO: null? varIndex += md.params[i].stackSize; } mapMasks.put(mt.getDescriptor(), fields); } } } return mapMasks; }
for (StructMethod mt : cl.getMethods()) { if (name.equals(mt.getName())) { MethodDescriptor md = MethodDescriptor.parseDescriptor(mt.getDescriptor());
private static boolean hideConstructor(ClassNode node, boolean init, boolean throwsExceptions, int paramCount, int methodAccessFlags) { if (!init || throwsExceptions || paramCount > 0 || !DecompilerContext.getOption(IFernflowerPreferences.HIDE_DEFAULT_CONSTRUCTOR)) { return false; } ClassWrapper wrapper = node.getWrapper(); StructClass cl = wrapper.getClassStruct(); int classAccesFlags = node.type == ClassNode.CLASS_ROOT ? cl.getAccessFlags() : node.access; boolean isEnum = cl.hasModifier(CodeConstants.ACC_ENUM) && DecompilerContext.getOption(IFernflowerPreferences.DECOMPILE_ENUM); // default constructor requires same accessibility flags. Exception: enum constructor which is always private if(!isEnum && ((classAccesFlags & ACCESSIBILITY_FLAGS) != (methodAccessFlags & ACCESSIBILITY_FLAGS))) { return false; } int count = 0; for (StructMethod mt : cl.getMethods()) { if (CodeConstants.INIT_NAME.equals(mt.getName())) { if (++count > 1) { return false; } } } return true; }
for (StructMethod mt : cl.getMethods()) { mt.expandData();
for (StructMethod md : cl.getMethods()) { setMethodNames.add(md.getName()); VBStyleCollection<StructMethod, String> methods = cl.getMethods(); for (int i = 0; i < methods.size(); i++) {
boolean testMode = DecompilerContext.getOption(IFernflowerPreferences.UNIT_TEST_MODE); for (StructMethod mt : classStruct.getMethods()) { DecompilerContext.getLogger().startMethod(mt.getName() + " " + mt.getDescriptor());
for (StructMethod mt : enclosingCl.getMethods()) { if (enclosingMethod != null && !enclosingMethod.equals(mt.getName())) { continue;
for (StructMethod mt : cl.getMethods()) { boolean hide = mt.isSynthetic() && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_SYNTHETIC) || mt.hasModifier(CodeConstants.ACC_BRIDGE) && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_BRIDGE) ||
private static boolean hideConstructor(ClassWrapper wrapper, boolean init, boolean throwsExceptions, int paramCount) { if (!init || throwsExceptions || paramCount > 0 || !DecompilerContext.getOption(IFernflowerPreferences.HIDE_DEFAULT_CONSTRUCTOR)) { return false; } int count = 0; for (StructMethod mt : wrapper.getClassStruct().getMethods()) { if (CodeConstants.INIT_NAME.equals(mt.getName())) { if (++count > 1) { return false; } } } return true; }
private static Map<String, List<VarFieldPair>> getMaskLocalVars(ClassWrapper wrapper) { Map<String, List<VarFieldPair>> mapMasks = new HashMap<>(); StructClass cl = wrapper.getClassStruct(); // iterate over constructors for (StructMethod mt : cl.getMethods()) { if (CodeConstants.INIT_NAME.equals(mt.getName())) { MethodDescriptor md = MethodDescriptor.parseDescriptor(mt.getDescriptor()); MethodWrapper method = wrapper.getMethodWrapper(CodeConstants.INIT_NAME, mt.getDescriptor()); DirectGraph graph = method.getOrBuildGraph(); if (graph != null) { // something gone wrong, should not be null List<VarFieldPair> fields = new ArrayList<>(md.params.length); int varIndex = 1; for (int i = 0; i < md.params.length; i++) { // no static methods allowed String keyField = getEnclosingVarField(cl, method, graph, varIndex); fields.add(keyField == null ? null : new VarFieldPair(keyField, new VarVersionPair(-1, 0))); // TODO: null? varIndex += md.params[i].stackSize; } mapMasks.put(mt.getDescriptor(), fields); } } } return mapMasks; }
for (StructMethod mt : cl.getMethods()) { if (name.equals(mt.getName())) { MethodDescriptor md = MethodDescriptor.parseDescriptor(mt.getDescriptor());
for (StructMethod mt : cl.getMethods()) { mt.expandData();
for (StructMethod md : cl.getMethods()) { setMethodNames.add(md.getName()); VBStyleCollection<StructMethod, String> methods = cl.getMethods(); for (int i = 0; i < methods.size(); i++) {
child.simpleName = "NamelessClass_" + (++nameless); child.namelessConstructorStub = !cl.hasModifier(CodeConstants.ACC_STATIC) && cl.getMethods().size() + cl.getFields().size() == 0; child.namelessConstructorStub = !cl.hasModifier(CodeConstants.ACC_STATIC) && cl.getMethods().size() + cl.getFields().size() == 0;
boolean testMode = DecompilerContext.getOption(IFernflowerPreferences.UNIT_TEST_MODE); for (StructMethod mt : classStruct.getMethods()) { DecompilerContext.getLogger().startMethod(mt.getName() + " " + mt.getDescriptor());
for (StructMethod mt : cl.getMethods()) { boolean hide = mt.isSynthetic() && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_SYNTHETIC) || mt.hasModifier(CodeConstants.ACC_BRIDGE) && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_BRIDGE) ||