Program: 135929
Project: 135929
Buggy source:
/** 
 * On 21 June 2010 LL discovered the following bug.  For a proof-step number of the form "<2>3.", the token in the syntax tree contains the ".".  This seems to be a reasonable place to fix it by returning just the "<2>3" and its location.
 * @param location
 * @return
 */
public static StringAndLocation getTokenAtLocation(Location location){
  TLAEditor editor=EditorUtil.getTLAEditorWithFocus();
  if (editor == null) {
    return null;
  }
  IFile moduleFile=((FileEditorInput)editor.getEditorInput()).getFile();
  if (editor.isDirty()) {
    System.out.println("String_Node_Str");
    return null;
  }
  ParseResult parseResult=ResourceHelper.getValidParseResult(moduleFile);
  if ((parseResult == null) || (parseResult.getStatus() != IParseConstants.PARSED)) {
    return null;
  }
  String moduleName=ResourceHelper.getModuleName(moduleFile);
  ModuleNode module=parseResult.getSpecObj().getExternalModuleTable().getModuleNode(UniqueString.uniqueStringOf(moduleName));
  if (module == null) {
    return null;
  }
  SyntaxTreeNode stn=(SyntaxTreeNode)module.stn;
  if (!locationContainment(location,stn.getLocation())) {
    return null;
  }
  StringAndLocation stl=innerGetCurrentToken(stn,location);
  if (stl == null) {
    return null;
  }
  if ((stl.string.charAt(0) == '<') && (stl.string.indexOf('.') != -1)) {
    Location loc=stl.location;
    stl=new StringAndLocation(stl.string.substring(0,stl.string.indexOf('.')),new Location(UniqueString.uniqueStringOf(loc.source()),loc.beginLine(),loc.beginColumn(),loc.endLine(),loc.beginColumn() + stl.string.indexOf('.')));
  }
  return stl;
}

Fixed version (ground truth):
/** 
 * On 21 June 2010 LL discovered the following bug.  For a proof-step number of the form "<2>3.", the token in the syntax tree contains the ".".  This seems to be a reasonable place to fix it by returning just the "<2>3" and its location.  Apparently, it has been fixed here.
 * @param location
 * @return
 */
public static StringAndLocation getTokenAtLocation(Location location){
  TLAEditor editor=EditorUtil.getTLAEditorWithFocus();
  if (editor == null) {
    return null;
  }
  IFile moduleFile=((FileEditorInput)editor.getEditorInput()).getFile();
  if (editor.isDirty()) {
    System.out.println("String_Node_Str");
    return null;
  }
  ParseResult parseResult=ResourceHelper.getValidParseResult(moduleFile);
  if ((parseResult == null) || (parseResult.getStatus() != IParseConstants.PARSED)) {
    return null;
  }
  String moduleName=ResourceHelper.getModuleName(moduleFile);
  ModuleNode module=parseResult.getSpecObj().getExternalModuleTable().getModuleNode(UniqueString.uniqueStringOf(moduleName));
  if (module == null) {
    return null;
  }
  SyntaxTreeNode stn=(SyntaxTreeNode)module.stn;
  if (!locationContainment(location,stn.getLocation())) {
    return null;
  }
  StringAndLocation stl=innerGetCurrentToken(stn,location);
  if (stl == null) {
    return null;
  }
  if ((stl.string.charAt(0) == '<') && (stl.string.indexOf('.') != -1)) {
    Location loc=stl.location;
    stl=new StringAndLocation(stl.string.substring(0,stl.string.indexOf('.')),new Location(UniqueString.uniqueStringOf(loc.source()),loc.beginLine(),loc.beginColumn(),loc.endLine(),loc.beginColumn() + stl.string.indexOf('.')));
  }
  return stl;
}