nus-yam/ex-repair huggingface dataset:
Program: 7537
Project: 7537
Buggy source:
/** 
 * {@inheritDoc} 
 */
public List<XMLObject> getOrderedChildren(){
  ArrayList<XMLObject> children=new ArrayList<XMLObject>();
  if (getSignature() != null) {
    children.add(getSignature());
  }
  if (getExpires() != null) {
    children.add(getExpires());
  }
  if (getSubject() != null) {
    children.add(getSubject());
  }
  children.addAll(getAliases());
  children.addAll(getTypes());
  children.addAll(getLinks());
  children.addAll(getUnknownXMLObjects());
  return Collections.unmodifiableList(children);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public List<XMLObject> getOrderedChildren(){
  ArrayList<XMLObject> children=new ArrayList<XMLObject>();
  if (getExpires() != null) {
    children.add(getExpires());
  }
  if (getSubject() != null) {
    children.add(getSubject());
  }
  children.addAll(getAliases());
  children.addAll(getTypes());
  children.addAll(getLinks());
  children.addAll(getUnknownXMLObjects());
  if (getSignature() != null) {
    children.add(getSignature());
  }
  return Collections.unmodifiableList(children);
}
Program: 7538
Project: 7538
Buggy source:
/** 
 * {@inheritDoc} 
 */
protected void marshallAttributes(XMLObject xmlObject,Element domElement) throws MarshallingException {
  XRD xrd=(XRD)xmlObject;
  if (xrd.getID() != null) {
    domElement.setAttributeNS(XRD.ID_ATTRIB_NAME.getNamespaceURI(),XRD.ID_ATTRIB_NAME.getLocalPart(),xrd.getID());
  }
  super.marshallAttributes(xmlObject,domElement);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
protected void marshallAttributes(XMLObject xmlObject,Element domElement) throws MarshallingException {
  XRD xrd=(XRD)xmlObject;
  if (xrd.getID() != null) {
    domElement.setAttributeNS(XRD.ID_ATTRIB_NAME.getNamespaceURI(),XRD.ID_ATTRIB_NAME.getPrefix() + "String_Node_Str" + XRD.ID_ATTRIB_NAME.getLocalPart(),xrd.getID());
  }
  super.marshallAttributes(xmlObject,domElement);
}
Program: 7539
Project: 7539
Buggy source:
/** 
 * Sign the XRD.
 * @param xrd XRD to sign
 */
public void addSignature(XRD xrd) throws Exception {
  QName qname=new QName(XMLConstants.XMLSIG_NS,Signature.DEFAULT_ELEMENT_LOCAL_NAME,XMLConstants.XMLSIG_PREFIX);
  Signature signature=(Signature)buildXMLObject(qname);
  KeyPair keyPair=SecurityHelper.generateKeyPair("String_Node_Str",1024,null);
  BasicCredential credential=SecurityHelper.getSimpleCredential(keyPair.getPublic(),keyPair.getPrivate());
  signature.setSigningCredential(credential);
  signature.setCanonicalizationAlgorithm(SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
  signature.setSignatureAlgorithm(SignatureConstants.ALGO_ID_SIGNATURE_RSA);
  xrd.setSignature(signature);
}

Fixed version (ground truth):
/** 
 * Sign the XRD.
 * @param xrd XRD to sign
 * @throws Exception if something breaks
 */
public void addSignature(XRD xrd) throws Exception {
  Signature signature=(Signature)buildXMLObject(Signature.DEFAULT_ELEMENT_NAME);
  Credential credential=getCredential();
  signature.setSigningCredential(credential);
  SecurityHelper.prepareSignatureParams(signature,credential,null,null);
  xrd.setSignature(signature);
}
Program: 7540
Project: 7540
Buggy source:
/** 
 * Test XRD building.
 * @throws Exception
 */
public void testXRD() throws Exception {
  QName qname=new QName(XRDConstants.XRD_NS,XRD.DEFAULT_ELEMENT_LOCAL_NAME,XRDConstants.XRD_PREFIX);
  XRD xrd=(XRD)buildXMLObject(qname);
  xrd.setID("String_Node_Str");
  addSignature(xrd);
  Marshaller marshaller=Configuration.getMarshallerFactory().getMarshaller(xrd);
  marshaller.marshall(xrd);
  Signer.signObject(xrd.getSignature());
  printXRD(xrd);
  System.out.println("String_Node_Str");
  printXRD2(xrd);
}

Fixed version (ground truth):
/** 
 * Test XRD building.
 * @throws Exception if something breaks
 */
public void testXRD() throws Exception {
  XRD xrd=(XRD)buildXMLObject(XRD.DEFAULT_ELEMENT_NAME);
  xrd.setID("String_Node_Str");
  Subject subject=(Subject)buildXMLObject(Subject.DEFAULT_ELEMENT_NAME);
  subject.setValue("String_Node_Str");
  xrd.setSubject(subject);
  addSignature(xrd);
  Configuration.getMarshallerFactory().getMarshaller(xrd).marshall(xrd);
  Signer.signObject(xrd.getSignature());
  System.out.println(XMLHelper.nodeToString(xrd.getDOM()));
}
Program: 7541
Project: 7541
Buggy source:
/** 
 * Match given link against media type values.
 * @param link link to match
 * @return true if link matches media type values for this filter
 */
protected boolean matchMediaTypes(Link link){
  if (link.getMediaTypes().size() != 0 && mediaTypes.size() != 0) {
    Set<String> linkMediaTypes=new HashSet<String>();
    for (    MediaType type : link.getMediaTypes()) {
      linkMediaTypes.add(type.getValue());
    }
    for (    String typeValue : mediaTypes) {
      if (!linkMediaTypes.contains(typeValue)) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Match given link against media type values.
 * @param link link to match
 * @return true if link matches media type values for this filter
 */
protected boolean matchMediaTypes(Link link){
  if (mediaTypes.size() != 0) {
    Set<String> linkMediaTypes=new HashSet<String>();
    for (    MediaType type : link.getMediaTypes()) {
      linkMediaTypes.add(type.getValue());
    }
    for (    String typeValue : mediaTypes) {
      if (!linkMediaTypes.contains(typeValue)) {
        return false;
      }
    }
  }
  return true;
}
Program: 7542
Project: 7542
Buggy source:
/** 
 * Match given link against rel values.
 * @param link link to match
 * @return true if link matches rel values for this filter
 */
protected boolean matchRels(Link link){
  if (link.getRels().size() != 0 && rels.size() != 0) {
    Set<String> linkRels=new HashSet<String>();
    for (    Rel rel : link.getRels()) {
      linkRels.add(rel.getValue());
    }
    for (    String relValue : rels) {
      if (!linkRels.contains(relValue)) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Match given link against rel values.
 * @param link link to match
 * @return true if link matches rel values for this filter
 */
protected boolean matchRels(Link link){
  if (rels.size() != 0) {
    Set<String> linkRels=new HashSet<String>();
    for (    Rel rel : link.getRels()) {
      linkRels.add(rel.getValue());
    }
    for (    String relValue : rels) {
      if (!linkRels.contains(relValue)) {
        return false;
      }
    }
  }
  return true;
}
Program: 7544
Project: 7544
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public HttpResponse doRequest(String url,HttpMethod method,Map<String,Object> requestParameters,String charset) throws IOException {
  Request request=new Request(url);
  request.setEnableThrowingIOException(true);
  request.setUserAgent(USER_AGENT);
  request.setConnectTimeoutMillis(connectTimeoutMillis);
  request.setReadTimeoutMillis(readTimeoutMillis);
  request.setCharset(charset);
  for (  String name : headersToOverwrite.keySet()) {
    request.setHeader(name,headersToOverwrite.get(name));
  }
  if (method == HttpMethod.GET) {
    request.setQueryParams(requestParameters);
  }
 else {
    request.setFormParams(requestParameters);
  }
  readGetParameters(request.getUrl());
  readGetParameters(request.getQueryParams().toString());
  String oAuthNonce=String.valueOf(new SecureRandom().nextLong());
  Long oAuthTimestamp=System.currentTimeMillis() / 1000;
  String signature=getSignature(url,method,oAuthNonce,oAuthTimestamp);
  String authorizationHeader=getAuthorizationHeader(signature,oAuthNonce,oAuthTimestamp);
  request.setHeader("String_Node_Str",authorizationHeader);
  try {
    Response response=HTTP.request(new Method(method.name()),request);
    return toReturnValue(response);
  }
 catch (  HTTPIOException ex) {
    HttpResponse httpResponse=toReturnValue(ex.getResponse());
    throw new HttpException(ex.getMessage(),httpResponse);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public HttpResponse doRequest(String url,HttpMethod method,Map<String,Object> requestParameters,String charset) throws IOException {
  Request request=new Request(url);
  request.setEnableThrowingIOException(true);
  request.setUserAgent(USER_AGENT);
  request.setConnectTimeoutMillis(connectTimeoutMillis);
  request.setReadTimeoutMillis(readTimeoutMillis);
  request.setCharset(charset);
  for (  String name : headersToOverwrite.keySet()) {
    request.setHeader(name,headersToOverwrite.get(name));
  }
  if (method == HttpMethod.GET) {
    request.setQueryParams(requestParameters);
  }
 else {
    request.setFormParams(requestParameters);
  }
  readQueryStringAndAddToSignatureBaseString(request.getUrl());
  readQueryStringAndAddToSignatureBaseString(request.getQueryParams().toString());
  String oAuthNonce=String.valueOf(new SecureRandom().nextLong());
  Long oAuthTimestamp=System.currentTimeMillis() / 1000;
  String signature=getSignature(url,method,oAuthNonce,oAuthTimestamp);
  String authorizationHeader=getAuthorizationHeader(signature,oAuthNonce,oAuthTimestamp);
  request.setHeader("String_Node_Str",authorizationHeader);
  try {
    Response response=HTTP.request(new Method(method.name()),request);
    return toReturnValue(response);
  }
 catch (  HTTPIOException ex) {
    HttpResponse httpResponse=toReturnValue(ex.getResponse());
    throw new HttpException(ex.getMessage(),httpResponse);
  }
}
Program: 7545
Project: 7545
Buggy source:
public static boolean verifyPOST(String url,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken,SignatureMethod signatureMethod,Map<String,Object> formParams){
  if (authorizationHeader == null) {
    return false;
  }
  Map<String,String> elements=parseAuthorizationHeader(authorizationHeader);
  for (  String key : formParams.keySet()) {
    Object value=formParams.get(key);
    if (value != null) {
      elements.put(key,value.toString());
    }
  }
  SignedRequest req=SignedRequestFactory.create(consumer,accessToken,signatureMethod);
  Map<String,Object> additionalParams=new HashMap<String,Object>();
  for (  String name : elements.keySet()) {
    String _name=name.replaceFirst("String_Node_Str","String_Node_Str");
    if (!oAuthElementNames.contains(_name)) {
      additionalParams.put(name,OAuthEncoding.decode(elements.get(name)));
    }
  }
  req.setAdditionalAuthorizationHeaderParams(additionalParams);
  String signature=req.getSignature(url,HttpMethod.POST,elements.get("String_Node_Str"),Long.valueOf(elements.get("String_Node_Str")));
  return OAuthEncoding.encode(signature).equals(elements.get("String_Node_Str"));
}

Fixed version (ground truth):
public static boolean verifyPOST(String url,String queryString,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken,SignatureMethod signatureMethod,Map<String,String> formParams){
  if (authorizationHeader == null) {
    return false;
  }
  Map<String,String> elements=parseAuthorizationHeader(authorizationHeader);
  for (  String key : formParams.keySet()) {
    String value=formParams.get(key);
    if (value != null) {
      elements.put(key,value);
    }
  }
  SignedRequest req=SignedRequestFactory.create(consumer,accessToken,signatureMethod);
  Map<String,Object> additionalParams=new HashMap<String,Object>();
  for (  String name : elements.keySet()) {
    String _name=name.replaceFirst("String_Node_Str","String_Node_Str");
    if (!oAuthElementNames.contains(_name)) {
      additionalParams.put(name,OAuthEncoding.decode(elements.get(name)));
    }
  }
  req.setAdditionalAuthorizationHeaderParams(additionalParams);
  if (queryString == null) {
    queryString="String_Node_Str";
  }
  req.readQueryStringAndAddToSignatureBaseString(url + "String_Node_Str" + queryString);
  String signature=req.getSignature(url,HttpMethod.POST,elements.get("String_Node_Str"),Long.valueOf(elements.get("String_Node_Str")));
  return OAuthEncoding.encode(signature).equals(elements.get("String_Node_Str"));
}
Program: 7546
Project: 7546
Buggy source:
public static boolean verifyHMacGetRequest(String url,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken){
  return verify(url,authorizationHeader,consumer,accessToken,HttpMethod.GET,SignatureMethod.HMAC_SHA1);
}

Fixed version (ground truth):
public static boolean verifyHMacGetRequest(String url,String queryString,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken){
  return verify(url,queryString,authorizationHeader,consumer,accessToken,HttpMethod.GET,SignatureMethod.HMAC_SHA1);
}
Program: 7547
Project: 7547
Buggy source:
public static boolean verify(String url,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken,HttpMethod httpMethod,SignatureMethod signatureMethod){
  if (authorizationHeader == null) {
    return false;
  }
  if (httpMethod.equals(HttpMethod.POST)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Map<String,String> elements=parseAuthorizationHeader(authorizationHeader);
  SignedRequest req=SignedRequestFactory.create(consumer,accessToken,signatureMethod);
  Map<String,Object> additionalParams=new HashMap<String,Object>();
  for (  String name : elements.keySet()) {
    String _name=name.replaceFirst("String_Node_Str","String_Node_Str");
    if (!oAuthElementNames.contains(_name)) {
      additionalParams.put(name,OAuthEncoding.decode(elements.get(name)));
    }
  }
  req.setAdditionalAuthorizationHeaderParams(additionalParams);
  String signature=req.getSignature(url,httpMethod,elements.get("String_Node_Str"),Long.valueOf(elements.get("String_Node_Str")));
  return OAuthEncoding.encode(signature).equals(elements.get("String_Node_Str"));
}

Fixed version (ground truth):
public static boolean verify(String url,String queryString,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken,HttpMethod httpMethod,SignatureMethod signatureMethod){
  if (authorizationHeader == null) {
    return false;
  }
  if (httpMethod.equals(HttpMethod.POST)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Map<String,String> elements=parseAuthorizationHeader(authorizationHeader);
  SignedRequest req=SignedRequestFactory.create(consumer,accessToken,signatureMethod);
  Map<String,Object> additionalParams=new HashMap<String,Object>();
  for (  String name : elements.keySet()) {
    String _name=name.replaceFirst("String_Node_Str","String_Node_Str");
    if (!oAuthElementNames.contains(_name)) {
      additionalParams.put(name,OAuthEncoding.decode(elements.get(name)));
    }
  }
  req.setAdditionalAuthorizationHeaderParams(additionalParams);
  if (queryString == null) {
    queryString="String_Node_Str";
  }
  req.readQueryStringAndAddToSignatureBaseString(url + "String_Node_Str" + queryString);
  String signature=req.getSignature(url,httpMethod,elements.get("String_Node_Str"),Long.valueOf(elements.get("String_Node_Str")));
  return OAuthEncoding.encode(signature).equals(elements.get("String_Node_Str"));
}
Program: 7548
Project: 7548
Buggy source:
public static boolean verifyHMacPostRequest(String url,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken){
  return verify(url,authorizationHeader,consumer,accessToken,HttpMethod.POST,SignatureMethod.HMAC_SHA1);
}

Fixed version (ground truth):
public static boolean verifyHMacPostRequest(String url,String queryString,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken){
  return verify(url,queryString,authorizationHeader,consumer,accessToken,HttpMethod.POST,SignatureMethod.HMAC_SHA1);
}
Program: 7549
Project: 7549
Buggy source:
@Test public void verifyPOST_A$String$OAuthConsumer$OSignatureMethod() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  OAuthAccessToken accessToken=new OAuthAccessToken("String_Node_Str","String_Node_Str");
  Map<String,Object> formParams=new HashMap<String,Object>();
  formParams.put("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verifyPOST("String_Node_Str",authorizationHeader,consumer,accessToken,SignatureMethod.HMAC_SHA1,formParams);
  boolean expected=true;
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void verifyPOST_A$String$OAuthConsumer$OSignatureMethod() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  OAuthAccessToken accessToken=new OAuthAccessToken("String_Node_Str","String_Node_Str");
  Map<String,String> formParams=new HashMap<String,String>();
  formParams.put("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verifyPOST("String_Node_Str","String_Node_Str",authorizationHeader,consumer,accessToken,SignatureMethod.HMAC_SHA1,formParams);
  boolean expected=true;
  assertEquals(expected,actual);
}
Program: 7550
Project: 7550
Buggy source:
@Test public void verifyPOST_A$String$OAuthConsumer$OAuthAccessToken$SignatureMethod() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  Map<String,Object> formParams=new HashMap<String,Object>();
  formParams.put("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verifyPOST("String_Node_Str",authorizationHeader,consumer,SignatureMethod.HMAC_SHA1,formParams);
  boolean expected=true;
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void verifyPOST_A$String$OAuthConsumer$OAuthAccessToken$SignatureMethod() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  Map<String,String> formParams=new HashMap<String,String>();
  formParams.put("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verifyPOST("String_Node_Str","String_Node_Str",authorizationHeader,consumer,SignatureMethod.HMAC_SHA1,formParams);
  boolean expected=true;
  assertEquals(expected,actual);
}
Program: 7551
Project: 7551
Buggy source:
@Test public void verify_A$String$OAuthConsumer$HttpMethod$SignatureMethod() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verify("String_Node_Str",authorizationHeader,consumer,HttpMethod.GET,SignatureMethod.HMAC_SHA1);
  boolean expected=true;
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void verify_A$String$OAuthConsumer$HttpMethod$SignatureMethod() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verify("String_Node_Str","String_Node_Str",authorizationHeader,consumer,HttpMethod.GET,SignatureMethod.HMAC_SHA1);
  boolean expected=true;
  assertEquals(expected,actual);
}
Program: 7552
Project: 7552
Buggy source:
@Test public void verify_A$String$OAuthConsumer$HttpMethod$SignatureMethod_AdditionalParameters() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verify("String_Node_Str",authorizationHeader,consumer,HttpMethod.GET,SignatureMethod.HMAC_SHA1);
  boolean expected=true;
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void verify_A$String$OAuthConsumer$HttpMethod$SignatureMethod_AdditionalParameters() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verify("String_Node_Str","String_Node_Str",authorizationHeader,consumer,HttpMethod.GET,SignatureMethod.HMAC_SHA1);
  boolean expected=true;
  assertEquals(expected,actual);
}
Program: 7553
Project: 7553
Buggy source:
@Test public void verify_A$String$OAuthConsumer$OAuthAccessToken$HttpMethod$SignatureMethod() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  OAuthAccessToken accessToken=new OAuthAccessToken("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verify("String_Node_Str",authorizationHeader,consumer,accessToken,HttpMethod.GET,SignatureMethod.HMAC_SHA1);
  boolean expected=true;
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void verify_A$String$OAuthConsumer$OAuthAccessToken$HttpMethod$SignatureMethod() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  OAuthAccessToken accessToken=new OAuthAccessToken("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verify("String_Node_Str","String_Node_Str",authorizationHeader,consumer,accessToken,HttpMethod.GET,SignatureMethod.HMAC_SHA1);
  boolean expected=true;
  assertEquals(expected,actual);
}
Program: 7554
Project: 7554
Buggy source:
@Test(expected=IllegalArgumentException.class) public void verify_A$String$OAuthConsumer$HttpMethod$SignatureMethod_POST() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verify("String_Node_Str",authorizationHeader,consumer,HttpMethod.POST,SignatureMethod.HMAC_SHA1);
  boolean expected=true;
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void verify_A$String$OAuthConsumer$HttpMethod$SignatureMethod_POST() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verify("String_Node_Str","String_Node_Str",authorizationHeader,consumer,HttpMethod.POST,SignatureMethod.HMAC_SHA1);
  boolean expected=true;
  assertEquals(expected,actual);
}
Program: 7555
Project: 7555
Buggy source:
@Test public void verifyPOST_A$String$OAuthConsumer$OAuthAccessToken$SignatureMethod_empty() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  Map<String,Object> formParams=new HashMap<String,Object>();
  formParams.put("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verifyPOST("String_Node_Str",authorizationHeader,consumer,SignatureMethod.HMAC_SHA1,formParams);
  boolean expected=true;
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void verifyPOST_A$String$OAuthConsumer$OAuthAccessToken$SignatureMethod_empty() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  Map<String,String> formParams=new HashMap<String,String>();
  formParams.put("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verifyPOST("String_Node_Str","String_Node_Str",authorizationHeader,consumer,SignatureMethod.HMAC_SHA1,formParams);
  boolean expected=true;
  assertEquals(expected,actual);
}
Program: 7556
Project: 7556
Buggy source:
@Test(expected=IllegalArgumentException.class) public void verify_A$String$OAuthConsumer$OAuthAccessToken$HttpMethod$SignatureMethod_POST() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  OAuthAccessToken accessToken=new OAuthAccessToken("String_Node_Str","String_Node_Str");
  SignedRequestVerifier.verify("String_Node_Str",authorizationHeader,consumer,accessToken,HttpMethod.POST,SignatureMethod.HMAC_SHA1);
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void verify_A$String$OAuthConsumer$OAuthAccessToken$HttpMethod$SignatureMethod_POST() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  OAuthAccessToken accessToken=new OAuthAccessToken("String_Node_Str","String_Node_Str");
  SignedRequestVerifier.verify("String_Node_Str","String_Node_Str",authorizationHeader,consumer,accessToken,HttpMethod.POST,SignatureMethod.HMAC_SHA1);
}
Program: 7557
Project: 7557
Buggy source:
@Test public void verify_A$String$OAuthConsumer$OAuthAccessToken$HttpMethod$SignatureMethod_AdditionalParameters() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  OAuthAccessToken accessToken=new OAuthAccessToken("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verify("String_Node_Str",authorizationHeader,consumer,accessToken,HttpMethod.GET,SignatureMethod.HMAC_SHA1);
  boolean expected=true;
  assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void verify_A$String$OAuthConsumer$OAuthAccessToken$HttpMethod$SignatureMethod_AdditionalParameters() throws Exception {
  String authorizationHeader="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  OAuthConsumer consumer=new OAuthConsumer("String_Node_Str","String_Node_Str");
  OAuthAccessToken accessToken=new OAuthAccessToken("String_Node_Str","String_Node_Str");
  boolean actual=SignedRequestVerifier.verify("String_Node_Str","String_Node_Str",authorizationHeader,consumer,accessToken,HttpMethod.GET,SignatureMethod.HMAC_SHA1);
  boolean expected=true;
  assertEquals(expected,actual);
}
Program: 7559
Project: 7559
Buggy source:
public void _handle(Boolean isAllowed,HttpMethod method,Request baseRequest,HttpServletRequest request,HttpServletResponse response) throws Exception {
  boolean isValid=false;
  if (method.equals(HttpMethod.POST)) {
    isValid=SignedRequestVerifier.verifyPOST("String_Node_Str",request.getHeader("String_Node_Str"),HttpServerSpec.SINGLETON_CONSUMER,SignatureMethod.HMAC_SHA1,request.getParameterMap());
  }
 else {
    isValid=SignedRequestVerifier.verify("String_Node_Str",request.getHeader("String_Node_Str"),HttpServerSpec.SINGLETON_CONSUMER,method,SignatureMethod.HMAC_SHA1);
  }
  if (isAllowed && isValid) {
    response.setStatus(HttpServletResponse.SC_OK);
  }
 else {
    response.setStatus(HttpServletResponse.SC_FORBIDDEN);
  }
  response.getWriter().print("String_Node_Str");
  baseRequest.setHandled(true);
}

Fixed version (ground truth):
public void _handle(Boolean isAllowed,HttpMethod method,Request baseRequest,HttpServletRequest request,HttpServletResponse response) throws Exception {
  boolean isValid=false;
  if (method.equals(HttpMethod.POST)) {
    isValid=SignedRequestVerifier.verifyPOST("String_Node_Str",request.getQueryString(),request.getHeader("String_Node_Str"),HttpServerSpec.SINGLETON_CONSUMER,SignatureMethod.HMAC_SHA1,request.getParameterMap());
  }
 else {
    isValid=SignedRequestVerifier.verify("String_Node_Str",request.getQueryString(),request.getHeader("String_Node_Str"),HttpServerSpec.SINGLETON_CONSUMER,method,SignatureMethod.HMAC_SHA1);
  }
  if (isAllowed && isValid) {
    response.setStatus(HttpServletResponse.SC_OK);
  }
 else {
    response.setStatus(HttpServletResponse.SC_FORBIDDEN);
  }
  response.getWriter().print("String_Node_Str");
  baseRequest.setHandled(true);
}
Program: 7561
Project: 7561
Buggy source:
List<Parameter> getNormalizedParameters(String oAuthNonce,Long oAuthTimestamp){
  List<Parameter> params=new ArrayList<Parameter>();
  params.add(new Parameter("String_Node_Str",consumer.getConsumerKey()));
  if (accessToken != null) {
    params.add(new Parameter("String_Node_Str",accessToken.getToken()));
  }
  params.add(new Parameter("String_Node_Str",oAuthNonce));
  params.add(new Parameter("String_Node_Str",signatureMethod));
  params.add(new Parameter("String_Node_Str",oAuthTimestamp));
  params.add(new Parameter("String_Node_Str",oAuthVersion));
  if (additionalParameters != null && additionalParameters.size() > 0) {
    for (    String key : additionalParameters.keySet()) {
      Object parameter=additionalParameters.get(key);
      if (parameter != null) {
        params.add(new Parameter(key,OAuthEncoding.encode(parameter)));
      }
    }
  }
  if (postParameters != null && postParameters.size() > 0) {
    for (    String key : postParameters.keySet()) {
      Object parameter=postParameters.get(key);
      if (parameter != null) {
        params.add(new Parameter(key,OAuthEncoding.encode(parameter)));
      }
    }
  }
  Collections.sort(params,new Comparator<Parameter>(){
    public int compare(    Parameter p1,    Parameter p2){
      return p1.getKey().compareTo(p2.getKey());
    }
  }
);
  return params;
}

Fixed version (ground truth):
protected List<Parameter> getNormalizedParameters(String oAuthNonce,Long oAuthTimestamp){
  List<Parameter> params=new ArrayList<Parameter>();
  params.add(new Parameter("String_Node_Str",consumer.getConsumerKey()));
  if (accessToken != null) {
    params.add(new Parameter("String_Node_Str",accessToken.getToken()));
  }
  params.add(new Parameter("String_Node_Str",oAuthNonce));
  params.add(new Parameter("String_Node_Str",signatureMethod));
  params.add(new Parameter("String_Node_Str",oAuthTimestamp));
  params.add(new Parameter("String_Node_Str",oAuthVersion));
  if (additionalParameters != null && additionalParameters.size() > 0) {
    for (    String key : additionalParameters.keySet()) {
      Object parameter=additionalParameters.get(key);
      if (parameter != null) {
        params.add(new Parameter(key,OAuthEncoding.encode(parameter)));
      }
    }
  }
  if (getParameters != null && getParameters.size() > 0) {
    for (    String key : getParameters.keySet()) {
      Object parameter=getParameters.get(key);
      if (parameter != null) {
        params.add(new Parameter(key,OAuthEncoding.encode(parameter)));
      }
    }
  }
  if (postParameters != null && postParameters.size() > 0) {
    for (    String key : postParameters.keySet()) {
      Object parameter=postParameters.get(key);
      if (parameter != null) {
        params.add(new Parameter(key,OAuthEncoding.encode(parameter)));
      }
    }
  }
  Collections.sort(params,new Comparator<Parameter>(){
    public int compare(    Parameter p1,    Parameter p2){
      return p1.getKey().compareTo(p2.getKey());
    }
  }
);
  return params;
}
Program: 7562
Project: 7562
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public HttpResponse doRequest(String url,HttpMethod method,Map<String,Object> requestParameters,String charset) throws IOException {
  Request request=new Request(url);
  request.setEnableThrowingIOException(true);
  request.setUserAgent(USER_AGENT);
  request.setConnectTimeoutMillis(connectTimeoutMillis);
  request.setReadTimeoutMillis(readTimeoutMillis);
  request.setCharset(charset);
  for (  String name : headersToOverwrite.keySet()) {
    request.setHeader(name,headersToOverwrite.get(name));
  }
  String oAuthNonce=String.valueOf(new SecureRandom().nextLong());
  Long oAuthTimestamp=System.currentTimeMillis() / 1000;
  String signature=getSignature(url,method,oAuthNonce,oAuthTimestamp);
  String authorizationHeader=getAuthorizationHeader(signature,oAuthNonce,oAuthTimestamp);
  request.setHeader("String_Node_Str",authorizationHeader);
  if (method == HttpMethod.GET) {
    request.setQueryParams(requestParameters);
  }
 else {
    request.setFormParams(requestParameters);
  }
  try {
    Response response=HTTP.request(new Method(method.name()),request);
    return toReturnValue(response);
  }
 catch (  HTTPIOException ex) {
    HttpResponse httpResponse=toReturnValue(ex.getResponse());
    throw new HttpException(ex.getMessage(),httpResponse);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public HttpResponse doRequest(String url,HttpMethod method,Map<String,Object> requestParameters,String charset) throws IOException {
  Request request=new Request(url);
  request.setEnableThrowingIOException(true);
  request.setUserAgent(USER_AGENT);
  request.setConnectTimeoutMillis(connectTimeoutMillis);
  request.setReadTimeoutMillis(readTimeoutMillis);
  request.setCharset(charset);
  for (  String name : headersToOverwrite.keySet()) {
    request.setHeader(name,headersToOverwrite.get(name));
  }
  if (method == HttpMethod.GET) {
    request.setQueryParams(requestParameters);
  }
 else {
    request.setFormParams(requestParameters);
  }
  readGetParameters(request.getUrl());
  readGetParameters(request.getQueryParams().toString());
  String oAuthNonce=String.valueOf(new SecureRandom().nextLong());
  Long oAuthTimestamp=System.currentTimeMillis() / 1000;
  String signature=getSignature(url,method,oAuthNonce,oAuthTimestamp);
  String authorizationHeader=getAuthorizationHeader(signature,oAuthNonce,oAuthTimestamp);
  request.setHeader("String_Node_Str",authorizationHeader);
  try {
    Response response=HTTP.request(new Method(method.name()),request);
    return toReturnValue(response);
  }
 catch (  HTTPIOException ex) {
    HttpResponse httpResponse=toReturnValue(ex.getResponse());
    throw new HttpException(ex.getMessage(),httpResponse);
  }
}
Program: 7563
Project: 7563
Buggy source:
@Test public void doRequest_A$String$HttpMethod$Map$String_TwitterOAuth_GET() throws Exception {
  try {
    OAuthRealm realm=new OAuthRealm("String_Node_Str");
    Properties props=new Properties();
    props.load(this.getClass().getClassLoader().getResourceAsStream("String_Node_Str"));
    String consumerKey=(String)props.get("String_Node_Str");
    String consumerSecret=(String)props.get("String_Node_Str");
    OAuthConsumer consumer=new OAuthConsumer(consumerKey,consumerSecret);
    String token=(String)props.get("String_Node_Str");
    String tokenSecret=(String)props.get("String_Node_Str");
    OAuthAccessToken accessToken=new OAuthAccessToken(token,tokenSecret);
    SignatureMethod signatureMethod=SignatureMethod.HMAC_SHA1;
    SignedRequestApacheHCImpl target=new SignedRequestApacheHCImpl(realm,consumer,accessToken,signatureMethod);
    String url="String_Node_Str";
    HttpMethod method=HttpMethod.GET;
    String charset="String_Node_Str";
    HttpResponse actual=target.doRequest(url,method,new HashMap<String,Object>(),charset);
    assertNotNull(actual);
    assertThat(actual.getStatusCode(),is(200));
    System.out.println(actual.getHeaders());
    System.out.println(actual.getTextBody());
  }
 catch (  NullPointerException e) {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void doRequest_A$String$HttpMethod$Map$String_TwitterOAuth_GET() throws Exception {
  try {
    OAuthRealm realm=new OAuthRealm("String_Node_Str");
    Properties props=new Properties();
    props.load(this.getClass().getClassLoader().getResourceAsStream("String_Node_Str"));
    String consumerKey=(String)props.get("String_Node_Str");
    String consumerSecret=(String)props.get("String_Node_Str");
    OAuthConsumer consumer=new OAuthConsumer(consumerKey,consumerSecret);
    String token=(String)props.get("String_Node_Str");
    String tokenSecret=(String)props.get("String_Node_Str");
    OAuthAccessToken accessToken=new OAuthAccessToken(token,tokenSecret);
    SignatureMethod signatureMethod=SignatureMethod.HMAC_SHA1;
    SignedRequestApacheHCImpl target=new SignedRequestApacheHCImpl(realm,consumer,accessToken,signatureMethod);
    String url="String_Node_Str";
    HttpMethod method=HttpMethod.GET;
    String charset="String_Node_Str";
    HttpResponse actual=target.doRequest(url,method,new HashMap<String,Object>(),charset);
    assertNotNull(actual);
    assertThat(actual.getStatusCode(),is(200));
    System.out.println(actual.getHeaders());
  }
 catch (  NullPointerException e) {
    System.out.println("String_Node_Str");
  }
}
Program: 7564
Project: 7564
Buggy source:
public static String encode(Object obj){
  String encoded="String_Node_Str";
  try {
    encoded=URLEncoder.encode(obj.toString(),"String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedEncodingException ignore) {
  }
  return encoded;
}

Fixed version (ground truth):
public static String encode(Object obj){
  if (obj == null) {
    return "String_Node_Str";
  }
  String encoded=obj.toString();
  try {
    encoded=URLEncoder.encode(obj.toString(),"String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedEncodingException ignore) {
  }
  return encoded;
}
Program: 7565
Project: 7565
Buggy source:
public static String decode(String encoded){
  String decoded="String_Node_Str";
  try {
    decoded=URLDecoder.decode(encoded,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException ignore) {
  }
  return decoded;
}

Fixed version (ground truth):
public static String decode(String encoded){
  if (encoded == null) {
    return "String_Node_Str";
  }
  String decoded=encoded;
  try {
    decoded=URLDecoder.decode(encoded,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException ignore) {
  }
catch (  IllegalArgumentException ignore) {
  }
  return decoded;
}
Program: 7566
Project: 7566
Buggy source:
public static boolean verifyPOST(String url,String queryString,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken,SignatureMethod signatureMethod,Map<String,String> formParams){
  if (authorizationHeader == null) {
    return false;
  }
  Map<String,String> elements=parseAuthorizationHeader(authorizationHeader);
  if (formParams != null) {
    for (    String key : formParams.keySet()) {
      String value=formParams.get(key);
      if (value != null) {
        elements.put(key,value);
      }
    }
  }
  SignedRequest req=SignedRequestFactory.create(consumer,accessToken,signatureMethod);
  Map<String,Object> additionalParams=new HashMap<String,Object>();
  for (  String name : elements.keySet()) {
    String _name=name.replaceFirst("String_Node_Str","String_Node_Str");
    if (!oAuthElementNames.contains(_name)) {
      additionalParams.put(name,OAuthEncoding.decode(elements.get(name)));
    }
  }
  req.setAdditionalAuthorizationHeaderParams(additionalParams);
  if (queryString == null) {
    queryString="String_Node_Str";
  }
  req.readQueryStringAndAddToSignatureBaseString(url + "String_Node_Str" + queryString);
  String signature=req.getSignature(url,HttpMethod.POST,elements.get("String_Node_Str"),Long.valueOf(elements.get("String_Node_Str")));
  return OAuthEncoding.encode(signature).equals(elements.get("String_Node_Str"));
}

Fixed version (ground truth):
public static boolean verifyPOST(String url,String queryString,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken,SignatureMethod signatureMethod,Map<String,String> formParams){
  if (authorizationHeader == null) {
    return false;
  }
  Map<String,String> urlDecodedElements=parseAuthorizationHeader(authorizationHeader);
  if (formParams != null) {
    for (    String key : formParams.keySet()) {
      String value=formParams.get(key);
      if (value != null) {
        urlDecodedElements.put(key,value);
      }
    }
  }
  SignedRequest req=SignedRequestFactory.create(consumer,accessToken,signatureMethod);
  Map<String,Object> additionalParams=new HashMap<String,Object>();
  for (  String name : urlDecodedElements.keySet()) {
    String _name=name.replaceFirst("String_Node_Str","String_Node_Str");
    if (!oAuthElementNames.contains(_name)) {
      additionalParams.put(name,urlDecodedElements.get(name));
    }
  }
  req.setAdditionalAuthorizationHeaderParams(additionalParams);
  if (queryString == null) {
    queryString="String_Node_Str";
  }
  req.readQueryStringAndAddToSignatureBaseString(url + "String_Node_Str" + queryString);
  String signature=req.getSignature(url,HttpMethod.POST,urlDecodedElements.get("String_Node_Str"),Long.valueOf(urlDecodedElements.get("String_Node_Str")));
  return signature.equals(urlDecodedElements.get("String_Node_Str"));
}
Program: 7567
Project: 7567
Buggy source:
@Deprecated public static boolean verifyLegacyUncorrected(String url,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken,HttpMethod httpMethod,SignatureMethod signatureMethod){
  if (authorizationHeader == null) {
    return false;
  }
  Map<String,String> elements=parseAuthorizationHeader(authorizationHeader);
  SignedRequest req=SignedRequestFactory.create(consumer,accessToken,signatureMethod);
  Map<String,Object> additionalParams=new HashMap<String,Object>();
  for (  String name : elements.keySet()) {
    String _name=name.replaceFirst("String_Node_Str","String_Node_Str");
    if (!oAuthElementNames.contains(_name)) {
      additionalParams.put(name,OAuthEncoding.decode(elements.get(name)));
    }
  }
  req.setAdditionalAuthorizationHeaderParams(additionalParams);
  String signature=req.getSignature(url,httpMethod,elements.get("String_Node_Str"),Long.valueOf(elements.get("String_Node_Str")));
  return OAuthEncoding.encode(signature).equals(elements.get("String_Node_Str"));
}

Fixed version (ground truth):
@Deprecated public static boolean verifyLegacyUncorrected(String url,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken,HttpMethod httpMethod,SignatureMethod signatureMethod){
  if (authorizationHeader == null) {
    return false;
  }
  Map<String,String> urlDecodedElements=parseAuthorizationHeader(authorizationHeader);
  SignedRequest req=SignedRequestFactory.create(consumer,accessToken,signatureMethod);
  Map<String,Object> additionalParams=new HashMap<String,Object>();
  for (  String name : urlDecodedElements.keySet()) {
    String _name=name.replaceFirst("String_Node_Str","String_Node_Str");
    if (!oAuthElementNames.contains(_name)) {
      additionalParams.put(name,urlDecodedElements.get(name));
    }
  }
  req.setAdditionalAuthorizationHeaderParams(additionalParams);
  String signature=req.getSignature(url,httpMethod,urlDecodedElements.get("String_Node_Str"),Long.valueOf(urlDecodedElements.get("String_Node_Str")));
  return signature.equals(urlDecodedElements.get("String_Node_Str"));
}
Program: 7568
Project: 7568
Buggy source:
public static boolean verify(String url,String queryString,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken,HttpMethod httpMethod,SignatureMethod signatureMethod){
  if (authorizationHeader == null) {
    return false;
  }
  if (httpMethod.equals(HttpMethod.POST)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Map<String,String> elements=parseAuthorizationHeader(authorizationHeader);
  SignedRequest req=SignedRequestFactory.create(consumer,accessToken,signatureMethod);
  Map<String,Object> additionalParams=new HashMap<String,Object>();
  for (  String name : elements.keySet()) {
    String _name=name.replaceFirst("String_Node_Str","String_Node_Str");
    if (!oAuthElementNames.contains(_name)) {
      additionalParams.put(name,OAuthEncoding.decode(elements.get(name)));
    }
  }
  req.setAdditionalAuthorizationHeaderParams(additionalParams);
  if (queryString == null) {
    queryString="String_Node_Str";
  }
  req.readQueryStringAndAddToSignatureBaseString(url + "String_Node_Str" + queryString);
  String signature=req.getSignature(url,httpMethod,elements.get("String_Node_Str"),Long.valueOf(elements.get("String_Node_Str")));
  return OAuthEncoding.encode(signature).equals(elements.get("String_Node_Str"));
}

Fixed version (ground truth):
public static boolean verify(String url,String queryString,String authorizationHeader,OAuthConsumer consumer,OAuthAccessToken accessToken,HttpMethod httpMethod,SignatureMethod signatureMethod){
  if (authorizationHeader == null) {
    return false;
  }
  if (httpMethod.equals(HttpMethod.POST)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Map<String,String> urlDecodedElements=parseAuthorizationHeader(authorizationHeader);
  SignedRequest req=SignedRequestFactory.create(consumer,accessToken,signatureMethod);
  Map<String,Object> additionalParams=new HashMap<String,Object>();
  for (  String name : urlDecodedElements.keySet()) {
    String _name=name.replaceFirst("String_Node_Str","String_Node_Str");
    if (!oAuthElementNames.contains(_name)) {
      additionalParams.put(name,urlDecodedElements.get(name));
    }
  }
  req.setAdditionalAuthorizationHeaderParams(additionalParams);
  if (queryString == null) {
    queryString="String_Node_Str";
  }
  req.readQueryStringAndAddToSignatureBaseString(url + "String_Node_Str" + queryString);
  String signature=req.getSignature(url,httpMethod,urlDecodedElements.get("String_Node_Str"),Long.valueOf(urlDecodedElements.get("String_Node_Str")));
  return signature.equals(urlDecodedElements.get("String_Node_Str"));
}
Program: 7569
Project: 7569
Buggy source:
public static Map<String,String> parseAuthorizationHeader(String authorizationHeader){
  Map<String,String> elements=new HashMap<String,String>();
  String[] keyAndValueArray=authorizationHeader.split("String_Node_Str");
  for (  String keyAndValue : keyAndValueArray) {
    String[] arr=keyAndValue.split("String_Node_Str");
    String key=arr[0].trim().replaceAll("String_Node_Str","String_Node_Str");
    String value=arr[1].trim().replaceAll("String_Node_Str","String_Node_Str");
    elements.put(key,value);
  }
  return elements;
}

Fixed version (ground truth):
public static Map<String,String> parseAuthorizationHeader(String authorizationHeader){
  Map<String,String> elements=new HashMap<String,String>();
  String[] keyAndValueArray=authorizationHeader.split("String_Node_Str");
  for (  String keyAndValue : keyAndValueArray) {
    String[] arr=keyAndValue.split("String_Node_Str");
    String key=arr[0].trim().replaceAll("String_Node_Str","String_Node_Str");
    String value=arr[1].trim().replaceAll("String_Node_Str","String_Node_Str");
    elements.put(key,OAuthEncoding.decode(value));
  }
  return elements;
}
Program: 7570
Project: 7570
Buggy source:
public HttpException(java.lang.String message,HttpResponse response){
  setMessage(message);
  setResponse(response);
}

Fixed version (ground truth):
public HttpException(String message,HttpResponse response){
  setMessage(message);
  setResponse(response);
}