Program: 124656
Project: 124656
Buggy source:
private void setMaprTicketConfig(IMetadataConnection metadataConn,ClassLoader classLoader,boolean useKerberos) throws Exception {
  String mapRTicketUsername=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRDB_AUTHENTICATION_USERNAME);
  String mapRTicketPassword=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRDB_AUTHENTICATION_MAPRTICKET_PASSWORD);
  String mapRTicketCluster=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRDB_AUTHENTICATION_MAPRTICKET_CLUSTER);
  String mapRTicketDuration=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRDB_AUTHENTICATION_MAPRTICKET_DURATION);
  boolean setMapRHadoopLogin=Boolean.valueOf((String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_SETMAPRHADOOPLOGIN));
  String mapRHadoopLogin=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_MAPRHADOOPLOGIN);
  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) {
    System.setProperty("String_Node_Str","String_Node_Str");
    ReflectionUtils.invokeMethod(mapRClientConfig,"String_Node_Str",new Object[]{ConnectionContextHelper.getParamValueOffContext(metadataConn,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=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRDB_VERSION);
    Object[] argsObj=new Object[]{ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketCluster),ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketUsername),ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketPassword),desiredTicketDurInSecs};
    if (version != null && "String_Node_Str".compareTo(version) <= 0) {
      argsObj=new Object[]{ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketCluster),ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketUsername),ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketPassword),desiredTicketDurInSecs,"String_Node_Str"};
    }
    ReflectionUtils.invokeMethod(mapRClientConfig,"String_Node_Str",argsObj);
  }
}

Fixed version (ground truth):
private void setMaprTicketConfig(IMetadataConnection metadataConn,ClassLoader classLoader,boolean useKerberos) throws Exception {
  String mapRTicketUsername=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRDB_AUTHENTICATION_USERNAME);
  String mapRTicketPassword=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRDB_AUTHENTICATION_MAPRTICKET_PASSWORD);
  String mapRTicketCluster=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRDB_AUTHENTICATION_MAPRTICKET_CLUSTER);
  String mapRTicketDuration=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRDB_AUTHENTICATION_MAPRTICKET_DURATION);
  boolean setMapRHadoopLogin=Boolean.valueOf((String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_SETMAPRHADOOPLOGIN));
  String mapRHadoopLogin=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_MAPRHADOOPLOGIN);
  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) {
    System.setProperty("String_Node_Str",setMapRHadoopLogin ? mapRHadoopLogin : "String_Node_Str");
    ReflectionUtils.invokeMethod(mapRClientConfig,"String_Node_Str",new Object[]{ConnectionContextHelper.getParamValueOffContext(metadataConn,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=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRDB_VERSION);
    Object[] argsObj=new Object[]{ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketCluster),ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketUsername),ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketPassword),desiredTicketDurInSecs};
    if (version != null && "String_Node_Str".compareTo(version) <= 0) {
      argsObj=new Object[]{ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketCluster),ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketUsername),ConnectionContextHelper.getParamValueOffContext(metadataConn,mapRTicketPassword),desiredTicketDurInSecs,"String_Node_Str"};
    }
    ReflectionUtils.invokeMethod(mapRClientConfig,"String_Node_Str",argsObj);
  }
}