Program: 4315
Project: 4315
Buggy source:
/** 
 * Creates a HandshakeResponse with the desired status code, status message,  and headers to respond with.
 * @param code the response code to use.
 * @param message the response message to use.
 * @param headers the headers to use in the response.
 */
HandshakeResponse(int code,String message,Properties headers){
  STATUS_CODE=code;
  STATUS_MESSAGE=message;
  HEADERS=headers;
  DEGREE=extractIntHeaderValue(HEADERS,HeaderNames.X_DEGREE,6);
  HIGH_DEGREE=getNumIntraUltrapeerConnections() >= 15;
  ULTRAPEER_QRP=isVersionOrHigher(HEADERS,HeaderNames.X_ULTRAPEER_QUERY_ROUTING,0.1F);
  MAX_TTL=extractByteHeaderValue(HEADERS,HeaderNames.X_MAX_TTL,(byte)4);
  DYNAMIC_QUERY=isVersionOrHigher(HEADERS,HeaderNames.X_DYNAMIC_QUERY,0.1F);
  PROBE_QUERIES=isVersionOrHigher(HEADERS,HeaderNames.X_PROBE_QUERIES,0.1F);
  NO_REQUERYING=isFalseValue(HEADERS,HeaderNames.X_REQUERIES);
  IS_LIMEWIRE=extractStringHeaderValue(headers,HeaderNames.USER_AGENT).toLowerCase().startsWith("String_Node_Str");
  GOOD_ULTRAPEER=isHighDegreeConnection() && isUltrapeerQueryRoutingConnection() && (getMaxTTL() < 5)&& isDynamicQueryConnection();
  GOOD_LEAF=GOOD_ULTRAPEER && (IS_LIMEWIRE || NO_REQUERYING);
  ULTRAPEER=isTrueValue(HEADERS,HeaderNames.X_ULTRAPEER);
  LEAF=isFalseValue(HEADERS,HeaderNames.X_ULTRAPEER);
  DEFLATE_ENCODED=isStringValue(HEADERS,HeaderNames.CONTENT_ENCODING,HeaderNames.DEFLATE_VALUE);
  PONG_CACHING=isVersionOrHigher(headers,HeaderNames.X_PONG_CACHING,0.1F);
  GUESS_CAPABLE=isVersionOrHigher(headers,HeaderNames.X_GUESS,0.1F);
  IS_CRAWLER=isVersionOrHigher(headers,HeaderNames.CRAWLER,0.1F);
  IS_OLD_LIMEWIRE=IS_LIMEWIRE && oldVersion(extractStringHeaderValue(headers,HeaderNames.USER_AGENT));
  String loc=extractStringHeaderValue(headers,HeaderNames.X_LOCALE_PREF);
  LOCALE_PREF=(loc.equals("String_Node_Str")) ? ApplicationSettings.DEFAULT_LOCALE.getValue() : loc;
}

Fixed version (ground truth):
/** 
 * Creates a HandshakeResponse with the desired status code, status message,  and headers to respond with.
 * @param code the response code to use.
 * @param message the response message to use.
 * @param headers the headers to use in the response.
 */
HandshakeResponse(int code,String message,Properties headers){
  STATUS_CODE=code;
  STATUS_MESSAGE=message;
  HEADERS=headers;
  DEGREE=extractIntHeaderValue(HEADERS,HeaderNames.X_DEGREE,6);
  HIGH_DEGREE=getNumIntraUltrapeerConnections() >= 15;
  ULTRAPEER_QRP=isVersionOrHigher(HEADERS,HeaderNames.X_ULTRAPEER_QUERY_ROUTING,0.1F);
  MAX_TTL=extractByteHeaderValue(HEADERS,HeaderNames.X_MAX_TTL,(byte)4);
  DYNAMIC_QUERY=isVersionOrHigher(HEADERS,HeaderNames.X_DYNAMIC_QUERY,0.1F);
  PROBE_QUERIES=isVersionOrHigher(HEADERS,HeaderNames.X_PROBE_QUERIES,0.1F);
  NO_REQUERYING=isFalseValue(HEADERS,HeaderNames.X_REQUERIES);
  IS_LIMEWIRE=extractStringHeaderValue(headers,HeaderNames.USER_AGENT).toLowerCase().startsWith("String_Node_Str");
  GOOD_ULTRAPEER=isHighDegreeConnection() && isUltrapeerQueryRoutingConnection() && (getMaxTTL() < 5)&& isDynamicQueryConnection();
  GOOD_LEAF=GOOD_ULTRAPEER && (IS_LIMEWIRE || NO_REQUERYING);
  ULTRAPEER=isTrueValue(HEADERS,HeaderNames.X_ULTRAPEER);
  LEAF=isFalseValue(HEADERS,HeaderNames.X_ULTRAPEER);
  DEFLATE_ENCODED=isStringValue(HEADERS,HeaderNames.CONTENT_ENCODING,HeaderNames.DEFLATE_VALUE);
  PONG_CACHING=isVersionOrHigher(headers,HeaderNames.X_PONG_CACHING,0.1F);
  GUESS_CAPABLE=isVersionOrHigher(headers,HeaderNames.X_GUESS,0.1F);
  IS_CRAWLER=isVersionOrHigher(headers,HeaderNames.CRAWLER,0.1F);
  IS_OLD_LIMEWIRE=IS_LIMEWIRE && oldVersion(extractStringHeaderValue(headers,HeaderNames.USER_AGENT));
  String loc=extractStringHeaderValue(headers,HeaderNames.X_LOCALE_PREF);
  LOCALE_PREF=(loc.equals("String_Node_Str")) ? ApplicationSettings.DEFAULT_LOCALE.getValue() : loc;
  LISTEN_PORT=extractIntHeaderValueAfter(headers,HeaderNames.LISTEN_IP,"String_Node_Str",-1);
}