nus-yam/ex-repair huggingface dataset:
Program: 91918
Project: 91918
Buggy source:
@Override public boolean matches(ITmfEvent event){
  Object value=getFieldValue(event,fField);
  if (value == null) {
    return false ^ fNot;
  }
  if (fType == Type.NUM) {
    if (fValueNumber != null) {
      if (value instanceof Number) {
        Double valueDouble=((Number)value).doubleValue();
        return (valueDouble.compareTo(fValueNumber.doubleValue()) == fResult) ^ fNot;
      }
      try {
        Double valueDouble=NumberFormat.getInstance().parse(value.toString()).doubleValue();
        return (valueDouble.compareTo(fValueNumber.doubleValue()) == fResult) ^ fNot;
      }
 catch (      ParseException e) {
      }
    }
  }
 else   if (fType == Type.ALPHA) {
    String valueString=value.toString();
    int comp=valueString.compareTo(fValue.toString());
    if (comp < -1) {
      comp=-1;
    }
 else     if (comp > 1) {
      comp=1;
    }
    return (comp == fResult) ^ fNot;
  }
 else   if (fType == Type.TIMESTAMP) {
    if (fValueTimestamp != null) {
      if (value instanceof TmfTimestamp) {
        TmfTimestamp valueTimestamp=(TmfTimestamp)value;
        return (valueTimestamp.compareTo(fValueTimestamp,false) == fResult) ^ fNot;
      }
      try {
        TmfTimestamp valueTimestamp=new TmfTimestamp((long)(1E9 * NumberFormat.getInstance().parse(value.toString()).doubleValue()));
        return (valueTimestamp.compareTo(fValueTimestamp,false) == fResult) ^ fNot;
      }
 catch (      ParseException e) {
      }
    }
  }
  return false ^ fNot;
}

Fixed version (ground truth):
@Override public boolean matches(ITmfEvent event){
  Object value=getFieldValue(event,fField);
  if (value == null) {
    return false ^ fNot;
  }
  if (fType == Type.NUM) {
    if (fValueNumber != null) {
      if (value instanceof Number) {
        double valueDouble=((Number)value).doubleValue();
        return (Double.compare(valueDouble,fValueNumber.doubleValue()) == fResult) ^ fNot;
      }
      try {
        double valueDouble=NumberFormat.getInstance().parse(value.toString()).doubleValue();
        return (Double.compare(valueDouble,fValueNumber.doubleValue()) == fResult) ^ fNot;
      }
 catch (      ParseException e) {
      }
    }
  }
 else   if (fType == Type.ALPHA) {
    String valueString=value.toString();
    int comp=valueString.compareTo(fValue.toString());
    if (comp < -1) {
      comp=-1;
    }
 else     if (comp > 1) {
      comp=1;
    }
    return (comp == fResult) ^ fNot;
  }
 else   if (fType == Type.TIMESTAMP) {
    if (fValueTimestamp != null) {
      if (value instanceof TmfTimestamp) {
        TmfTimestamp valueTimestamp=(TmfTimestamp)value;
        return (valueTimestamp.compareTo(fValueTimestamp,false) == fResult) ^ fNot;
      }
      try {
        TmfTimestamp valueTimestamp=new TmfTimestamp((long)(1E9 * NumberFormat.getInstance().parse(value.toString()).doubleValue()));
        return (valueTimestamp.compareTo(fValueTimestamp,false) == fResult) ^ fNot;
      }
 catch (      ParseException e) {
      }
    }
  }
  return false ^ fNot;
}
Program: 91919
Project: 91919
Buggy source:
@Override public synchronized double getLocationRatio(final ITmfLocation location){
  if (fFile == null) {
    return 0;
  }
  try {
    if (location.getLocationInfo() instanceof Long) {
      return (double)((Long)location.getLocationInfo()) / fFile.length();
    }
  }
 catch (  final IOException e) {
    Activator.logError("String_Node_Str" + getPath(),e);
  }
  return 0;
}

Fixed version (ground truth):
@Override public synchronized double getLocationRatio(final ITmfLocation location){
  if (fFile == null) {
    return 0;
  }
  try {
    if (location.getLocationInfo() instanceof Long) {
      return ((Long)location.getLocationInfo()).doubleValue() / fFile.length();
    }
  }
 catch (  final IOException e) {
    Activator.logError("String_Node_Str" + getPath(),e);
  }
  return 0;
}
Program: 91920
Project: 91920
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + (min >= 0 ? min : "String_Node_Str") + "String_Node_Str"+ (max == INF ? "String_Node_Str" : (max >= 0 ? max : "String_Node_Str"))+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + (min >= 0 ? min : "String_Node_Str") + ','+ (max == INF ? "String_Node_Str" : (max >= 0 ? max : "String_Node_Str"))+ ')';
}
Program: 91921
Project: 91921
Buggy source:
@Override public synchronized double getLocationRatio(final ITmfLocation location){
  if (fFile == null) {
    return 0;
  }
  try {
    if (location.getLocationInfo() instanceof Long) {
      return (double)((Long)location.getLocationInfo()) / fFile.length();
    }
  }
 catch (  final IOException e) {
    Activator.logError("String_Node_Str" + getPath(),e);
  }
  return 0;
}

Fixed version (ground truth):
@Override public synchronized double getLocationRatio(final ITmfLocation location){
  if (fFile == null) {
    return 0;
  }
  try {
    if (location.getLocationInfo() instanceof Long) {
      return ((Long)location.getLocationInfo()).doubleValue() / fFile.length();
    }
  }
 catch (  final IOException e) {
    Activator.logError("String_Node_Str" + getPath(),e);
  }
  return 0;
}
Program: 91922
Project: 91922
Buggy source:
/** 
 * Starts the <code>Thread</code> that the new <code>Process</code> will run in. This must be called in order to get the process to start running.
 * @throws CoreException
 */
public void start() throws CoreException {
  IStatus status=init();
  if (status.isOK()) {
    Thread t=new Thread(this,cmd[0]);
    t.start();
  }
 else {
    stop();
    returnVal=Integer.MIN_VALUE;
    throw new CoreException(status);
  }
}

Fixed version (ground truth):
/** 
 * Starts the <code>Thread</code> that the new <code>Process</code> will run in. This must be called in order to get the process to start running.
 * @throws CoreException
 */
public void start() throws CoreException {
  IStatus status=init();
  if (status.isOK()) {
    Thread t=new Thread(this,cmd[0]);
    t.start();
    started=true;
  }
 else {
    stop();
    returnVal=Integer.MIN_VALUE;
    throw new CoreException(status);
  }
}
Program: 91923
Project: 91923
Buggy source:
@Override public void runningStateChanged(boolean running){
  setEnabled(!running);
}

Fixed version (ground truth):
@Override public void runningStateChanged(boolean started,boolean stopped){
  setEnabled(stopped);
}
Program: 91924
Project: 91924
Buggy source:
/** 
 * @since 2.0
 */
@Override public void runningStateChanged(boolean running){
  setEnabled(running);
}

Fixed version (ground truth):
/** 
 * @since 2.0
 */
@Override public void runningStateChanged(boolean started,boolean stopped){
  setEnabled(!stopped);
}
Program: 91925
Project: 91925
Buggy source:
/** 
 * Test that XML modules are available through the analysis manager
 */
@Test public void testPopulateModulesWithAnalysisManager(){
  TmfAnalysisManager.initializeModuleSources();
  Map<String,IAnalysisModuleHelper> modules=TmfAnalysisManager.getAnalysisModules();
  assertFalse(findStateSystemModule(modules.values()));
  File testXmlFile=TmfXmlTestFiles.VALID_FILE.getFile();
  if ((testXmlFile == null) || !testXmlFile.exists()) {
    fail("String_Node_Str");
  }
  XmlUtils.addXmlFile(testXmlFile);
  XmlAnalysisModuleSource.notifyModuleChange();
  modules=TmfAnalysisManager.getAnalysisModules();
  assertTrue(findStateSystemModule(modules.values()));
}

Fixed version (ground truth):
/** 
 * Test that XML modules are available through the analysis manager
 */
@Test public void testPopulateModulesWithAnalysisManager(){
  TmfAnalysisManager.initialize();
  Map<String,IAnalysisModuleHelper> modules=TmfAnalysisManager.getAnalysisModules();
  assertFalse(findStateSystemModule(modules.values()));
  File testXmlFile=TmfXmlTestFiles.VALID_FILE.getFile();
  if ((testXmlFile == null) || !testXmlFile.exists()) {
    fail("String_Node_Str");
  }
  XmlUtils.addXmlFile(testXmlFile);
  XmlAnalysisModuleSource.notifyModuleChange();
  modules=TmfAnalysisManager.getAnalysisModules();
  assertTrue(findStateSystemModule(modules.values()));
}
Program: 91927
Project: 91927
Buggy source:
/** 
 * Copy the pattern but quote (bracket with "[&" and "&]") the TmfTimestampFormat specific tags so these fields are treated as comments by the base class. It also keeps track of the corresponding quoted fields so they can be properly populated later on (by format()).
 * @param pattern the 'extended' pattern
 * @return the quoted and bracketed pattern
 */
private String quoteSpecificTags(final String pattern){
  StringBuffer result=new StringBuffer();
  int length=pattern.length();
  boolean inQuote=false;
  for (int i=0; i < length; i++) {
    char c=pattern.charAt(i);
    result.append(c);
    if (c == '\'') {
      if ((i + 1) < length) {
        c=pattern.charAt(i + 1);
        if (c == '\'') {
          i++;
          result.append(c);
          continue;
        }
      }
      inQuote=!inQuote;
      continue;
    }
    if (!inQuote) {
      if (fSupplPatternLetters.indexOf(c) != -1) {
        StringBuilder pat=new StringBuilder();
        pat.append(c);
        result.insert(result.length() - 1,"String_Node_Str" + fOpenBracket);
        while ((i + 1) < length && pattern.charAt(i + 1) == c) {
          result.append(c);
          pat.append(c);
          i++;
        }
        result.append(fCloseBracket + "String_Node_Str");
        fSupplPatterns.add(pat.toString());
      }
    }
  }
  return result.toString();
}

Fixed version (ground truth):
/** 
 * Copy the pattern but quote (bracket with "[&" and "&]") the TmfTimestampFormat specific tags. Optionally surround tags with single quotes so these fields are treated as comments by the base class. It also keeps track of the corresponding quoted fields so they can be properly populated later on (by format()).
 * @param pattern the 'extended' pattern
 * @param addQuotes true to add single quotes around tags
 * @return the quoted and bracketed pattern
 */
private String quoteSpecificTags(final String pattern,boolean addQuotes){
  StringBuffer result=new StringBuffer();
  int length=pattern.length();
  boolean inQuote=false;
  for (int i=0; i < length; i++) {
    char c=pattern.charAt(i);
    result.append(c);
    if (c == '\'') {
      if ((i + 1) < length) {
        c=pattern.charAt(i + 1);
        if (c == '\'') {
          i++;
          result.append(c);
          continue;
        }
      }
      inQuote=!inQuote;
      continue;
    }
    if (!inQuote) {
      if (fSupplPatternLetters.indexOf(c) != -1) {
        StringBuilder pat=new StringBuilder();
        pat.append(c);
        if (addQuotes) {
          result.insert(result.length() - 1,"String_Node_Str");
        }
        result.insert(result.length() - 1,fOpenBracket);
        while ((i + 1) < length && pattern.charAt(i + 1) == c) {
          result.append(c);
          pat.append(c);
          i++;
        }
        result.append(fCloseBracket);
        if (addQuotes) {
          result.append("String_Node_Str");
        }
        fSupplPatterns.add(pat.toString());
      }
    }
  }
  return result.toString();
}
Program: 91928
Project: 91928
Buggy source:
/** 
 * Parse a string according to the format pattern
 * @param string the source string
 * @return the parsed value
 * @throws ParseException if the string has an invalid format
 */
public long parseValue(final String string) throws ParseException {
  long result=parseValue(string,0);
  return result;
}

Fixed version (ground truth):
/** 
 * Parse a string according to the format pattern
 * @param string the source string
 * @return the parsed value (in ns)
 * @throws ParseException if the string has an invalid format
 */
public long parseValue(final String string) throws ParseException {
  long result=parseValue(string,0);
  return result;
}
Program: 91929
Project: 91929
Buggy source:
@Override public void applyPattern(String pattern){
  fPattern=pattern;
  String quotedPattern=quoteSpecificTags(pattern);
  super.applyPattern(quotedPattern);
}

Fixed version (ground truth):
@Override public void applyPattern(String pattern){
  fPattern=pattern;
  int dot=pattern.indexOf('.');
  if (dot == -1) {
    dot=pattern.length();
  }
  super.applyPattern(quoteSpecificTags(pattern.substring(0,dot),true));
  fSubSecPattern=quoteSpecificTags(pattern.substring(dot),false);
}
Program: 91930
Project: 91930
Buggy source:
/** 
 * FIXME The ID's should be saved in the state system themselves (ITmfStateSystem.getId()), so this will eventually not be needed. Return the ID of a given state system.
 * @param ss The state system for which you want the ID, null if there is no match.
 * @return The corresponding state system
 */
@Nullable String getStateSystemId(ITmfStateSystem ss);

Fixed version (ground truth):
/** 
 * FIXME The ID's should be saved in the state system themselves (ITmfStateSystem.getId()), so this will eventually not be needed. Return the ID of a given state system.
 * @param ss The state system for which you want the ID, null if there is no match.
 * @return The corresponding state system
 */
@Nullable String getStateSystemId(@NonNull ITmfStateSystem ss);
Program: 91931
Project: 91931
Buggy source:
/** 
 * Return a specific state system provided by this analysis.
 * @param id The ID of the state system
 * @return The state system corresponding to the given ID, null if there isno match.
 */
@Nullable ITmfStateSystem getStateSystem(String id);

Fixed version (ground truth):
/** 
 * Return a specific state system provided by this analysis.
 * @param id The ID of the state system
 * @return The state system corresponding to the given ID, null if there isno match.
 */
@Nullable ITmfStateSystem getStateSystem(@NonNull String id);
Program: 91932
Project: 91932
Buggy source:
/** 
 * Gets a project element with traces all initialized
 * @return A project stub element
 * @throws CoreException If something happened with the project creation
 */
public static TmfProjectElement getFilledProject() throws CoreException {
  assumeTrue(CtfTmfTestTrace.KERNEL.exists());
  IProject project=TmfProjectRegistry.createProject(PROJECT_NAME,null,null);
  IFolder traceFolder=project.getFolder(TmfTraceFolder.TRACE_FOLDER_NAME);
  File file=new File(testTrace.getPath());
  String path=file.getAbsolutePath();
  final IPath pathString=Path.fromOSString(path);
  IResource linkedTrace=TmfImportHelper.createLink(traceFolder,pathString,pathString.lastSegment());
  if (!(linkedTrace != null && linkedTrace.exists())) {
    return null;
  }
  linkedTrace.setPersistentProperty(TmfCommonConstants.TRACETYPE,"String_Node_Str");
  final TmfProjectElement projectElement=TmfProjectRegistry.getProject(project,true);
  TmfTraceElement traceElement=projectElement.getTracesFolder().getTraces().get(0);
  traceElement.refreshTraceType();
  return projectElement;
}

Fixed version (ground truth):
/** 
 * Gets a project element with traces all initialized
 * @return A project stub element
 * @throws CoreException If something happened with the project creation
 */
public static TmfProjectElement getFilledProject() throws CoreException {
  assumeTrue(CtfTmfTestTrace.KERNEL.exists());
  IProject project=TmfProjectRegistry.createProject(PROJECT_NAME,null,null);
  IFolder traceFolder=project.getFolder(TmfTraceFolder.TRACE_FOLDER_NAME);
  File file=new File(testTrace.getPath());
  String path=file.getAbsolutePath();
  final IPath pathString=Path.fromOSString(path);
  IResource linkedTrace=TmfImportHelper.createLink(traceFolder,pathString,pathString.lastSegment());
  if (!(linkedTrace != null && linkedTrace.exists())) {
    return null;
  }
  linkedTrace.setPersistentProperty(TmfCommonConstants.TRACETYPE,"String_Node_Str");
  final TmfProjectElement projectElement=TmfProjectRegistry.getProject(project,true);
  TmfTraceElement traceElement=projectElement.getTracesFolder().getTraces().get(0);
  traceElement.refreshTraceType();
  projectElement.refresh();
  return projectElement;
}
Program: 91933
Project: 91933
Buggy source:
/** 
 * Get the list of analysis elements
 * @return Array of analysis elements
 */
public List<TmfAnalysisOutputElement> getAvailableOutputs(){
  List<TmfAnalysisOutputElement> list=new ArrayList<>();
  IAnalysisModuleHelper helper=TmfAnalysisManager.getAnalysisModule(fAnalysisId);
  if (helper == null) {
    return list;
  }
  IPath path=getProject().getTracesFolder().getPath();
  if (fResource instanceof IFolder) {
    path=((IFolder)fResource).getFullPath();
  }
  ITmfProjectModelElement parent=getParent();
  if (parent instanceof TmfTraceElement) {
    ITmfTrace trace=((TmfTraceElement)parent).getTrace();
    if (trace == null) {
      return list;
    }
    IAnalysisModule module=trace.getAnalysisModule(fAnalysisId);
    if (module == null) {
      return list;
    }
    for (    IAnalysisOutput output : module.getOutputs()) {
      if (fResource instanceof IFolder) {
        IFolder newresource=ResourcesPlugin.getWorkspace().getRoot().getFolder(path.append(output.getName()));
        TmfAnalysisOutputElement out=new TmfAnalysisOutputElement(output.getName(),newresource,this,output);
        list.add(out);
      }
    }
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Get the list of analysis output model elements under this analysis
 * @return Array of analysis output elements
 */
public List<TmfAnalysisOutputElement> getAvailableOutputs(){
  List<ITmfProjectModelElement> children=getChildren();
  List<TmfAnalysisOutputElement> outputs=new ArrayList<>();
  for (  ITmfProjectModelElement child : children) {
    if (child instanceof TmfAnalysisOutputElement) {
      outputs.add((TmfAnalysisOutputElement)child);
    }
  }
  return outputs;
}
Program: 91934
Project: 91934
Buggy source:
/** 
 * Constructor
 * @param name Name of the analysis
 * @param resource The resource
 * @param parent Parent of the analysis
 * @param id The analysis module id
 */
protected TmfAnalysisElement(String name,IResource resource,ITmfProjectModelElement parent,String id){
  super(name,resource,parent);
  fAnalysisId=id;
  refreshOutputs();
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param name Name of the analysis
 * @param resource The resource
 * @param parent Parent of the analysis
 * @param id The analysis module id
 */
protected TmfAnalysisElement(String name,IResource resource,ITmfProjectModelElement parent,String id){
  super(name,resource,parent);
  fAnalysisId=id;
  parent.addChild(this);
}
Program: 91935
Project: 91935
Buggy source:
/** 
 * Constructor
 * @param name Name of the view
 * @param resource Resource for the view
 * @param parent Parent analysis of the view
 * @param output The output object
 */
protected TmfAnalysisOutputElement(String name,IResource resource,ITmfProjectModelElement parent,IAnalysisOutput output){
  super(name,resource,parent);
  fOutput=output;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param name Name of the view
 * @param resource Resource for the view
 * @param parent Parent analysis of the view
 * @param output The output object
 */
protected TmfAnalysisOutputElement(String name,IResource resource,ITmfProjectModelElement parent,IAnalysisOutput output){
  super(name,resource,parent);
  fOutput=output;
  parent.addChild(this);
}
Program: 91936
Project: 91936
Buggy source:
/** 
 * Get the list of analysis elements
 * @return Array of analysis elements
 * @since 3.0
 */
public List<TmfAnalysisElement> getAvailableAnalysis(){
  List<TmfAnalysisElement> list=new ArrayList<>();
  return list;
}

Fixed version (ground truth):
/** 
 * Get the list of analysis model elements under this experiment
 * @return Array of analysis elements
 * @since 3.0
 */
public List<TmfAnalysisElement> getAvailableAnalysis(){
  List<TmfAnalysisElement> list=new ArrayList<>();
  return list;
}
Program: 91937
Project: 91937
Buggy source:
/** 
 * Refreshes the trace type filed by reading the trace type persistent property of the resource referenece.
 */
public void refreshTraceType(){
  try {
    fTraceTypeId=getResource().getPersistentProperty(TmfCommonConstants.TRACETYPE);
    refreshAnalysis();
  }
 catch (  CoreException e) {
    Activator.getDefault().logError("String_Node_Str" + getName(),e);
  }
}

Fixed version (ground truth):
/** 
 * Refreshes the trace type filed by reading the trace type persistent property of the resource referenece.
 */
public void refreshTraceType(){
  try {
    fTraceTypeId=getResource().getPersistentProperty(TmfCommonConstants.TRACETYPE);
  }
 catch (  CoreException e) {
    Activator.getDefault().logError("String_Node_Str" + getName(),e);
  }
}
Program: 91938
Project: 91938
Buggy source:
/** 
 * Handler for the Trace Opened signal
 * @param signal The incoming signal
 * @since 3.0
 */
@TmfSignalHandler public void traceOpened(TmfTraceOpenedSignal signal){
  IResource resource=signal.getTrace().getResource();
  if ((resource == null) || !resource.equals(getResource())) {
    return;
  }
  refreshAnalysis();
  getParent().refresh();
}

Fixed version (ground truth):
/** 
 * Handler for the Trace Opened signal
 * @param signal The incoming signal
 * @since 3.0
 */
@TmfSignalHandler public void traceOpened(TmfTraceOpenedSignal signal){
  IResource resource=signal.getTrace().getResource();
  if ((resource == null) || !resource.equals(getResource())) {
    return;
  }
  getParent().refresh();
}
Program: 91939
Project: 91939
Buggy source:
/** 
 * Get the list of analysis elements
 * @return Array of analysis elements
 * @since 3.0
 */
public List<TmfAnalysisElement> getAvailableAnalysis(){
  List<TmfAnalysisElement> list=new ArrayList<>();
  TraceTypeHelper helper=TmfTraceType.getInstance().getTraceType(getTraceType());
  Class<? extends ITmfTrace> traceClass=null;
  if (helper == null && fTraceTypeId != null) {
    if (fTraceTypeId.startsWith(CustomTxtTrace.class.getCanonicalName())) {
      for (      CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
        if (fTraceTypeId.equals(CustomTxtTrace.class.getCanonicalName() + "String_Node_Str" + def.definitionName)) {
          traceClass=CustomTxtTrace.class;
        }
      }
    }
    if (fTraceTypeId.startsWith(CustomXmlTrace.class.getCanonicalName())) {
      for (      CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
        if (fTraceTypeId.equals(CustomXmlTrace.class.getCanonicalName() + "String_Node_Str" + def.definitionName)) {
          traceClass=CustomTxtTrace.class;
        }
      }
    }
  }
 else   if (helper != null) {
    traceClass=helper.getTraceClass();
  }
  if (traceClass == null) {
    return list;
  }
  IPath path=fResource.getFullPath();
  for (  IAnalysisModuleHelper module : TmfAnalysisManager.getAnalysisModules(traceClass).values()) {
    IFolder newresource=ResourcesPlugin.getWorkspace().getRoot().getFolder(path.append(module.getId()));
    TmfAnalysisElement analysis=new TmfAnalysisElement(module.getName(),newresource,this,module.getId());
    list.add(analysis);
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Get the list of analysis model elements under this trace
 * @return Array of analysis elements
 * @since 3.0
 */
public List<TmfAnalysisElement> getAvailableAnalysis(){
  List<ITmfProjectModelElement> children=getChildren();
  List<TmfAnalysisElement> analysis=new ArrayList<>();
  for (  ITmfProjectModelElement child : children) {
    if (child instanceof TmfAnalysisElement) {
      analysis.add((TmfAnalysisElement)child);
    }
  }
  return analysis;
}
Program: 91940
Project: 91940
Buggy source:
@Override void refreshChildren(){
  refreshAnalysis();
}

Fixed version (ground truth):
@Override void refreshChildren(){
  Map<String,TmfAnalysisElement> childrenMap=new HashMap<>();
  for (  TmfAnalysisElement analysis : getAvailableAnalysis()) {
    childrenMap.put(analysis.getAnalysisId(),analysis);
  }
  TraceTypeHelper helper=TmfTraceType.getInstance().getTraceType(getTraceType());
  Class<? extends ITmfTrace> traceClass=null;
  if (helper == null && fTraceTypeId != null) {
    if (fTraceTypeId.startsWith(CustomTxtTrace.class.getCanonicalName())) {
      for (      CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
        if (fTraceTypeId.equals(CustomTxtTrace.class.getCanonicalName() + "String_Node_Str" + def.definitionName)) {
          traceClass=CustomTxtTrace.class;
        }
      }
    }
    if (fTraceTypeId.startsWith(CustomXmlTrace.class.getCanonicalName())) {
      for (      CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
        if (fTraceTypeId.equals(CustomXmlTrace.class.getCanonicalName() + "String_Node_Str" + def.definitionName)) {
          traceClass=CustomTxtTrace.class;
        }
      }
    }
  }
 else   if (helper != null) {
    traceClass=helper.getTraceClass();
  }
  if (traceClass == null) {
    for (    TmfAnalysisElement analysis : childrenMap.values()) {
      removeChild(analysis);
    }
    return;
  }
  IPath path=fResource.getFullPath();
  for (  IAnalysisModuleHelper module : TmfAnalysisManager.getAnalysisModules(traceClass).values()) {
    TmfAnalysisElement analysis=childrenMap.remove(module.getId());
    if (analysis == null) {
      IFolder newresource=ResourcesPlugin.getWorkspace().getRoot().getFolder(path.append(module.getId()));
      analysis=new TmfAnalysisElement(module.getName(),newresource,this,module.getId());
    }
    analysis.refreshChildren();
  }
  for (  TmfAnalysisElement analysis : childrenMap.values()) {
    removeChild(analysis);
  }
}
Program: 91941
Project: 91941
Buggy source:
/** 
 * Sets the time range of the full histogram.
 * @param startTime A start time
 * @param endTime A end time
 */
public void setFullRange(long startTime,long endTime){
  fZoom.setFullRange(startTime,endTime);
}

Fixed version (ground truth):
/** 
 * Sets the time range of the full histogram.
 * @param startTime A start time
 * @param endTime A end time
 */
public void setFullRange(long startTime,long endTime){
  fZoom.setFullRange(startTime,endTime);
  fZoom.setNewRange(fRangeStartTime,fRangeDuration);
}
Program: 91942
Project: 91942
Buggy source:
@Override public void mouseMove(MouseEvent event){
  if (fDragState == DRAG_RANGE) {
    int nbBuckets=event.x - fStartPosition;
    long delta=nbBuckets * fScaledData.fBucketDuration;
    long newStart=fZoom.getStartTime() + delta;
    if (newStart < getStartTime()) {
      newStart=getStartTime();
    }
    long newEnd=newStart + fZoom.getDuration();
    if (newEnd > getEndTime()) {
      newEnd=getEndTime();
      newStart=newEnd - fZoom.getDuration();
    }
    fRangeStartTime=newStart;
    fCanvas.redraw();
    fMouseMoved=true;
    return;
  }
 else   if (fDragState == DRAG_ZOOM) {
    long endTime=Math.max(getStartTime(),Math.min(getEndTime(),getTimestamp(event.x)));
    fRangeDuration=endTime - fRangeStartTime;
    fCanvas.redraw();
    return;
  }
  super.mouseMove(event);
}

Fixed version (ground truth):
@Override public void mouseMove(MouseEvent event){
  if (fDragState == DRAG_RANGE) {
    int center=event.x + fStartDelta;
    long newStart=getTimestamp(center) - fRangeDuration / 2;
    fRangeStartTime=Math.max(getStartTime(),Math.min(getEndTime() - fRangeDuration,newStart));
    fCanvas.redraw();
    fMouseMoved=true;
    return;
  }
 else   if (fDragState == DRAG_ZOOM) {
    long endTime=Math.max(getStartTime(),Math.min(getEndTime(),getTimestamp(event.x)));
    fRangeDuration=endTime - fRangeStartTime;
    fCanvas.redraw();
    return;
  }
  super.mouseMove(event);
}
Program: 91943
Project: 91943
Buggy source:
@Override public void mouseDown(MouseEvent event){
  if (fScaledData != null && fDragState == DRAG_NONE && fDataModel.getStartTime() < fDataModel.getEndTime()) {
    if (event.button == 2 || (event.button == 1 && (event.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL)) {
      fDragState=DRAG_RANGE;
      fDragButton=event.button;
      fStartPosition=event.x;
      fMouseMoved=false;
      return;
    }
 else     if (event.button == 3) {
      fDragState=DRAG_ZOOM;
      fDragButton=event.button;
      long time=Math.min(getTimestamp(event.x),getEndTime());
      if ((event.stateMask & SWT.MODIFIER_MASK) == SWT.SHIFT) {
        if (time < fRangeStartTime + fRangeDuration / 2) {
          fRangeStartTime=fRangeStartTime + fRangeDuration;
        }
      }
 else {
        fRangeStartTime=time;
      }
      fRangeDuration=time - fRangeStartTime;
      fCanvas.redraw();
      return;
    }
  }
  super.mouseDown(event);
}

Fixed version (ground truth):
@Override public void mouseDown(MouseEvent event){
  if (fScaledData != null && fDragState == DRAG_NONE && fDataModel.getStartTime() < fDataModel.getEndTime()) {
    if (event.button == 2 || (event.button == 1 && (event.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL)) {
      fDragState=DRAG_RANGE;
      fDragButton=event.button;
      int center=(int)(((fRangeStartTime + fRangeDuration / 2) - fScaledData.fFirstBucketTime) / fScaledData.fBucketDuration);
      fStartDelta=center - event.x;
      fMouseMoved=false;
      return;
    }
 else     if (event.button == 3) {
      fDragState=DRAG_ZOOM;
      fDragButton=event.button;
      long time=Math.min(getTimestamp(event.x),getEndTime());
      if ((event.stateMask & SWT.MODIFIER_MASK) == SWT.SHIFT) {
        if (time < fRangeStartTime + fRangeDuration / 2) {
          fRangeStartTime=fRangeStartTime + fRangeDuration;
        }
      }
 else {
        fRangeStartTime=time;
      }
      fRangeDuration=time - fRangeStartTime;
      fCanvas.redraw();
      return;
    }
  }
  super.mouseDown(event);
}
Program: 91944
Project: 91944
Buggy source:
/** 
 * Clear the histogram and reset the data
 */
public void clear(){
  fDataModel.clear();
synchronized (fDataModel) {
    fScaledData=null;
  }
}

Fixed version (ground truth):
/** 
 * Clear the histogram and reset the data
 */
public void clear(){
  fDataModel.clear();
  fDragState=DRAG_NONE;
  fDragButton=0;
synchronized (fDataModel) {
    fScaledData=null;
  }
}
Program: 91945
Project: 91945
Buggy source:
/** 
 * Handles the trace updated signal. Used to update time limits (start and end time)
 * @param signal the trace updated signal
 * @since 2.0
 */
@TmfSignalHandler public void traceUpdated(TmfTraceUpdatedSignal signal){
  if (signal.getTrace() != fTrace) {
    return;
  }
  TmfTimeRange fullRange=signal.getTrace().getTimeRange();
  fTraceStartTime=fullRange.getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  fTraceEndTime=fullRange.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  fFullTraceHistogram.setFullRange(fTraceStartTime,fTraceEndTime);
  fTimeRangeHistogram.setFullRange(fTraceStartTime,fTraceEndTime);
  fFullTraceHistogram.setTimeRange(fTimeRangeHistogram.getStartTime(),fWindowSpan);
  fTimeRangeHistogram.setTimeRange(fTimeRangeHistogram.getStartTime(),fWindowSpan);
  if ((fFullTraceRequest != null) && fFullTraceRequest.getRange().getEndTime().compareTo(signal.getRange().getEndTime()) < 0) {
    sendFullRangeRequest(fullRange);
  }
}

Fixed version (ground truth):
/** 
 * Handles the trace updated signal. Used to update time limits (start and end time)
 * @param signal the trace updated signal
 * @since 2.0
 */
@TmfSignalHandler public void traceUpdated(TmfTraceUpdatedSignal signal){
  if (signal.getTrace() != fTrace) {
    return;
  }
  TmfTimeRange fullRange=signal.getTrace().getTimeRange();
  fTraceStartTime=fullRange.getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  fTraceEndTime=fullRange.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  fFullTraceHistogram.setFullRange(fTraceStartTime,fTraceEndTime);
  fTimeRangeHistogram.setFullRange(fTraceStartTime,fTraceEndTime);
  if ((fFullTraceRequest != null) && fFullTraceRequest.getRange().getEndTime().compareTo(signal.getRange().getEndTime()) < 0) {
    sendFullRangeRequest(fullRange);
  }
}
Program: 91946
Project: 91946
Buggy source:
@Override public void run(){
  HistogramScaledData.hideLostEvents=hideLostEventsAction.isChecked();
  long maxNbEvents=HistogramScaledData.hideLostEvents ? fFullTraceHistogram.fScaledData.fMaxValue : fFullTraceHistogram.fScaledData.fMaxCombinedValue;
  fFullTraceHistogram.getMaxNbEventsText().setText(Long.toString(maxNbEvents));
  fFullTraceHistogram.getMaxNbEventsText().getParent().layout();
  fFullTraceHistogram.fCanvas.redraw();
  maxNbEvents=HistogramScaledData.hideLostEvents ? fTimeRangeHistogram.fScaledData.fMaxValue : fTimeRangeHistogram.fScaledData.fMaxCombinedValue;
  fTimeRangeHistogram.getMaxNbEventsText().setText(Long.toString(maxNbEvents));
  fTimeRangeHistogram.getMaxNbEventsText().getParent().layout();
  fTimeRangeHistogram.fCanvas.redraw();
}

Fixed version (ground truth):
@Override public void run(){
  if (fParent.isDisposed()) {
    return;
  }
  timeRangeUpdated(signal);
}
Program: 91947
Project: 91947
Buggy source:
/** 
 * Handles the current time updated signal. Sets the current time in the time range histogram as well as the full histogram.
 * @param signal the signal to process
 */
@TmfSignalHandler public void currentTimeUpdated(TmfTimeSynchSignal signal){
  assert(signal != null);
  ITmfTimestamp beginTime=signal.getBeginTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE);
  ITmfTimestamp endTime=signal.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE);
  updateDisplayedSelectionTime(beginTime.getValue(),endTime.getValue());
}

Fixed version (ground truth):
/** 
 * Handles the current time updated signal. Sets the current time in the time range histogram as well as the full histogram.
 * @param signal the signal to process
 */
@TmfSignalHandler public void currentTimeUpdated(final TmfTimeSynchSignal signal){
  if (Display.getCurrent() == null) {
    Display.getDefault().asyncExec(new Runnable(){
      @Override public void run(){
        if (fParent.isDisposed()) {
          return;
        }
        currentTimeUpdated(signal);
      }
    }
);
    return;
  }
  ITmfTimestamp beginTime=signal.getBeginTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE);
  ITmfTimestamp endTime=signal.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE);
  updateDisplayedSelectionTime(beginTime.getValue(),endTime.getValue());
}
Program: 91948
Project: 91948
Buggy source:
/** 
 * Updates the current time range in the time range histogram and full range histogram.
 * @param signal the signal to process
 */
@TmfSignalHandler public void timeRangeUpdated(TmfRangeSynchSignal signal){
  assert(signal != null);
  if (fTrace != null) {
    TmfTimeRange range=signal.getCurrentRange().getIntersection(fTrace.getTimeRange());
    if (range == null) {
      return;
    }
    updateDisplayedTimeRange(range.getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue(),range.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue());
    sendTimeRangeRequest(fWindowStartTime,fWindowEndTime);
    fTimeSpanControl.setValue(fWindowSpan);
  }
}

Fixed version (ground truth):
/** 
 * Updates the current time range in the time range histogram and full range histogram.
 * @param signal the signal to process
 */
@TmfSignalHandler public void timeRangeUpdated(final TmfRangeSynchSignal signal){
  if (Display.getCurrent() == null) {
    Display.getDefault().asyncExec(new Runnable(){
      @Override public void run(){
        if (fParent.isDisposed()) {
          return;
        }
        timeRangeUpdated(signal);
      }
    }
);
    return;
  }
  if (fTrace != null) {
    TmfTimeRange range=signal.getCurrentRange().getIntersection(fTrace.getTimeRange());
    if (range == null) {
      return;
    }
    updateDisplayedTimeRange(range.getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue(),range.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue());
    sendTimeRangeRequest(fWindowStartTime,fWindowEndTime);
    fTimeSpanControl.setValue(fWindowSpan);
  }
}
Program: 91949
Project: 91949
Buggy source:
/** 
 * Sets the full time range of the whole trace.
 * @param startTime The start time
 * @param endTime The end time
 */
public void setFullRange(long startTime,long endTime){
  fFullRangeStartTime=startTime;
  fFullRangeEndTime=endTime;
  long currentFirstEvent=getStartTime();
  fZoom.setFullRange((currentFirstEvent == 0) ? startTime : currentFirstEvent,endTime);
}

Fixed version (ground truth):
/** 
 * Sets the full time range of the whole trace.
 * @param startTime The start time
 * @param endTime The end time
 */
public void setFullRange(long startTime,long endTime){
  fFullRangeStartTime=startTime;
  fFullRangeEndTime=endTime;
  fZoom.setFullRange(startTime,endTime);
  fZoom.setNewRange(fRangeStartTime,fRangeDuration);
}
Program: 91950
Project: 91950
Buggy source:
/** 
 * Tell the Attribute Tree to write itself somewhere. The passed FileOutputStream defines where (which file/position).
 * @param fos Where to write. Make sure it's seeked at the right position you want.
 * @return The total number of bytes written.
 */
int writeSelf(File file,long pos){
  RandomAccessFile raf=null;
  int total=0;
  byte[] curByteArray;
  try {
    raf=new RandomAccessFile(file,"String_Node_Str");
    raf.seek(pos);
    raf.writeInt(ATTRIB_TREE_MAGIC_NUMBER);
    raf.writeInt(-8000);
    raf.writeInt(this.attributeList.size());
    total+=12;
    for (    Attribute entry : this.attributeList) {
      curByteArray=entry.getFullAttributeName().getBytes();
      if (curByteArray.length > Byte.MAX_VALUE) {
        throw new IOException("String_Node_Str" + Arrays.toString(curByteArray) + "String_Node_Str");
      }
      raf.writeByte((byte)curByteArray.length);
      raf.write(curByteArray);
      raf.writeByte((byte)0);
      total+=curByteArray.length + 2;
    }
    raf.seek(pos + 4);
    raf.writeInt(total);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    if (raf != null) {
      try {
        raf.close();
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  return total;
}

Fixed version (ground truth):
/** 
 * Tell the Attribute Tree to write itself somewhere. The passed FileOutputStream defines where (which file/position).
 * @param fos Where to write. Make sure it's sought at the right position you want.
 * @return The total number of bytes written.
 */
int writeSelf(File file,long pos){
  RandomAccessFile raf=null;
  int total=0;
  byte[] curByteArray;
  try {
    raf=new RandomAccessFile(file,"String_Node_Str");
    raf.seek(pos);
    raf.writeInt(ATTRIB_TREE_MAGIC_NUMBER);
    raf.writeInt(-8000);
    raf.writeInt(this.attributeList.size());
    total+=12;
    for (    Attribute entry : this.attributeList) {
      curByteArray=entry.getFullAttributeName().getBytes();
      if (curByteArray.length > Byte.MAX_VALUE) {
        throw new IOException("String_Node_Str" + Arrays.toString(curByteArray) + "String_Node_Str");
      }
      raf.writeByte((byte)curByteArray.length);
      raf.write(curByteArray);
      raf.writeByte((byte)0);
      total+=curByteArray.length + 2;
    }
    raf.seek(pos + 4);
    raf.writeInt(total);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    if (raf != null) {
      try {
        raf.close();
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  return total;
}
Program: 91951
Project: 91951
Buggy source:
/** 
 * "Existing file" constructor Builds a attribute tree from a "mapping file" or mapping section previously saved somewhere.
 * @param ss StateSystem to which this AT is attached
 * @param fis File stream where to read the AT information. Make sure it's seeked at the right place!
 * @throws IOException
 */
AttributeTree(StateSystem ss,FileInputStream fis) throws IOException {
  this(ss);
  DataInputStream in=new DataInputStream(new BufferedInputStream(fis));
  final String errorMessage="String_Node_Str";
  ArrayList<String[]> list=new ArrayList<String[]>();
  byte[] curByteArray;
  String curFullString;
  String[] curStringArray;
  int res, remain, size;
  int expectedSize=0;
  int total=0;
  res=in.readInt();
  if (res != ATTRIB_TREE_MAGIC_NUMBER) {
    throw new IOException(errorMessage);
  }
  expectedSize=in.readInt();
  if (expectedSize <= 12) {
    throw new IOException(errorMessage);
  }
  remain=in.readInt();
  total+=12;
  for (; remain > 0; remain--) {
    size=in.readByte();
    curByteArray=new byte[size];
    res=in.read(curByteArray);
    if (res != size) {
      throw new IOException(errorMessage);
    }
    curFullString=new String(curByteArray);
    curStringArray=curFullString.split("String_Node_Str");
    list.add(curStringArray);
    res=in.readByte();
    if (res != 0) {
      throw new IOException(errorMessage);
    }
    total+=curByteArray.length + 2;
  }
  if (total != expectedSize) {
    throw new IOException(errorMessage);
  }
  for (  String[] attrib : list) {
    this.getQuarkAndAdd(-1,attrib);
  }
}

Fixed version (ground truth):
/** 
 * "Existing file" constructor. Builds an attribute tree from a "mapping file" or mapping section previously saved somewhere.
 * @param ss StateSystem to which this AT is attached
 * @param fis File stream where to read the AT information. Make sure it's sought at the right place!
 * @throws IOException
 */
AttributeTree(StateSystem ss,FileInputStream fis) throws IOException {
  this(ss);
  DataInputStream in=new DataInputStream(new BufferedInputStream(fis));
  final String errorMessage="String_Node_Str";
  ArrayList<String[]> list=new ArrayList<String[]>();
  byte[] curByteArray;
  String curFullString;
  String[] curStringArray;
  int res, remain, size;
  int expectedSize=0;
  int total=0;
  res=in.readInt();
  if (res != ATTRIB_TREE_MAGIC_NUMBER) {
    throw new IOException(errorMessage);
  }
  expectedSize=in.readInt();
  if (expectedSize <= 12) {
    throw new IOException(errorMessage);
  }
  remain=in.readInt();
  total+=12;
  for (; remain > 0; remain--) {
    size=in.readByte();
    curByteArray=new byte[size];
    res=in.read(curByteArray);
    if (res != size) {
      throw new IOException(errorMessage);
    }
    curFullString=new String(curByteArray);
    curStringArray=curFullString.split("String_Node_Str");
    list.add(curStringArray);
    res=in.readByte();
    if (res != 0) {
      throw new IOException(errorMessage);
    }
    total+=curByteArray.length + 2;
  }
  if (total != expectedSize) {
    throw new IOException(errorMessage);
  }
  for (  String[] attrib : list) {
    this.getQuarkAndAdd(-1,attrib);
  }
}
Program: 91952
Project: 91952
Buggy source:
/** 
 * Standard constructor.
 * @param file File object. This is passed as-is to the RandomeAccessFile's constructor.
 * @param mode File open mode ("r", "rw", etc.). This is passed as-is to RandomAccessFile's constructor.
 * @param bufsize Buffer size to use, in bytes
 * @throws IOException If the file was not found or couldn't be opened with the request permissions
 */
public BufferedRandomAccessFile(File file,String mode,int bufsize) throws IOException {
  super(file,mode);
  invalidate();
  BUF_SIZE=bufsize;
  buffer=new byte[BUF_SIZE];
}

Fixed version (ground truth):
/** 
 * Standard constructor.
 * @param file File object. This is passed as-is to the RandomAccessFile's constructor.
 * @param mode File open mode ("r", "rw", etc.). This is passed as-is to RandomAccessFile's constructor.
 * @param bufsize Buffer size to use, in bytes
 * @throws IOException If the file was not found or couldn't be opened with the request permissions
 */
public BufferedRandomAccessFile(File file,String mode,int bufsize) throws IOException {
  super(file,mode);
  invalidate();
  BUF_SIZE=bufsize;
  buffer=new byte[BUF_SIZE];
}
Program: 91953
Project: 91953
Buggy source:
/** 
 * Seeks to a given timestamp It will go to the event just after the timestamp or the timestamp itself. if a if a trace is 10 20 30 40 and you're looking for 19, it'll give you 20, it you want 20, you'll get 20, if you want 21, you'll get 30. You want -inf, you'll get the first element, you want +inf, you'll get the end of the file with no events.
 * @param timestamp the timestamp to seek to
 * @return true if the trace has more events following the timestamp
 */
public boolean seek(long timestamp){
  this.prio.clear();
  for (  StreamInputReader streamInputReader : this.streamInputReaders) {
    streamInputReader.seek(timestamp);
  }
  for (  StreamInputReader streamInputReader : this.streamInputReaders) {
    if (streamInputReader.getCurrentEvent() != null) {
      this.prio.add(streamInputReader);
    }
  }
  return hasMoreEvents();
}

Fixed version (ground truth):
/** 
 * Seeks to a given timestamp. It will seek to the nearest event greater or equal to timestamp. If a trace is [10 20 30 40] and you are looking for 19, it will give you 20. If you want 20, you will get 20, if you want 21, you will get 30. The value -inf will seek to the first element and the value +inf will seek to the end of the file (past the last event).
 * @param timestamp the timestamp to seek to
 * @return true if there are events above or equal the seek timestamp,false if seek at the end of the trace (no valid event).
 */
public boolean seek(long timestamp){
  this.prio.clear();
  for (  StreamInputReader streamInputReader : this.streamInputReaders) {
    streamInputReader.seek(timestamp);
    if (streamInputReader.getCurrentEvent() != null) {
      this.prio.add(streamInputReader);
    }
  }
  return hasMoreEvents();
}
Program: 91954
Project: 91954
Buggy source:
/** 
 * gets the last event timestamp that was read. This is NOT necessarily the last event in a trace, just the last one read so far.
 * @return the last event
 */
public long getEndTime(){
  return this.endTime;
}

Fixed version (ground truth):
/** 
 * Gets the last event timestamp that was read. This is NOT necessarily the last event in a trace, just the last one read so far.
 * @return the last event
 */
public long getEndTime(){
  return this.endTime;
}
Program: 91955
Project: 91955
Buggy source:
/** 
 * gets the stream with the oldest event
 * @return the stream with the oldest event
 */
public StreamInputReader getTopStream(){
  return this.prio.peek();
}

Fixed version (ground truth):
/** 
 * Gets the stream with the oldest event
 * @return the stream with the oldest event
 */
public StreamInputReader getTopStream(){
  return this.prio.peek();
}
Program: 91956
Project: 91956
Buggy source:
/** 
 * the common streamInput Index
 * @return the stream input Index
 */
StreamInputPacketIndex getIndex(){
  return index;
}

Fixed version (ground truth):
/** 
 * The common streamInput Index
 * @return the stream input Index
 */
StreamInputPacketIndex getIndex(){
  return index;
}
Program: 91957
Project: 91957
Buggy source:
/** 
 * gets the last read timestamp of a stream. (this is not necessarily the last time in the stream.)
 * @return the last read timestamp
 */
public long getTimestampEnd(){
  return timestampEnd;
}

Fixed version (ground truth):
/** 
 * Gets the last read timestamp of a stream. (this is not necessarily the last time in the stream.)
 * @return the last read timestamp
 */
public long getTimestampEnd(){
  return timestampEnd;
}
Program: 91958
Project: 91958
Buggy source:
/** 
 * useless for streaminputs
 */
@Override public String getPath(){
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Useless for streaminputs
 */
@Override public String getPath(){
  return "String_Node_Str";
}
Program: 91959
Project: 91959
Buggy source:
/** 
 * Gets the filechannel of the streamInput. This is a limited Java ressource.
 * @return the filechannel
 */
public FileChannel getFileChannel(){
  return fileChannel;
}

Fixed version (ground truth):
/** 
 * Gets the filechannel of the streamInput. This is a limited Java resource.
 * @return the filechannel
 */
public FileChannel getFileChannel(){
  return fileChannel;
}
Program: 91960
Project: 91960
Buggy source:
/** 
 * gets the current packet context
 * @return the current packet context (size, lost events and such)
 */
public StructDefinition getCurrentPacketContext(){
  return this.packetReader.getStreamPacketContextDef();
}

Fixed version (ground truth):
/** 
 * Gets the current packet context
 * @return the current packet context (size, lost events and such)
 */
public StructDefinition getCurrentPacketContext(){
  return this.packetReader.getStreamPacketContextDef();
}