package org.brandonhaynes.pipegen.utilities;

import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.Modifier;
import javassist.NotFoundException;
import org.brandonhaynes.pipegen.mutation.ClassModifierReplacer;

import java.io.IOException;

public class JvmUtilities {
    public static void main(String[] args) throws IOException {
        if(args.length != 2)
            System.out.println("Usage: JvmUtilities RemoveFinalFlagFromString class-name");
        else
            for(String className: args[1].split(","))
                removeFinalFlag(className);
    }

    public static void removeFinalFlag(String className) throws IOException {
        try {
            ClassModifierReplacer.setModifiers(new ClassPool(true), className, Modifier.PUBLIC);
        } catch(NotFoundException | CannotCompileException e) {
            throw new IOException(e);
        }
    }
}

@@ -545,16 +545,65 @@
 it(%22,%22))
+ %7B%0A                System.out.println(className);
 %0A       
@@ -635,24 +635,38 @@
 className);%0A
+            %7D%0A
     %7D%0A%0A    p

Print modified classes