#vulnerable code 
                                @Override
    public void transformPost(JObfImpl inst, HashMap<String, ClassNode> nodes) {
        if (!enabled.getObject()) return;
        HashMap<String, String> mappings = new HashMap<>();

        mappings.clear();

        List<ClassWrapper> classWrappers = new ArrayList<>();


        System.out.println("Building Hierarchy");

        for (ClassNode value : nodes.values()) {
            ClassWrapper cw = new ClassWrapper(value, false, new byte[0]);

            classWrappers.add(cw);

            JObfImpl.INSTANCE.buildHierarchy(cw, null);
        }
        System.out.println("Finished building hierarchy");

        long current = System.currentTimeMillis();
        JObf.log.info("Generating mappings...");

        NameUtils.setup("", "", "", true);

        AtomicInteger classCounter = new AtomicInteger();

        classWrappers.forEach(classWrapper -> {
            boolean excluded = this.excluded(classWrapper);

            for (MethodWrapper method : classWrapper.methods) {
                method.methodNode.access &= ~Opcodes.ACC_PRIVATE;
                method.methodNode.access &= ~Opcodes.ACC_PROTECTED;
                method.methodNode.access |= Opcodes.ACC_PUBLIC;
            }
            for (FieldWrapper fieldWrapper : classWrapper.fields) {
                fieldWrapper.fieldNode.access &= ~Opcodes.ACC_PRIVATE;
                fieldWrapper.fieldNode.access &= ~Opcodes.ACC_PROTECTED;
                fieldWrapper.fieldNode.access |= Opcodes.ACC_PUBLIC;
            }
            if (excluded) return;

            classWrapper.methods.stream().filter(methodWrapper -> !Modifier.isNative(methodWrapper.methodNode.access)
                    && !methodWrapper.methodNode.name.equals("main") && !methodWrapper.methodNode.name.equals("premain")
                    && !methodWrapper.methodNode.name.startsWith("<")).forEach(methodWrapper -> {
//                        if (!excluded) {

//                        }
                if (canRenameMethodTree(mappings, new HashSet<>(), methodWrapper, classWrapper.originalName)) {
                    this.renameMethodTree(mappings, new HashSet<>(), methodWrapper, classWrapper.originalName, NameUtils.generateMethodName(classWrapper.originalName, methodWrapper.originalDescription));
                }
            });

            classWrapper.fields.forEach(fieldWrapper -> {
//                if (!excluded) {
//                }
                if (canRenameFieldTree(mappings, new HashSet<>(), fieldWrapper, classWrapper.originalName)) {
                    this.renameFieldTree(new HashSet<>(), fieldWrapper, classWrapper.originalName, NameUtils.generateFieldName(classWrapper.originalName), mappings);
                }
            });
            classWrapper.classNode.access &= ~Opcodes.ACC_PRIVATE;
            classWrapper.classNode.access &= ~Opcodes.ACC_PROTECTED;
            classWrapper.classNode.access |= Opcodes.ACC_PUBLIC;

            putMapping(mappings, classWrapper.originalName, (repackage)
                    ? repackageName + '/' + NameUtils.generateClassName() : NameUtils.generateClassName());
            classCounter.incrementAndGet();
        });

        try {
            FileOutputStream outStream = new FileOutputStream("mappings.txt");
            PrintStream printStream = new PrintStream(outStream);

            for (Map.Entry<String, String> stringStringEntry : mappings.entrySet()) {
                printStream.println(stringStringEntry.getKey() + " -> " + stringStringEntry.getValue());
            }

            outStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        }


        JObf.log.info(String.format("Finished generating mappings (%dms)", (System.currentTimeMillis() - current)));
        JObf.log.info("Applying mappings...");

        current = System.currentTimeMillis();

        Remapper simpleRemapper = new MemberRemapper(mappings);

        for (ClassWrapper classWrapper : classWrappers) {
            ClassNode classNode = classWrapper.classNode;

            ClassNode copy = new ClassNode();
            classNode.accept(new ClassRemapper(copy, simpleRemapper));
            for (int i = 0; i < copy.methods.size(); i++) {
                classWrapper.methods.get(i).methodNode = copy.methods.get(i);

                /*for (AbstractInsnNode insn : methodNode.instructions.toArray()) { // TODO: Fix lambdas + interface
                    if (insn instanceof InvokeDynamicInsnNode) {
                        InvokeDynamicInsnNode indy = (InvokeDynamicInsnNode) insn;
                        if (indy.bsm.getOwner().equals("java/lang/invoke/LambdaMetafactory")) {
                            Handle handle = (Handle) indy.bsmArgs[1];
                            String newName = mappings.get(handle.getOwner() + '.' + handle.getName() + handle.getDesc());
                            if (newName != null) {
                                indy.name = newName;
                                indy.bsm = new Handle(handle.getTag(), handle.getOwner(), newName, handle.getDesc(), false);
                            }
                        }
                    }
                }*/
            }

            if (copy.fields != null) {
                for (int i = 0; i < copy.fields.size(); i++) {
                    classWrapper.fields.get(i).fieldNode = copy.fields.get(i);
                }
            }

            classWrapper.classNode = copy;
            JObfImpl.classes.remove(classWrapper.originalName + ".class");
            JObfImpl.classes.put(classWrapper.classNode.name + ".class", classWrapper.classNode);
//            JObfImpl.INSTANCE.getClassPath().put();
//            this.getClasses().put(classWrapper.classNode.name, classWrapper);
            JObfImpl.INSTANCE.getClassPath().put(classWrapper.classNode.name, classWrapper);
        }
        JObf.log.info(String.format("Finished applying mappings (%dms)", (System.currentTimeMillis() - current)));
    } 
                            #location 79 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Override
    public void transformPost(JObfImpl inst, HashMap<String, ClassNode> nodes) {
        if (!enabled.getObject()) return;
        HashMap<String, String> mappings = new HashMap<>();

        mappings.clear();

        List<ClassWrapper> classWrappers = new ArrayList<>();


        JObf.log.info("Building Hierarchy...");

        for (ClassNode value : nodes.values()) {
            ClassWrapper cw = new ClassWrapper(value, false, new byte[0]);

            classWrappers.add(cw);

            JObfImpl.INSTANCE.buildHierarchy(cw, null);
        }
        JObf.log.info("Finished building hierarchy");

        long current = System.currentTimeMillis();
        JObf.log.info("Generating mappings...");

        NameUtils.setup("", "", "", true);

        AtomicInteger classCounter = new AtomicInteger();

        classWrappers.forEach(classWrapper -> {
            boolean excluded = this.excluded(classWrapper);

            for (MethodWrapper method : classWrapper.methods) {
                method.methodNode.access &= ~Opcodes.ACC_PRIVATE;
                method.methodNode.access &= ~Opcodes.ACC_PROTECTED;
                method.methodNode.access |= Opcodes.ACC_PUBLIC;
            }
            for (FieldWrapper fieldWrapper : classWrapper.fields) {
                fieldWrapper.fieldNode.access &= ~Opcodes.ACC_PRIVATE;
                fieldWrapper.fieldNode.access &= ~Opcodes.ACC_PROTECTED;
                fieldWrapper.fieldNode.access |= Opcodes.ACC_PUBLIC;
            }
            if (excluded) return;

            classWrapper.methods.stream().filter(methodWrapper -> !Modifier.isNative(methodWrapper.methodNode.access)
                    && !methodWrapper.methodNode.name.equals("main") && !methodWrapper.methodNode.name.equals("premain")
                    && !methodWrapper.methodNode.name.startsWith("<")).forEach(methodWrapper -> {
//                        if (!excluded) {

//                        }
                if (canRenameMethodTree(mappings, new HashSet<>(), methodWrapper, classWrapper.originalName)) {
                    this.renameMethodTree(mappings, new HashSet<>(), methodWrapper, classWrapper.originalName, NameUtils.generateMethodName(classWrapper.originalName, methodWrapper.originalDescription));
                }
            });

            classWrapper.fields.forEach(fieldWrapper -> {
//                if (!excluded) {
//                }
                if (canRenameFieldTree(mappings, new HashSet<>(), fieldWrapper, classWrapper.originalName)) {
                    this.renameFieldTree(new HashSet<>(), fieldWrapper, classWrapper.originalName, NameUtils.generateFieldName(classWrapper.originalName), mappings);
                }
            });
            classWrapper.classNode.access &= ~Opcodes.ACC_PRIVATE;
            classWrapper.classNode.access &= ~Opcodes.ACC_PROTECTED;
            classWrapper.classNode.access |= Opcodes.ACC_PUBLIC;

            putMapping(mappings, classWrapper.originalName, (repackage)
                    ? repackageName + '/' + NameUtils.generateClassName() : NameUtils.generateClassName());
            classCounter.incrementAndGet();
        });

//        try {
//            FileOutputStream outStream = new FileOutputStream("mappings.txt");
//            PrintStream printStream = new PrintStream(outStream);
//
//            for (Map.Entry<String, String> stringStringEntry : mappings.entrySet()) {
//                printStream.println(stringStringEntry.getKey() + " -> " + stringStringEntry.getValue());
//            }
//
//            outStream.close();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }


        JObf.log.info(String.format("Finished generating mappings (%dms)", (System.currentTimeMillis() - current)));
        JObf.log.info("Applying mappings...");

        current = System.currentTimeMillis();

        Remapper simpleRemapper = new MemberRemapper(mappings);

        for (ClassWrapper classWrapper : classWrappers) {
            ClassNode classNode = classWrapper.classNode;

            ClassNode copy = new ClassNode();
            classNode.accept(new ClassRemapper(copy, simpleRemapper));
            for (int i = 0; i < copy.methods.size(); i++) {
                classWrapper.methods.get(i).methodNode = copy.methods.get(i);

                /*for (AbstractInsnNode insn : methodNode.instructions.toArray()) { // TODO: Fix lambdas + interface
                    if (insn instanceof InvokeDynamicInsnNode) {
                        InvokeDynamicInsnNode indy = (InvokeDynamicInsnNode) insn;
                        if (indy.bsm.getOwner().equals("java/lang/invoke/LambdaMetafactory")) {
                            Handle handle = (Handle) indy.bsmArgs[1];
                            String newName = mappings.get(handle.getOwner() + '.' + handle.getName() + handle.getDesc());
                            if (newName != null) {
                                indy.name = newName;
                                indy.bsm = new Handle(handle.getTag(), handle.getOwner(), newName, handle.getDesc(), false);
                            }
                        }
                    }
                }*/
            }

            if (copy.fields != null) {
                for (int i = 0; i < copy.fields.size(); i++) {
                    classWrapper.fields.get(i).fieldNode = copy.fields.get(i);
                }
            }

            classWrapper.classNode = copy;
            JObfImpl.classes.remove(classWrapper.originalName + ".class");
            JObfImpl.classes.put(classWrapper.classNode.name + ".class", classWrapper.classNode);
//            JObfImpl.INSTANCE.getClassPath().put();
//            this.getClasses().put(classWrapper.classNode.name, classWrapper);
            JObfImpl.INSTANCE.getClassPath().put(classWrapper.classNode.name, classWrapper);
        }
        JObf.log.info(String.format("Finished applying mappings (%dms)", (System.currentTimeMillis() - current)));
    }