Program: 124654
Project: 124654
Buggy source:
private static void setMaprTicketConfig(HadoopClusterConnection hcConnection,ClassLoader classLoader,boolean useKerberos) throws Exception {
  String mapRTicketUsername=hcConnection.getUserName();
  String mapRTicketPassword=hcConnection.getMaprTPassword();
  String mapRTicketCluster=hcConnection.getMaprTCluster();
  String mapRTicketDuration=hcConnection.getMaprTDuration();
  boolean setMapRHadoopLogin=hcConnection.isSetHadoopLogin();
  String mapRHadoopLogin=hcConnection.getMaprTHadoopLogin();
  Long desiredTicketDurInSecs=86400L;
  if (mapRTicketDuration != null && StringUtils.isNotBlank(mapRTicketDuration)) {
    if (mapRTicketDuration.endsWith("String_Node_Str")) {
      mapRTicketDuration=mapRTicketDuration.substring(0,mapRTicketDuration.length() - 1);
      desiredTicketDurInSecs=Long.valueOf(mapRTicketDuration) + 'L';
    }
 else     if (StringUtils.isNumeric(mapRTicketDuration)) {
      desiredTicketDurInSecs=Long.valueOf(mapRTicketDuration) + 'L';
    }
  }
  Object mapRClientConfig=ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{});
  if (useKerberos) {
    Object conf=Class.forName("String_Node_Str",true,classLoader).newInstance();
    String nameNodePrincipal=hcConnection.getPrincipal();
    ReflectionUtils.invokeMethod(conf,"String_Node_Str",new Object[]{"String_Node_Str",nameNodePrincipal});
    ReflectionUtils.invokeMethod(mapRClientConfig,"String_Node_Str",new Object[]{mapRTicketCluster,desiredTicketDurInSecs});
  }
 else {
    if (setMapRHadoopLogin) {
      System.setProperty("String_Node_Str",mapRHadoopLogin);
    }
 else {
      ReflectionUtils.invokeMethod(mapRClientConfig,"String_Node_Str",new Object[]{false},boolean.class);
    }
    String version=hcConnection.getVersion();
    Object[] argsObj=new Object[]{mapRTicketCluster,mapRTicketUsername,mapRTicketPassword,desiredTicketDurInSecs};
    if (version != null && "String_Node_Str".compareTo(version) <= 0) {
      argsObj=new Object[]{mapRTicketCluster,mapRTicketUsername,mapRTicketPassword,desiredTicketDurInSecs,"String_Node_Str"};
    }
    ReflectionUtils.invokeMethod(mapRClientConfig,"String_Node_Str",argsObj);
  }
}

Fixed version (ground truth):
private static void setMaprTicketConfig(HadoopClusterConnection hcConnection,ClassLoader classLoader,boolean useKerberos) throws Exception {
  String mapRTicketUsername=hcConnection.getUserName();
  String mapRTicketPassword=hcConnection.getMaprTPassword();
  String mapRTicketCluster=hcConnection.getMaprTCluster();
  String mapRTicketDuration=hcConnection.getMaprTDuration();
  boolean setMapRHadoopLogin=hcConnection.isSetHadoopLogin();
  String mapRHadoopLogin=hcConnection.getMaprTHadoopLogin();
  Long desiredTicketDurInSecs=86400L;
  if (mapRTicketDuration != null && StringUtils.isNotBlank(mapRTicketDuration)) {
    if (mapRTicketDuration.endsWith("String_Node_Str")) {
      mapRTicketDuration=mapRTicketDuration.substring(0,mapRTicketDuration.length() - 1);
      desiredTicketDurInSecs=Long.valueOf(mapRTicketDuration) + 'L';
    }
 else     if (StringUtils.isNumeric(mapRTicketDuration)) {
      desiredTicketDurInSecs=Long.valueOf(mapRTicketDuration) + 'L';
    }
  }
  Object mapRClientConfig=ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{});
  if (useKerberos) {
    Object conf=Class.forName("String_Node_Str",true,classLoader).newInstance();
    String nameNodePrincipal=hcConnection.getPrincipal();
    System.setProperty("String_Node_Str",setMapRHadoopLogin ? mapRHadoopLogin : "String_Node_Str");
    ReflectionUtils.invokeMethod(conf,"String_Node_Str",new Object[]{"String_Node_Str",nameNodePrincipal});
    ReflectionUtils.invokeMethod(mapRClientConfig,"String_Node_Str",new Object[]{mapRTicketCluster,desiredTicketDurInSecs});
  }
 else {
    if (setMapRHadoopLogin) {
      System.setProperty("String_Node_Str",mapRHadoopLogin);
    }
 else {
      ReflectionUtils.invokeMethod(mapRClientConfig,"String_Node_Str",new Object[]{false},boolean.class);
    }
    String version=hcConnection.getVersion();
    Object[] argsObj=new Object[]{mapRTicketCluster,mapRTicketUsername,mapRTicketPassword,desiredTicketDurInSecs};
    if (version != null && "String_Node_Str".compareTo(version) <= 0) {
      argsObj=new Object[]{mapRTicketCluster,mapRTicketUsername,mapRTicketPassword,desiredTicketDurInSecs,"String_Node_Str"};
    }
    ReflectionUtils.invokeMethod(mapRClientConfig,"String_Node_Str",argsObj);
  }
}