Program: 30356
Project: 30356
Buggy source:
private FrameAnimation getFrameAnimation(String id){
  FrameAnimation fa=fanims.get(id);
  flipX=false;
  if (fa == null) {
    String flipId=FrameAnimation.getFlipId(id);
    fa=fanims.get(flipId);
    if (fa != null)     flipX=true;
 else {
      StringBuilder sb=new StringBuilder();
      if (id.endsWith(FrameAnimation.FRONTLEFT) || id.endsWith(FrameAnimation.FRONTRIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONT);
      }
 else       if (id.endsWith(FrameAnimation.BACKLEFT) || id.endsWith(FrameAnimation.BACKRIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.BACK);
      }
 else       if (id.endsWith(FrameAnimation.LEFT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONTLEFT);
      }
 else       if (id.endsWith(FrameAnimation.RIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONTRIGHT);
      }
      String s=sb.toString();
      fa=fanims.get(s);
      if (fa == null) {
        flipId=FrameAnimation.getFlipId(s);
        fa=fanims.get(flipId);
        if (fa != null) {
          flipX=true;
        }
 else         if (s.endsWith(FrameAnimation.FRONT) || s.endsWith(FrameAnimation.BACK)) {
          if (id.endsWith(FrameAnimation.LEFT)) {
            sb.append(id.substring(0,id.lastIndexOf('.') + 1));
            sb.append(FrameAnimation.LEFT);
          }
 else {
            sb.append(id.substring(0,id.lastIndexOf('.') + 1));
            sb.append(FrameAnimation.RIGHT);
          }
          s=sb.toString();
          fa=fanims.get(s);
          if (fa == null) {
            flipId=FrameAnimation.getFlipId(s);
            fa=fanims.get(flipId);
            if (fa != null) {
              flipX=true;
            }
          }
        }
      }
    }
  }
  return fa;
}

Fixed version (ground truth):
private FrameAnimation getFrameAnimation(String id){
  FrameAnimation fa=fanims.get(id);
  flipX=false;
  if (fa == null && id.indexOf('.') != -1) {
    String flipId=FrameAnimation.getFlipId(id);
    fa=fanims.get(flipId);
    if (fa != null)     flipX=true;
 else {
      StringBuilder sb=new StringBuilder();
      if (id.endsWith(FrameAnimation.FRONTLEFT) || id.endsWith(FrameAnimation.FRONTRIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONT);
      }
 else       if (id.endsWith(FrameAnimation.BACKLEFT) || id.endsWith(FrameAnimation.BACKRIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.BACK);
      }
 else       if (id.endsWith(FrameAnimation.LEFT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONTLEFT);
      }
 else       if (id.endsWith(FrameAnimation.RIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONTRIGHT);
      }
      String s=sb.toString();
      fa=fanims.get(s);
      if (fa == null) {
        flipId=FrameAnimation.getFlipId(s);
        fa=fanims.get(flipId);
        if (fa != null) {
          flipX=true;
        }
 else         if (s.endsWith(FrameAnimation.FRONT) || s.endsWith(FrameAnimation.BACK)) {
          if (id.endsWith(FrameAnimation.LEFT)) {
            sb.append(id.substring(0,id.lastIndexOf('.') + 1));
            sb.append(FrameAnimation.LEFT);
          }
 else {
            sb.append(id.substring(0,id.lastIndexOf('.') + 1));
            sb.append(FrameAnimation.RIGHT);
          }
          s=sb.toString();
          fa=fanims.get(s);
          if (fa == null) {
            flipId=FrameAnimation.getFlipId(s);
            fa=fanims.get(flipId);
            if (fa != null) {
              flipX=true;
            }
          }
        }
      }
    }
  }
  return fa;
}