nus-yam/ex-repair huggingface dataset:
Program: 51319
Project: 51319
Buggy source:
/** 
 * Redirect to a URI that ends in a slash. TODO use the complete URI.
 */
private boolean redirect(UriRuleContext context){
  final HttpRequestContext request=context.getRequest();
  final HttpResponseContext response=context.getResponse();
  response.setResponse(Response.temporaryRedirect(UriBuilder.fromUri(context.getUriInfo().getAbsolutePath()).path("String_Node_Str").build()).build());
  return true;
}

Fixed version (ground truth):
/** 
 * Redirect to a URI that ends in a slash. TODO use the complete URI.
 */
private boolean redirect(UriRuleContext context){
  final HttpResponseContext response=context.getResponse();
  response.setResponse(Response.temporaryRedirect(UriBuilder.fromUri(context.getUriInfo().getAbsolutePath()).path("String_Node_Str").build()).build());
  return true;
}
Program: 51320
Project: 51320
Buggy source:
/** 
 * Check if JAXB is present in the class path
 * @throws java.lang.ClassNotFoundException
 */
private static void checkForJAXB() throws ClassNotFoundException {
  Class<?> c=Class.forName("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Check if JAXB is present in the class path
 * @throws java.lang.ClassNotFoundException
 */
private static void checkForJAXB() throws ClassNotFoundException {
  Class.forName("String_Node_Str");
}
Program: 51322
Project: 51322
Buggy source:
private static Class resolveTypeVariable(Class c,Class dc,TypeVariable tv,Map<TypeVariable,Type> map){
  ParameterizedType pt=(ParameterizedType)c.getGenericSuperclass();
  Type[] typeArguments=pt.getActualTypeArguments();
  Class sc=c.getSuperclass();
  TypeVariable[] typeParameters=sc.getTypeParameters();
  Map<TypeVariable,Type> submap=new HashMap<TypeVariable,Type>();
  for (int i=0; i < typeArguments.length; i++) {
    if (typeArguments[i] instanceof TypeVariable) {
      Type t=map.get(typeArguments[i]);
      submap.put(typeParameters[i],t);
    }
 else {
      submap.put(typeParameters[i],typeArguments[i]);
    }
  }
  if (sc == dc) {
    Type t=submap.get(tv);
    if (t instanceof Class) {
      return (Class)t;
    }
 else     if (t instanceof GenericArrayType) {
      t=((GenericArrayType)t).getGenericComponentType();
      if (t instanceof Class) {
        c=(Class)t;
        try {
          Object o=Array.newInstance(c,0);
          return o.getClass();
        }
 catch (        Exception e) {
        }
        return null;
      }
 else {
        return null;
      }
    }
 else     if (t instanceof ParameterizedType) {
      pt=(ParameterizedType)t;
      return null;
    }
 else {
      return null;
    }
  }
 else {
    return resolveTypeVariable(sc,dc,tv,submap);
  }
}

Fixed version (ground truth):
private static ClassTypePair resolveTypeVariable(Class c,Class dc,TypeVariable tv,Map<TypeVariable,Type> map){
  ParameterizedType pt=(ParameterizedType)c.getGenericSuperclass();
  Type[] typeArguments=pt.getActualTypeArguments();
  Class sc=c.getSuperclass();
  TypeVariable[] typeParameters=sc.getTypeParameters();
  Map<TypeVariable,Type> submap=new HashMap<TypeVariable,Type>();
  for (int i=0; i < typeArguments.length; i++) {
    if (typeArguments[i] instanceof TypeVariable) {
      Type t=map.get(typeArguments[i]);
      submap.put(typeParameters[i],t);
    }
 else {
      submap.put(typeParameters[i],typeArguments[i]);
    }
  }
  if (sc == dc) {
    Type t=submap.get(tv);
    if (t instanceof Class) {
      return new ClassTypePair((Class)t);
    }
 else     if (t instanceof GenericArrayType) {
      t=((GenericArrayType)t).getGenericComponentType();
      if (t instanceof Class) {
        c=(Class)t;
        try {
          Object o=Array.newInstance(c,0);
          return new ClassTypePair(o.getClass());
        }
 catch (        Exception e) {
        }
        return null;
      }
 else {
        return null;
      }
    }
 else     if (t instanceof ParameterizedType) {
      pt=(ParameterizedType)t;
      if (pt.getRawType() instanceof Class) {
        return new ClassTypePair((Class)pt.getRawType(),pt);
      }
 else       return null;
    }
 else {
      return null;
    }
  }
 else {
    return resolveTypeVariable(sc,dc,tv,submap);
  }
}
Program: 51323
Project: 51323
Buggy source:
private ParameterExtractor processParameter(AbstractResourceMethod method,Parameter parameter,Annotation[] annotations,boolean requireNoEntityParameter){
  if (Parameter.Source.ENTITY == parameter.getSource()) {
    if (requireNoEntityParameter) {
      return null;
    }
    if (parameter.getParameterType() instanceof TypeVariable) {
      Class c=ReflectionHelper.resolveTypeVariable(method.getDeclaringResource().getResourceClass(),method.getMethod().getDeclaringClass(),(TypeVariable)parameter.getParameterType());
      return (c != null) ? new EntityExtractor(c,c,annotations) : null;
    }
 else {
      return new EntityExtractor(parameter.getParameterClass(),parameter.getParameterType(),annotations);
    }
  }
  ParameterProcessor p=ParameterProcessorFactory.createParameterProcessor(parameter.getSource());
  if (null == p) {
    return null;
  }
  return p.process(parameter);
}

Fixed version (ground truth):
private ParameterExtractor processParameter(AbstractResourceMethod method,Parameter parameter,Annotation[] annotations,boolean requireNoEntityParameter){
  if (Parameter.Source.ENTITY == parameter.getSource()) {
    if (requireNoEntityParameter) {
      return null;
    }
    if (parameter.getParameterType() instanceof TypeVariable) {
      ReflectionHelper.ClassTypePair ct=ReflectionHelper.resolveTypeVariable(method.getDeclaringResource().getResourceClass(),method.getMethod().getDeclaringClass(),(TypeVariable)parameter.getParameterType());
      return (ct != null) ? new EntityExtractor(ct.c,ct.t,annotations) : null;
    }
 else {
      return new EntityExtractor(parameter.getParameterClass(),parameter.getParameterType(),annotations);
    }
  }
  ParameterProcessor p=ParameterProcessorFactory.createParameterProcessor(parameter.getSource());
  if (null == p) {
    return null;
  }
  return p.process(parameter);
}
Program: 51324
Project: 51324
Buggy source:
private void analyzeClassFile(URI classFileUri){
  getClassReader(classFileUri).accept(classVisitor,0);
}

Fixed version (ground truth):
private void analyzeClassFile(JarFile jarFile,JarEntry entry){
  getClassReader(jarFile,entry).accept(classVisitor,0);
}
Program: 51325
Project: 51325
Buggy source:
private ClassReader getClassReader(URI classFileUri){
  try {
    InputStream is=classFileUri.toURL().openStream();
    ClassReader cr=new ClassReader(is);
    is.close();
    return cr;
  }
 catch (  IOException ex) {
    String s="String_Node_Str" + classFileUri;
    LOGGER.severe(s);
    throw new RuntimeException(s,ex);
  }
}

Fixed version (ground truth):
private ClassReader getClassReader(URI classFileUri){
  InputStream is=null;
  try {
    is=classFileUri.toURL().openStream();
    ClassReader cr=new ClassReader(is);
    return cr;
  }
 catch (  IOException ex) {
    String s="String_Node_Str" + classFileUri;
    LOGGER.severe(s);
    throw new RuntimeException(s,ex);
  }
 finally {
    try {
      is.close();
    }
 catch (    IOException ex) {
      String s="String_Node_Str" + classFileUri;
      LOGGER.severe(s);
    }
  }
}
Program: 51326
Project: 51326
Buggy source:
private void indexJar(File file,String parent){
  final JarFile jar=getJarFile(file);
  final Enumeration<JarEntry> entries=jar.entries();
  final String jarBase="String_Node_Str" + file.toURI() + "String_Node_Str";
  while (entries.hasMoreElements()) {
    JarEntry e=entries.nextElement();
    if (!e.isDirectory() && e.getName().startsWith(parent) && e.getName().endsWith("String_Node_Str")) {
      analyzeClassFile(URI.create(jarBase + e.getName()));
    }
  }
}

Fixed version (ground truth):
private void indexJar(File file,String parent){
  final JarFile jar=getJarFile(file);
  final Enumeration<JarEntry> entries=jar.entries();
  while (entries.hasMoreElements()) {
    JarEntry e=entries.nextElement();
    if (!e.isDirectory() && e.getName().startsWith(parent) && e.getName().endsWith("String_Node_Str")) {
      analyzeClassFile(jar,e);
    }
  }
  try {
    jar.close();
  }
 catch (  IOException ex) {
    String s="String_Node_Str" + jar.getName();
    LOGGER.severe(s);
  }
}
Program: 51327
Project: 51327
Buggy source:
/** 
 * Parse the content of the given URL as a provider-configuration file.
 * @param service  The service class for which providers are being sought;used to construct error detail strings
 * @param u        The URL naming the configuration file to be parsed
 * @param returned A Set containing the names of provider classes that have alreadybeen returned.  This set will be updated to contain the names that will be yielded from the returned <tt>Iterator</tt>.
 * @return A (possibly empty) <tt>Iterator</tt> that will yield theprovider-class names in the given configuration file that are not yet members of the returned set
 * @throws ServiceConfigurationError If an I/O error occurs while reading from the given URL, orif a configuration-file format error is detected
 */
@SuppressWarnings({"String_Node_Str"}) private static Iterator<String> parse(Class service,URL u,Set<String> returned) throws ServiceConfigurationError {
  InputStream in=null;
  BufferedReader r=null;
  ArrayList<String> names=new ArrayList<String>();
  try {
    in=u.openStream();
    r=new BufferedReader(new InputStreamReader(in,"String_Node_Str"));
    int lc=1;
    while ((lc=parseLine(service,u,r,lc,names,returned)) >= 0)     ;
  }
 catch (  IOException x) {
    fail(service,"String_Node_Str" + x);
  }
 finally {
    try {
      if (r != null)       r.close();
      if (in != null)       in.close();
    }
 catch (    IOException y) {
      fail(service,"String_Node_Str" + y);
    }
  }
  return names.iterator();
}

Fixed version (ground truth):
/** 
 * Parse the content of the given URL as a provider-configuration file.
 * @param service  The service class for which providers are being sought;used to construct error detail strings
 * @param u        The URL naming the configuration file to be parsed
 * @param returned A Set containing the names of provider classes that have alreadybeen returned.  This set will be updated to contain the names that will be yielded from the returned <tt>Iterator</tt>.
 * @return A (possibly empty) <tt>Iterator</tt> that will yield theprovider-class names in the given configuration file that are not yet members of the returned set
 * @throws ServiceConfigurationError If an I/O error occurs while reading from the given URL, orif a configuration-file format error is detected
 */
@SuppressWarnings({"String_Node_Str"}) private static Iterator<String> parse(Class service,URL u,Set<String> returned) throws ServiceConfigurationError {
  InputStream in=null;
  BufferedReader r=null;
  ArrayList<String> names=new ArrayList<String>();
  try {
    URLConnection uConn=u.openConnection();
    uConn.setDefaultUseCaches(false);
    in=uConn.getInputStream();
    r=new BufferedReader(new InputStreamReader(in,"String_Node_Str"));
    int lc=1;
    while ((lc=parseLine(service,u,r,lc,names,returned)) >= 0)     ;
  }
 catch (  IOException x) {
    fail(service,"String_Node_Str" + x);
  }
 finally {
    try {
      if (r != null)       r.close();
      if (in != null)       in.close();
    }
 catch (    IOException y) {
      fail(service,"String_Node_Str" + y);
    }
  }
  return names.iterator();
}
Program: 51330
Project: 51330
Buggy source:
public void writeAttribute(String prefix,String namespaceURI,String localName,String value) throws XMLStreamException {
  writeStartElement(prefix,"String_Node_Str" + localName,namespaceURI);
  writeCharacters(value);
  writeEndElement();
}

Fixed version (ground truth):
public void writeAttribute(String prefix,String namespaceURI,String localName,String value) throws XMLStreamException {
  processingStack.get(depth).hasAttributes=true;
  writeStartElement(prefix,"String_Node_Str" + localName,namespaceURI);
  writeCharacters(value);
  writeEndElement();
}
Program: 51331
Project: 51331
Buggy source:
public void writeCharacters(String text) throws XMLStreamException {
  try {
    if (isNonString(processingStack.get(depth - 1).currentName)) {
      processingStack.get(depth).writer.write(JsonEncoder.encode(text));
    }
 else {
      processingStack.get(depth).writer.write("String_Node_Str" + JsonEncoder.encode(text) + "String_Node_Str");
    }
    processingStack.get(depth).lastWasPrimitive=true;
  }
 catch (  IOException ex) {
    Logger.getLogger(JsonXmlStreamWriter.class.getName()).log(Level.SEVERE,null,ex);
  }
}

Fixed version (ground truth):
public void writeCharacters(String text) throws XMLStreamException {
  if (processingStack.get(depth).hasAttributes) {
    writeStartElement(null,"String_Node_Str",null);
    writeCharacters(text);
    writeEndElement();
  }
 else {
    try {
      if (isNonString(processingStack.get(depth - 1).currentName)) {
        processingStack.get(depth).writer.write(JsonEncoder.encode(text));
      }
 else {
        processingStack.get(depth).writer.write("String_Node_Str" + JsonEncoder.encode(text) + "String_Node_Str");
      }
      processingStack.get(depth).lastWasPrimitive=true;
    }
 catch (    IOException ex) {
      Logger.getLogger(JsonXmlStreamWriter.class.getName()).log(Level.SEVERE,null,ex);
    }
  }
}
Program: 51332
Project: 51332
Buggy source:
public synchronized void allBeansTest(JSONJAXBContext context,Collection<Object> beans) throws Exception {
  JSONMarshaller marshaller=(JSONMarshaller)context.createMarshaller();
  marshaller.setProperty(JSONJAXBContext.JSON_ENABLED,Boolean.TRUE);
  marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
  JSONUnmarshaller unmarshaller=(JSONUnmarshaller)context.createUnmarshaller();
  unmarshaller.setProperty(JSONJAXBContext.JSON_ENABLED,Boolean.TRUE);
  for (  Object originalBean : beans) {
    System.out.println("String_Node_Str" + originalBean.toString());
    StringWriter sWriter=new StringWriter();
    marshaller.marshal(originalBean,sWriter);
    System.out.println(sWriter.toString());
    assertEquals(originalBean,unmarshall(unmarshaller,originalBean.getClass(),new StringReader(sWriter.toString())));
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
public synchronized void allBeansTest(JSONJAXBContext context,Collection<Object> beans) throws Exception {
  JSONMarshaller marshaller=(JSONMarshaller)context.createMarshaller();
  marshaller.setProperty(JSONJAXBContext.JSON_ENABLED,Boolean.TRUE);
  marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
  JSONUnmarshaller unmarshaller=(JSONUnmarshaller)context.createUnmarshaller();
  unmarshaller.setProperty(JSONJAXBContext.JSON_ENABLED,Boolean.TRUE);
  for (  Object originalBean : beans) {
    System.out.println("String_Node_Str" + originalBean.toString());
    JAXBContext ctx=JAXBContext.newInstance(originalBean.getClass());
    Marshaller m=ctx.createMarshaller();
    m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
    m.marshal(originalBean,System.out);
    StringWriter sWriter=new StringWriter();
    marshaller.marshal(originalBean,sWriter);
    System.out.println(sWriter.toString());
    assertEquals(originalBean,unmarshall(unmarshaller,originalBean.getClass(),new StringReader(sWriter.toString())));
    System.out.println("String_Node_Str");
  }
}
Program: 51335
Project: 51335
Buggy source:
private void appendPath(String segment){
  if (segment == null || segment.length() == 0)   return;
  segment=encode(segment,UriComponent.Type.PATH);
  final boolean pathEndsInSlash=path.length() > 0 && path.charAt(path.length() - 1) == '/';
  final boolean segmentStartsWithSlash=segment.charAt(0) == '/';
  if (!pathEndsInSlash && !segmentStartsWithSlash) {
    path.append('/');
  }
 else   if (pathEndsInSlash && segmentStartsWithSlash) {
    segment=segment.substring(1);
    if (segment.length() == 0)     return;
  }
  path.append(segment);
}

Fixed version (ground truth):
private void appendPath(String segment){
  if (segment == null || segment.length() == 0)   return;
  segment=encode(segment,UriComponent.Type.PATH);
  final boolean pathEndsInSlash=path.length() > 0 && path.charAt(path.length() - 1) == '/';
  final boolean segmentStartsWithSlash=segment.charAt(0) == '/';
  if (path.length() > 0 && !pathEndsInSlash && !segmentStartsWithSlash) {
    path.append('/');
  }
 else   if (pathEndsInSlash && segmentStartsWithSlash) {
    segment=segment.substring(1);
    if (segment.length() == 0)     return;
  }
  path.append(segment);
}
Program: 51336
Project: 51336
Buggy source:
private String create(){
  StringBuilder sb=new StringBuilder();
  if (scheme != null)   sb.append(scheme).append(':');
  if (userInfo != null || host != null || port != -1) {
    sb.append("String_Node_Str");
    if (userInfo != null && userInfo.length() > 0)     sb.append(userInfo).append('@');
    if (host != null) {
      sb.append(host);
    }
    if (port != -1)     sb.append(':').append(port);
  }
  if (path.length() > 0)   sb.append(path);
  if (query.length() > 0)   sb.append('?').append(query);
  if (fragment != null && fragment.length() > 0)   sb.append('#').append(fragment);
  return sb.toString();
}

Fixed version (ground truth):
private String create(){
  StringBuilder sb=new StringBuilder();
  if (scheme != null)   sb.append(scheme).append(':');
  if (userInfo != null || host != null || port != -1) {
    sb.append("String_Node_Str");
    if (userInfo != null && userInfo.length() > 0)     sb.append(userInfo).append('@');
    if (host != null) {
      sb.append(host);
    }
    if (port != -1)     sb.append(':').append(port);
  }
  if (path.length() > 0) {
    if (sb.length() > 0 && path.charAt(0) != '/')     sb.append("String_Node_Str");
    sb.append(path);
  }
  if (query.length() > 0)   sb.append('?').append(query);
  if (fragment != null && fragment.length() > 0)   sb.append('#').append(fragment);
  return sb.toString();
}
Program: 51337
Project: 51337
Buggy source:
public void testAppendPath(){
  URI bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
}

Fixed version (ground truth):
public void testAppendPath(){
  URI bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
  bu=UriBuilder.fromUri("String_Node_Str").path("String_Node_Str").build();
  assertEquals(URI.create("String_Node_Str"),bu);
}
Program: 51338
Project: 51338
Buggy source:
public abstract MultivaluedMap<String,String> getMetadata();

Fixed version (ground truth):
/** 
 * Get the HTTP metadata
 * @return the HTTP metadata.
 */
public abstract MultivaluedMap<String,String> getMetadata();
Program: 51339
Project: 51339
Buggy source:
public abstract boolean hasEntity();

Fixed version (ground truth):
/** 
 * @return true if there is an entity present in the response.
 */
public abstract boolean hasEntity();
Program: 51340
Project: 51340
Buggy source:
public abstract Map<String,Object> getProperties();

Fixed version (ground truth):
/** 
 * Get a list of response properties.
 * @return the list of response properties.
 */
public abstract Map<String,Object> getProperties();
Program: 51341
Project: 51341
Buggy source:
public abstract int getStatus();

Fixed version (ground truth):
/** 
 * Get the status code.
 * @return the status code.
 */
public abstract int getStatus();
Program: 51342
Project: 51342
Buggy source:
public abstract <T>T getEntity(Class<T> c) throws IllegalArgumentException ;

Fixed version (ground truth):
/** 
 * Get the entity of the response.
 * @param c the type of the entity.
 * @return an instance of the type <code>c</code>.
 * @throws java.lang.IllegalArgumentException
 */
public abstract <T>T getEntity(Class<T> c) throws IllegalArgumentException ;
Program: 51344
Project: 51344
Buggy source:
WadlMethodDispatcher(AbstractResource resource){
  this.a=WadlGenerator.generate(resource);
}

Fixed version (ground truth):
WadlMethodDispatcher(AbstractResource resource,String path){
  this.resource=resource;
  this.path=path;
}
Program: 51345
Project: 51345
Buggy source:
public void dispatch(final Object resource,final HttpRequestContext requestContext,final HttpResponseContext responseContext){
  if (a.getResources().getBase() == null) {
    a.getResources().setBase(requestContext.getBaseUri().toString());
    Resource r=a.getResources().getResource().get(0);
    String p=requestContext.getBaseUri().relativize(requestContext.getAbsolutePath()).toString();
    r.setPath(p);
    r.getParam().clear();
  }
  responseContext.setResponse(Response.ok(a,MediaTypes.WADL).build());
}

Fixed version (ground truth):
public void dispatch(final Object o,final HttpRequestContext requestContext,final HttpResponseContext responseContext){
  final Application a=generate();
  a.getResources().setBase(requestContext.getBaseUri().toString());
  final Resource r=a.getResources().getResource().get(0);
  r.setPath(requestContext.getBaseUri().relativize(requestContext.getAbsolutePath()).toString());
  r.getParam().clear();
  responseContext.setResponse(Response.ok(a,MediaTypes.WADL).build());
}
Program: 51346
Project: 51346
Buggy source:
public void testGetSubResourceWadl() throws ParserConfigurationException, SAXException, IOException, XPathExpressionException {
  initiateWebApplication(WidgetsResource.class,ExtraResource.class);
  ResourceProxy r=resourceProxy("String_Node_Str");
  File tmpFile=r.acceptable(MediaTypes.WADL).get(File.class);
  DocumentBuilderFactory bf=DocumentBuilderFactory.newInstance();
  bf.setNamespaceAware(true);
  bf.setValidating(false);
  bf.setXIncludeAware(false);
  DocumentBuilder b=bf.newDocumentBuilder();
  Document d=b.parse(tmpFile);
  printSource(new DOMSource(d));
  XPath xp=XPathFactory.newInstance().newXPath();
  xp.setNamespaceContext(new NSResolver("String_Node_Str","String_Node_Str"));
  String val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
  val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
  val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
  val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
  val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
}

Fixed version (ground truth):
public void testGetSubResourceWadl() throws ParserConfigurationException, SAXException, IOException, XPathExpressionException {
  initiateWebApplication(WidgetsResource.class,ExtraResource.class);
  ResourceProxy r=resourceProxy("String_Node_Str");
  File tmpFile=r.acceptable(MediaTypes.WADL).get(File.class);
  DocumentBuilderFactory bf=DocumentBuilderFactory.newInstance();
  bf.setNamespaceAware(true);
  bf.setValidating(false);
  bf.setXIncludeAware(false);
  DocumentBuilder b=bf.newDocumentBuilder();
  Document d=b.parse(tmpFile);
  printSource(new DOMSource(d));
  XPath xp=XPathFactory.newInstance().newXPath();
  xp.setNamespaceContext(new NSResolver("String_Node_Str","String_Node_Str"));
  String val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
  val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
  val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
  val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
}
Program: 51347
Project: 51347
Buggy source:
public void testRecursive() throws ParserConfigurationException, SAXException, IOException, XPathExpressionException {
  initiateWebApplication(RootResource.class);
  ResourceProxy r=resourceProxy("String_Node_Str");
  File tmpFile=r.acceptable(MediaTypes.WADL).get(File.class);
  DocumentBuilderFactory bf=DocumentBuilderFactory.newInstance();
  bf.setNamespaceAware(true);
  bf.setValidating(false);
  bf.setXIncludeAware(false);
  DocumentBuilder b=bf.newDocumentBuilder();
  Document d=b.parse(tmpFile);
  printSource(new DOMSource(d));
  XPath xp=XPathFactory.newInstance().newXPath();
  xp.setNamespaceContext(new NSResolver("String_Node_Str","String_Node_Str"));
  String val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
}

Fixed version (ground truth):
public void testRecursive() throws ParserConfigurationException, SAXException, IOException, XPathExpressionException {
  initiateWebApplication(RootResource.class);
  ResourceProxy r=resourceProxy("String_Node_Str");
  File tmpFile=r.acceptable(MediaTypes.WADL).get(File.class);
  DocumentBuilderFactory bf=DocumentBuilderFactory.newInstance();
  bf.setNamespaceAware(true);
  bf.setValidating(false);
  bf.setXIncludeAware(false);
  DocumentBuilder b=bf.newDocumentBuilder();
  Document d=b.parse(tmpFile);
  printSource(new DOMSource(d));
  XPath xp=XPathFactory.newInstance().newXPath();
  xp.setNamespaceContext(new NSResolver("String_Node_Str","String_Node_Str"));
  String val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
  val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
  r=resourceProxy("String_Node_Str");
  tmpFile=r.acceptable(MediaTypes.WADL).get(File.class);
  bf=DocumentBuilderFactory.newInstance();
  bf.setNamespaceAware(true);
  bf.setValidating(false);
  bf.setXIncludeAware(false);
  b=bf.newDocumentBuilder();
  d=b.parse(tmpFile);
  printSource(new DOMSource(d));
  xp=XPathFactory.newInstance().newXPath();
  xp.setNamespaceContext(new NSResolver("String_Node_Str","String_Node_Str"));
  val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
  val=(String)xp.evaluate("String_Node_Str",d,XPathConstants.STRING);
  assertEquals(val,"String_Node_Str");
}
Program: 51348
Project: 51348
Buggy source:
public UriBuilder schemeSpecificPart(String ssp){
  URI uri=createURI(null,ssp,null);
  userInfo=uri.getRawUserInfo();
  host=uri.getHost();
  port=uri.getPort();
  path=new StringBuilder(replaceNull(uri.getRawPath()));
  query=new StringBuilder(replaceNull(uri.getRawQuery()));
  return this;
}

Fixed version (ground truth):
public UriBuilder schemeSpecificPart(String ssp){
  URI uri=createURI(null,ssp,null);
  userInfo=uri.getRawUserInfo();
  host=uri.getHost();
  port=uri.getPort();
  path.setLength(0);
  path.append(replaceNull(uri.getRawPath()));
  query.setLength(0);
  query.append(replaceNull(uri.getRawQuery()));
  return this;
}
Program: 51349
Project: 51349
Buggy source:
public UriBuilder uri(String uri){
  uri(createURI(uri));
  return this;
}

Fixed version (ground truth):
public UriBuilder uri(URI uri){
  if (uri.getScheme() != null)   scheme=uri.getScheme();
  if (uri.getRawUserInfo() != null)   userInfo=uri.getRawUserInfo();
  if (uri.getHost() != null)   host=uri.getHost();
  if (uri.getPort() != -1)   port=uri.getPort();
  if (uri.getRawPath() != null && uri.getRawPath().length() > 0) {
    path.setLength(0);
    path.append(uri.getRawPath());
  }
  if (uri.getRawQuery() != null && uri.getRawQuery().length() > 0) {
    query.setLength(0);
    query.append(uri.getRawQuery());
  }
  if (uri.getRawFragment() != null)   fragment=uri.getRawFragment();
  return this;
}
Program: 51350
Project: 51350
Buggy source:
public FormURLEncodedProperties readFrom(Class<FormURLEncodedProperties> type,MediaType mediaType,MultivaluedMap<String,String> headers,InputStream entityStream) throws IOException {
  String decoded=URLDecoder.decode(readFromAsString(entityStream),"String_Node_Str");
  FormURLEncodedProperties map=new FormURLEncodedProperties();
  StringTokenizer tokenizer=new StringTokenizer(decoded,"String_Node_Str");
  String token;
  while (tokenizer.hasMoreTokens()) {
    token=tokenizer.nextToken();
    int idx=token.indexOf('=');
    if (idx < 0) {
      map.put(token,null);
    }
 else     if (idx > 0) {
      map.put(token.substring(0,idx),token.substring(idx + 1));
    }
  }
  return map;
}

Fixed version (ground truth):
public FormURLEncodedProperties readFrom(Class<FormURLEncodedProperties> type,MediaType mediaType,MultivaluedMap<String,String> headers,InputStream entityStream) throws IOException {
  String encoded=readFromAsString(entityStream);
  FormURLEncodedProperties map=new FormURLEncodedProperties();
  StringTokenizer tokenizer=new StringTokenizer(encoded,"String_Node_Str");
  String token;
  while (tokenizer.hasMoreTokens()) {
    token=tokenizer.nextToken();
    int idx=token.indexOf('=');
    if (idx < 0) {
      map.put(URLDecoder.decode(token,"String_Node_Str"),null);
    }
 else     if (idx > 0) {
      map.put(URLDecoder.decode(token.substring(0,idx),"String_Node_Str"),URLDecoder.decode(token.substring(idx + 1),"String_Node_Str"));
    }
  }
  return map;
}
Program: 51351
Project: 51351
Buggy source:
public void visitEnd(){
  if (isScoped && isAnnotated) {
    classes.add(getClassForName(className.replaceAll("String_Node_Str","String_Node_Str")));
  }
}

Fixed version (ground truth):
public void visitEnd(){
  System.out.println("String_Node_Str" + isScoped + "String_Node_Str"+ isAnnotated);
  if (isScoped && isAnnotated) {
    classes.add(getClassForName(className.replaceAll("String_Node_Str","String_Node_Str")));
  }
}
Program: 51352
Project: 51352
Buggy source:
public AnnotationVisitor visitAnnotation(String desc,boolean visible){
  isAnnotated=annotations.contains(desc);
  return null;
}

Fixed version (ground truth):
public AnnotationVisitor visitAnnotation(String desc,boolean visible){
  isAnnotated|=annotations.contains(desc);
  return null;
}
Program: 51353
Project: 51353
Buggy source:
private void indexDir(File root){
  for (  File child : root.listFiles()) {
    if (child.isDirectory()) {
      indexDir(child);
    }
 else     if (child.getName().endsWith("String_Node_Str")) {
      indexJar(child);
    }
 else     if (child.getName().endsWith("String_Node_Str")) {
      analyzeClassFile(child.toURI());
    }
  }
}

Fixed version (ground truth):
private void indexDir(File root){
  for (  File child : root.listFiles()) {
    if (child.isDirectory()) {
      indexDir(child);
    }
 else     if (child.getName().endsWith("String_Node_Str")) {
      indexJar(child);
    }
 else     if (child.getName().endsWith("String_Node_Str")) {
      System.out.println("String_Node_Str" + child);
      analyzeClassFile(child.toURI());
    }
  }
}
Program: 51354
Project: 51354
Buggy source:
public void writeTo(InputStream t,MediaType mediaType,MultivaluedMap<String,Object> headers,OutputStream entityStream) throws IOException {
  writeTo(t,entityStream);
}

Fixed version (ground truth):
public void writeTo(InputStream t,MediaType mediaType,MultivaluedMap<String,Object> headers,OutputStream entityStream) throws IOException {
  writeTo(t,entityStream);
  t.close();
}
Program: 51355
Project: 51355
Buggy source:
private void initiateUriInfo(){
  UriBuilder absoluteUriBuilder=UriBuilder.fromUri(request.getRequestURL().toString());
  final String decodedBasePath=(request.getPathInfo() != null) ? request.getContextPath() + request.getServletPath() + "String_Node_Str" : request.getContextPath() + "String_Node_Str";
  String decodedCompletePath;
  try {
    decodedCompletePath=(new URI(request.getRequestURI())).getPath();
  }
 catch (  URISyntaxException ex) {
    decodedCompletePath=decodedBasePath + ((request.getPathInfo() != null) ? request.getPathInfo().substring(1) : request.getServletPath().substring(1));
  }
  final String decodedPath=(decodedCompletePath.startsWith(decodedBasePath)) ? decodedCompletePath.substring(decodedBasePath.length()) : decodedCompletePath;
  String queryParameters=request.getQueryString();
  if (queryParameters == null)   queryParameters="String_Node_Str";
  this.baseUri=absoluteUriBuilder.replacePath(decodedBasePath).build();
  this.completeUri=absoluteUriBuilder.encode(true).path(decodedPath).encode(false).replaceQueryParams(queryParameters).build();
}

Fixed version (ground truth):
private void initiateUriInfo(){
  UriBuilder absoluteUriBuilder=UriBuilder.fromUri(request.getRequestURL().toString());
  final String decodedBasePath=(request.getPathInfo() != null) ? request.getContextPath() + request.getServletPath() + "String_Node_Str" : request.getContextPath() + "String_Node_Str";
  final String encodedBasePath=UriBuilder.fromPath(decodedBasePath,true).build().toString();
  String encodedCompletePath;
  try {
    encodedCompletePath=(new URI(request.getRequestURI())).getRawPath();
  }
 catch (  URISyntaxException ex) {
    encodedCompletePath=encodedBasePath + ((request.getPathInfo() != null) ? request.getPathInfo().substring(1) : request.getServletPath().substring(1));
  }
  final String encodedPath=(encodedCompletePath.startsWith(encodedBasePath)) ? encodedCompletePath.substring(encodedBasePath.length()) : encodedCompletePath;
  String queryParameters=request.getQueryString();
  if (queryParameters == null)   queryParameters="String_Node_Str";
  this.baseUri=absoluteUriBuilder.replacePath(decodedBasePath).build();
  this.completeUri=absoluteUriBuilder.encode(false).path(encodedPath).replaceQueryParams(queryParameters).build();
}
Program: 51356
Project: 51356
Buggy source:
public void writeTo(File t,MediaType mediaType,MultivaluedMap<String,Object> headers,OutputStream entityStream) throws IOException {
  InputStream in=new FileInputStream(t);
  writeTo(in,entityStream);
  in.close();
}

Fixed version (ground truth):
public void writeTo(File t,MediaType mediaType,MultivaluedMap<String,Object> headers,OutputStream entityStream) throws IOException {
  InputStream in=new BufferedInputStream(new FileInputStream(t));
  writeTo(in,entityStream);
  in.close();
}
Program: 51357
Project: 51357
Buggy source:
public File readFrom(Class<File> type,MediaType mediaType,MultivaluedMap<String,String> headers,InputStream entityStream) throws IOException {
  File f=File.createTempFile("String_Node_Str","String_Node_Str");
  OutputStream out=new FileOutputStream(f);
  writeTo(entityStream,out);
  out.close();
  return f;
}

Fixed version (ground truth):
public File readFrom(Class<File> type,MediaType mediaType,MultivaluedMap<String,String> headers,InputStream entityStream) throws IOException {
  File f=File.createTempFile("String_Node_Str","String_Node_Str");
  OutputStream out=new BufferedOutputStream(new FileOutputStream(f));
  writeTo(entityStream,out);
  out.close();
  return f;
}
Program: 51358
Project: 51358
Buggy source:
void commitAll() throws IOException {
  if (isCommitted()) {
    exchange.close();
    return;
  }
  commitHeaders();
  Object entity=this.getEntity();
  if (entity != null) {
    exchange.sendResponseHeaders(this.getStatus(),0);
    writeEntity(entity,getUnderlyingOutputStream());
  }
 else {
    exchange.sendResponseHeaders(this.getStatus(),-1);
  }
  exchange.close();
}

Fixed version (ground truth):
void commitAll() throws IOException {
  if (isCommitted()) {
    exchange.close();
    return;
  }
  commitHeaders();
  Object entity=this.getEntity();
  if (entity != null) {
    exchange.sendResponseHeaders(this.getStatus(),0);
    writeEntity(entity,getUnderlyingOutputStream());
  }
 else {
    exchange.sendResponseHeaders(this.getStatus(),-1);
  }
  exchange.getResponseBody().close();
  exchange.close();
}
Program: 51359
Project: 51359
Buggy source:
@RequestMapping(method=RequestMethod.POST) public String processSubmit(@ModelAttribute("String_Node_Str") Customer customer,BindingResult result,SessionStatus status,HttpSession session){
  loginValidator.validate(customer,result);
  if (result.hasErrors()) {
    return "String_Node_Str";
  }
 else {
    status.setComplete();
    session.setAttribute("String_Node_Str",customer.getUserName());
    return "String_Node_Str" + customer.getUserName();
  }
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST) public String processSubmit(@ModelAttribute("String_Node_Str") Customer customer,BindingResult result,SessionStatus status,HttpSession session){
  loginValidator.validate(customer,result);
  String returnStr;
  if (result.hasErrors()) {
    returnStr="String_Node_Str";
  }
 else {
    status.setComplete();
    Customer dbCustomer=null;
    try {
      dbCustomer=customerDao.getCustomerByUserName(customer.getUserName());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (dbCustomer != null) {
      session.setAttribute("String_Node_Str",dbCustomer);
      returnStr="String_Node_Str" + customer.getUserName();
    }
 else {
      result.addError(new ObjectError("String_Node_Str","String_Node_Str" + customer.getUserName() + "String_Node_Str"));
      returnStr="String_Node_Str";
    }
  }
  return returnStr;
}
Program: 51360
Project: 51360
Buggy source:
@RequestMapping(method=RequestMethod.POST) public String processSubmit(@ModelAttribute("String_Node_Str") Customer customer,BindingResult result,SessionStatus status,HttpSession session){
  profileValidator.validate(customer,result);
  if (result.hasErrors()) {
  }
 else {
    status.setComplete();
    try {
      Customer cust=customerDao.saveOrUpdateCustomer(customer);
      session.setAttribute("String_Node_Str",cust);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST) public String processSubmit(@ModelAttribute("String_Node_Str") Customer customer,BindingResult result,SessionStatus status,HttpSession session,ModelMap model){
  profileValidator.validate(customer,result);
  if (result.hasErrors()) {
  }
 else {
    try {
      Customer sessionCustomer=(Customer)session.getAttribute("String_Node_Str");
      sessionCustomer.setAccountType(customer.getAccountType());
      sessionCustomer.setEmail(customer.getEmail());
      sessionCustomer.setFirstName(customer.getFirstName());
      sessionCustomer.setLastName(customer.getLastName());
      sessionCustomer.setPassword(customer.getPassword());
      customer=customerDao.updateCustomer(new Customer(sessionCustomer));
      customer.setUserName(sessionCustomer.getUserName());
      customer.setTootList(sessionCustomer.getTootList());
      model.addAttribute("String_Node_Str",customer);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    status.setComplete();
  }
  return "String_Node_Str";
}
Program: 51361
Project: 51361
Buggy source:
@RequestMapping(method=RequestMethod.GET) public String initForm(ModelMap model,HttpSession session){
  Customer cust=(Customer)session.getAttribute("String_Node_Str");
  ;
  try {
    cust=customerDao.getCustomerByUserName(cust.getUserName());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  model.addAttribute("String_Node_Str",cust);
  return "String_Node_Str";
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET) public String initForm(ModelMap model,HttpSession session){
  Customer customer=(Customer)session.getAttribute("String_Node_Str");
  model.addAttribute("String_Node_Str",customer);
  return customer == null ? "String_Node_Str" : "String_Node_Str";
}
Program: 51362
Project: 51362
Buggy source:
@RequestMapping(method=RequestMethod.POST) public String processSubmit(@ModelAttribute("String_Node_Str") Customer customer,BindingResult result,SessionStatus status){
  singUpValidator.validate(customer,result);
  if (result.hasErrors()) {
    return "String_Node_Str";
  }
 else {
    status.setComplete();
    try {
      customer.setUserName(customer.getFirstName().toLowerCase() + customer.getLastName().toLowerCase());
      customerDao.saveOrUpdateCustomer(customer);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST) public String processSubmit(@ModelAttribute("String_Node_Str") Customer customer,BindingResult result,SessionStatus status){
  singUpValidator.validate(customer,result);
  if (result.hasErrors()) {
    return "String_Node_Str";
  }
 else {
    status.setComplete();
    try {
      String userName=customer.getFirstName().toLowerCase() + customer.getLastName().toLowerCase();
      DataStore dataStore=stormpathSDKService.getStormpathSDKClient().getDataStore();
      Directory directory=dataStore.load(stormpathSDKService.getRestURL(),Directory.class);
      Account account=dataStore.instantiate(Account.class);
      account.setEmail(customer.getEmail());
      account.setGivenName(customer.getFirstName());
      account.setSurname(customer.getLastName());
      account.setPassword(customer.getPassword());
      account.setUsername(userName);
      directory.createAccount(account);
      customer.setUserName(userName);
      customerDao.saveCustomer(customer);
    }
 catch (    ResourceException re) {
      result.addError(new ObjectError("String_Node_Str",re.getMessage()));
      re.printStackTrace();
      return "String_Node_Str";
    }
catch (    Exception e) {
      e.printStackTrace();
    }
    return "String_Node_Str";
  }
}
Program: 51363
Project: 51363
Buggy source:
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public String processSubmit(@ModelAttribute("String_Node_Str") Toot toot,BindingResult result,SessionStatus status,HttpSession session){
  tootValidator.validate(toot,result);
  if (result.hasErrors()) {
    return "String_Node_Str";
  }
 else {
    Customer sessionCustomer=(Customer)session.getAttribute("String_Node_Str");
    Customer persistCustomer=new Customer();
    persistCustomer.setId(sessionCustomer.getId());
    List<Toot> tootList=new ArrayList<Toot>();
    Toot persistToot=new Toot();
    persistToot.setTootMessage(toot.getTootMessage());
    persistToot.setCustomer(persistCustomer);
    try {
      tootDao.saveToot(persistToot);
      tootList=tootDao.getTootsByUserId(persistCustomer.getId());
      sessionCustomer.setTootList(tootList);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    toot.setTootMessage("String_Node_Str");
    toot.setCustomer(sessionCustomer);
    status.setComplete();
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public String processSubmit(@ModelAttribute("String_Node_Str") Toot toot,BindingResult result,SessionStatus status,HttpSession session){
  tootValidator.validate(toot,result);
  if (result.hasErrors()) {
    return "String_Node_Str";
  }
 else {
    Customer sessionCustomer=(Customer)session.getAttribute("String_Node_Str");
    Customer persistCustomer=new Customer(sessionCustomer);
    List<Toot> tootList;
    Toot persistToot=new Toot();
    persistToot.setTootMessage(toot.getTootMessage());
    persistToot.setCustomer(persistCustomer);
    try {
      tootDao.saveToot(persistToot);
      toot.setTootId(persistToot.getTootId());
      tootList=tootDao.getTootsByUserId(persistCustomer.getId());
      sessionCustomer.setTootList(tootList);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    toot.setTootMessage("String_Node_Str");
    toot.setCustomer(sessionCustomer);
    status.setComplete();
    return "String_Node_Str";
  }
}
Program: 51364
Project: 51364
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public String initForm(@RequestParam("String_Node_Str") String userName,ModelMap model,@ModelAttribute("String_Node_Str") Toot toot,BindingResult result,HttpSession session){
  List<Toot> tootList=new ArrayList<Toot>();
  Toot tooot=new Toot();
  try {
    Object accountIdAtt=session.getAttribute("String_Node_Str");
    String accountId=accountIdAtt == null ? userName : (String)accountIdAtt;
    session.removeAttribute("String_Node_Str");
    Object sessionCustObj=session.getAttribute("String_Node_Str");
    Integer custId=sessionCustObj == null ? 0 : ((Customer)sessionCustObj).getId();
    Customer customer=customerDao.getCustomerByUserName(accountId);
    session.setAttribute("String_Node_Str",customer);
    tootList=tootDao.getTootsByUserId(custId > 0 ? custId : customer.getId());
    customer.setTootList(tootList);
    tooot.setCustomer(customer);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  model.addAttribute("String_Node_Str",tooot);
  return "String_Node_Str";
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public String initForm(@RequestParam("String_Node_Str") String userName,ModelMap model,@ModelAttribute("String_Node_Str") Toot toot,BindingResult result,HttpSession session){
  List<Toot> tootList;
  Toot tooot=new Toot();
  try {
    Object objCustomer=session.getAttribute("String_Node_Str");
    Customer customer=null;
    if (objCustomer == null) {
      customer=customerDao.getCustomerByUserName(userName);
    }
 else {
      customer=(Customer)objCustomer;
    }
    tootList=tootDao.getTootsByUserId(customer.getId());
    customer.setTootList(tootList);
    tooot.setCustomer(customer);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  model.addAttribute("String_Node_Str",tooot);
  return "String_Node_Str";
}
Program: 51365
Project: 51365
Buggy source:
@RequestMapping("String_Node_Str") public String removeToot(@RequestParam("String_Node_Str") String userName,@RequestParam("String_Node_Str") String removeTootId,ModelMap model,@ModelAttribute("String_Node_Str") Toot toot,HttpSession session){
  try {
    tootDao.removeTootById(Integer.valueOf(removeTootId));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return "String_Node_Str" + userName;
}

Fixed version (ground truth):
@RequestMapping("String_Node_Str") public String removeToot(@RequestParam("String_Node_Str") String userName,@RequestParam("String_Node_Str") String removeTootId,ModelMap model,@ModelAttribute("String_Node_Str") Toot toot,HttpSession session){
  try {
    tootDao.removeTootById(Integer.valueOf(removeTootId));
    userName=userName == null || userName.isEmpty() ? ((Customer)session.getAttribute("String_Node_Str")).getUserName() : userName;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return "String_Node_Str" + userName;
}