Program: 166450
Project: 166450
Buggy source:
private static byte[] injectFSPermissionCheckerHooks(ClassLoader aClassLoader,String aClassName,Class<?> aClassBeingRedefined,ProtectionDomain aProtectionDomain,byte[] aClassFileBuffer) throws IllegalClassFormatException {
  byte[] ret=null;
  System.out.println("String_Node_Str" + Runtime.getRuntime() + "String_Node_Str"+ aClassName+ "String_Node_Str");
  try {
    CtClass curClass=getCtClass(aClassName.replaceAll("String_Node_Str","String_Node_Str"));
    CtClass stringClass=getCtClass("String_Node_Str");
    CtClass throwable=getCtClass("String_Node_Str");
    CtClass fsActionClass=getCtClass("String_Node_Str");
    CtClass fsDirClass=getCtClass("String_Node_Str");
    CtClass inodeClass=getCtClass("String_Node_Str");
    CtClass inodesInPathClass=getCtClass("String_Node_Str");
    CtClass accCtrlExcp=getCtClass("String_Node_Str");
    boolean is3ParamsCheckMethod=false;
    CtMethod checkMethod=null;
    CtMethod checkPermissionMethod=null;
    if (checkMethod == null && curClass != null && inodeClass != null && fsActionClass != null) {
      try {
        System.out.print("String_Node_Str");
        CtClass[] paramArgs=new CtClass[]{inodeClass,CtClass.intType,fsActionClass};
        checkMethod=curClass.getDeclaredMethod("String_Node_Str",paramArgs);
        is3ParamsCheckMethod=true;
        System.out.println("String_Node_Str");
      }
 catch (      NotFoundException nfe) {
        System.out.println("String_Node_Str");
      }
    }
    if (checkMethod == null && curClass != null && inodeClass != null && fsActionClass != null) {
      try {
        System.out.print("String_Node_Str");
        CtClass[] paramArgs=new CtClass[]{inodeClass,fsActionClass};
        checkMethod=curClass.getDeclaredMethod("String_Node_Str",paramArgs);
        is3ParamsCheckMethod=false;
        System.out.println("String_Node_Str");
      }
 catch (      NotFoundException nfe) {
        System.out.println("String_Node_Str");
      }
    }
    if (checkPermissionMethod == null && curClass != null && inodesInPathClass != null && fsActionClass != null) {
      try {
        System.out.print("String_Node_Str");
        CtClass[] paramArgs=new CtClass[]{inodesInPathClass,CtClass.booleanType,fsActionClass,fsActionClass,fsActionClass,fsActionClass,CtClass.booleanType};
        checkPermissionMethod=curClass.getDeclaredMethod("String_Node_Str",paramArgs);
        System.out.println("String_Node_Str");
      }
 catch (      NotFoundException nfe) {
        System.out.println("String_Node_Str");
      }
    }
    if (checkPermissionMethod == null && curClass != null && stringClass != null && fsDirClass != null && fsActionClass != null) {
      try {
        System.out.print("String_Node_Str");
        CtClass[] paramArgs=new CtClass[]{stringClass,fsDirClass,CtClass.booleanType,fsActionClass,fsActionClass,fsActionClass,fsActionClass,CtClass.booleanType,CtClass.booleanType};
        checkPermissionMethod=curClass.getDeclaredMethod("String_Node_Str",paramArgs);
        System.out.println("String_Node_Str");
      }
 catch (      NotFoundException nfe) {
        System.out.println("String_Node_Str");
      }
    }
    if (checkMethod != null) {
      System.out.print("String_Node_Str");
      checkMethod.insertAfter("String_Node_Str");
      checkMethod.addCatch("String_Node_Str",throwable);
      if (is3ParamsCheckMethod) {
        checkMethod.insertBefore("String_Node_Str");
      }
 else {
        checkMethod.insertBefore("String_Node_Str");
      }
      System.out.println("String_Node_Str");
      if (checkPermissionMethod != null) {
        System.out.print("String_Node_Str");
        checkPermissionMethod.insertAfter("String_Node_Str");
        checkPermissionMethod.addCatch("String_Node_Str",accCtrlExcp);
        checkPermissionMethod.insertBefore("String_Node_Str");
        System.out.println("String_Node_Str");
      }
      ret=curClass.toBytecode();
    }
 else {
      System.out.println("String_Node_Str" + aClassName + "String_Node_Str");
      for (      CtMethod m : curClass.getDeclaredMethods()) {
        System.err.println("String_Node_Str" + m);
      }
      System.out.println("String_Node_Str");
    }
  }
 catch (  CannotCompileException e) {
    System.err.println("String_Node_Str" + aClassName + "String_Node_Str"+ e);
    e.printStackTrace();
  }
catch (  IOException e) {
    System.err.println("String_Node_Str" + aClassName + "String_Node_Str"+ e);
    e.printStackTrace();
  }
  return ret;
}

Fixed version (ground truth):
private static byte[] injectFSPermissionCheckerHooks(ClassLoader aClassLoader,String aClassName,Class<?> aClassBeingRedefined,ProtectionDomain aProtectionDomain,byte[] aClassFileBuffer) throws IllegalClassFormatException {
  byte[] ret=null;
  System.out.println("String_Node_Str" + Runtime.getRuntime() + "String_Node_Str"+ aClassName+ "String_Node_Str");
  try {
    CtClass curClass=getCtClass(aClassName.replaceAll("String_Node_Str","String_Node_Str"));
    CtClass stringClass=getCtClass("String_Node_Str");
    CtClass throwable=getCtClass("String_Node_Str");
    CtClass fsActionClass=getCtClass("String_Node_Str");
    CtClass fsDirClass=getCtClass("String_Node_Str");
    CtClass inodeClass=getCtClass("String_Node_Str");
    CtClass inodesInPathClass=getCtClass("String_Node_Str");
    CtClass accCtrlExcp=getCtClass("String_Node_Str");
    boolean is3ParamsCheckMethod=false;
    CtMethod checkMethod=null;
    CtMethod checkPermissionMethod=null;
    if (checkMethod == null && curClass != null && inodeClass != null && fsActionClass != null) {
      try {
        System.out.print("String_Node_Str");
        CtClass[] paramArgs=new CtClass[]{inodeClass,CtClass.intType,fsActionClass};
        checkMethod=curClass.getDeclaredMethod("String_Node_Str",paramArgs);
        is3ParamsCheckMethod=true;
        System.out.println("String_Node_Str");
      }
 catch (      NotFoundException nfe) {
        System.out.println("String_Node_Str");
      }
    }
    if (checkMethod == null && curClass != null && inodeClass != null && fsActionClass != null) {
      try {
        System.out.print("String_Node_Str");
        CtClass[] paramArgs=new CtClass[]{inodeClass,fsActionClass};
        checkMethod=curClass.getDeclaredMethod("String_Node_Str",paramArgs);
        is3ParamsCheckMethod=false;
        System.out.println("String_Node_Str");
      }
 catch (      NotFoundException nfe) {
        System.out.println("String_Node_Str");
      }
    }
    if (checkPermissionMethod == null && curClass != null && inodesInPathClass != null && fsActionClass != null) {
      try {
        System.out.print("String_Node_Str");
        CtClass[] paramArgs=new CtClass[]{inodesInPathClass,CtClass.booleanType,fsActionClass,fsActionClass,fsActionClass,fsActionClass,CtClass.booleanType};
        checkPermissionMethod=curClass.getDeclaredMethod("String_Node_Str",paramArgs);
        System.out.println("String_Node_Str");
      }
 catch (      NotFoundException nfe) {
        System.out.println("String_Node_Str");
      }
    }
    if (checkPermissionMethod == null && curClass != null && stringClass != null && fsDirClass != null && fsActionClass != null) {
      try {
        System.out.print("String_Node_Str");
        CtClass[] paramArgs=new CtClass[]{stringClass,fsDirClass,CtClass.booleanType,fsActionClass,fsActionClass,fsActionClass,fsActionClass,CtClass.booleanType,CtClass.booleanType};
        checkPermissionMethod=curClass.getDeclaredMethod("String_Node_Str",paramArgs);
        System.out.println("String_Node_Str");
      }
 catch (      NotFoundException nfe) {
        System.out.println("String_Node_Str");
      }
    }
    if (curClass != null) {
      if (checkMethod != null) {
        System.out.print("String_Node_Str");
        checkMethod.insertAfter("String_Node_Str");
        checkMethod.addCatch("String_Node_Str",throwable);
        if (is3ParamsCheckMethod) {
          checkMethod.insertBefore("String_Node_Str");
        }
 else {
          checkMethod.insertBefore("String_Node_Str");
        }
        System.out.println("String_Node_Str");
        if (checkPermissionMethod != null) {
          System.out.print("String_Node_Str");
          checkPermissionMethod.insertAfter("String_Node_Str");
          checkPermissionMethod.addCatch("String_Node_Str",accCtrlExcp);
          checkPermissionMethod.insertBefore("String_Node_Str");
          System.out.println("String_Node_Str");
        }
        ret=curClass.toBytecode();
      }
 else {
        System.out.println("String_Node_Str" + aClassName + "String_Node_Str");
        for (        CtMethod m : curClass.getDeclaredMethods()) {
          System.err.println("String_Node_Str" + m);
        }
        System.out.println("String_Node_Str");
      }
    }
  }
 catch (  CannotCompileException e) {
    System.err.println("String_Node_Str" + aClassName + "String_Node_Str"+ e);
    e.printStackTrace();
  }
catch (  IOException e) {
    System.err.println("String_Node_Str" + aClassName + "String_Node_Str"+ e);
    e.printStackTrace();
  }
  return ret;
}