Program: 41310
Project: 41310
Buggy source:
public KubernetesClient createClient() throws NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException, IOException, CertificateEncodingException {
  ConfigBuilder builder=new ConfigBuilder().withMasterUrl(serviceAddress).withRequestTimeout(readTimeout * 1000).withConnectionTimeout(connectTimeout * 1000);
  if (!StringUtils.isBlank(namespace)) {
    builder.withNamespace(namespace);
  }
  if (credentials instanceof TokenProducer) {
    final String token=((TokenProducer)credentials).getToken(serviceAddress,caCertData,skipTlsVerify);
    builder.withOauthToken(token);
  }
 else   if (credentials instanceof UsernamePasswordCredentials) {
    UsernamePasswordCredentials usernamePassword=(UsernamePasswordCredentials)credentials;
    builder.withUsername(usernamePassword.getUsername()).withPassword(Secret.toString(usernamePassword.getPassword()));
  }
 else   if (credentials instanceof StandardCertificateCredentials) {
    StandardCertificateCredentials certificateCredentials=(StandardCertificateCredentials)credentials;
    KeyStore keyStore=certificateCredentials.getKeyStore();
    String alias=keyStore.aliases().nextElement();
    X509Certificate certificate=(X509Certificate)keyStore.getCertificate(alias);
    Key key=keyStore.getKey(alias,Secret.toString(certificateCredentials.getPassword()).toCharArray());
    builder.withClientCertData(Base64.encodeBase64String(certificate.getEncoded())).withClientKeyData(pemEncodeKey(key)).withClientKeyPassphrase(Secret.toString(certificateCredentials.getPassword()));
  }
  if (skipTlsVerify) {
    builder.withTrustCerts(true);
  }
  if (caCertData != null) {
    builder.withCaCertData(new String(Base64.encodeBase64String(caCertData.getBytes())));
  }
  LOGGER.log(Level.FINE,"String_Node_Str",this.toString());
  return new DefaultKubernetesClient(builder.build());
}

Fixed version (ground truth):
public KubernetesClient createClient() throws NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException, IOException, CertificateEncodingException {
  ConfigBuilder builder=new ConfigBuilder().withMasterUrl(serviceAddress).withRequestTimeout(readTimeout * 1000).withConnectionTimeout(connectTimeout * 1000);
  if (!StringUtils.isBlank(namespace)) {
    builder.withNamespace(namespace);
  }
  if (credentials instanceof TokenProducer) {
    final String token=((TokenProducer)credentials).getToken(serviceAddress,caCertData,skipTlsVerify);
    builder.withOauthToken(token);
  }
 else   if (credentials instanceof UsernamePasswordCredentials) {
    UsernamePasswordCredentials usernamePassword=(UsernamePasswordCredentials)credentials;
    builder.withUsername(usernamePassword.getUsername()).withPassword(Secret.toString(usernamePassword.getPassword()));
  }
 else   if (credentials instanceof StandardCertificateCredentials) {
    StandardCertificateCredentials certificateCredentials=(StandardCertificateCredentials)credentials;
    KeyStore keyStore=certificateCredentials.getKeyStore();
    String alias=keyStore.aliases().nextElement();
    X509Certificate certificate=(X509Certificate)keyStore.getCertificate(alias);
    Key key=keyStore.getKey(alias,Secret.toString(certificateCredentials.getPassword()).toCharArray());
    builder.withClientCertData(Base64.encodeBase64String(certificate.getEncoded())).withClientKeyData(pemEncodeKey(key)).withClientKeyPassphrase(Secret.toString(certificateCredentials.getPassword()));
  }
  if (skipTlsVerify) {
    builder.withTrustCerts(true);
  }
  if (caCertData != null) {
    builder.withCaCertData(Base64.encodeBase64String(caCertData.getBytes(UTF_8)));
  }
  LOGGER.log(Level.FINE,"String_Node_Str",this.toString());
  return new DefaultKubernetesClient(builder.build());
}