Program: 136037
Project: 136037
Buggy source:
/** 
 * Collects and stores trace expression information for later use.
 */
private void getTraceExpressionsInformation(){
  if (traceExpressionDataTable == null) {
    traceExpressionDataTable=new Hashtable();
  }
 else {
    traceExpressionDataTable.clear();
  }
  try {
    IFile teFile=ModelHelper.getTraceExplorerTLAFile(getConfig());
    FileEditorInput teFileEditorInput=new FileEditorInput((IFile)teFile);
    FileDocumentProvider teFileDocumentProvider=new FileDocumentProvider();
    teFileDocumentProvider.connect(teFileEditorInput);
    IDocument teDocument=teFileDocumentProvider.getDocument(teFileEditorInput);
    FindReplaceDocumentAdapter teSearcher=new FindReplaceDocumentAdapter(teDocument);
    String regularExpression=FindReplaceDocumentAdapter.escapeForRegExPattern("String_Node_Str") + "String_Node_Str" + ModelWriter.TRACE_EXPR_VAR_SCHEME+ "String_Node_Str";
    IRegion region=teSearcher.find(0,regularExpression,true,true,false,true);
    while (region != null) {
      System.out.println(teDocument.get(region.getOffset(),region.getLength()));
      String commentString=teDocument.get(region.getOffset(),region.getLength());
      String[] stringSections=commentString.split("String_Node_Str");
      int level=Integer.parseInt(stringSections[1]);
      String variableName=stringSections[2];
      String expression=stringSections[3];
      TraceExpressionInformationHolder expressionData=new TraceExpressionInformationHolder(expression,null,variableName);
      expressionData.setLevel(level);
      this.traceExpressionDataTable.put(variableName.trim(),expressionData);
      region=teSearcher.find(region.getOffset() + region.getLength(),regularExpression,true,true,false,true);
    }
  }
 catch (  CoreException e) {
    TLCUIActivator.logError("String_Node_Str",e);
  }
catch (  BadLocationException e) {
    TLCUIActivator.logError("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Collects and stores trace expression information for later use.
 */
private void getTraceExpressionsInformation(){
  if (traceExpressionDataTable == null) {
    traceExpressionDataTable=new Hashtable();
  }
 else {
    traceExpressionDataTable.clear();
  }
  try {
    IFile teFile=ModelHelper.getTraceExplorerTLAFile(getConfig());
    FileEditorInput teFileEditorInput=new FileEditorInput((IFile)teFile);
    FileDocumentProvider teFileDocumentProvider=new FileDocumentProvider();
    teFileDocumentProvider.connect(teFileEditorInput);
    IDocument teDocument=teFileDocumentProvider.getDocument(teFileEditorInput);
    FindReplaceDocumentAdapter teSearcher=new FindReplaceDocumentAdapter(teDocument);
    String regularExpression=FindReplaceDocumentAdapter.escapeForRegExPattern("String_Node_Str") + "String_Node_Str" + ModelWriter.TRACE_EXPR_VAR_SCHEME+ "String_Node_Str";
    IRegion region=teSearcher.find(0,regularExpression,true,true,false,true);
    while (region != null) {
      System.out.println(teDocument.get(region.getOffset(),region.getLength()));
      String commentString=teDocument.get(region.getOffset(),region.getLength());
      String[] stringSections=commentString.split("String_Node_Str",4);
      int level=Integer.parseInt(stringSections[1]);
      String variableName=stringSections[2];
      String expression=stringSections[3];
      TraceExpressionInformationHolder expressionData=new TraceExpressionInformationHolder(expression,null,variableName);
      expressionData.setLevel(level);
      this.traceExpressionDataTable.put(variableName.trim(),expressionData);
      region=teSearcher.find(region.getOffset() + region.getLength(),regularExpression,true,true,false,true);
    }
  }
 catch (  CoreException e) {
    TLCUIActivator.logError("String_Node_Str",e);
  }
catch (  BadLocationException e) {
    TLCUIActivator.logError("String_Node_Str",e);
  }
}