Program: 30241
Project: 30241
Buggy source:
private boolean evaluate_client_conformance_ssl(EjbIORConfigurationDescriptor iordesc,boolean ssl_used,X509Certificate[] certchain){
  try {
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str");
    }
    boolean ssl_required=false;
    boolean ssl_supported=false;
    int ssl_target_requires=0;
    int ssl_target_supports=0;
    ssl_target_requires=this.getCtc().getTargetRequires(iordesc);
    ssl_target_supports=this.getCtc().getTargetSupports(iordesc);
    if (isSet(ssl_target_requires,Integrity.value) || isSet(ssl_target_requires,Confidentiality.value) || isSet(ssl_target_requires,EstablishTrustInClient.value))     ssl_required=true;
 else     ssl_required=false;
    if (ssl_target_supports != 0)     ssl_supported=true;
 else     ssl_supported=false;
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str" + "String_Node_Str" + isSet(ssl_target_requires,Integrity.value) + "String_Node_Str"+ isSet(ssl_target_requires,Confidentiality.value)+ "String_Node_Str"+ isSet(ssl_target_requires,EstablishTrustInClient.value)+ "String_Node_Str"+ ssl_required+ "String_Node_Str"+ ssl_supported+ "String_Node_Str"+ ssl_used);
    }
    if (ssl_used) {
      if (!(ssl_required || ssl_supported))       return false;
    }
 else {
      if (ssl_required)       return false;
    }
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str" + "String_Node_Str" + certchain + "String_Node_Str"+ isSet(ssl_target_requires,EstablishTrustInClient.value)+ "String_Node_Str"+ isSet(ssl_target_supports,EstablishTrustInClient.value));
    }
    if (certchain != null) {
      if (!(isSet(ssl_target_requires,EstablishTrustInClient.value) || isSet(ssl_target_supports,EstablishTrustInClient.value)))       return false;
    }
 else {
      if (isSet(ssl_target_requires,EstablishTrustInClient.value))       return false;
    }
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str");
    }
    return true;
  }
  finally {
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private boolean evaluate_client_conformance_ssl(EjbIORConfigurationDescriptor iordesc,boolean ssl_used,X509Certificate[] certchain){
  try {
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str");
    }
    boolean ssl_required=false;
    boolean ssl_supported=false;
    int ssl_target_requires=0;
    int ssl_target_supports=0;
    ssl_target_requires=this.getCtc().getTargetRequires(iordesc);
    ssl_target_supports=this.getCtc().getTargetSupports(iordesc);
    if (isSet(ssl_target_requires,Integrity.value) || isSet(ssl_target_requires,Confidentiality.value) || isSet(ssl_target_requires,EstablishTrustInClient.value))     ssl_required=true;
 else     ssl_required=false;
    if (ssl_target_supports != 0)     ssl_supported=true;
 else     ssl_supported=false;
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str" + "String_Node_Str" + isSet(ssl_target_requires,Integrity.value) + "String_Node_Str"+ isSet(ssl_target_requires,Confidentiality.value)+ "String_Node_Str"+ isSet(ssl_target_requires,EstablishTrustInClient.value)+ "String_Node_Str"+ ssl_required+ "String_Node_Str"+ ssl_supported+ "String_Node_Str"+ ssl_used);
    }
    if (ssl_used) {
      if (!(ssl_required || ssl_supported))       return false;
    }
 else {
      if (ssl_required)       return false;
    }
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str" + "String_Node_Str" + isSet(ssl_target_requires,EstablishTrustInClient.value) + "String_Node_Str"+ isSet(ssl_target_supports,EstablishTrustInClient.value));
    }
    if (certchain != null) {
      if (!(isSet(ssl_target_requires,EstablishTrustInClient.value) || isSet(ssl_target_supports,EstablishTrustInClient.value)))       return false;
    }
 else {
      if (isSet(ssl_target_requires,EstablishTrustInClient.value))       return false;
    }
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str");
    }
    return true;
  }
  finally {
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str");
    }
  }
}