Program: 53668
Project: 53668
Buggy source:
/** 
 * Best effort resymbolization of a a single stack trace element.
 * @param ste        the stack trace element to resymbolize
 * @param strongName the GWT permutation strong name
 * @return the best effort resymbolized stack trace element
 */
public StackTraceElement resymbolize(StackTraceElement ste,String strongName){
  String declaringClass=null;
  String methodName=null;
  String filename=null;
  int lineNumber=-1;
  int fragmentId=-1;
  String steFilename=ste.getFileName();
  SymbolMap map=loadSymbolMap(strongName);
  String symbolData=map == null ? null : map.get(ste.getMethodName());
  if (symbolData != null) {
    String[] parts=symbolData.split("String_Node_Str");
    if (parts.length == 6) {
      String[] ref=parse(parts[0].substring(0,parts[0].lastIndexOf(')') + 1));
      if (ref != null) {
        declaringClass=ref[0];
        methodName=ref[1];
      }
 else {
        declaringClass=ste.getClassName();
        methodName=ste.getMethodName();
      }
      filename="String_Node_Str".equals(parts[3]) ? null : parts[3].substring(parts[3].lastIndexOf('/') + 1);
      lineNumber=ste.getLineNumber();
      if (lineNumber == LINE_NUMBER_UNKNOWN) {
        lineNumber=Integer.parseInt(parts[4]);
      }
      fragmentId=Integer.parseInt(parts[5]);
    }
  }
  int column=1;
  if (steFilename != null) {
    int columnMarkerIndex=steFilename.indexOf("String_Node_Str");
    if (columnMarkerIndex != -1) {
      try {
        column=Integer.parseInt(steFilename.substring(columnMarkerIndex + 1));
      }
 catch (      NumberFormatException nfe) {
      }
      steFilename=steFilename.substring(0,columnMarkerIndex);
    }
  }
  if (fragmentId == -1 && steFilename != null) {
    Matcher matcher=fragmentIdPattern.matcher(steFilename);
    if (matcher.matches()) {
      String fragment=matcher.group(1);
      try {
        fragmentId=Integer.parseInt(fragment);
      }
 catch (      Exception e) {
      }
    }
 else     if (steFilename.contains(strongName)) {
      fragmentId=0;
    }
  }
  int jsLineNumber=ste.getLineNumber();
  if (fragmentId != -1) {
    SourceMapping sourceMapping=loadSourceMap(strongName,fragmentId);
    if (sourceMapping != null && ste.getLineNumber() > -1) {
      Mapping.OriginalMapping mappingForLine=sourceMapping.getMappingForLine(jsLineNumber,column);
      if (mappingForLine != null) {
        if (declaringClass == null || declaringClass.equals(ste.getClassName())) {
          declaringClass=mappingForLine.getOriginalFile();
          methodName=mappingForLine.getIdentifier();
        }
        filename=mappingForLine.getOriginalFile();
        lineNumber=mappingForLine.getLineNumber() - 1;
      }
    }
  }
  if (declaringClass != null) {
    return new StackTraceElement(declaringClass,methodName,filename,lineNumber);
  }
  return ste;
}

Fixed version (ground truth):
/** 
 * Best effort resymbolization of a a single stack trace element.
 * @param ste        the stack trace element to resymbolize
 * @param strongName the GWT permutation strong name
 * @return the best effort resymbolized stack trace element
 */
public StackTraceElement resymbolize(StackTraceElement ste,String strongName){
  String declaringClass=null;
  String methodName=null;
  String filename=null;
  int lineNumber=-1;
  int fragmentId=-1;
  String steFilename=ste.getFileName();
  SymbolMap map=loadSymbolMap(strongName);
  String symbolData=map == null ? null : map.get(ste.getMethodName());
  if (symbolData != null) {
    String[] parts=symbolData.split("String_Node_Str");
    if (parts.length == 6) {
      String[] ref=parse(parts[0].substring(0,parts[0].lastIndexOf(')') + 1));
      if (ref != null) {
        declaringClass=ref[0];
        methodName=ref[1];
      }
 else {
        declaringClass=ste.getClassName();
        methodName=ste.getMethodName();
      }
      filename="String_Node_Str".equals(parts[3]) ? null : parts[3].substring(parts[3].lastIndexOf('/') + 1);
      lineNumber=ste.getLineNumber();
      if (lineNumber == LINE_NUMBER_UNKNOWN) {
        lineNumber=Integer.parseInt(parts[4]);
      }
      fragmentId=Integer.parseInt(parts[5]);
    }
  }
  int column=1;
  if (steFilename != null) {
    int columnMarkerIndex=steFilename.indexOf("String_Node_Str");
    if (columnMarkerIndex != -1) {
      try {
        column=Integer.parseInt(steFilename.substring(columnMarkerIndex + 1));
      }
 catch (      NumberFormatException nfe) {
      }
      steFilename=steFilename.substring(0,columnMarkerIndex);
    }
  }
  if (fragmentId == -1 && steFilename != null) {
    Matcher matcher=fragmentIdPattern.matcher(steFilename);
    if (matcher.matches()) {
      String fragment=matcher.group(1);
      try {
        fragmentId=Integer.parseInt(fragment);
      }
 catch (      Exception e) {
      }
    }
 else     if (steFilename.contains(strongName)) {
      fragmentId=0;
    }
  }
  int jsLineNumber=ste.getLineNumber();
  if (fragmentId != -1) {
    SourceMapping sourceMapping=loadSourceMap(strongName,fragmentId);
    if (sourceMapping != null && ste.getLineNumber() > -1) {
      Mapping.OriginalMapping mappingForLine=sourceMapping.getMappingForLine(jsLineNumber,column);
      if (mappingForLine != null) {
        if (declaringClass == null || declaringClass.equals(ste.getClassName())) {
          declaringClass=mappingForLine.getOriginalFile();
          methodName=mappingForLine.getIdentifier();
        }
        filename=mappingForLine.getOriginalFile();
        lineNumber=mappingForLine.getLineNumber();
      }
    }
  }
  if (declaringClass != null) {
    return new StackTraceElement(declaringClass,methodName,filename,lineNumber);
  }
  return ste;
}