Program: 106319
Project: 106319
Buggy source:
/** 
 * Establishes session with the virtual center server.
 * @throws Exception the exception
 */
public void connect(String url,String userName,String password) throws Exception {
  HostnameVerifier hv=new HostnameVerifier(){
    @Override public boolean verify(    String urlHostName,    SSLSession session){
      return true;
    }
  }
;
  trustAllHttpsCertificates();
  HttpsURLConnection.setDefaultHostnameVerifier(hv);
  SVC_INST_REF.setType(SVC_INST_NAME);
  SVC_INST_REF.setValue(SVC_INST_NAME);
  vimService=new VimService();
  vimPort=vimService.getVimPort();
  Map<String,Object> ctxt=((BindingProvider)vimPort).getRequestContext();
  ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,url);
  ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);
  ctxt.put("String_Node_Str",600000);
  ctxt.put("String_Node_Str",600000);
  serviceContent=vimPort.retrieveServiceContent(SVC_INST_REF);
  URL urlUrl=new URL(url);
  Map<String,List<String>> headers=(Map<String,List<String>>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
  for (  String header_raw_value : (List<String>)headers.get("String_Node_Str")) {
    List<Cookie> cookies=new BrowserCompatSpec().parse(new BasicHeader("String_Node_Str",header_raw_value),new CookieOrigin(urlUrl.getHost(),urlUrl.getPort(),urlUrl.getPath(),true));
    if (cookies.size() > 0) {
      serviceCookie=cookies.get(0).getValue();
      break;
    }
  }
  vimPort.login(serviceContent.getSessionManager(),userName,password,null);
  isConnected=true;
  propCollectorRef=serviceContent.getPropertyCollector();
  rootRef=serviceContent.getRootFolder();
}

Fixed version (ground truth):
/** 
 * Establishes session with the virtual center server.
 * @throws Exception the exception
 */
public void connect(String url,String userName,String password) throws Exception {
  HostnameVerifier hv=new HostnameVerifier(){
    @Override public boolean verify(    String urlHostName,    SSLSession session){
      return true;
    }
  }
;
  trustAllHttpsCertificates();
  HttpsURLConnection.setDefaultHostnameVerifier(hv);
  SVC_INST_REF.setType(SVC_INST_NAME);
  SVC_INST_REF.setValue(SVC_INST_NAME);
  vimService=new VimService();
  vimPort=vimService.getVimPort();
  Map<String,Object> ctxt=((BindingProvider)vimPort).getRequestContext();
  ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,url);
  ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);
  ctxt.put("String_Node_Str",600000);
  ctxt.put("String_Node_Str",600000);
  serviceContent=vimPort.retrieveServiceContent(SVC_INST_REF);
  Map<String,List<String>> headers=(Map<String,List<String>>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
  List<String> cookies=(List<String>)headers.get("String_Node_Str");
  String cookieValue=cookies.get(0);
  StringTokenizer tokenizer=new StringTokenizer(cookieValue,"String_Node_Str");
  cookieValue=tokenizer.nextToken();
  String pathData="String_Node_Str" + tokenizer.nextToken();
  serviceCookie="String_Node_Str" + cookieValue + "String_Node_Str"+ pathData;
  vimPort.login(serviceContent.getSessionManager(),userName,password,null);
  isConnected=true;
  propCollectorRef=serviceContent.getPropertyCollector();
  rootRef=serviceContent.getRootFolder();
}