nus-yam/ex-repair huggingface dataset:
Program: 92022
Project: 92022
Buggy source:
/** 
 * Create a link and replace what was already there.
 * @param parentFolder the resource to import to, does not contain the element name
 * @param location where the resource (file/directory) is located
 * @param targetName the name to display
 * @return the resource created. Should not be null
 * @throws CoreException an exception made by createLink.
 */
public static IResource createLink(IFolder parentFolder,IPath location,String targetName) throws CoreException {
  File source=new File(location.toString());
  IResource res=null;
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  if (source.isDirectory()) {
    IFolder folder=parentFolder.getFolder(targetName);
    IStatus result=workspace.validateLinkLocation(folder,location);
    if (result.isOK()) {
      folder.createLink(location,IResource.REPLACE,new NullProgressMonitor());
    }
 else {
      Activator.getDefault().logError(result.getMessage());
    }
  }
 else {
    IFile file=parentFolder.getFile(targetName);
    IStatus result=workspace.validateLinkLocation(file,location);
    if (result.isOK()) {
      file.createLink(location,IResource.REPLACE,new NullProgressMonitor());
    }
 else {
      Activator.getDefault().logError(result.getMessage());
    }
  }
  forceFolderRefresh(parentFolder);
  res=parentFolder.findMember(location.lastSegment());
  return res;
}

Fixed version (ground truth):
/** 
 * Create a link and replace what was already there.
 * @param parentFolder the resource to import to, does not contain the element name
 * @param location where the resource (file/directory) is located
 * @param targetName the name to display
 * @return the resource created. Should not be null
 * @throws CoreException an exception made by createLink.
 */
public static IResource createLink(IFolder parentFolder,IPath location,String targetName) throws CoreException {
  File source=new File(location.toString());
  IResource res=null;
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  if (source.isDirectory()) {
    IFolder folder=parentFolder.getFolder(targetName);
    IStatus result=workspace.validateLinkLocation(folder,location);
    if (result.isOK()) {
      folder.createLink(location,IResource.REPLACE,new NullProgressMonitor());
    }
 else {
      Activator.getDefault().logError(result.getMessage());
    }
  }
 else {
    IFile file=parentFolder.getFile(targetName);
    IStatus result=workspace.validateLinkLocation(file,location);
    if (result.isOK()) {
      file.createLink(location,IResource.REPLACE,new NullProgressMonitor());
    }
 else {
      Activator.getDefault().logError(result.getMessage());
    }
  }
  forceFolderRefresh(parentFolder);
  res=parentFolder.findMember(targetName);
  return res;
}
Program: 92024
Project: 92024
Buggy source:
private long testMain(){
  List<CTFCallsite> l=fTrace.getCallsiteCandidates(callsites[0]);
  CTFCallsite cs=fTrace.getCallsite(1);
  CTFCallsite cs1=fTrace.getCallsite(callsites[0]);
  CTFCallsite cs2=fTrace.getCallsite(callsites[0],1);
  assertNotNull(l);
  assertNotNull(cs);
  assertNotNull(cs1);
  assertNotNull(cs2);
  long start=System.nanoTime();
  perfTest();
  long end=System.nanoTime();
  long diff=end - start;
  assertTrue(diff > 0);
  return diff;
}

Fixed version (ground truth):
private long testMain(){
  TreeSet<CTFCallsite> l=fTrace.getCallsiteCandidates(callsites[0]);
  CTFCallsite cs=fTrace.getCallsite(1);
  CTFCallsite cs1=fTrace.getCallsite(callsites[0]);
  CTFCallsite cs2=fTrace.getCallsite(callsites[0],1);
  assertNotNull(l);
  assertNotNull(cs);
  assertNotNull(cs1);
  assertNotNull(cs2);
  long start=System.nanoTime();
  perfTest();
  long end=System.nanoTime();
  long diff=end - start;
  assertTrue(diff > 0);
  return diff;
}
Program: 92025
Project: 92025
Buggy source:
/** 
 * Gets the list of callsites associated to an event name. O(1)
 * @param eventName the event name
 * @return the callsite list can be empty
 * @since 1.2
 */
public List<CTFCallsite> getCallsiteCandidates(String eventName){
  LinkedList<CTFCallsite> retVal=callsitesByName.get(eventName);
  if (retVal == null) {
    retVal=new LinkedList<CTFCallsite>();
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * Gets the set of callsites associated to an event name. O(1)
 * @param eventName the event name
 * @return the callsite set can be empty
 * @since 3.0
 */
public TreeSet<CTFCallsite> getCallsiteCandidates(String eventName){
  TreeSet<CTFCallsite> retVal=callsitesByName.get(eventName);
  if (retVal == null) {
    retVal=new TreeSet<CTFCallsite>(ctfCallsiteComparator);
  }
  return retVal;
}
Program: 92026
Project: 92026
Buggy source:
/** 
 * Gets a callsite using the event name and instruction pointer O(log(n))
 * @param eventName the name of the event
 * @param ip the instruction pointer
 * @return the closest matching callsite, can be null
 */
public CTFCallsite getCallsite(String eventName,long ip){
  final LinkedList<CTFCallsite> candidates=callsitesByName.get(eventName);
  final CTFCallsite dummyCs=new CTFCallsite(null,null,ip,null,-1);
  final int pos=Collections.binarySearch(candidates,dummyCs) + 1;
  if (pos >= candidates.size()) {
    return null;
  }
  return candidates.get(pos);
}

Fixed version (ground truth):
/** 
 * Gets a callsite using the event name and instruction pointer O(log(n))
 * @param eventName the name of the event
 * @param ip the instruction pointer
 * @return the closest matching callsite, can be null
 */
public CTFCallsite getCallsite(String eventName,long ip){
  final TreeSet<CTFCallsite> candidates=callsitesByName.get(eventName);
  final CTFCallsite dummyCs=new CTFCallsite(null,null,ip,null,-1);
  final CTFCallsite callsite=candidates.ceiling(dummyCs);
  if (callsite == null) {
    return candidates.floor(dummyCs);
  }
  return callsite;
}
Program: 92027
Project: 92027
Buggy source:
/** 
 * Adds a callsite
 * @param eventName the event name of the callsite
 * @param funcName the name of the callsite function
 * @param ip the ip of the callsite
 * @param fileName the filename of the callsite
 * @param lineNumber the line number of the callsite
 */
public void addCallsite(String eventName,String funcName,long ip,String fileName,long lineNumber){
  final CTFCallsite cs=new CTFCallsite(eventName,funcName,ip,fileName,lineNumber);
  LinkedList<CTFCallsite> csl=callsitesByName.get(eventName);
  if (csl == null) {
    csl=new LinkedList<CTFCallsite>();
    callsitesByName.put(eventName,csl);
  }
  ListIterator<CTFCallsite> iter=csl.listIterator();
  int index=0;
  for (; index < csl.size(); index++) {
    if (iter.next().compareTo(cs) < 0) {
      break;
    }
  }
  csl.add(index,cs);
  callsitesByIP.add(cs);
}

Fixed version (ground truth):
/** 
 * Adds a callsite
 * @param eventName the event name of the callsite
 * @param funcName the name of the callsite function
 * @param ip the ip of the callsite
 * @param fileName the filename of the callsite
 * @param lineNumber the line number of the callsite
 */
public void addCallsite(String eventName,String funcName,long ip,String fileName,long lineNumber){
  final CTFCallsite cs=new CTFCallsite(eventName,funcName,ip,fileName,lineNumber);
  TreeSet<CTFCallsite> csl=callsitesByName.get(eventName);
  if (csl == null) {
    csl=new TreeSet<CTFCallsite>(ctfCallsiteComparator);
    callsitesByName.put(eventName,csl);
  }
  csl.add(cs);
  callsitesByIP.add(cs);
}
Program: 92029
Project: 92029
Buggy source:
@Override public void run(){
  if (ss == null) {
    System.err.println("String_Node_Str");
    return;
  }
  ITmfEvent event;
  try {
    event=eventsQueue.take();
    while (event.getTimestamp().getValue() != -1) {
      currentEvent=event;
      if (eventType.isInstance(event) && event.getType() != null) {
        eventHandle(event);
      }
      event=eventsQueue.take();
    }
    closeStateSystem();
    return;
  }
 catch (  InterruptedException e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (ss == null) {
    System.err.println("String_Node_Str");
    return;
  }
  ITmfEvent event;
  try {
    event=eventsQueue.take();
    while (event.getTimestamp().getValue() != -1) {
      if (event instanceof EmptyEvent) {
        event=eventsQueue.take();
        continue;
      }
      currentEvent=event;
      if (eventType.isInstance(event) && event.getType() != null) {
        eventHandle(event);
      }
      event=eventsQueue.take();
    }
    closeStateSystem();
    return;
  }
 catch (  InterruptedException e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
}
Program: 92030
Project: 92030
Buggy source:
/** 
 * Block the caller until the events queue is empty.
 */
public void waitForEmptyQueue(){
  TmfTimestamp ts=new TmfTimestamp(0);
  TmfEvent ev=new TmfEvent(null,ts,null,null,null,null);
  try {
    eventsQueue.put(ev);
    while (!eventsQueue.isEmpty()) {
      Thread.sleep(100);
    }
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Block the caller until the events queue is empty.
 */
public void waitForEmptyQueue(){
  TmfEvent ev=new EmptyEvent();
  try {
    eventsQueue.put(ev);
    while (!eventsQueue.isEmpty()) {
      Thread.sleep(100);
    }
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 92031
Project: 92031
Buggy source:
/** 
 * Gets an event Declaration hashmap for a given StreamInput
 * @param id the StreamInput
 * @return the hashmap with the event definitions
 * @since 2.0
 */
public Map<Long,EventDefinition> getEventDefs(StreamInput id){
  if (!eventDefs.containsKey(id)) {
    eventDefs.put(id,new HashMap<Long,EventDefinition>());
  }
  return eventDefs.get(id);
}

Fixed version (ground truth):
/** 
 * Gets an event Declaration hashmap for a given StreamInput
 * @param id the StreamInput
 * @return an empty hashmap, please see deprecated
 * @since 2.0
 * @deprecated You should be using {@link StreamInputReader#getEventDefinitions()}instead.
 */
@Deprecated public Map<Long,EventDefinition> getEventDefs(StreamInput id){
  return new HashMap<Long,EventDefinition>();
}
Program: 92034
Project: 92034
Buggy source:
/** 
 * Check if the user has permission to run opcontrol
 * @param project The project to be run
 * @return true if the user has sudo permission to run opcontrol, otherwise false
 * @throws OpcontrolException
 */
public boolean hasPermissions(IProject project) throws OpcontrolException ;

Fixed version (ground truth):
/** 
 * Check if the user has permission to run opcontrol
 * @param project The project to be run
 * @return true if the user has sudo permission to run opcontrol, otherwise false
 * @throws OpcontrolException
 * @since 2.0
 */
public boolean hasPermissions(IProject project) throws OpcontrolException ;
Program: 92035
Project: 92035
Buggy source:
protected STChangeRulerColumn createSTRulerColumn(ISTAnnotationColumn annotationColumn){
  fSTChangeRulerColumn=new STChangeRulerColumn(getSharedColors(),annotationColumn);
  ((IChangeRulerColumn)fSTChangeRulerColumn).setHover(createChangeHover());
  initializeLineNumberRulerColumn(fLineNumberRulerColumn);
  return fSTChangeRulerColumn;
}

Fixed version (ground truth):
/** 
 * @since 5.0
 */
protected STChangeRulerColumn createSTRulerColumn(ISTAnnotationColumn annotationColumn){
  fSTChangeRulerColumn=new STChangeRulerColumn(getSharedColors(),annotationColumn);
  ((IChangeRulerColumn)fSTChangeRulerColumn).setHover(createChangeHover());
  initializeLineNumberRulerColumn(fLineNumberRulerColumn);
  return fSTChangeRulerColumn;
}
Program: 92036
Project: 92036
Buggy source:
public abstract FileStoreEditorInput getInput(IFileStore fs);

Fixed version (ground truth):
/** 
 * @since 5.0
 */
public abstract FileStoreEditorInput getInput(IFileStore fs);
Program: 92037
Project: 92037
Buggy source:
/** 
 * Return whether the receiver is showing or not by default.
 * @return boolean
 */
boolean isShowingByDefault();

Fixed version (ground truth):
/** 
 * Return whether the receiver is showing or not by default.
 * @return boolean
 * @since 5.0
 */
boolean isShowingByDefault();
Program: 92039
Project: 92039
Buggy source:
@Override public void treeExpanded(TimeGraphTreeExpansionEvent event){
  fTreeViewer.setExpandedState(event.getEntry(),true);
}

Fixed version (ground truth):
@Override public void treeExpanded(TimeGraphTreeExpansionEvent event){
  ITimeGraphEntry entry=event.getEntry();
  fTreeViewer.setExpandedState(entry,true);
  for (  ITimeGraphEntry child : entry.getChildren()) {
    boolean expanded=fTreeViewer.getExpandedState(child);
    fTimeGraphViewer.setExpandedState(child,expanded);
  }
}
Program: 92040
Project: 92040
Buggy source:
/** 
 * Handler for the trace selected signal
 * @param signal The signal that's received
 */
@TmfSignalHandler public void traceSelected(final TmfTraceSelectedSignal signal){
  if (signal.getTrace() == fTrace) {
    return;
  }
  fTrace=signal.getTrace();
synchronized (fEntryListMap) {
    fEntryList=fEntryListMap.get(fTrace);
    if (fEntryList == null) {
synchronized (fBuildThreadMap) {
        BuildThread buildThread=new BuildThread(fTrace);
        fBuildThreadMap.put(fTrace,buildThread);
        buildThread.start();
      }
    }
 else {
      fStartTime=fTrace.getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
      fEndTime=fTrace.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
      refresh();
    }
  }
}

Fixed version (ground truth):
/** 
 * Handler for the trace selected signal
 * @param signal The incoming signal
 */
@TmfSignalHandler public void traceSelected(final TmfTraceSelectedSignal signal){
  if (signal.getTrace() == fTrace) {
    return;
  }
  fTrace=signal.getTrace();
  loadTrace();
}
Program: 92041
Project: 92041
Buggy source:
/** 
 * Handler for the trace selected signal
 * @param signal The incoming signal
 */
@TmfSignalHandler public void traceSelected(final TmfTraceSelectedSignal signal){
  if (signal.getTrace() == fTrace) {
    return;
  }
  fTrace=signal.getTrace();
synchronized (fEntryListMap) {
    fEntryList=fEntryListMap.get(fTrace);
    if (fEntryList == null) {
synchronized (fBuildThreadMap) {
        BuildThread buildThread=new BuildThread(fTrace);
        fBuildThreadMap.put(fTrace,buildThread);
        buildThread.start();
      }
    }
 else {
      fStartTime=fTrace.getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
      fEndTime=fTrace.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
      refresh();
    }
  }
}

Fixed version (ground truth):
/** 
 * Handler for the trace selected signal
 * @param signal The incoming signal
 */
@TmfSignalHandler public void traceSelected(final TmfTraceSelectedSignal signal){
  if (signal.getTrace() == fTrace) {
    return;
  }
  fTrace=signal.getTrace();
  loadTrace();
}
Program: 92042
Project: 92042
Buggy source:
/** 
 * Register an object to the signal manager as a "VIP" listener. All VIP listeners will all receive the signal before the manager moves on to the lowly, non-VIP listeners.
 * @param listener The object that will be notified of new signals
 */
public static synchronized void registerVIP(Object listener){
  Method[] methods=getSignalHandlerMethods(listener);
  if (methods.length > 0) {
    fVIPListeners.put(listener,methods);
  }
}

Fixed version (ground truth):
/** 
 * Register an object to the signal manager as a "VIP" listener. All VIP listeners will all receive the signal before the manager moves on to the lowly, non-VIP listeners.
 * @param listener The object that will be notified of new signals
 */
public static synchronized void registerVIP(Object listener){
  deregister(listener);
  Method[] methods=getSignalHandlerMethods(listener);
  if (methods.length > 0) {
    fVIPListeners.put(listener,methods);
  }
}
Program: 92043
Project: 92043
Buggy source:
/** 
 * Register an object to the signal manager. This object can then implement handler methods, marked with @TmfSignalHandler and with the expected signal type as parameter.
 * @param listener The object that will be notified of new signals
 */
public static synchronized void register(Object listener){
  Method[] methods=getSignalHandlerMethods(listener);
  if (methods.length > 0) {
    fListeners.put(listener,methods);
  }
}

Fixed version (ground truth):
/** 
 * Register an object to the signal manager. This object can then implement handler methods, marked with @TmfSignalHandler and with the expected signal type as parameter.
 * @param listener The object that will be notified of new signals
 */
public static synchronized void register(Object listener){
  deregister(listener);
  Method[] methods=getSignalHandlerMethods(listener);
  if (methods.length > 0) {
    fListeners.put(listener,methods);
  }
}
Program: 92044
Project: 92044
Buggy source:
/** 
 * Initialize the trace common attributes and the base component.
 * @param resource the Eclipse resource (trace)
 * @param path the trace path
 * @param type the trace event type
 * @throws TmfTraceException If something failed during the initialization
 */
protected void initialize(final IResource resource,final String path,final Class<? extends ITmfEvent> type) throws TmfTraceException {
  if (path == null) {
    throw new TmfTraceException("String_Node_Str");
  }
  fPath=path;
  fResource=resource;
  String traceName=(resource != null) ? resource.getName() : null;
  if (traceName == null) {
    final int sep=path.lastIndexOf(IPath.SEPARATOR);
    traceName=(sep >= 0) ? path.substring(sep + 1) : path;
  }
  if (fParser == null) {
    if (this instanceof ITmfEventParser) {
      fParser=(ITmfEventParser)this;
    }
 else {
      throw new TmfTraceException("String_Node_Str");
    }
  }
  super.init(traceName,type);
}

Fixed version (ground truth):
/** 
 * Initialize the trace common attributes and the base component.
 * @param resource the Eclipse resource (trace)
 * @param path the trace path
 * @param type the trace event type
 * @throws TmfTraceException If something failed during the initialization
 */
protected void initialize(final IResource resource,final String path,final Class<? extends ITmfEvent> type) throws TmfTraceException {
  if (path == null) {
    throw new TmfTraceException("String_Node_Str");
  }
  fPath=path;
  fResource=resource;
  String traceName=(resource != null) ? resource.getName() : null;
  if (traceName == null) {
    final int sep=path.lastIndexOf(IPath.SEPARATOR);
    traceName=(sep >= 0) ? path.substring(sep + 1) : path;
  }
  if (fParser == null) {
    if (this instanceof ITmfEventParser) {
      fParser=(ITmfEventParser)this;
    }
 else {
      throw new TmfTraceException("String_Node_Str");
    }
  }
  super.init(traceName,type);
  TmfSignalManager.registerVIP(this);
}
Program: 92045
Project: 92045
Buggy source:
/** 
 * Handler for the trace selected signal
 * @param signal The incoming signal
 */
@TmfSignalHandler public void traceSelected(final TmfTraceSelectedSignal signal){
  if (signal.getTrace() == fTrace) {
    return;
  }
  fTrace=signal.getTrace();
synchronized (fEntryListMap) {
    fEntryList=fEntryListMap.get(fTrace);
    if (fEntryList == null) {
synchronized (fBuildThreadMap) {
        BuildThread buildThread=new BuildThread(fTrace);
        fBuildThreadMap.put(fTrace,buildThread);
        buildThread.start();
      }
    }
 else {
      fStartTime=fTrace.getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
      fEndTime=fTrace.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
      refresh();
    }
  }
}

Fixed version (ground truth):
/** 
 * Handler for the trace selected signal
 * @param signal The incoming signal
 */
@TmfSignalHandler public void traceSelected(final TmfTraceSelectedSignal signal){
  if (signal.getTrace() == fTrace) {
    return;
  }
  fTrace=signal.getTrace();
  loadTrace();
}
Program: 92046
Project: 92046
Buggy source:
/** 
 * Handles trace opened signal. Loads histogram if new trace time range is not equal <code>TmfTimeRange.NULL_RANGE</code>
 * @param signal the trace selected signal
 * @since 2.0
 */
@TmfSignalHandler public void traceOpened(TmfTraceOpenedSignal signal){
  assert(signal != null);
  fTrace=signal.getTrace();
  loadTrace();
}

Fixed version (ground truth):
/** 
 * Handles trace opened signal. Loads histogram if new trace time range is not equal <code>TmfTimeRange.NULL_RANGE</code>
 * @param signal the trace opened signal
 * @since 2.0
 */
@TmfSignalHandler public void traceOpened(TmfTraceOpenedSignal signal){
  assert(signal != null);
  fTrace=signal.getTrace();
  loadTrace();
}
Program: 92047
Project: 92047
Buggy source:
/** 
 * Handler for the trace selected signal. This will make the view display the information for the newly-selected trace.
 * @param signal The incoming signal
 */
@TmfSignalHandler public void traceSelected(TmfTraceSelectedSignal signal){
  ITmfTrace trace=signal.getTrace();
  if (trace != fTrace) {
    fTrace=trace;
    Thread thread=new Thread("String_Node_Str"){
      @Override public void run(){
        createTable();
      }
    }
;
    thread.start();
  }
}

Fixed version (ground truth):
/** 
 * Handler for the trace selected signal. This will make the view display the information for the newly-selected trace.
 * @param signal The incoming signal
 */
@TmfSignalHandler public void traceSelected(TmfTraceSelectedSignal signal){
  ITmfTrace trace=signal.getTrace();
  if (trace != fTrace) {
    fTrace=trace;
    loadTrace();
  }
}
Program: 92048
Project: 92048
Buggy source:
@Override public void run(){
  ITmfTimestamp currentTime=signal.getCurrentTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE);
  fCurrentTimestamp=currentTime.getValue();
  updateTable();
}

Fixed version (ground truth):
@Override public void run(){
  createTable();
}
Program: 92049
Project: 92049
Buggy source:
public synchronized void reset(){
  Iterator<Entry<IBinaryObject,AutoDisposeAddr2line>> iter=addr2lines.entrySet().iterator();
  while (iter.hasNext()) {
    Entry<IBinaryObject,AutoDisposeAddr2line> entry=iter.next();
    AutoDisposeAddr2line ada2l=entry.getValue();
    ada2l.addr2line.dispose();
    ada2l.addr2line=null;
    iter.remove();
  }
  Iterator<Entry<String,AutoDisposeCPPFilt>> iter2=cppfilts.entrySet().iterator();
  while (iter2.hasNext()) {
    Entry<String,AutoDisposeCPPFilt> entry=iter2.next();
    AutoDisposeCPPFilt adcppf=entry.getValue();
    adcppf.cppfilt.dispose();
    adcppf.cppfilt=null;
  }
}

Fixed version (ground truth):
/** 
 * @since 4.1
 */
public synchronized void reset(){
  Iterator<Entry<IBinaryObject,AutoDisposeAddr2line>> iter=addr2lines.entrySet().iterator();
  while (iter.hasNext()) {
    Entry<IBinaryObject,AutoDisposeAddr2line> entry=iter.next();
    AutoDisposeAddr2line ada2l=entry.getValue();
    ada2l.addr2line.dispose();
    ada2l.addr2line=null;
    iter.remove();
  }
  Iterator<Entry<String,AutoDisposeCPPFilt>> iter2=cppfilts.entrySet().iterator();
  while (iter2.hasNext()) {
    Entry<String,AutoDisposeCPPFilt> entry=iter2.next();
    AutoDisposeCPPFilt adcppf=entry.getValue();
    adcppf.cppfilt.dispose();
    adcppf.cppfilt=null;
  }
}
Program: 92050
Project: 92050
Buggy source:
@Override public boolean isShowingByDefault(){
  return true;
}

Fixed version (ground truth):
/** 
 * @since 5.0
 */
@Override public boolean isShowingByDefault(){
  return true;
}
Program: 92051
Project: 92051
Buggy source:
/** 
 * It creates the wrapped TableViewer
 * @param parent - the parent Composite
 * @param style - the table style
 * @return a TableViewer
 * @since 4.1
 */
@Override protected TableViewer createViewer(Composite parent,int style){
  Table t=createTable(parent,style);
  return new TableViewer(t);
}

Fixed version (ground truth):
/** 
 * It creates the wrapped TableViewer
 * @param parent - the parent Composite
 * @param style - the table style
 * @return a TableViewer
 * @since 5.0
 */
@Override protected TableViewer createViewer(Composite parent,int style){
  Table t=createTable(parent,style);
  return new TableViewer(t);
}
Program: 92052
Project: 92052
Buggy source:
/** 
 * (non-Javadoc)
 * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTViewer#getColumns()
 * @since 4.1
 */
@Override public TableColumn[] getColumns(){
  return getViewer().getTable().getColumns();
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTViewer#getColumns()
 * @since 5.0
 */
@Override public TableColumn[] getColumns(){
  return getViewer().getTable().getColumns();
}
Program: 92053
Project: 92053
Buggy source:
/** 
 * It creates the wrapped TreeViewer
 * @param parent - the parent Composite
 * @param style - the table style
 * @return a TreeViewer
 * @since 4.1
 */
@Override protected TreeViewer createViewer(Composite parent,int style){
  Tree t=createTree(parent,style);
  return new TreeViewer(t);
}

Fixed version (ground truth):
/** 
 * It creates the wrapped TreeViewer
 * @param parent - the parent Composite
 * @param style - the table style
 * @return a TreeViewer
 * @since 5.0
 */
@Override protected TreeViewer createViewer(Composite parent,int style){
  Tree t=createTree(parent,style);
  return new TreeViewer(t);
}
Program: 92054
Project: 92054
Buggy source:
/** 
 * (non-Javadoc)
 * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTViewer#getColumns()
 * @since 4.1
 */
@Override public TreeColumn[] getColumns(){
  return getViewer().getTree().getColumns();
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTViewer#getColumns()
 * @since 5.0
 */
@Override public TreeColumn[] getColumns(){
  return getViewer().getTree().getColumns();
}
Program: 92055
Project: 92055
Buggy source:
/** 
 * Updates the columns width and status
 */
public void updateColumns(){
  Item[] columns=stViewer.getColumns();
  for (int i=columns.length; i-- > 0; ) {
    Item column=columns[i];
    if (getState(i) == STDataViewersHideShowManager.STATE_HIDDEN) {
      stViewer.setColumnWidth(column,0);
      stViewer.setColumnResizable(column,false);
    }
 else {
      stViewer.setColumnWidth(column,getWidth(i));
      stViewer.setColumnResizable(column,true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the columns width and status
 * @since 5.0
 */
public void updateColumns(){
  Item[] columns=stViewer.getColumns();
  for (int i=columns.length; i-- > 0; ) {
    Item column=columns[i];
    if (getState(i) == STDataViewersHideShowManager.STATE_HIDDEN) {
      stViewer.setColumnWidth(column,0);
      stViewer.setColumnResizable(column,false);
    }
 else {
      stViewer.setColumnWidth(column,getWidth(i));
      stViewer.setColumnResizable(column,true);
    }
  }
}
Program: 92056
Project: 92056
Buggy source:
@Override public void init(IWorkbenchWindow window){
  this.window=window;
}

Fixed version (ground truth):
/** 
 * @since 2.0
 */
@Override public void init(IWorkbenchWindow window){
  this.window=window;
}
Program: 92057
Project: 92057
Buggy source:
@Override public void selectionChanged(IAction act,ISelection select){
  action=act;
  action.setEnabled(true);
}

Fixed version (ground truth):
/** 
 * @since 2.0
 */
@Override public void selectionChanged(IAction act,ISelection select){
  action=act;
  action.setEnabled(true);
}
Program: 92058
Project: 92058
Buggy source:
@Override public void dispose(){
  window=null;
  action=null;
}

Fixed version (ground truth):
/** 
 * @since 2.0
 */
@Override public void dispose(){
  window=null;
  action=null;
}
Program: 92061
Project: 92061
Buggy source:
@Override public void checkStateChanged(CheckStateChangedEvent event){
  boolean checkStatus=event.getChecked();
  Object element=event.getElement();
  fTreeView.setGrayed(element,false);
  fTreeView.setSubtreeChecked(element,checkStatus);
  ITreeContentProvider tcp=(ITreeContentProvider)fTreeView.getContentProvider();
  String parentElement=(String)tcp.getParent(element);
  if (parentElement != null) {
    String[] siblings=(String[])tcp.getChildren(parentElement);
    final String first=siblings[0];
    final boolean isFirstChecked=fTreeView.getChecked(first);
    boolean allSame=true;
    for (    String peer : siblings) {
      final boolean peerChecked=fTreeView.getChecked(peer);
      if (peerChecked != isFirstChecked) {
        allSame=false;
      }
    }
    if (allSame) {
      fTreeView.setGrayed(parentElement,false);
      fTreeView.setChecked(parentElement,checkStatus);
    }
 else {
      fTreeView.setChecked(parentElement,false);
      fTreeView.setGrayed(parentElement,true);
    }
  }
  getWizard().getContainer().updateButtons();
}

Fixed version (ground truth):
@Override public void checkStateChanged(CheckStateChangedEvent event){
  boolean checkStatus=event.getChecked();
  Object element=event.getElement();
  fTreeView.setGrayed(element,false);
  fTreeView.setSubtreeChecked(element,checkStatus);
  ITreeContentProvider tcp=(ITreeContentProvider)fTreeView.getContentProvider();
  String parentElement=(String)tcp.getParent(element);
  if (parentElement != null) {
    TraceTypeHelper[] siblings=(TraceTypeHelper[])tcp.getChildren(parentElement);
    final TraceTypeHelper first=siblings[0];
    final boolean isFirstChecked=fTreeView.getChecked(first);
    boolean allSame=true;
    for (    TraceTypeHelper peer : siblings) {
      final boolean peerChecked=fTreeView.getChecked(peer);
      if (peerChecked != isFirstChecked) {
        allSame=false;
      }
    }
    if (allSame) {
      fTreeView.setGrayed(parentElement,false);
      fTreeView.setChecked(parentElement,checkStatus);
    }
 else {
      fTreeView.setChecked(parentElement,false);
      fTreeView.setGrayed(parentElement,true);
    }
  }
  getWizard().getContainer().updateButtons();
}
Program: 92062
Project: 92062
Buggy source:
@Override public Object getParent(Object element){
  if (element instanceof String) {
    for (    String key : fTraceCategory) {
      List<TraceTypeHelper> traceSet=fTraceType.get(key);
      if (traceSet != null) {
        if (traceSet.contains(element)) {
          return key;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Object getParent(Object element){
  if (element instanceof TraceTypeHelper) {
    for (    String key : fTraceCategory) {
      List<TraceTypeHelper> traceSet=fTraceType.get(key);
      if (traceSet != null) {
        if (traceSet.contains(element)) {
          return key;
        }
      }
    }
  }
  return null;
}
Program: 92063
Project: 92063
Buggy source:
@Override public Object execute(ExecutionEvent event) throws ExecutionException {
  TmfTraceFolder traceFolder=getTraceFolder();
  if (traceFolder == null) {
    return null;
  }
  IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench != null) {
    final IWorkbenchWindow activeWorkbenchWindow=workbench.getActiveWorkbenchWindow();
    if (activeWorkbenchWindow != null) {
      Shell shell=activeWorkbenchWindow.getShell();
      BatchImportTraceWizard wizard=new BatchImportTraceWizard();
      wizard.init(PlatformUI.getWorkbench(),new StructuredSelection(traceFolder));
      WizardDialog dialog=new NonModalWizardDialog(shell,wizard);
      dialog.open();
      traceFolder.refresh();
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Object execute(ExecutionEvent event) throws ExecutionException {
  TmfTraceFolder traceFolder=getTraceFolder();
  if (traceFolder == null) {
    return null;
  }
  IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench != null) {
    final IWorkbenchWindow activeWorkbenchWindow=workbench.getActiveWorkbenchWindow();
    if (activeWorkbenchWindow != null) {
      Shell shell=activeWorkbenchWindow.getShell();
      BatchImportTraceWizard wizard=new BatchImportTraceWizard();
      wizard.init(PlatformUI.getWorkbench(),new StructuredSelection(traceFolder));
      WizardDialog dialog=new WizardDialog(shell,wizard);
      dialog.open();
      traceFolder.refresh();
    }
  }
  return null;
}
Program: 92064
Project: 92064
Buggy source:
/** 
 * Add a file to scan
 * @param fileName the file to scan
 */
public void addFileToScan(final String fileName){
  fParentFilesToScan.add(fileName);
  startUpdateTask(Messages.BatchImportTraceWizard_add + "String_Node_Str" + fileName);
}

Fixed version (ground truth):
/** 
 * Add a file to scan
 * @param fileName the file to scan
 */
public void addFileToScan(final String fileName){
  if (!fParentFiles.containsKey(fileName)) {
    fParentFiles.put(fileName,new HashSet<String>());
    startUpdateTask(Messages.BatchImportTraceWizard_add + ' ' + fileName,fileName);
  }
}
Program: 92065
Project: 92065
Buggy source:
private synchronized IStatus updateFiles(IProgressMonitor monitor){
  final Set<String> filesToScan=new TreeSet<String>();
  final String[] parentFiles=fParentFilesToScan.toArray(new String[0]);
  final String[] traceTypes=fTraceTypesToScan.toArray(new String[0]);
  int workToDo=1;
  for (  String name : parentFiles) {
    final File file=new File(name);
    final File[] listFiles=file.listFiles();
    if (listFiles != null) {
      workToDo+=listFiles.length;
    }
  }
  int step=TOTALWORK / workToDo;
  try {
    for (    String name : parentFiles) {
      final File fileToAdd=new File(name);
      recurse(filesToScan,fileToAdd,monitor,step);
    }
    for (    String fileToScan : filesToScan) {
      for (      String traceCat : traceTypes) {
        TraceValidationHelper tv=new TraceValidationHelper(fileToScan,traceCat);
        if (!fResults.containsKey(tv)) {
          if (!fTracesToScan.contains(tv)) {
            fTracesToScan.put(tv);
            monitor.subTask(tv.getTraceToScan());
          }
        }
      }
    }
  }
 catch (  InterruptedException e) {
    monitor.done();
    return new Status(IStatus.ERROR,Activator.PLUGIN_ID,e.getMessage(),e);
  }
  monitor.done();
  return Status.OK_STATUS;
}

Fixed version (ground truth):
private synchronized IStatus updateFiles(IProgressMonitor monitor,String traceToScan){
  final Set<String> filesToScan=new TreeSet<String>();
  int workToDo=1;
  for (  String name : fParentFiles.keySet()) {
    final File file=new File(name);
    final File[] listFiles=file.listFiles();
    if (listFiles != null) {
      workToDo+=listFiles.length;
    }
  }
  int step=TOTALWORK / workToDo;
  try {
    for (    String name : fParentFiles.keySet()) {
      final File fileToAdd=new File(name);
      final Set<String> parentFilesToScan=fParentFiles.get(fileToAdd.getAbsolutePath());
      recurse(parentFilesToScan,fileToAdd,monitor,step);
      if (monitor.isCanceled()) {
        fParentFilesToScan.remove(traceToScan);
        fParentFiles.remove(traceToScan);
        return CANCEL_STATUS;
      }
    }
    filesToScan.clear();
    for (    String name : fParentFiles.keySet()) {
      filesToScan.addAll(fParentFiles.get(name));
      fParentFilesToScan.add(name);
    }
    for (    String fileToScan : filesToScan) {
      for (      String traceCat : fTraceTypesToScan) {
        TraceValidationHelper tv=new TraceValidationHelper(fileToScan,traceCat);
        if (!fResults.containsKey(tv)) {
          if (!fTracesToScan.contains(tv)) {
            fTracesToScan.put(tv);
            monitor.subTask(tv.getTraceToScan());
            if (monitor.isCanceled()) {
              fParentFilesToScan.remove(traceToScan);
              fParentFiles.remove(traceToScan);
              return CANCEL_STATUS;
            }
          }
        }
      }
    }
  }
 catch (  InterruptedException e) {
    monitor.done();
    return new Status(IStatus.ERROR,Activator.PLUGIN_ID,e.getMessage(),e);
  }
  monitor.done();
  return Status.OK_STATUS;
}
Program: 92066
Project: 92066
Buggy source:
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
synchronized (BatchImportTraceWizard.this) {
    SubMonitor sm;
    sm=SubMonitor.convert(monitor);
    sm.setTaskName(taskName);
    sm.setWorkRemaining(TOTALWORK);
    updateFiles(sm);
    sm.done();
  }
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
synchronized (BatchImportTraceWizard.this) {
    SubMonitor sm;
    sm=SubMonitor.convert(monitor);
    sm.setTaskName(taskName);
    sm.setWorkRemaining(TOTALWORK);
    updateFiles(sm,fileName);
    sm.done();
  }
}
Program: 92067
Project: 92067
Buggy source:
private void startUpdateTask(final String taskName){
  try {
    this.getContainer().run(true,false,new IRunnableWithProgress(){
      @Override public void run(      IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
synchronized (BatchImportTraceWizard.this) {
          SubMonitor sm;
          sm=SubMonitor.convert(monitor);
          sm.setTaskName(taskName);
          sm.setWorkRemaining(TOTALWORK);
          updateFiles(sm);
          sm.done();
        }
      }
    }
);
  }
 catch (  InvocationTargetException e) {
  }
catch (  InterruptedException e) {
  }
 finally {
  }
}

Fixed version (ground truth):
private void startUpdateTask(final String taskName,final String fileName){
  try {
    this.getContainer().run(true,true,new IRunnableWithProgress(){
      @Override public void run(      IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
synchronized (BatchImportTraceWizard.this) {
          SubMonitor sm;
          sm=SubMonitor.convert(monitor);
          sm.setTaskName(taskName);
          sm.setWorkRemaining(TOTALWORK);
          updateFiles(sm,fileName);
          sm.done();
        }
      }
    }
);
  }
 catch (  InvocationTargetException e) {
  }
catch (  InterruptedException e) {
  }
}
Program: 92068
Project: 92068
Buggy source:
/** 
 * Remove files from selection
 * @param fileName the name of the file to remove
 */
public void removeFile(final String fileName){
  fParentFilesToScan.remove(fileName);
  startUpdateTask(Messages.BatchImportTraceWizard_remove + "String_Node_Str" + fileName);
}

Fixed version (ground truth):
/** 
 * Remove files from selection
 * @param fileName the name of the file to remove
 */
public void removeFile(final String fileName){
  fParentFiles.remove(fileName);
  fParentFilesToScan.remove(fileName);
  startUpdateTask(Messages.BatchImportTraceWizard_remove + ' ' + fileName,null);
}
Program: 92069
Project: 92069
Buggy source:
@Override public void addPages(){
  addPage(fSelectTypePage);
  addPage(fSelectDirectoriesPage);
  addPage(fScanPage);
  final WizardDialog container=(WizardDialog)getContainer();
  container.setPageSize(800,400);
  container.updateSize();
}

Fixed version (ground truth):
@Override public void addPages(){
  addPage(fSelectTypePage);
  addPage(fSelectDirectoriesPage);
  addPage(fScanPage);
  final WizardDialog container=(WizardDialog)getContainer();
  if (container != null) {
    container.setPageSize(WIN_WIDTH,WIN_HEIGHT);
    container.updateSize();
  }
}
Program: 92070
Project: 92070
Buggy source:
private void recurse(Set<String> filesToScan,File fileToAdd){
  final String absolutePath=fileToAdd.getAbsolutePath();
  if (!filesToScan.contains(absolutePath) && (filesToScan.size() < MAX_FILES)) {
    filesToScan.add(absolutePath);
    final File[] listFiles=fileToAdd.listFiles();
    if (null != listFiles) {
      for (      File child : listFiles) {
        recurse(filesToScan,child);
      }
    }
  }
}

Fixed version (ground truth):
private IStatus recurse(Set<String> filesToScan,File fileToAdd,IProgressMonitor monitor){
  final String absolutePath=fileToAdd.getAbsolutePath();
  if (!filesToScan.contains(absolutePath) && (filesToScan.size() < MAX_FILES)) {
    filesToScan.add(absolutePath);
    final File[] listFiles=fileToAdd.listFiles();
    if (null != listFiles) {
      for (      File child : listFiles) {
        if (monitor.isCanceled()) {
          return CANCEL_STATUS;
        }
        IStatus retVal=recurse(filesToScan,child,monitor);
        if (retVal.getSeverity() == IStatus.CANCEL) {
          return retVal;
        }
      }
    }
  }
  return Status.OK_STATUS;
}
Program: 92071
Project: 92071
Buggy source:
public ScanRunnable(String name){
  super(name);
}

Fixed version (ground truth):
public ScanRunnable(String name){
  super(name);
  this.setSystem(true);
}
Program: 92072
Project: 92072
Buggy source:
/** 
 * Gets all the custom trace types
 * @return the list of custom trace types
 * @since 2.0
 */
public List<String> getCustomTraceTypes(){
  List<String> traceTypes=new ArrayList<String>();
  final String[] keySet=fTraceTypes.keySet().toArray(new String[0]);
  for (  String key : keySet) {
    if (fTraceTypes.get(key).getCategoryName().equals(CUSTOM_TXT_CATEGORY) || fTraceTypes.get(key).getCategoryName().equals(CUSTOM_XML_CATEGORY)) {
      fTraceTypes.remove(key);
    }
  }
  for (  CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
    String traceTypeName=CUSTOM_TXT_CATEGORY + "String_Node_Str" + def.definitionName;
    TraceTypeHelper tt=new TraceTypeHelper(traceTypeName,CUSTOM_TXT_CATEGORY,def.definitionName,null);
    fTraceTypes.put(traceTypeName,tt);
    traceTypes.add(traceTypeName);
  }
  for (  CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
    String traceTypeName=CUSTOM_XML_CATEGORY + "String_Node_Str" + def.definitionName;
    TraceTypeHelper tt=new TraceTypeHelper(traceTypeName,CUSTOM_TXT_CATEGORY,def.definitionName,null);
    fTraceTypes.put(traceTypeName,tt);
    traceTypes.add(traceTypeName);
  }
  return traceTypes;
}

Fixed version (ground truth):
/** 
 * Gets all the custom trace types
 * @return the list of custom trace types
 * @since 2.0
 */
public List<String> getCustomTraceTypes(){
  List<String> traceTypes=new ArrayList<String>();
  final String[] keySet=fTraceTypes.keySet().toArray(new String[0]);
  for (  String key : keySet) {
    if (fTraceTypes.get(key).getCategoryName().equals(CUSTOM_TXT_CATEGORY) || fTraceTypes.get(key).getCategoryName().equals(CUSTOM_XML_CATEGORY)) {
      fTraceTypes.remove(key);
    }
  }
  for (  CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
    String traceTypeName=CUSTOM_TXT_CATEGORY + SEPARATOR + def.definitionName;
    TraceTypeHelper tt=new TraceTypeHelper(traceTypeName,CUSTOM_TXT_CATEGORY,def.definitionName,null);
    fTraceTypes.put(traceTypeName,tt);
    traceTypes.add(traceTypeName);
  }
  for (  CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
    String traceTypeName=CUSTOM_XML_CATEGORY + SEPARATOR + def.definitionName;
    TraceTypeHelper tt=new TraceTypeHelper(traceTypeName,CUSTOM_TXT_CATEGORY,def.definitionName,null);
    fTraceTypes.put(traceTypeName,tt);
    traceTypes.add(traceTypeName);
  }
  return traceTypes;
}
Program: 92073
Project: 92073
Buggy source:
/** 
 * Returns a list of "category : tracetype , ..."
 * @return returns a list of "category : tracetype , ..."
 * @since 2.0
 */
public String[] getAvailableTraceTypes(){
  List<String> traceTypes=new ArrayList<String>();
  List<String> customTypes=getCustomTraceTypes();
  for (  String key : this.fTraceTypes.keySet()) {
    TraceTypeHelper tt=this.fTraceTypes.get(key);
    traceTypes.add(tt.getCategoryName() + "String_Node_Str" + tt.getName());
  }
  traceTypes.addAll(customTypes);
  return traceTypes.toArray(new String[traceTypes.size()]);
}

Fixed version (ground truth):
/** 
 * Returns a list of "category:tracetype , ..."
 * @return returns a list of "category:tracetype , ..."
 * @since 2.0
 */
public String[] getAvailableTraceTypes(){
  List<String> traceTypes=new ArrayList<String>();
  List<String> customTypes=getCustomTraceTypes();
  for (  String key : this.fTraceTypes.keySet()) {
    TraceTypeHelper tt=this.fTraceTypes.get(key);
    traceTypes.add(tt.getCategoryName() + SEPARATOR + tt.getName());
  }
  traceTypes.addAll(customTypes);
  return traceTypes.toArray(new String[traceTypes.size()]);
}
Program: 92074
Project: 92074
Buggy source:
@Override public void addPages(){
  addPage(fSelectTypePage);
  addPage(fSelectDirectoriesPage);
  addPage(fScanPage);
  final WizardDialog container=(WizardDialog)getContainer();
  if (container != null) {
    container.setPageSize(WIN_WIDTH,WIN_HEIGHT);
    container.updateSize();
  }
}

Fixed version (ground truth):
@Override public void addPages(){
  addPage(fSelectTypePage);
  addPage(fSelectDirectoriesPage);
  addPage(fScanPage);
  addPage(fOptions);
  final WizardDialog container=(WizardDialog)getContainer();
  if (container != null) {
    container.setPageSize(WIN_WIDTH,WIN_HEIGHT);
  }
}
Program: 92075
Project: 92075
Buggy source:
@Override public void init(IWorkbench workbench,IStructuredSelection selection){
  fSelectDirectoriesPage=new ImportTraceWizardSelectDirectoriesPage(workbench,selection);
  fScanPage=new ImportTraceWizardScanPage(workbench,selection);
  fSelectTypePage=new ImportTraceWizardSelectTraceTypePage(workbench,selection);
  Iterator<?> iter=selection.iterator();
  while (iter.hasNext()) {
    Object selected=iter.next();
    if (selected instanceof TmfTraceFolder) {
      fTargetFolder=((TmfTraceFolder)selected).getResource();
      break;
    }
  }
  fResults.clear();
}

Fixed version (ground truth):
@Override public void init(IWorkbench workbench,IStructuredSelection selection){
  fSelectDirectoriesPage=new ImportTraceWizardSelectDirectoriesPage(workbench,selection);
  fScanPage=new ImportTraceWizardScanPage(workbench,selection);
  fSelectTypePage=new ImportTraceWizardSelectTraceTypePage(workbench,selection);
  fOptions=new ImportTraceWizardPageOptions(workbench,selection);
  Iterator<?> iter=selection.iterator();
  while (iter.hasNext()) {
    Object selected=iter.next();
    if (selected instanceof TmfTraceFolder) {
      fTargetFolder=((TmfTraceFolder)selected).getResource();
      break;
    }
  }
  fResults.clear();
}
Program: 92076
Project: 92076
Buggy source:
@Override public boolean canFinish(){
  return super.canFinish() && hasTracesToImport() && !hasConflicts();
}

Fixed version (ground truth):
@Override public boolean canFinish(){
  return super.canFinish() && hasTracesToImport() && !hasConflicts()&& (fTargetFolder != null);
}
Program: 92078
Project: 92078
Buggy source:
private static void initializeOperation(ImportOperation op){
  op.setCreateContainerStructure(false);
  op.setOverwriteResources(false);
  op.setCreateLinks(true);
  op.setVirtualFolders(false);
}

Fixed version (ground truth):
private static void initializeOperation(ImportOperation op){
  op.setCreateContainerStructure(false);
  op.setOverwriteResources(false);
  op.setVirtualFolders(false);
}
Program: 92079
Project: 92079
Buggy source:
/** 
 * Gets the folder in the resource (project)
 * @param targetFolder the folder to import to
 */
public void setTraceFolder(IFolder targetFolder){
  fTargetFolder=targetFolder;
}

Fixed version (ground truth):
/** 
 * Gets the folder in the resource (project)
 * @param targetFolder the folder to import to
 */
public void setTraceFolder(IFolder targetFolder){
  fTargetFolder=targetFolder;
  if (this.getContainer() != null && this.getContainer().getCurrentPage() != null) {
    this.getContainer().updateButtons();
  }
}
Program: 92081
Project: 92081
Buggy source:
/** 
 * Returns the time graph control associated with this viewer.
 * @return the time graph control
 */
TimeGraphControl getTimeGraphControl(){
  return _stateCtrl;
}

Fixed version (ground truth):
/** 
 * Returns the time graph control associated with this viewer.
 * @return the time graph control
 * @since 2.0
 */
public TimeGraphControl getTimeGraphControl(){
  return _stateCtrl;
}
Program: 92082
Project: 92082
Buggy source:
/** 
 * Refresh the view
 */
public void refresh(){
  setInput(_stateCtrl.getTraces());
}

Fixed version (ground truth):
/** 
 * Refresh the view
 */
public void refresh(){
  setTimeRange(_stateCtrl.getTraces());
  _verticalScrollBar.setEnabled(true);
  refreshAllData(_stateCtrl.getTraces());
}
Program: 92083
Project: 92083
Buggy source:
/** 
 * Returns the time graph scale associated with this viewer.
 * @return the time graph scale
 */
TimeGraphScale getTimeGraphScale(){
  return _timeScaleCtrl;
}

Fixed version (ground truth):
/** 
 * Returns the time graph scale associated with this viewer.
 * @return the time graph scale
 * @since 2.0
 */
public TimeGraphScale getTimeGraphScale(){
  return _timeScaleCtrl;
}