nus-yam/ex-repair huggingface dataset:
Program: 16620
Project: 16620
Buggy source:
/** 
 * Returns the XEL context.
 */
private XelContext getXelContext(Object ref){
  final FunctionMapper mapper=getFunctionMapper(ref);
  final VariableResolver resolver=getVariableResolver(ref);
  if (_xelc == null) {
    _xelc=new SimpleXelContext(resolver,mapper);
  }
 else {
    _xelc.setVariableResolver(resolver);
    _xelc.setFunctionMapper(mapper);
  }
  return _xelc;
}

Fixed version (ground truth):
/** 
 * Returns the XEL context.
 */
private XelContext getXelContext(Object ref){
  final FunctionMapper mapper=getFunctionMapper(ref);
  final VariableResolver resolver=getVariableResolver(ref);
  SimpleXelContext xelc=new SimpleXelContext(resolver,mapper);
  return xelc;
}
Program: 16623
Project: 16623
Buggy source:
public void render(Component comp,Writer out) throws IOException {
  final Label self=(Label)comp;
  final boolean idRequired=self.isIdRequired();
  if (idRequired) {
    out.write("String_Node_Str");
    out.write(self.getUuid());
    out.write("String_Node_Str");
    out.write(self.getOuterAttrs());
    out.write(self.getInnerAttrs());
    out.write('>');
  }
  out.write(self.getEncodedText());
  if (idRequired)   out.write("String_Node_Str");
}

Fixed version (ground truth):
public void render(Component comp,Writer out) throws IOException {
  final WriterHelper wh=new WriterHelper(out);
  final Label self=(Label)comp;
  final boolean idRequired=self.isIdRequired();
  if (idRequired) {
    wh.write("String_Node_Str").write(self.getUuid()).write("String_Node_Str");
    wh.write(self.getOuterAttrs()).write(self.getInnerAttrs());
    wh.write("String_Node_Str");
  }
  wh.writeln(self.getEncodedText());
  if (idRequired)   wh.writeln("String_Node_Str");
}
Program: 16624
Project: 16624
Buggy source:
public void render(Component comp,Writer out) throws IOException {
  final Textbox self=(Textbox)comp;
  final boolean isMultiline=self.isMultiline();
  if (isMultiline) {
    out.write("String_Node_Str");
    out.write(self.getUuid());
    out.write("String_Node_Str");
    out.write(self.getOuterAttrs());
    out.write(self.getOuterAttrs());
    out.write(self.getInnerAttrs());
    out.write("String_Node_Str");
    out.write(self.getAreaText());
    out.write("String_Node_Str");
  }
 else {
    out.write("String_Node_Str");
    out.write(self.getUuid());
    out.write("String_Node_Str");
    out.write(self.getOuterAttrs());
    out.write(self.getInnerAttrs());
    out.write("String_Node_Str");
  }
}

Fixed version (ground truth):
public void render(Component comp,Writer out) throws IOException {
  final WriterHelper wh=new WriterHelper(out);
  final Textbox self=(Textbox)comp;
  final boolean isMultiline=self.isMultiline();
  if (isMultiline) {
    wh.write("String_Node_Str").write(self.getUuid()).write("String_Node_Str");
    wh.write(self.getOuterAttrs()).write(self.getInnerAttrs()).write("String_Node_Str");
    wh.write(self.getAreaText());
    wh.writeln("String_Node_Str");
  }
 else {
    wh.write("String_Node_Str").write(self.getUuid()).write("String_Node_Str");
    wh.write(self.getOuterAttrs()).write(self.getInnerAttrs());
    wh.writeln("String_Node_Str");
  }
}
Program: 16626
Project: 16626
Buggy source:
public boolean insertBefore(Component child,Component insertBefore){
  if (!(child instanceof Treeitem))   throw new UiException("String_Node_Str" + child);
  if (super.insertBefore(child,insertBefore)) {
    final int pgsz=getPageSize();
    if (pgsz > 0) {
      final int sz=getChildren().size();
      if (sz > 1 && (sz % pgsz) == 1)       smartUpdatePaging();
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean insertBefore(Component child,Component insertBefore){
  if (!(child instanceof Treeitem))   throw new UiException("String_Node_Str" + child);
  if (super.insertBefore(child,insertBefore)) {
    final int sz=getChildren().size();
    if (sz == 1) {
      Executions.getCurrent().setAttribute(ATTR_NO_CHILD,Boolean.TRUE);
    }
 else {
      final int pgsz=getPageSize();
      if (pgsz > 0 && ((sz % pgsz) == 1 || pgsz == 1))       smartUpdatePaging();
    }
    return true;
  }
  return false;
}
Program: 16627
Project: 16627
Buggy source:
public void invalidate(){
  final Component parent=getParent();
  if (parent instanceof Tree) {
    parent.invalidate();
  }
 else {
    super.invalidate();
  }
}

Fixed version (ground truth):
public void invalidate(){
  final Component parent=getParent();
  if (parent instanceof Tree) {
    parent.invalidate();
  }
 else   if (!getChildren().isEmpty() && Executions.getCurrent().getAttribute(ATTR_NO_CHILD) == null) {
    super.invalidate();
  }
}
Program: 16628
Project: 16628
Buggy source:
public void onChildRemoved(Component child){
  super.onChildRemoved(child);
  final int pgsz=getPageSize();
  if (pgsz > 0) {
    final int sz=getChildren().size();
    if (sz > 0 && (sz % pgsz) == 0) {
      final int pgcnt=smartUpdatePaging();
      if (_actpg >= pgcnt) {
        _actpg=pgcnt - 1;
        getParent().invalidate();
      }
    }
  }
}

Fixed version (ground truth):
public void onChildRemoved(Component child){
  super.onChildRemoved(child);
  final int pgsz=getPageSize();
  if (pgsz > 0) {
    final int sz=getChildren().size();
    if (sz > 0 && ((sz % pgsz) == 0 || pgsz == 1)) {
      final int pgcnt=smartUpdatePaging();
      if (_actpg >= pgcnt) {
        _actpg=pgcnt - 1;
        getParent().invalidate();
      }
    }
  }
}
Program: 16629
Project: 16629
Buggy source:
/** 
 * Returns the value of a variable defined in the namespace, or null if not defined or the value is null. <p>This method is the same as getNamespace().getVariable(name, local). <h3>Differences between   {@link #getVariable} and {@link #getZScriptVariable}</h3> <p>  {@link #getVariable} returns only variables defined by{@link #setVariable} (and {@link Namespace#setVariable}. On the other hand,   {@link #getZScriptVariable} returns these variablesand those defined when executing zscripts.
 * @param local whether not to search its ancestor.If false and the current namespace doen't define the variable, it searches up its ancestor (via  {@link #getParent}) to see any of them has defined the specified variable.
 * @see #getSpaceOwner
 * @see #getNamespace
 */
public Object getVariable(String name,boolean local);

Fixed version (ground truth):
/** 
 * Returns the value of a variable defined in the namespace, or null if not defined or the value is null. <p>This method is the same as getNamespace().getVariable(name, local). <h3>Differences between   {@link #getVariable} and {@link Page#getZScriptVariable}</h3> <p>  {@link #getVariable} returns only variables defined by{@link #setVariable} (i.e., a shortcut of {@link Namespace#setVariable}). On the other hand,   {@link Page#getZScriptVariable} returns these variablesand those defined when executing zscripts.
 * @param local whether not to search its ancestor.If false and the current namespace doen't define the variable, it searches up its ancestor (via  {@link #getParent}) to see any of them has defined the specified variable.
 * @see #getSpaceOwner
 * @see #getNamespace
 */
public Object getVariable(String name,boolean local);
Program: 16630
Project: 16630
Buggy source:
/** 
 * Returns the namespace to store variables and functions belonging to the ID space of this component. <p>Exactly one namespace is allocated for each ID space. For example, if the space owner of this component is the page, then the returned namespace is the same as   {@link Page#getNamespace}. Otherwise, it is the same as the namspace returned by the component owning this ID space. <p>Namspace is another part of an ID space. It holds only variables defined thru   {@link #setVariable} (and {@link Namespace#setVariable}. <p>Note: The namespace doesn't include any variable defined by executing zscripts. To retrieve them, use   {@link #getZScriptVariable}.
 * @see #getSpaceOwner
 */
public Namespace getNamespace();

Fixed version (ground truth):
/** 
 * Returns the namespace to store variables and functions belonging to the ID space of this component. <p>Exactly one namespace is allocated for each ID space. For example, if the space owner of this component is the page, then the returned namespace is the same as   {@link Page#getNamespace}. Otherwise, it is the same as the namspace returned by the component owning this ID space. <p>Namspace is another part of an ID space. It holds only variables defined thru   {@link #setVariable} (and {@link Namespace#setVariable}. <p>Note: The namespace doesn't include any variable defined by executing zscripts. To retrieve them, use   {@link Page#getZScriptVariable}.
 * @see #getSpaceOwner
 */
public Namespace getNamespace();
Program: 16631
Project: 16631
Buggy source:
/** 
 * Returns the class of the specified name by searching the thread class loader and the classes defined in the loaded interpreters.
 * @return the class, or null if not found
 * @see #getLoadedInterpreters
 */
public Class getZScriptClass(String clsnm);

Fixed version (ground truth):
/** 
 * Returns the class of the specified name by searching the thread class loader and the classes defined in the loaded interpreters. <p>Note: it also looks for the class by use of the current thread's class loader.
 * @return the class, or null if not found
 * @see #getLoadedInterpreters
 */
public Class getZScriptClass(String clsnm);
Program: 16632
Project: 16632
Buggy source:
/** 
 * Returns the value of a variable defined in the namespace (  {@link #getNamespace}). <p>It is the same as getNamespace().getVariable(name, true). <h3>Differences between   {@link #getVariable} and {@link #getZScriptVariable}</h3> <p>  {@link #getVariable} returns only variables defined by{@link #setVariable} (and {@link Namespace#setVariable}. On the other hand,   {@link #getZScriptVariable} returns these variablesand those defined when executing zscripts.
 * @see Component#getVariable
 * @see Component#getNamespace
 */
public Object getVariable(String name);

Fixed version (ground truth):
/** 
 * Returns the value of a variable defined in the namespace (  {@link #getNamespace}). <p>It is the same as getNamespace().getVariable(name, true). <h3>Differences between   {@link #getVariable} and {@link #getZScriptVariable}</h3> <p>  {@link #getVariable} returns only variables defined by{@link #setVariable} (i.e., a shortcut to {@link Namespace#setVariable}). On the other hand,   {@link #getZScriptVariable} returns these variablesand those defined when executing zscripts.
 * @see Component#getVariable
 * @see Component#getNamespace
 */
public Object getVariable(String name);
Program: 16633
Project: 16633
Buggy source:
/** 
 * Gets a variable that is visible to EL expressions. <p>This method is mainly used to access special variable, such as request parameters (if this page is requested by HTTP). <p>Note: components that are specified with an ID are already accessible by   {@link #getVariable}.
 */
public Object getELVariable(String name);

Fixed version (ground truth):
/** 
 * Returns a variable that is visible to EL expressions. <p>This method is mainly used to access special variable, such as request parameters (if this page is requested by HTTP). <p>Note: components that are specified with an ID are already accessible by   {@link #getVariable}.
 */
public Object getELVariable(String name);
Program: 16634
Project: 16634
Buggy source:
/** 
 * Returns the value of the variable of the specified name by searching the namespaces and the loaded interpreters. <h3>Differences between   {@link #getVariable} and {@link #getZScriptVariable}</h3> <p>  {@link #getVariable} returns only variables defined by{@link #setVariable} (and {@link Namespace#setVariable}. On the other hand,   {@link #getZScriptVariable} returns these variablesand those defined when executing zscripts.
 * @return the value of the variable, or null if not found
 * @see #getLoadedInterpreters
 */
public Object getZScriptVariable(String name);

Fixed version (ground truth):
/** 
 * Returns the value of the variable of the specified name by searching the namespaces and the loaded interpreters. <h3>Differences between   {@link #getVariable} and {@link #getZScriptVariable}</h3> <p>  {@link #getVariable} returns only variables defined by{@link #setVariable} (i.e., a shortcut to {@link Namespace#setVariable}). On the other hand,   {@link #getZScriptVariable} returns these variablesand those defined when executing zscripts.
 * @return the value of the variable, or null if not found
 * @see #getLoadedInterpreters
 */
public Object getZScriptVariable(String name);
Program: 16636
Project: 16636
Buggy source:
public Class getZScriptClass(String clsnm){
  try {
    return Classes.forNameByThread(clsnm);
  }
 catch (  ClassNotFoundException ex) {
    for (Iterator it=getLoadedInterpreters().iterator(); it.hasNext(); ) {
      Class cls=((Interpreter)it.next()).getClass(clsnm);
      if (cls != null)       return cls;
    }
    return null;
  }
}

Fixed version (ground truth):
public Class getZScriptClass(String clsnm){
  for (Iterator it=getLoadedInterpreters().iterator(); it.hasNext(); ) {
    Class cls=((Interpreter)it.next()).getClass(clsnm);
    if (cls != null)     return cls;
  }
  try {
    return Classes.forNameByThread(clsnm);
  }
 catch (  ClassNotFoundException ex) {
    return null;
  }
}
Program: 16637
Project: 16637
Buggy source:
public Object getZScriptVariable(String name){
  Object val=getVariable(name);
  if (val != null)   return val;
  for (Iterator it=getLoadedInterpreters().iterator(); it.hasNext(); ) {
    val=((Interpreter)it.next()).getVariable(name,true);
    if (val != null)     return val;
  }
  return null;
}

Fixed version (ground truth):
public Object getZScriptVariable(String name){
  for (Iterator it=getLoadedInterpreters().iterator(); it.hasNext(); ) {
    final Object val=((Interpreter)it.next()).getVariable(name,true);
    if (val != null)     return val;
  }
  return null;
}
Program: 16638
Project: 16638
Buggy source:
public PagedList<Album> getAlbums(String userId,PagingParameters pagedListParameters){
  return graphApi.fetchConnections(userId,"String_Node_Str",Album.class,getPagingParameters(pagedListParameters));
}

Fixed version (ground truth):
public PagedList<Album> getAlbums(String userId,PagingParameters pagedListParameters){
  return graphApi.fetchConnections(userId,"String_Node_Str",Album.class,getPagingParameters(pagedListParameters),ALL_ALBUM_FIELDS);
}
Program: 16639
Project: 16639
Buggy source:
public MultiValueMap<String,Object> toRequestParameters(){
  MultiValueMap<String,Object> parameters=new LinkedMultiValueMap<String,Object>();
  if (about != null) {
    parameters.add("String_Node_Str",about);
  }
  if (bio != null) {
    parameters.add("String_Node_Str",bio);
  }
  if (cover != null) {
    parameters.add("String_Node_Str",cover);
  }
  if (name != null) {
    parameters.add("String_Node_Str",name);
  }
  if (offsetX != null) {
    parameters.add("String_Node_Str",offsetX.toString());
  }
  if (offsetY != null) {
    parameters.add("String_Node_Str",offsetY.toString());
  }
  if (zoomScaleX != null) {
    parameters.add("String_Node_Str",zoomScaleX.toString());
  }
  if (zoomScaleY != null) {
    parameters.add("String_Node_Str",zoomScaleY.toString());
  }
  if (focusX != null) {
    parameters.add("String_Node_Str",focusX.toString());
  }
  if (focusY != null) {
    parameters.add("String_Node_Str",focusY.toString());
  }
  return parameters;
}

Fixed version (ground truth):
public MultiValueMap<String,Object> toRequestParameters(){
  MultiValueMap<String,Object> parameters=new LinkedMultiValueMap<String,Object>();
  if (about != null) {
    parameters.add("String_Node_Str",about);
  }
  if (cover != null) {
    parameters.add("String_Node_Str",cover);
  }
  if (name != null) {
    parameters.add("String_Node_Str",name);
  }
  if (offsetX != null) {
    parameters.add("String_Node_Str",offsetX.toString());
  }
  if (offsetY != null) {
    parameters.add("String_Node_Str",offsetY.toString());
  }
  if (zoomScaleX != null) {
    parameters.add("String_Node_Str",zoomScaleX.toString());
  }
  if (zoomScaleY != null) {
    parameters.add("String_Node_Str",zoomScaleY.toString());
  }
  if (focusX != null) {
    parameters.add("String_Node_Str",focusX.toString());
  }
  if (focusY != null) {
    parameters.add("String_Node_Str",focusY.toString());
  }
  return parameters;
}
Program: 16641
Project: 16641
Buggy source:
/** 
 * @param linkUrl A link to include in the post.
 * @param picture A preview image associated with the link. May be null.
 * @param name Overwrites the title of the link preview. May be null.
 * @param caption Overwrites the caption of the link preview. May be null.
 * @param description Overwrites the caption of hte link preview. May be null.
 * @return the PagePostData object for additional configuration
 */
public PostData link(String linkUrl,String picture,String name,String caption,String description){
  this.linkUrl=linkUrl;
  this.name=name;
  this.caption=caption;
  this.description=description;
  return this;
}

Fixed version (ground truth):
/** 
 * @param linkUrl A link to include in the post.
 * @param picture A preview image associated with the link. May be null.
 * @param name Overwrites the title of the link preview. May be null.
 * @param caption Overwrites the caption of the link preview. May be null.
 * @param description Overwrites the caption of hte link preview. May be null.
 * @return the PagePostData object for additional configuration
 */
public PostData link(String linkUrl,String picture,String name,String caption,String description){
  this.linkUrl=linkUrl;
  this.picture=picture;
  this.name=name;
  this.caption=caption;
  this.description=description;
  return this;
}
Program: 16642
Project: 16642
Buggy source:
public String postLink(String ownerId,String message,FacebookLink link){
  MultiValueMap<String,Object> map=new LinkedMultiValueMap<String,Object>();
  map.set("String_Node_Str",link.getLink());
  map.set("String_Node_Str",link.getName());
  map.set("String_Node_Str",link.getCaption());
  map.set("String_Node_Str",link.getDescription());
  map.set("String_Node_Str",message);
  return graphApi.publish(ownerId,"String_Node_Str",map);
}

Fixed version (ground truth):
public String postLink(String ownerId,String message,FacebookLink link){
  MultiValueMap<String,Object> map=new LinkedMultiValueMap<String,Object>();
  map.set("String_Node_Str",link.getLink());
  map.set("String_Node_Str",link.getName());
  map.set("String_Node_Str",link.getCaption());
  map.set("String_Node_Str",link.getDescription());
  map.set("String_Node_Str",message);
  if (link.getPicture() != null)   map.set("String_Node_Str",link.getPicture());
  return graphApi.publish(ownerId,"String_Node_Str",map);
}
Program: 16644
Project: 16644
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public Object resolveArgument(MethodParameter parameter,NativeWebRequest request) throws Exception {
  SignedRequest annotation=parameter.getParameterAnnotation(SignedRequest.class);
  if (annotation == null) {
    return WebArgumentResolver.UNRESOLVED;
  }
  String signedRequest=request.getParameter("String_Node_Str");
  if (signedRequest == null && annotation.required()) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (signedRequest == null) {
    return null;
  }
  Class<?> parameterType=parameter.getParameterType();
  if (MultiValueMap.class.isAssignableFrom(parameterType)) {
    Map map=signedRequestDecoder.decodeSignedRequest(signedRequest,Map.class);
    LinkedMultiValueMap<String,Object> mvm=new LinkedMultiValueMap<String,Object>(map.size());
    mvm.setAll((Map<String,Object>)map);
    return mvm;
  }
  return signedRequestDecoder.decodeSignedRequest(signedRequest,parameterType);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public Object resolveArgument(MethodParameter parameter,ModelAndViewContainer mavContainer,NativeWebRequest request,WebDataBinderFactory binderFactory) throws Exception {
  SignedRequest annotation=parameter.getParameterAnnotation(SignedRequest.class);
  if (annotation == null) {
    return WebArgumentResolver.UNRESOLVED;
  }
  String signedRequest=request.getParameter("String_Node_Str");
  if (signedRequest == null && annotation.required()) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (signedRequest == null) {
    return null;
  }
  Class<?> parameterType=parameter.getParameterType();
  if (MultiValueMap.class.isAssignableFrom(parameterType)) {
    Map map=signedRequestDecoder.decodeSignedRequest(signedRequest,Map.class);
    LinkedMultiValueMap<String,Object> mvm=new LinkedMultiValueMap<String,Object>(map.size());
    mvm.setAll((Map<String,Object>)map);
    return mvm;
  }
  return signedRequestDecoder.decodeSignedRequest(signedRequest,parameterType);
}
Program: 16645
Project: 16645
Buggy source:
/** 
 * Decodes a signed request, returning the payload of the signed request as a specified type.
 * @param signedRequest the value of the signed_request parameter sent by Facebook.
 * @param type the type to bind the signed_request to.
 * @return the payload of the signed request as an object
 */
public <T>T decodeSignedRequest(String signedRequest,Class<T> type) throws SignedRequestException {
  String[] split=signedRequest.split("String_Node_Str");
  String encodedSignature=split[0];
  String payload=split[1];
  byte[] signature=base64DecodeToBytes(encodedSignature);
  try {
    T data=objectMapper.readValue(base64DecodeToString(payload),type);
    String algorithm=getAlgorithm(data);
    if (algorithm == null || !algorithm.equals("String_Node_Str")) {
      throw new SignedRequestException("String_Node_Str" + algorithm);
    }
    byte[] expectedSignature=encrypt(payload,secret);
    if (!Arrays.equals(expectedSignature,signature)) {
      throw new SignedRequestException("String_Node_Str");
    }
    return data;
  }
 catch (  IOException e) {
    throw new SignedRequestException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Decodes a signed request, returning the payload of the signed request as a specified type.
 * @param signedRequest the value of the signed_request parameter sent by Facebook.
 * @param type the type to bind the signed_request to.
 * @return the payload of the signed request as an object
 */
public <T>T decodeSignedRequest(String signedRequest,Class<T> type) throws SignedRequestException {
  String[] split=signedRequest.split("String_Node_Str");
  String encodedSignature=split[0];
  String payload=split[1];
  String decoded=base64DecodeToString(payload);
  byte[] signature=base64DecodeToBytes(encodedSignature);
  try {
    T data=objectMapper.readValue(decoded,type);
    String algorithm=objectMapper.readTree(decoded).get("String_Node_Str").getTextValue();
    if (algorithm == null || !algorithm.equals("String_Node_Str")) {
      throw new SignedRequestException("String_Node_Str" + algorithm);
    }
    byte[] expectedSignature=encrypt(payload,secret);
    if (!Arrays.equals(expectedSignature,signature)) {
      throw new SignedRequestException("String_Node_Str");
    }
    return data;
  }
 catch (  IOException e) {
    throw new SignedRequestException("String_Node_Str",e);
  }
}
Program: 16646
Project: 16646
Buggy source:
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void resolveArgument_dauthorizationRequest_map() throws Exception {
  MockHttpServletRequest httpServletRequest=new MockHttpServletRequest();
  httpServletRequest.setParameter("String_Node_Str",DEAUTH_CALLBACK);
  NativeWebRequest request=new ServletWebRequest(httpServletRequest);
  Method method=SignedRequestArgumentResolverTest.class.getDeclaredMethod("String_Node_Str",DeauthorizationRequest.class,Map.class,MultiValueMap.class,String.class);
  MethodParameter deauthParameter=new MethodParameter(method,1);
  Class<?> parameterType=deauthParameter.getParameterType();
  Map<String,Object> resolved=(Map<String,Object>)resolver.resolveArgument(deauthParameter,request);
  assertEquals("String_Node_Str",resolved.get("String_Node_Str"));
  assertEquals(1335894796,resolved.get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.get("String_Node_Str"));
  Map<String,?> userData=(Map<String,?>)resolved.get("String_Node_Str");
  assertEquals("String_Node_Str",userData.get("String_Node_Str"));
  assertEquals("String_Node_Str",userData.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void resolveArgument_dauthorizationRequest_map() throws Exception {
  MockHttpServletRequest httpServletRequest=new MockHttpServletRequest();
  httpServletRequest.setParameter("String_Node_Str",DEAUTH_CALLBACK);
  NativeWebRequest request=new ServletWebRequest(httpServletRequest);
  Method method=SignedRequestArgumentResolverTest.class.getDeclaredMethod("String_Node_Str",DeauthorizationRequest.class,Map.class,MultiValueMap.class,String.class);
  MethodParameter deauthParameter=new MethodParameter(method,1);
  Class<?> parameterType=deauthParameter.getParameterType();
  Map<String,Object> resolved=(Map<String,Object>)resolver.resolveArgument(deauthParameter,null,request,null);
  assertEquals("String_Node_Str",resolved.get("String_Node_Str"));
  assertEquals(1335894796,resolved.get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.get("String_Node_Str"));
  Map<String,?> userData=(Map<String,?>)resolved.get("String_Node_Str");
  assertEquals("String_Node_Str",userData.get("String_Node_Str"));
  assertEquals("String_Node_Str",userData.get("String_Node_Str"));
}
Program: 16647
Project: 16647
Buggy source:
@Test public void resolveArgument_dauthorizationRequest_object() throws Exception {
  MockHttpServletRequest httpServletRequest=new MockHttpServletRequest();
  httpServletRequest.setParameter("String_Node_Str",DEAUTH_CALLBACK);
  NativeWebRequest request=new ServletWebRequest(httpServletRequest);
  Method method=SignedRequestArgumentResolverTest.class.getDeclaredMethod("String_Node_Str",DeauthorizationRequest.class,Map.class,MultiValueMap.class,String.class);
  MethodParameter deauthParameter=new MethodParameter(method,0);
  DeauthorizationRequest resolved=(DeauthorizationRequest)resolver.resolveArgument(deauthParameter,request);
  assertEquals("String_Node_Str",resolved.getAlgorithm());
  assertEquals(1335894796,resolved.getIssuedAt());
  assertEquals("String_Node_Str",resolved.getUserId());
  assertEquals("String_Node_Str",resolved.getUser().getCountry());
  assertEquals("String_Node_Str",resolved.getUser().getLocale());
}

Fixed version (ground truth):
@Test public void resolveArgument_dauthorizationRequest_object() throws Exception {
  MockHttpServletRequest httpServletRequest=new MockHttpServletRequest();
  httpServletRequest.setParameter("String_Node_Str",DEAUTH_CALLBACK);
  NativeWebRequest request=new ServletWebRequest(httpServletRequest);
  Method method=SignedRequestArgumentResolverTest.class.getDeclaredMethod("String_Node_Str",DeauthorizationRequest.class,Map.class,MultiValueMap.class,String.class);
  MethodParameter deauthParameter=new MethodParameter(method,0);
  DeauthorizationRequest resolved=(DeauthorizationRequest)resolver.resolveArgument(deauthParameter,null,request,null);
  assertEquals("String_Node_Str",resolved.getAlgorithm());
  assertEquals(1335894796,resolved.getIssuedAt());
  assertEquals("String_Node_Str",resolved.getUserId());
  assertEquals("String_Node_Str",resolved.getUser().getCountry());
  assertEquals("String_Node_Str",resolved.getUser().getLocale());
}
Program: 16648
Project: 16648
Buggy source:
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void resolveArgument_dauthorizationRequest_multiValueMap() throws Exception {
  MockHttpServletRequest httpServletRequest=new MockHttpServletRequest();
  httpServletRequest.setParameter("String_Node_Str",DEAUTH_CALLBACK);
  NativeWebRequest request=new ServletWebRequest(httpServletRequest);
  Method method=SignedRequestArgumentResolverTest.class.getDeclaredMethod("String_Node_Str",DeauthorizationRequest.class,Map.class,MultiValueMap.class,String.class);
  MethodParameter deauthParameter=new MethodParameter(method,2);
  Class<?> parameterType=deauthParameter.getParameterType();
  MultiValueMap<String,Object> resolved=(MultiValueMap<String,Object>)resolver.resolveArgument(deauthParameter,request);
  assertEquals("String_Node_Str",resolved.getFirst("String_Node_Str"));
  assertEquals(1335894796,resolved.getFirst("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getFirst("String_Node_Str"));
  Map<String,?> userData=(Map<String,?>)resolved.getFirst("String_Node_Str");
  assertEquals("String_Node_Str",userData.get("String_Node_Str"));
  assertEquals("String_Node_Str",userData.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void resolveArgument_dauthorizationRequest_multiValueMap() throws Exception {
  MockHttpServletRequest httpServletRequest=new MockHttpServletRequest();
  httpServletRequest.setParameter("String_Node_Str",DEAUTH_CALLBACK);
  NativeWebRequest request=new ServletWebRequest(httpServletRequest);
  Method method=SignedRequestArgumentResolverTest.class.getDeclaredMethod("String_Node_Str",DeauthorizationRequest.class,Map.class,MultiValueMap.class,String.class);
  MethodParameter deauthParameter=new MethodParameter(method,2);
  Class<?> parameterType=deauthParameter.getParameterType();
  MultiValueMap<String,Object> resolved=(MultiValueMap<String,Object>)resolver.resolveArgument(deauthParameter,null,request,null);
  assertEquals("String_Node_Str",resolved.getFirst("String_Node_Str"));
  assertEquals(1335894796,resolved.getFirst("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getFirst("String_Node_Str"));
  Map<String,?> userData=(Map<String,?>)resolved.getFirst("String_Node_Str");
  assertEquals("String_Node_Str",userData.get("String_Node_Str"));
  assertEquals("String_Node_Str",userData.get("String_Node_Str"));
}
Program: 16649
Project: 16649
Buggy source:
private Photo(String id,Reference from,String link,String icon,Date createdTime,List<Image> images){
  this.id=id;
  this.from=from;
  this.link=link;
  this.icon=icon;
  this.createdTime=createdTime;
  Map<Character,Image> imageMap=extractImages(images);
  this.tinyImage=imageMap.get('t');
  this.sourceImage=imageMap.get('n');
  this.smallImage=imageMap.get('s');
  this.albumImage=imageMap.get('a');
}

Fixed version (ground truth):
private Photo(String id,Reference from,String link,String icon,Date createdTime,List<Image> images){
  this.id=id;
  this.from=from;
  this.link=link;
  this.icon=icon;
  this.createdTime=createdTime;
  int i=0;
  if (images.size() == 5) {
    this.oversizedImage=images.get(i++);
  }
  this.sourceImage=images.get(i++);
  this.albumImage=images.get(i++);
  this.smallImage=images.get(i++);
  this.tinyImage=images.get(i++);
}
Program: 16650
Project: 16650
Buggy source:
@SuppressWarnings("String_Node_Str") public Comment extractObject(Map<String,Object> commentMap){
  String id=(String)commentMap.get("String_Node_Str");
  String message=(String)commentMap.get("String_Node_Str");
  Map<String,String> fromMap=(Map<String,String>)commentMap.get("String_Node_Str");
  String fromId=fromMap.get("String_Node_Str");
  String fromName=fromMap.get("String_Node_Str");
  String createdTimeAsString=(String)commentMap.get("String_Node_Str");
  Map<String,Object> likesMap=(Map<String,Object>)commentMap.get("String_Node_Str");
  List<Reference> likes=extractReferences(likesMap);
  return new Comment(id,new Reference(fromId,fromName),message,toDate(createdTimeAsString),likes);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Comment extractObject(Map<String,Object> commentMap){
  String id=(String)commentMap.get("String_Node_Str");
  String message=(String)commentMap.get("String_Node_Str");
  Map<String,String> fromMap=(Map<String,String>)commentMap.get("String_Node_Str");
  String fromId=fromMap.get("String_Node_Str");
  String fromName=fromMap.get("String_Node_Str");
  String createdTimeAsString=(String)commentMap.get("String_Node_Str");
  Object likesObject=commentMap.get("String_Node_Str");
  if (likesObject instanceof Integer) {
    Integer likesCount=(Integer)likesObject;
    return new Comment(id,new Reference(fromId,fromName),message,toDate(createdTimeAsString),likesCount);
  }
 else {
    Map<String,Object> likesMap=(Map<String,Object>)likesObject;
    List<Reference> likes=extractReferences(likesMap);
    return new Comment(id,new Reference(fromId,fromName),message,toDate(createdTimeAsString),likes);
  }
}
Program: 16651
Project: 16651
Buggy source:
public Comment(String id,Reference from,String message,Date createdTime,List<Reference> likes){
  this.id=id;
  this.from=from;
  this.message=message;
  this.createdTime=createdTime;
  this.likes=likes;
}

Fixed version (ground truth):
/** 
 * Constructs a Comment object.
 * @param id the comment's Graph API ID
 * @param from the author of the comment
 * @param message the comment text
 * @param createdTime the creation time of the comment
 * @param likesCount the number of users who have liked this comment.
 */
public Comment(String id,Reference from,String message,Date createdTime,int likesCount){
  this.id=id;
  this.from=from;
  this.message=message;
  this.createdTime=createdTime;
  this.likesCount=likesCount;
}
Program: 16652
Project: 16652
Buggy source:
public List<Reference> getLikes(){
  return likes;
}

Fixed version (ground truth):
/** 
 * A list of references to users who liked this comment. May be null, as Facebook often sends only a count of likes. In some cases (such as a comment on a checkin) the likes will be a list of references.
 */
public List<Reference> getLikes(){
  return likes;
}
Program: 16653
Project: 16653
Buggy source:
public String getMessage(){
  return message;
}

Fixed version (ground truth):
/** 
 * The text of the comment
 */
public String getMessage(){
  return message;
}
Program: 16654
Project: 16654
Buggy source:
public String getId(){
  return id;
}

Fixed version (ground truth):
/** 
 * The comment's Graph API object ID
 */
public String getId(){
  return id;
}
Program: 16655
Project: 16655
Buggy source:
public Date getCreatedTime(){
  return createdTime;
}

Fixed version (ground truth):
/** 
 * The time the comment was created.
 */
public Date getCreatedTime(){
  return createdTime;
}
Program: 16656
Project: 16656
Buggy source:
public Reference getFrom(){
  return from;
}

Fixed version (ground truth):
/** 
 * A reference to the user who posted the comment.
 */
public Reference getFrom(){
  return from;
}
Program: 16657
Project: 16657
Buggy source:
@Test public void getComment(){
  mockServer.expect(requestTo("String_Node_Str")).andExpect(method(GET)).andExpect(header("String_Node_Str","String_Node_Str")).andRespond(withResponse(new ClassPathResource("String_Node_Str",getClass()),responseHeaders));
  Comment comment=facebook.commentOperations().getComment("String_Node_Str");
  assertEquals("String_Node_Str",comment.getFrom().getId());
  assertEquals("String_Node_Str",comment.getFrom().getName());
  assertEquals("String_Node_Str",comment.getMessage());
}

Fixed version (ground truth):
@Test public void getComment(){
  mockServer.expect(requestTo("String_Node_Str")).andExpect(method(GET)).andExpect(header("String_Node_Str","String_Node_Str")).andRespond(withResponse(new ClassPathResource("String_Node_Str",getClass()),responseHeaders));
  Comment comment=facebook.commentOperations().getComment("String_Node_Str");
  assertEquals("String_Node_Str",comment.getFrom().getId());
  assertEquals("String_Node_Str",comment.getFrom().getName());
  assertEquals("String_Node_Str",comment.getMessage());
  assertNull(comment.getLikes());
  assertEquals(4,comment.getLikesCount());
}
Program: 16658
Project: 16658
Buggy source:
@Test public void getFeedEntry(){
  mockServer.expect(requestTo("String_Node_Str")).andExpect(method(GET)).andExpect(header("String_Node_Str","String_Node_Str")).andRespond(withResponse(new ClassPathResource("String_Node_Str",getClass()),responseHeaders));
  FeedEntry feedEntry=facebook.feedOperations().getFeedEntry("String_Node_Str");
  assertEquals("String_Node_Str",feedEntry.getId());
  assertEquals("String_Node_Str",feedEntry.getMessage());
  assertEquals("String_Node_Str",feedEntry.getFrom().getId());
  assertEquals("String_Node_Str",feedEntry.getFrom().getName());
  assertEquals(1,feedEntry.getLikes().size());
  assertEquals(2,feedEntry.getComments().size());
}

Fixed version (ground truth):
@Test public void getFeedEntry(){
  mockServer.expect(requestTo("String_Node_Str")).andExpect(method(GET)).andExpect(header("String_Node_Str","String_Node_Str")).andRespond(withResponse(new ClassPathResource("String_Node_Str",getClass()),responseHeaders));
  FeedEntry feedEntry=facebook.feedOperations().getFeedEntry("String_Node_Str");
  assertEquals("String_Node_Str",feedEntry.getId());
  assertEquals("String_Node_Str",feedEntry.getMessage());
  assertEquals("String_Node_Str",feedEntry.getFrom().getId());
  assertEquals("String_Node_Str",feedEntry.getFrom().getName());
  assertEquals(1,feedEntry.getLikes().size());
  assertEquals(2,feedEntry.getComments().size());
  assertNull(feedEntry.getComments().get(1).getLikes());
  assertEquals(3,feedEntry.getComments().get(1).getLikesCount());
}
Program: 16659
Project: 16659
Buggy source:
public BeanDefinition parse(Element element,ParserContext parserContext){
  BeanDefinitionBuilder beanBuilder=BeanDefinitionBuilder.genericBeanDefinition(JdbcConnectionRepository.class);
  String jdbcTemplate=element.getAttribute("String_Node_Str");
  beanBuilder.addConstructorArgReference(jdbcTemplate);
  String stringEncryptor=element.getAttribute("String_Node_Str");
  if (stringEncryptor != null && !stringEncryptor.isEmpty()) {
    beanBuilder.addConstructorArgReference(stringEncryptor);
  }
 else {
    beanBuilder.addConstructorArgValue(Encryptors.noOpText());
  }
  AbstractBeanDefinition beanDefinition=beanBuilder.getBeanDefinition();
  parserContext.getRegistry().registerBeanDefinition("String_Node_Str",beanDefinition);
  return beanDefinition;
}

Fixed version (ground truth):
public BeanDefinition parse(Element element,ParserContext parserContext){
  BeanDefinitionBuilder beanBuilder=BeanDefinitionBuilder.genericBeanDefinition(JdbcConnectionRepository.class);
  String dataSource=element.getAttribute("String_Node_Str");
  beanBuilder.addConstructorArgReference(dataSource);
  String stringEncryptor=element.getAttribute("String_Node_Str");
  if (stringEncryptor != null && !stringEncryptor.isEmpty()) {
    beanBuilder.addConstructorArgReference(stringEncryptor);
  }
 else {
    beanBuilder.addConstructorArgValue(Encryptors.noOpText());
  }
  AbstractBeanDefinition beanDefinition=beanBuilder.getBeanDefinition();
  parserContext.getRegistry().registerBeanDefinition("String_Node_Str",beanDefinition);
  return beanDefinition;
}
Program: 16660
Project: 16660
Buggy source:
public void retweet(long tweetId){
  @SuppressWarnings("String_Node_Str") ResponseEntity<Map> response=restOperations.postForEntity(RETWEET_URL,Collections.emptyMap(),Map.class,Collections.singletonMap("String_Node_Str",Long.toString(tweetId)));
  handleResponseErrors(response);
}

Fixed version (ground truth):
public void retweet(long tweetId){
  @SuppressWarnings("String_Node_Str") ResponseEntity<Map> response=restOperations.postForEntity(RETWEET_URL,"String_Node_Str",Map.class,Collections.singletonMap("String_Node_Str",Long.toString(tweetId)));
  handleResponseErrors(response);
}
Program: 16661
Project: 16661
Buggy source:
/** 
 * Create a new instance of ScribeOAuth1RequestSigner.
 * @param accessToken the access token value
 * @param accessTokenSecret the access token secret
 * @param apiKey the API key assigned by the provider
 * @param apiSecret the API secret assigned by the provider
 */
public ScribeOAuth1RequestSigner(String apiKey,String apiSecret,String accessToken,String accessTokenSecret){
  this.accessToken=accessToken;
  this.accessTokenSecret=accessTokenSecret;
  this.service=new ServiceBuilder().provider(TwitterApi.class).apiKey(apiKey).apiSecret(apiSecret).callback("String_Node_Str").build();
}

Fixed version (ground truth):
/** 
 * Create a new instance of ScribeOAuth1RequestSigner.
 * @param accessToken the access token value
 * @param accessTokenSecret the access token secret
 * @param apiKey the API key assigned by the provider
 * @param apiSecret the API secret assigned by the provider
 */
public ScribeOAuth1RequestSigner(String apiKey,String apiSecret,String accessToken,String accessTokenSecret){
  this.accessToken=accessToken;
  this.accessTokenSecret=accessTokenSecret;
  this.service=new ServiceBuilder().provider(LinkedInApi.class).apiKey(apiKey).apiSecret(apiSecret).callback("String_Node_Str").build();
}
Program: 16662
Project: 16662
Buggy source:
/** 
 * Create a new instance of TwitterTemplate. This constructor creates a new TwitterTemplate given the minimal amount of information required to sign a request and builds up a  {@link RestOperations} internally using this information.
 * @param apiKey the application's API key.
 * @param apiSecret the application's API secret.
 * @param accessToken the user's access token, given after successful OAuth authentication.
 * @param accessTokenSecret the access token secret, given along with the access token after successful OAuth authentication.
 */
public TwitterTemplate(String apiKey,String apiSecret,String accessToken,String accessTokenSecret){
  this.restOperations=new RestTemplate(new OAuthSigningClientHttpRequestFactory(new ScribeOAuth1RequestSigner(apiKey,apiSecret,accessToken,accessTokenSecret)));
}

Fixed version (ground truth):
/** 
 * Create a new instance of TwitterTemplate. This constructor creates a new TwitterTemplate given the minimal amount of information required to sign a request and builds up a  {@link RestOperations} internally using this information.
 * @param apiKey the application's API key.
 * @param apiSecret the application's API secret.
 * @param accessToken the user's access token, given after successful OAuth authentication.
 * @param accessTokenSecret the access token secret, given along with the access token after successful OAuth authentication.
 */
public TwitterTemplate(String apiKey,String apiSecret,String accessToken,String accessTokenSecret){
  RestTemplate restTemplate=new RestTemplate(new OAuthSigningClientHttpRequestFactory(new ScribeOAuth1RequestSigner(apiKey,apiSecret,accessToken,accessTokenSecret)));
  restTemplate.setErrorHandler(new TwitterErrorHandler());
  this.restOperations=restTemplate;
  this.statusCodeTranslator=new TwitterResponseStatusCodeTranslator();
}
Program: 16663
Project: 16663
Buggy source:
SearchResults buildSearchResults(Map<String,Object> response,List<Tweet> tweets){
  Long maxId=response.containsKey("String_Node_Str") ? NumberUtils.parseNumber((String)response.get("String_Node_Str"),Long.class) : 0;
  Long sinceId=response.containsKey("String_Node_Str") ? NumberUtils.parseNumber((String)response.get("String_Node_Str"),Long.class) : 0;
  return new SearchResults(tweets,maxId,sinceId,response.get("String_Node_Str") == null);
}

Fixed version (ground truth):
SearchResults buildSearchResults(Map<String,Object> response,List<Tweet> tweets){
  Number maxId=response.containsKey("String_Node_Str") ? (Number)response.get("String_Node_Str") : 0;
  Number sinceId=response.containsKey("String_Node_Str") ? (Number)response.get("String_Node_Str") : 0;
  return new SearchResults(tweets,maxId.longValue(),sinceId.longValue(),response.get("String_Node_Str") == null);
}
Program: 16664
Project: 16664
Buggy source:
@Test public void buildSearchResults(){
  TwitterTemplate twitter=new TwitterTemplate(null);
  Map<String,Object> response=new HashMap<String,Object>();
  response.put("String_Node_Str","String_Node_Str");
  response.put("String_Node_Str","String_Node_Str");
  response.put("String_Node_Str","String_Node_Str");
  SearchResults results=twitter.buildSearchResults(response,new ArrayList<Tweet>());
  assertEquals(42,results.getMaxId());
  assertEquals(24,results.getSinceId());
  assertEquals(false,results.isLastPage());
}

Fixed version (ground truth):
@Test public void buildSearchResults(){
  TwitterTemplate twitter=new TwitterTemplate(null);
  Map<String,Object> response=new HashMap<String,Object>();
  response.put("String_Node_Str",42);
  response.put("String_Node_Str",24);
  response.put("String_Node_Str","String_Node_Str");
  SearchResults results=twitter.buildSearchResults(response,new ArrayList<Tweet>());
  assertEquals(42,results.getMaxId());
  assertEquals(24,results.getSinceId());
  assertEquals(false,results.isLastPage());
}
Program: 16665
Project: 16665
Buggy source:
public synchronized void sendTransaction(Transaction tx){
  boolean success=false;
  for (  Peer peer : connectedPeers) {
    try {
      peer.broadcastTransaction(tx);
      success=true;
      Log.d("String_Node_Str","String_Node_Str");
    }
 catch (    IOException e) {
      peer.disconnect();
      connectedPeers.remove(peer);
      Log.d("String_Node_Str","String_Node_Str");
    }
  }
  if (success) {
    wallet.confirmSend(tx);
    saveWallet();
  }
}

Fixed version (ground truth):
public void sendTransaction(Transaction tx){
  boolean success=false;
synchronized (connectedPeersLock) {
    for (    Peer peer : connectedPeers) {
      try {
        peer.broadcastTransaction(tx);
        success=true;
        Log.d("String_Node_Str","String_Node_Str");
      }
 catch (      IOException e) {
        peer.disconnect();
        connectedPeers.remove(peer);
        Log.d("String_Node_Str","String_Node_Str");
      }
    }
  }
  if (success) {
    wallet.confirmSend(tx);
    saveWallet();
  }
}
Program: 16666
Project: 16666
Buggy source:
private void connectToLocalPeers(){
  Log.d("String_Node_Str","String_Node_Str");
  for (  Peer peer : appState.connectedPeers) {
    if (!peer.isRunning())     appState.connectedPeers.remove(peer);
  }
  if (appState.connectedPeers.size() < 3) {
    for (    InetSocketAddress isa : appState.discoverPeers()) {
      NetworkConnection conn=createNetworkConnection(isa);
      if (conn == null) {
        appState.removeBadPeer(isa);
      }
 else {
        Peer peer=new Peer(appState.params,conn,appState.blockChain,appState.wallet);
        peer.start();
        appState.connectedPeers.add(peer);
        if (appState.connectedPeers.size() >= 8)         break;
      }
    }
  }
}

Fixed version (ground truth):
private void connectToLocalPeers(){
  Log.d("String_Node_Str","String_Node_Str");
synchronized (appState.connectedPeersLock) {
    for (    Peer peer : appState.connectedPeers) {
      if (!peer.isRunning())       appState.connectedPeers.remove(peer);
    }
    if (appState.connectedPeers.size() < 3) {
      for (      InetSocketAddress isa : appState.discoverPeers()) {
        NetworkConnection conn=createNetworkConnection(isa);
        if (conn == null) {
          appState.removeBadPeer(isa);
        }
 else {
          Peer peer=new Peer(appState.params,conn,appState.blockChain,appState.wallet);
          peer.start();
          appState.connectedPeers.add(peer);
          if (appState.connectedPeers.size() >= 8)           break;
        }
      }
    }
  }
}
Program: 16668
Project: 16668
Buggy source:
private String formatPath(String path){
  String formattedPath=null;
  if (path != null) {
    formattedPath=(path.startsWith("String_Node_Str") ? path : "String_Node_Str" + path);
    formattedPath=(path.endsWith("String_Node_Str") ? path : path + "String_Node_Str");
  }
  return formattedPath;
}

Fixed version (ground truth):
private String formatPath(String path){
  String formattedPath=null;
  if (path != null) {
    formattedPath=(path.startsWith("String_Node_Str") ? path : "String_Node_Str" + path);
    formattedPath=(path.endsWith("String_Node_Str") ? formattedPath : formattedPath + "String_Node_Str");
  }
  return formattedPath;
}