Program: 10691
Project: 10691
Buggy source:
/** 
 * Validates the given credentials. If an error occurred, it either returns a validation message if the error can be recognised, or throws  {@link CoreException} if error cannot be recognised.
 * @param cfServer
 * @param userName
 * @param password
 * @param urlText
 * @param displayURL
 * @param context
 * @return null if validation was successful. Error message if validationerror is recognised
 * @throws CoreException if validation failed and error type cannot bedetermined
 */
public static String validateCredentials(CloudFoundryServer cfServer,final String userName,final String password,final String urlText,final boolean displayURL,IRunnableContext context) throws CoreException {
  if (cfServer != null) {
    try {
      final boolean selfSigned=cfServer.getSelfSignedCertificate();
      ICoreRunnable coreRunner=new ICoreRunnable(){
        public void run(        IProgressMonitor monitor) throws CoreException {
          String url=urlText;
          if (displayURL) {
            url=getUrlFromDisplayText(urlText);
          }
          CloudFoundryServerBehaviour.validate(url,userName,password,selfSigned,monitor);
        }
      }
;
      if (context != null) {
        runForked(coreRunner,context);
      }
 else {
        runForked(coreRunner);
      }
      return null;
    }
 catch (    CoreException ce) {
      if (ce.getCause() instanceof ResourceAccessException && ce.getCause().getCause() instanceof javax.net.ssl.SSLPeerUnverifiedException) {
        throw CloudErrorUtil.toCoreException(ce.getCause().getCause());
      }
 else {
        String message=CloudErrorUtil.getConnectionError(ce);
        return message;
      }
    }
catch (    OperationCanceledException e) {
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Validates the given credentials. If an error occurred, it either returns a validation message if the error can be recognised, or throws  {@link CoreException} if error cannot be recognised.
 * @param userName
 * @param password
 * @param urlText
 * @param displayURL
 * @param selfSigned true if its a server using self-signed certificate. Ifthis information is not known, set this to false
 * @param context
 * @return null if validation was successful. Error message if validationerror is recognised
 * @throws CoreException if validation failed and error type cannot bedetermined
 */
public static String validateCredentials(final String userName,final String password,final String urlText,final boolean displayURL,final boolean selfSigned,IRunnableContext context) throws CoreException {
  try {
    ICoreRunnable coreRunner=new ICoreRunnable(){
      public void run(      IProgressMonitor monitor) throws CoreException {
        String url=urlText;
        if (displayURL) {
          url=getUrlFromDisplayText(urlText);
        }
        CloudFoundryServerBehaviour.validate(url,userName,password,selfSigned,monitor);
      }
    }
;
    if (context != null) {
      runForked(coreRunner,context);
    }
 else {
      runForked(coreRunner);
    }
    return null;
  }
 catch (  CoreException ce) {
    if (ce.getCause() instanceof ResourceAccessException && ce.getCause().getCause() instanceof javax.net.ssl.SSLPeerUnverifiedException) {
      throw CloudErrorUtil.toCoreException(ce.getCause().getCause());
    }
 else {
      String message=CloudErrorUtil.getConnectionError(ce);
      return message;
    }
  }
catch (  OperationCanceledException e) {
  }
  return "String_Node_Str";
}