void (ClassWrapper wrapper) { StructClass cl = wrapper.getClassStruct(); boolean isAnonymous = DecompilerContext.getClassProcessor().getMapRootClasses().get(cl.qualifiedName).type == ClassNode.CLASS_ANONYMOUS; List<List<Exprent>> lstFirst = new ArrayList<>(); List<MethodWrapper> lstMethodWrappers = new ArrayList<>(); for (MethodWrapper method : wrapper.getMethods()) { if (CodeConstants.INIT_NAME.equals(method.methodStruct.getName()) && method.root != null) { // successfully decompiled constructor Statement firstData = Statements.findFirstData(method.root); if (firstData == null || firstData.getExprents().isEmpty()) { return; } lstFirst.add(firstData.getExprents()); lstMethodWrappers.add(method); Exprent exprent = firstData.getExprents().get(0); if (!isAnonymous) { // FIXME: doesn't make sense if (exprent.type != Exprent.EXPRENT_INVOCATION || !Statements.isInvocationInitConstructor((InvocationExprent)exprent, method, wrapper, false)) { return; } } } } if (lstFirst.isEmpty()) { return; } while (true) { String fieldWithDescr = null; Exprent value = null; for (int i = 0; i < lstFirst.size(); i++) { List<Exprent> lst = lstFirst.get(i); if (lst.size() < (isAnonymous ? 1 : 2)) { return; } Exprent exprent = lst.get(isAnonymous ? 0 : 1); boolean found = false; if (exprent.type == Exprent.EXPRENT_ASSIGNMENT) { AssignmentExprent assignExpr = (AssignmentExprent)exprent; if (assignExpr.getLeft().type == Exprent.EXPRENT_FIELD) { FieldExprent fExpr = (FieldExprent)assignExpr.getLeft(); if (!fExpr.isStatic() && fExpr.getClassname().equals(cl.qualifiedName) && cl.hasField(fExpr.getName(), fExpr.getDescriptor().descriptorString)) { // check for the physical existence of the field. Could be defined in a superclass. if (isExprentIndependent(assignExpr.getRight(), lstMethodWrappers.get(i))) { String fieldKey = InterpreterUtil.makeUniqueKey(fExpr.getName(), fExpr.getDescriptor().descriptorString); if (fieldWithDescr == null) { fieldWithDescr = fieldKey; value = assignExpr.getRight(); } else { if (!fieldWithDescr.equals(fieldKey) || !value.equals(assignExpr.getRight())) { return; } } found = true; } } } } if (!found) { return; } } if (!wrapper.getDynamicFieldInitializers().containsKey(fieldWithDescr)) { wrapper.getDynamicFieldInitializers().addWithKey(value, fieldWithDescr); for (List<Exprent> lst : lstFirst) { lst.remove(isAnonymous ? 0 : 1); } } else { return; } } }