Program: 59227
Project: 59227
Buggy source:
@Override public boolean await(){
  return Ping.ping(pollIterations,getSleepTime(),getTimeUnit(),new PingCommand(){
    @Override public boolean call(){
      try {
        urlConnection=(HttpURLConnection)url.openConnection();
        urlConnection.connect();
        int connectionResponseCode=urlConnection.getResponseCode();
        if (responseCode != connectionResponseCode) {
          return false;
        }
        if (matcher != null) {
          String content=IOUtil.asString(urlConnection.getInputStream());
          if (matcher.startsWith(REGEXP_PREFIX)) {
            String pattern=matcher.substring(REGEXP_PREFIX.length());
            final boolean matches=Pattern.compile(pattern,Pattern.DOTALL).matcher(content).matches();
            if (!matches)             return false;
          }
 else {
            final boolean matches=content.startsWith(matcher);
            if (!matches)             return false;
          }
        }
        if (headers != null) {
          final Set<String> keys=headers.keySet();
          for (          String key : keys) {
            if (urlConnection.getHeaderField(key) != null) {
              String connectionHeaderValue=urlConnection.getHeaderField(key);
              if (!connectionHeaderValue.equals(headers.get(key))) {
                return false;
              }
            }
 else {
              return false;
            }
          }
        }
      }
 catch (      IOException e) {
        return false;
      }
      return true;
    }
  }
);
}

Fixed version (ground truth):
@Override public boolean await(){
  return Ping.ping(pollIterations,getSleepTime(),getTimeUnit(),new PingCommand(){
    @Override public boolean call(){
      try {
        urlConnection=(HttpURLConnection)url.openConnection();
        urlConnection.connect();
        int connectionResponseCode=urlConnection.getResponseCode();
        if (responseCode != connectionResponseCode) {
          return false;
        }
        if (matcher != null) {
          String content=IOUtil.asString(urlConnection.getInputStream());
          if (matcher.startsWith(REGEXP_PREFIX)) {
            String pattern=matcher.substring(REGEXP_PREFIX.length());
            final boolean matches=Pattern.compile(pattern,Pattern.DOTALL).matcher(content).matches();
            if (!matches)             return false;
          }
 else {
            final boolean matches=content.startsWith(matcher);
            if (!matches)             return false;
          }
        }
        if (headers != null) {
          final Set<String> keys=headers.keySet();
          for (          String key : keys) {
            if (urlConnection.getHeaderField(key) != null) {
              String connectionHeaderValue=urlConnection.getHeaderField(key);
              if (!connectionHeaderValue.equals(headers.get(key))) {
                return false;
              }
            }
 else {
              return false;
            }
          }
        }
      }
 catch (      IOException e) {
        return false;
      }
 finally {
        if (urlConnection != null) {
          urlConnection.disconnect();
        }
      }
      return true;
    }
  }
);
}