Program: 124732
Project: 124732
Buggy source:
private static void addKerberos2Client(WebClient client,HCatalogConnection connection) throws Exception {
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  if (hcConnection != null && hcConnection.isEnableMaprT()) {
    setMaprTicketConfig(hcConnection,getClassLoader(hcConnection,connection),hcConnection.isEnableKerberos());
  }
  if (hcConnection != null && hcConnection.isEnableKerberos()) {
    KerberosAuthOutInterceptor kbInterceptor=new KerberosAuthOutInterceptor();
    AuthorizationPolicy policy=new AuthorizationPolicy();
    policy.setAuthorizationType(HttpAuthHeader.AUTH_TYPE_NEGOTIATE);
    kbInterceptor.setPolicy(policy);
    java.util.Map<String,String> properties=new HashMap<String,String>();
    String krbPrincipal=ConnectionContextHelper.getParamValueOffContext(connection,StringUtils.trimToEmpty(connection.getKrbPrincipal()));
    kbInterceptor.setServicePrincipalName(StringUtils.trimToEmpty(krbPrincipal));
    String krbRealm=ConnectionContextHelper.getParamValueOffContext(connection,StringUtils.trimToEmpty(connection.getKrbRealm()));
    kbInterceptor.setRealm(StringUtils.trimToEmpty(krbRealm));
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    if (hcConnection.isUseKeytab()) {
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str",ConnectionContextHelper.getParamValueOffContext(hcConnection,hcConnection.getKeytabPrincipal()));
      properties.put("String_Node_Str",ConnectionContextHelper.getParamValueOffContext(hcConnection,hcConnection.getKeytab()));
    }
    kbInterceptor.setLoginConfig(new KerberosPolicyConfig(properties));
    WebClient.getConfig(client).getOutInterceptors().add(kbInterceptor);
  }
}

Fixed version (ground truth):
private static void addKerberos2Client(WebClient client,HCatalogConnection connection) throws Exception {
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  if (hcConnection != null) {
    if (hcConnection.isEnableKerberos()) {
      KerberosAuthOutInterceptor kbInterceptor=new KerberosAuthOutInterceptor();
      AuthorizationPolicy policy=new AuthorizationPolicy();
      policy.setAuthorizationType(HttpAuthHeader.AUTH_TYPE_NEGOTIATE);
      kbInterceptor.setPolicy(policy);
      java.util.Map<String,String> properties=new HashMap<String,String>();
      String krbPrincipal=ConnectionContextHelper.getParamValueOffContext(connection,StringUtils.trimToEmpty(connection.getKrbPrincipal()));
      kbInterceptor.setServicePrincipalName(StringUtils.trimToEmpty(krbPrincipal));
      String krbRealm=ConnectionContextHelper.getParamValueOffContext(connection,StringUtils.trimToEmpty(connection.getKrbRealm()));
      kbInterceptor.setRealm(StringUtils.trimToEmpty(krbRealm));
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str","String_Node_Str");
      if (hcConnection.isUseKeytab()) {
        properties.put("String_Node_Str","String_Node_Str");
        properties.put("String_Node_Str",ConnectionContextHelper.getParamValueOffContext(hcConnection,hcConnection.getKeytabPrincipal()));
        properties.put("String_Node_Str",ConnectionContextHelper.getParamValueOffContext(hcConnection,hcConnection.getKeytab()));
      }
      kbInterceptor.setLoginConfig(new KerberosPolicyConfig(properties));
      WebClient.getConfig(client).getOutInterceptors().add(kbInterceptor);
      if (hcConnection.isEnableMaprT()) {
        setMaprTicketConfig(hcConnection,getClassLoader(hcConnection,connection),true);
      }
    }
 else     if (hcConnection.isEnableMaprT()) {
      setMaprTicketConfig(hcConnection,getClassLoader(hcConnection,connection),false);
    }
  }
}