Program: 101116
Project: 101116
Buggy source:
public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest httpRequest=(HttpServletRequest)request;
  String uri=URLDecoder.decode(httpRequest.getRequestURI(),"String_Node_Str");
  final HttpServletResponse httpResponse=(HttpServletResponse)response;
  ExoContainer portalContainer=ExoContainerContext.getCurrentContainer();
  SkinService skinService=(SkinService)portalContainer.getComponentInstanceOfType(SkinService.class);
  if (uri.endsWith("String_Node_Str")) {
    final OutputStream out=response.getOutputStream();
    final Appendable app=new Appendable(){
      public Appendable append(      CharSequence csq) throws IOException {
        String s=(String)csq;
        byte[] bytes=null;
        try {
          bytes=(byte[])cssCache.get(s);
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
        if (bytes == null) {
          ByteArrayOutputStream baos=new ByteArrayOutputStream(s.length() * 2);
          encoder.encode(s,0,s.length(),baos);
          baos.flush();
          bytes=baos.toByteArray();
          try {
            cssCache.put(s,bytes);
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
        }
        out.write(bytes);
        return this;
      }
      public Appendable append(      CharSequence csq,      int start,      int end) throws IOException {
        throw new UnsupportedOperationException("String_Node_Str");
      }
      public Appendable append(      char c) throws IOException {
        throw new UnsupportedOperationException("String_Node_Str");
      }
    }
;
    ResourceRenderer renderer=new ResourceRenderer(){
      public Appendable getAppendable(){
        return app;
      }
      public void setExpiration(      long seconds){
        if (seconds > 0) {
          httpResponse.addHeader("String_Node_Str","String_Node_Str" + seconds + "String_Node_Str"+ seconds);
        }
 else {
          httpResponse.setHeader("String_Node_Str","String_Node_Str");
        }
      }
    }
;
    try {
      skinService.renderCSS(renderer,uri);
      log.debug("String_Node_Str" + uri);
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + uri,e);
      httpResponse.setStatus(HttpServletResponse.SC_NOT_FOUND);
    }
  }
 else {
    final int len=uri.length();
    if (len >= 7 && uri.charAt(len - 7) == '-' && uri.charAt(len - 6) == 'r' && uri.charAt(len - 5) == 't') {
      for (      final ImageType imageType : imageTypes) {
        if (imageType.matches(uri)) {
          final String resource=uri.substring(httpRequest.getContextPath().length(),len - 7) + uri.substring(len - 4);
          FutureTask<Image> futureImg=mirroredImageCache.get(resource);
          if (futureImg == null) {
            FutureTask<Image> tmp=new FutureTask<Image>(new Callable<Image>(){
              public Image call() throws Exception {
                InputStream in=cfg.getServletContext().getResourceAsStream(resource);
                if (in == null) {
                  return null;
                }
                BufferedImage img=ImageIO.read(in);
                AffineTransform tx=AffineTransform.getScaleInstance(-1,1);
                tx.translate(-img.getWidth(null),0);
                AffineTransformOp op=new AffineTransformOp(tx,AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
                img=op.filter(img,null);
                ByteArrayOutputStream baos=new ByteArrayOutputStream(1000);
                ImageIO.write(img,imageType.getFormat(),baos);
                baos.close();
                return new Image(imageType,baos.toByteArray());
              }
            }
);
            futureImg=mirroredImageCache.putIfAbsent(resource,tmp);
            if (futureImg == null) {
              futureImg=tmp;
              futureImg.run();
            }
          }
          try {
            Image img=futureImg.get();
            if (img != null) {
              httpResponse.setContentType(img.type.getMimeType());
              httpResponse.setContentLength(img.bytes.length);
              OutputStream out=httpResponse.getOutputStream();
              out.write(img.bytes);
              out.close();
            }
 else {
              mirroredImageCache.remove(resource);
              httpResponse.setStatus(HttpServletResponse.SC_NOT_FOUND);
            }
            return;
          }
 catch (          InterruptedException e) {
            e.printStackTrace();
          }
catch (          ExecutionException e) {
            e.printStackTrace();
            mirroredImageCache.remove(resource);
          }
        }
      }
    }
    if (!PropertyManager.isDevelopping()) {
      httpResponse.addHeader("String_Node_Str","String_Node_Str");
    }
 else {
      if (uri.endsWith("String_Node_Str") || uri.endsWith("String_Node_Str")) {
        httpResponse.setHeader("String_Node_Str","String_Node_Str");
      }
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + uri);
    }
    chain.doFilter(request,response);
  }
}

Fixed version (ground truth):
public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest httpRequest=(HttpServletRequest)request;
  String uri=URLDecoder.decode(httpRequest.getRequestURI(),"String_Node_Str");
  final HttpServletResponse httpResponse=(HttpServletResponse)response;
  ExoContainer portalContainer=ExoContainerContext.getCurrentContainer();
  SkinService skinService=(SkinService)portalContainer.getComponentInstanceOfType(SkinService.class);
  if (uri.endsWith("String_Node_Str")) {
    final OutputStream out=response.getOutputStream();
    final Appendable app=new Appendable(){
      public Appendable append(      CharSequence csq) throws IOException {
        String s=(String)csq;
        byte[] bytes=null;
        try {
          bytes=(byte[])cssCache.get(s);
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
        if (bytes == null) {
          ByteArrayOutputStream baos=new ByteArrayOutputStream(s.length() * 2);
          encoder.encode(s,0,s.length(),baos);
          baos.flush();
          bytes=baos.toByteArray();
          try {
            cssCache.put(s,bytes);
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
        }
        out.write(bytes);
        return this;
      }
      public Appendable append(      CharSequence csq,      int start,      int end) throws IOException {
        throw new UnsupportedOperationException("String_Node_Str");
      }
      public Appendable append(      char c) throws IOException {
        encoder.encode(c,out);
        return this;
      }
    }
;
    ResourceRenderer renderer=new ResourceRenderer(){
      public Appendable getAppendable(){
        return app;
      }
      public void setExpiration(      long seconds){
        if (seconds > 0) {
          httpResponse.addHeader("String_Node_Str","String_Node_Str" + seconds + "String_Node_Str"+ seconds);
        }
 else {
          httpResponse.setHeader("String_Node_Str","String_Node_Str");
        }
      }
    }
;
    try {
      skinService.renderCSS(renderer,uri);
      log.debug("String_Node_Str" + uri);
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + uri,e);
      httpResponse.setStatus(HttpServletResponse.SC_NOT_FOUND);
    }
  }
 else {
    final int len=uri.length();
    if (len >= 7 && uri.charAt(len - 7) == '-' && uri.charAt(len - 6) == 'r' && uri.charAt(len - 5) == 't') {
      for (      final ImageType imageType : imageTypes) {
        if (imageType.matches(uri)) {
          final String resource=uri.substring(httpRequest.getContextPath().length(),len - 7) + uri.substring(len - 4);
          FutureTask<Image> futureImg=mirroredImageCache.get(resource);
          if (futureImg == null) {
            FutureTask<Image> tmp=new FutureTask<Image>(new Callable<Image>(){
              public Image call() throws Exception {
                InputStream in=cfg.getServletContext().getResourceAsStream(resource);
                if (in == null) {
                  return null;
                }
                BufferedImage img=ImageIO.read(in);
                AffineTransform tx=AffineTransform.getScaleInstance(-1,1);
                tx.translate(-img.getWidth(null),0);
                AffineTransformOp op=new AffineTransformOp(tx,AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
                img=op.filter(img,null);
                ByteArrayOutputStream baos=new ByteArrayOutputStream(1000);
                ImageIO.write(img,imageType.getFormat(),baos);
                baos.close();
                return new Image(imageType,baos.toByteArray());
              }
            }
);
            futureImg=mirroredImageCache.putIfAbsent(resource,tmp);
            if (futureImg == null) {
              futureImg=tmp;
              futureImg.run();
            }
          }
          try {
            Image img=futureImg.get();
            if (img != null) {
              httpResponse.setContentType(img.type.getMimeType());
              httpResponse.setContentLength(img.bytes.length);
              OutputStream out=httpResponse.getOutputStream();
              out.write(img.bytes);
              out.close();
            }
 else {
              mirroredImageCache.remove(resource);
              httpResponse.setStatus(HttpServletResponse.SC_NOT_FOUND);
            }
            return;
          }
 catch (          InterruptedException e) {
            e.printStackTrace();
          }
catch (          ExecutionException e) {
            e.printStackTrace();
            mirroredImageCache.remove(resource);
          }
        }
      }
    }
    if (!PropertyManager.isDevelopping()) {
      httpResponse.addHeader("String_Node_Str","String_Node_Str");
    }
 else {
      if (uri.endsWith("String_Node_Str") || uri.endsWith("String_Node_Str")) {
        httpResponse.setHeader("String_Node_Str","String_Node_Str");
      }
      if (log.isDebugEnabled())       log.debug("String_Node_Str" + uri);
    }
    chain.doFilter(request,response);
  }
}