nus-yam/ex-repair huggingface dataset:
Program: 91961
Project: 91961
Buggy source:
/** 
 * Changes the location of the trace file reader so that the current event is the first event with a timestamp greater than the given timestamp.
 * @param timestamp The timestamp to seek to.
 * @return The offset compared to the current position
 */
public long seek(long timestamp){
  long offset=0;
  gotoPacket(timestamp);
  while ((this.packetReader.getCurrentPacket() != null) && (this.packetReader.getCurrentPacket().getTimestampEnd() < timestamp)) {
    try {
      this.streamInput.addPacketHeaderIndex();
      goToNextPacket();
    }
 catch (    CTFReaderException e) {
    }
  }
  if (this.packetReader.getCurrentPacket() == null) {
    gotoPacket(timestamp);
  }
  readNextEvent();
  boolean done=(this.getCurrentEvent() == null);
  while (!done && (this.getCurrentEvent().getTimestamp() < timestamp)) {
    readNextEvent();
    done=(this.getCurrentEvent() == null);
    offset++;
  }
  return offset;
}

Fixed version (ground truth):
/** 
 * Changes the location of the trace file reader so that the current event is the first event with a timestamp greater or equal the given timestamp.
 * @param timestamp The timestamp to seek to.
 * @return The offset compared to the current position
 */
public long seek(long timestamp){
  long offset=0;
  gotoPacket(timestamp);
  while ((this.packetReader.getCurrentPacket() != null) && (this.packetReader.getCurrentPacket().getTimestampEnd() < timestamp)) {
    try {
      this.streamInput.addPacketHeaderIndex();
      goToNextPacket();
    }
 catch (    CTFReaderException e) {
    }
  }
  if (this.packetReader.getCurrentPacket() == null) {
    gotoPacket(timestamp);
  }
  readNextEvent();
  boolean done=(this.getCurrentEvent() == null);
  while (!done && (this.getCurrentEvent().getTimestamp() < timestamp)) {
    readNextEvent();
    done=(this.getCurrentEvent() == null);
    offset++;
  }
  return offset;
}
Program: 91962
Project: 91962
Buggy source:
/** 
 * Sets the id of am event declaration
 * @param id the id
 */
public void setId(long id){
  this.id=id;
}

Fixed version (ground truth):
/** 
 * Sets the id of an event declaration
 * @param id the id
 */
public void setId(long id){
  this.id=id;
}
Program: 91963
Project: 91963
Buggy source:
/** 
 * Sets the stream of am event declaration
 * @param stream the stream
 * @since 2.0
 */
public void setStream(Stream stream){
  this.stream=stream;
}

Fixed version (ground truth):
/** 
 * Sets the stream of an event declaration
 * @param stream the stream
 * @since 2.0
 */
public void setStream(Stream stream){
  this.stream=stream;
}
Program: 91964
Project: 91964
Buggy source:
/** 
 * Constuctor
 * @param tree the tree (ANTLR generated) with the parsed TSDL data.
 * @param trace the trace containing the places to put all the read metadata
 */
public IOStructGen(CommonTree tree,CTFTrace trace){
  this.trace=trace;
  this.tree=tree;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param tree the tree (ANTLR generated) with the parsed TSDL data.
 * @param trace the trace containing the places to put all the read metadata
 */
public IOStructGen(CommonTree tree,CTFTrace trace){
  this.trace=trace;
  this.tree=tree;
}
Program: 91965
Project: 91965
Buggy source:
/** 
 * This method returns the first packet with the end timestamp greater or equal to the given timestamp. The returned packet is the first one that could include the timestamp.
 * @param timestamp The timestamp to look for.
 * @return The StreamInputPacketEntry that corresponds to the packet thatincludes the given timestamp.
 */
public ListIterator<StreamInputPacketIndexEntry> search(final long timestamp){
  int max=this.entries.size() - 1;
  int min=0;
  int guessI;
  StreamInputPacketIndexEntry guessEntry=null;
  if (this.getEntries().isEmpty()) {
    return this.getEntries().listIterator();
  }
  if (timestamp < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (; ; ) {
    guessI=min + ((max - min) / 2);
    guessEntry=this.entries.get(guessI);
    if (min == max) {
      break;
    }
    if (timestamp <= guessEntry.getTimestampEnd()) {
      max=guessI;
    }
 else {
      min=guessI + 1;
    }
  }
  return this.entries.listIterator(guessI);
}

Fixed version (ground truth):
/** 
 * Returns the first PacketIndexEntry that could include the timestamp, that is the last packet with a begin timestamp smaller than the given timestamp.
 * @param timestamp The timestamp to look for.
 * @return The StreamInputPacketEntry that corresponds to the packet thatincludes the given timestamp.
 */
public ListIterator<StreamInputPacketIndexEntry> search(final long timestamp){
  int max=this.entries.size() - 1;
  int min=0;
  int guessI;
  StreamInputPacketIndexEntry guessEntry=null;
  if (this.getEntries().isEmpty()) {
    return this.getEntries().listIterator();
  }
  if (timestamp < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (; ; ) {
    guessI=min + ((max - min) / 2);
    guessEntry=this.entries.get(guessI);
    if (min == max) {
      break;
    }
    if (timestamp <= guessEntry.getTimestampEnd()) {
      max=guessI;
    }
 else {
      min=guessI + 1;
    }
  }
  return this.entries.listIterator(guessI);
}
Program: 91966
Project: 91966
Buggy source:
/** 
 * Adds an entry to the index.
 * @param entry The entry to add
 * @throws CTFReaderException If there was a problem reading the entry
 */
public void addEntry(StreamInputPacketIndexEntry entry) throws CTFReaderException {
  assert(entry.getContentSizeBits() != 0);
  assert(entry.getContentSizeBits() != 0);
  if (entry.getTimestampBegin() > entry.getTimestampEnd()) {
    throw new CTFReaderException("String_Node_Str");
  }
  if (!this.entries.isEmpty()) {
    if (entry.getTimestampBegin() < this.entries.lastElement().getTimestampBegin()) {
      throw new CTFReaderException("String_Node_Str");
    }
  }
  this.entries.add(entry);
}

Fixed version (ground truth):
/** 
 * Adds an entry to the index.
 * @param entry The entry to add
 * @throws CTFReaderException If there was a problem reading the entry
 */
public void addEntry(StreamInputPacketIndexEntry entry) throws CTFReaderException {
  assert(entry.getContentSizeBits() != 0);
  if (entry.getTimestampBegin() > entry.getTimestampEnd()) {
    throw new CTFReaderException("String_Node_Str");
  }
  if (!this.entries.isEmpty()) {
    if (entry.getTimestampBegin() < this.entries.lastElement().getTimestampBegin()) {
      throw new CTFReaderException("String_Node_Str");
    }
  }
  this.entries.add(entry);
}
Program: 91967
Project: 91967
Buggy source:
/** 
 * This needs explaining: the iterator table is effectively a cache. Originally the contexts had a 1 to 1 structure with the file handles of a trace. This failed since there is a limit to how many file handles we can have opened simultaneously. Then a round-robin scheme was implemented, this lead up to a two competing contexts syncing up and using the same file handler, causing horrible slowdowns. Now a random replacement algorithm is selected. This is the same as used by arm processors, and it works quite well when many cores so this looks promising for very multi-threaded systems.
 * @param context the context to look up
 * @return the iterator refering to the context
 */
public CtfIterator getIterator(final CtfTmfContext context){
  CtfIterator retVal=fMap.get(context);
  if (retVal == null) {
    if (fRandomAccess.size() < MAX_SIZE) {
      retVal=fTrace.createIterator();
      addElement(context,retVal);
    }
 else {
      retVal=replaceRandomElement(context);
    }
    if (context.getLocation() != null) {
      final CtfLocationInfo location=(CtfLocationInfo)context.getLocation().getLocationInfo();
      retVal.seek(location);
    }
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * This needs explaining: the iterator table is effectively a cache. Originally the contexts had a 1 to 1 structure with the file handles of a trace. This failed since there is a limit to how many file handles we can have opened simultaneously. Then a round-robin scheme was implemented, this lead up to a two competing contexts syncing up and using the same file handler, causing horrible slowdowns. Now a random replacement algorithm is selected. This is the same as used by arm processors, and it works quite well when many cores so this looks promising for very multi-threaded systems.
 * @param context the context to look up
 * @return the iterator referring to the context
 */
public CtfIterator getIterator(final CtfTmfContext context){
  CtfIterator retVal=fMap.get(context);
  if (retVal == null) {
    if (fRandomAccess.size() < MAX_SIZE) {
      retVal=fTrace.createIterator();
      addElement(context,retVal);
    }
 else {
      retVal=replaceRandomElement(context);
    }
    if (context.getLocation() != null) {
      final CtfLocationInfo location=(CtfLocationInfo)context.getLocation().getLocationInfo();
      retVal.seek(location);
    }
  }
  return retVal;
}
Program: 91968
Project: 91968
Buggy source:
/** 
 * Constructor. Only   {@link CtfTmfEventFactory} should call this.
 * @param trace The origin trace
 * @param rank The rank of the event in the trace
 * @param content The event's payload (fields). In case this event has some.
 * @param fileName The name of the trace file from which this event comes
 * @param cpu The CPU on which this event happend
 * @param declaration The CTF Event Declaration object that created this event
 * @param timeRange The time range of lost events indicated by this one
 * @param nbLost The number of lost events in the range
 */
CtfTmfLostEvent(CtfTmfTrace trace,long rank,ITmfEventField content,String fileName,int cpu,IEventDeclaration declaration,TmfTimeRange timeRange,long nbLost){
  super(trace,rank,(CtfTmfTimestamp)timeRange.getStartTime(),content,fileName,cpu,declaration);
  fTimeRange=timeRange;
  fNbLost=nbLost;
}

Fixed version (ground truth):
/** 
 * Constructor. Only   {@link CtfTmfEventFactory} should call this.
 * @param trace The origin trace
 * @param rank The rank of the event in the trace
 * @param content The event's payload (fields). In case this event has some.
 * @param fileName The name of the trace file from which this event comes
 * @param cpu The CPU on which this event happened
 * @param declaration The CTF Event Declaration object that created this event
 * @param timeRange The time range of lost events indicated by this one
 * @param nbLost The number of lost events in the range
 */
CtfTmfLostEvent(CtfTmfTrace trace,long rank,ITmfEventField content,String fileName,int cpu,IEventDeclaration declaration,TmfTimeRange timeRange,long nbLost){
  super(trace,rank,(CtfTmfTimestamp)timeRange.getStartTime(),content,fileName,cpu,declaration);
  fTimeRange=timeRange;
  fNbLost=nbLost;
}
Program: 91969
Project: 91969
Buggy source:
/** 
 * return the first label that matches a value
 * @param value the value to query
 * @return the label corresponding to that value
 */
public String query(long value){
  for (  Range r : ranges) {
    if (r.intersects(value)) {
      return r.str;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return the first label that matches a value
 * @param value the value to query
 * @return the label corresponding to that value
 */
public String query(long value){
  for (  Range r : ranges) {
    if (r.intersects(value)) {
      return r.str;
    }
  }
  return null;
}
Program: 91970
Project: 91970
Buggy source:
/** 
 * THe value of a float stored, fit into a double. This should be extended for exotic floats if this is necessary.
 * @return the value of the float field fit into a double.
 */
public double getValue(){
  return value;
}

Fixed version (ground truth):
/** 
 * The value of a float stored, fit into a double. This should be extended for exotic floats if this is necessary.
 * @return the value of the float field fit into a double.
 */
public double getValue(){
  return value;
}
Program: 91971
Project: 91971
Buggy source:
/** 
 * is the integer a character (8 bits and encoded?)
 * @return is the integer a char
 */
public boolean isCharacter(){
  return (length == 8) && (encoding != Encoding.NONE);
}

Fixed version (ground truth):
/** 
 * Is the integer a character (8 bits and encoded?)
 * @return is the integer a char
 */
public boolean isCharacter(){
  return (length == 8) && (encoding != Encoding.NONE);
}
Program: 91972
Project: 91972
Buggy source:
/** 
 * get encoding, chars are 8 bit ints
 * @return the encoding
 */
public Encoding getEncoding(){
  return encoding;
}

Fixed version (ground truth):
/** 
 * Get encoding, chars are 8 bit ints
 * @return the encoding
 */
public Encoding getEncoding(){
  return encoding;
}
Program: 91973
Project: 91973
Buggy source:
/** 
 * Contructor
 * @param len The length in bits
 * @param signed Is the integer signed? false == unsigned
 * @param base The base (10-16 are most common)
 * @param byteOrder Big endian little endian or other
 * @param encoding ascii, utf8 or none.
 * @param clock The clock path, can be null
 * @param alignment The minimum alignment. Should be >= 1
 */
public IntegerDeclaration(int len,boolean signed,int base,ByteOrder byteOrder,Encoding encoding,String clock,long alignment){
  if (len <= 0 || len == 1 && signed) {
    throw new IllegalArgumentException();
  }
  this.length=len;
  this.signed=signed;
  this.base=base;
  this.byteOrder=byteOrder;
  this.encoding=encoding;
  this.clock=clock;
  this.alignment=Math.max(alignment,1);
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param len The length in bits
 * @param signed Is the integer signed? false == unsigned
 * @param base The base (10-16 are most common)
 * @param byteOrder Big-endian little-endian or other
 * @param encoding ascii, utf8 or none.
 * @param clock The clock path, can be null
 * @param alignment The minimum alignment. Should be >= 1
 */
public IntegerDeclaration(int len,boolean signed,int base,ByteOrder byteOrder,Encoding encoding,String clock,long alignment){
  if (len <= 0 || len == 1 && signed) {
    throw new IllegalArgumentException();
  }
  this.length=len;
  this.signed=signed;
  this.base=base;
  this.byteOrder=byteOrder;
  this.encoding=encoding;
  this.clock=clock;
  this.alignment=Math.max(alignment,1);
}
Program: 91974
Project: 91974
Buggy source:
/** 
 * gets the byte order
 * @return the byte order
 */
public ByteOrder getByteOrder(){
  return byteOrder;
}

Fixed version (ground truth):
/** 
 * Gets the byte order
 * @return the byte order
 */
public ByteOrder getByteOrder(){
  return byteOrder;
}
Program: 91975
Project: 91975
Buggy source:
/** 
 * get the integer base commonly decimal or hex
 * @return the integer base
 */
public int getBase(){
  return base;
}

Fixed version (ground truth):
/** 
 * Get the integer base commonly decimal or hex
 * @return the integer base
 */
public int getBase(){
  return base;
}
Program: 91976
Project: 91976
Buggy source:
/** 
 * gets the value in integer form
 * @return the integer in a Long, can be null
 */
public Long getIntegerValue(){
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the value in integer form
 * @return the integer in a Long, can be null
 */
public Long getIntegerValue(){
  return null;
}
Program: 91977
Project: 91977
Buggy source:
/** 
 * gets the value in string form
 * @return the integer in a String, can be null
 */
public String getStringValue(){
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the value in string form
 * @return the integer in a String, can be null
 */
public String getStringValue(){
  return null;
}
Program: 91978
Project: 91978
Buggy source:
/** 
 * generate an encoded string declaration
 * @param encoding the encoding, utf8 or ascii
 */
public StringDeclaration(Encoding encoding){
  this.encoding=encoding;
}

Fixed version (ground truth):
/** 
 * Generate an encoded string declaration
 * @param encoding the encoding, utf8 or ascii
 */
public StringDeclaration(Encoding encoding){
  this.encoding=encoding;
}
Program: 91979
Project: 91979
Buggy source:
/** 
 * Lookup a string in a struct. if the name returns a non-string (like an int) than the method returns null
 * @param name the name of the string
 * @return the string or null.
 */
public StringDefinition lookupString(String name){
  Definition def=lookupDefinition(name);
  return (StringDefinition)((def instanceof StringDefinition) ? def : null);
}

Fixed version (ground truth):
/** 
 * Lookup a string in a struct. If the name returns a non-string (like an int) than the method returns null
 * @param name the name of the string
 * @return the string or null.
 */
public StringDefinition lookupString(String name){
  Definition def=lookupDefinition(name);
  return (StringDefinition)((def instanceof StringDefinition) ? def : null);
}
Program: 91980
Project: 91980
Buggy source:
/** 
 * Lookup an array in a struct. if the name returns a non-array (like an int) than the method returns null
 * @param name the name of the array
 * @return the array or null.
 */
public ArrayDefinition lookupArray(String name){
  Definition def=lookupDefinition(name);
  return (ArrayDefinition)((def instanceof ArrayDefinition) ? def : null);
}

Fixed version (ground truth):
/** 
 * Lookup an array in a struct. If the name returns a non-array (like an int) than the method returns null
 * @param name the name of the array
 * @return the array or null.
 */
public ArrayDefinition lookupArray(String name){
  Definition def=lookupDefinition(name);
  return (ArrayDefinition)((def instanceof ArrayDefinition) ? def : null);
}
Program: 91981
Project: 91981
Buggy source:
/** 
 * Lookup a variant in a struct. if the name returns a non-variant (like an int) than the method returns null
 * @param name the name of the variant
 * @return the variant or null.
 */
public VariantDefinition lookupVariant(String name){
  Definition def=lookupDefinition(name);
  return (VariantDefinition)((def instanceof VariantDefinition) ? def : null);
}

Fixed version (ground truth):
/** 
 * Lookup a variant in a struct. If the name returns a non-variant (like an int) than the method returns null
 * @param name the name of the variant
 * @return the variant or null.
 */
public VariantDefinition lookupVariant(String name){
  Definition def=lookupDefinition(name);
  return (VariantDefinition)((def instanceof VariantDefinition) ? def : null);
}
Program: 91982
Project: 91982
Buggy source:
/** 
 * Lookup a struct in a struct. if the name returns a non-struct (like an int) than the method returns null
 * @param name the name of the struct
 * @return the struct or null.
 */
public StructDefinition lookupStruct(String name){
  Definition def=lookupDefinition(name);
  return (StructDefinition)((def instanceof StructDefinition) ? def : null);
}

Fixed version (ground truth):
/** 
 * Lookup a struct in a struct. If the name returns a non-struct (like an int) than the method returns null
 * @param name the name of the struct
 * @return the struct or null.
 */
public StructDefinition lookupStruct(String name){
  Definition def=lookupDefinition(name);
  return (StructDefinition)((def instanceof StructDefinition) ? def : null);
}
Program: 91983
Project: 91983
Buggy source:
/** 
 * Lookup an integer in a struct. if the name returns a non-integer (like an float) than the method returns null
 * @param name the name of the integer
 * @return the integer or null.
 */
public IntegerDefinition lookupInteger(String name){
  Definition def=lookupDefinition(name);
  return (IntegerDefinition)((def instanceof IntegerDefinition) ? def : null);
}

Fixed version (ground truth):
/** 
 * Lookup an integer in a struct. If the name returns a non-integer (like an float) than the method returns null
 * @param name the name of the integer
 * @return the integer or null.
 */
public IntegerDefinition lookupInteger(String name){
  Definition def=lookupDefinition(name);
  return (IntegerDefinition)((def instanceof IntegerDefinition) ? def : null);
}
Program: 91984
Project: 91984
Buggy source:
/** 
 * Lookup an enum in a struct. if the name returns a non-enum (like an int) than the method returns null
 * @param name the name of the enum
 * @return the enum or null.
 */
public EnumDefinition lookupEnum(String name){
  Definition def=lookupDefinition(name);
  return (EnumDefinition)((def instanceof EnumDefinition) ? def : null);
}

Fixed version (ground truth):
/** 
 * Lookup an enum in a struct. If the name returns a non-enum (like an int) than the method returns null
 * @param name the name of the enum
 * @return the enum or null.
 */
public EnumDefinition lookupEnum(String name){
  Definition def=lookupDefinition(name);
  return (EnumDefinition)((def instanceof EnumDefinition) ? def : null);
}
Program: 91985
Project: 91985
Buggy source:
/** 
 * Lookup a sequence in a struct. if the name returns a non-sequence (like an int) than the method returns null
 * @param name the name of the sequence
 * @return the sequence or null.
 */
public SequenceDefinition lookupSequence(String name){
  Definition def=lookupDefinition(name);
  return (SequenceDefinition)((def instanceof SequenceDefinition) ? def : null);
}

Fixed version (ground truth):
/** 
 * Lookup a sequence in a struct. If the name returns a non-sequence (like an int) than the method returns null
 * @param name the name of the sequence
 * @return the sequence or null.
 */
public SequenceDefinition lookupSequence(String name){
  Definition def=lookupDefinition(name);
  return (SequenceDefinition)((def instanceof SequenceDefinition) ? def : null);
}
Program: 91986
Project: 91986
Buggy source:
/** 
 * gets current variant tag
 * @return the variant tag.
 */
public String getTag(){
  return this.tag;
}

Fixed version (ground truth):
/** 
 * Gets current variant tag
 * @return the variant tag.
 */
public String getTag(){
  return this.tag;
}
Program: 91987
Project: 91987
Buggy source:
/** 
 * constructor
 */
public VariantDeclaration(){
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public VariantDeclaration(){
}
Program: 91988
Project: 91988
Buggy source:
/** 
 * resets the bitbuffer.
 */
public void clear(){
  position(0);
  if (this.buf == null) {
    return;
  }
  this.buf.clear();
}

Fixed version (ground truth):
/** 
 * Resets the bitbuffer.
 */
public void clear(){
  position(0);
  if (this.buf == null) {
    return;
  }
  this.buf.clear();
}
Program: 91989
Project: 91989
Buggy source:
/** 
 * Relative <i>get</i> method for reading integer of <i>length</i> bits. Reads <i>length</i> bits starting at the current position. The result is signed extended if <i>signed</i> is true. The current position is increased of <i>length</i> bits.
 * @param length The length in bits of this integer
 * @param signed The sign extended flag
 * @return The int value read from the buffer
 */
public int getInt(int length,boolean signed){
  int val=0;
  if (!canRead(length)) {
    throw new BufferOverflowException();
  }
  if (length == 0) {
    return 0;
  }
  boolean gotIt=false;
  if (this.pos % BitBuffer.BIT_CHAR == 0) {
switch (length) {
case BitBuffer.BIT_CHAR:
      if (signed) {
        val=this.buf.get((int)(this.pos / 8));
      }
 else {
        val=(this.buf.get((int)(this.pos / 8))) & 0xff;
      }
    gotIt=true;
  break;
case BitBuffer.BIT_SHORT:
if (signed) {
  val=this.buf.getShort((int)(this.pos / 8));
}
 else {
  short a=this.buf.getShort((int)(this.pos / 8));
  val=a & 0xffff;
}
gotIt=true;
break;
case BitBuffer.BIT_INT:
val=this.buf.getInt((int)(this.pos / 8));
gotIt=true;
break;
default :
break;
}
}
if (!gotIt) {
if (this.byteOrder == ByteOrder.LITTLE_ENDIAN) {
val=getIntLE(this.pos,length,signed);
}
 else {
val=getIntBE(this.pos,length,signed);
}
}
this.pos+=length;
return val;
}

Fixed version (ground truth):
/** 
 * Relative <i>get</i> method for reading integer of <i>length</i> bits. Reads <i>length</i> bits starting at the current position. The result is signed extended if <i>signed</i> is true. The current position is increased of <i>length</i> bits.
 * @param length The length in bits of this integer
 * @param signed The sign extended flag
 * @return The int value read from the buffer
 */
public int getInt(int length,boolean signed){
  if (length == 0) {
    return 0;
  }
  if (!canRead(length)) {
    throw new BufferOverflowException();
  }
  int val=0;
  boolean gotIt=false;
  if (this.pos % BitBuffer.BIT_CHAR == 0) {
switch (length) {
case BitBuffer.BIT_CHAR:
      val=this.buf.get((int)(this.pos / 8));
    if (!signed) {
      val=val & 0xff;
    }
  gotIt=true;
break;
case BitBuffer.BIT_SHORT:
val=this.buf.getShort((int)(this.pos / 8));
if (!signed) {
val=val & 0xffff;
}
gotIt=true;
break;
case BitBuffer.BIT_INT:
val=this.buf.getInt((int)(this.pos / 8));
gotIt=true;
break;
default :
break;
}
}
if (!gotIt) {
if (this.byteOrder == ByteOrder.LITTLE_ENDIAN) {
val=getIntLE(this.pos,length,signed);
}
 else {
val=getIntBE(this.pos,length,signed);
}
}
this.pos+=length;
return val;
}
Program: 91990
Project: 91990
Buggy source:
/** 
 * Constructor that is fully parametrisable
 * @param buf the buffer to read
 * @param order the byte order (big endian, little endian, network?)
 */
public BitBuffer(ByteBuffer buf,ByteOrder order){
  setByteBuffer(buf);
  setByteOrder(order);
  position(0);
}

Fixed version (ground truth):
/** 
 * Constructor that is fully parameterizable
 * @param buf the buffer to read
 * @param order the byte order (big-endian, little-endian, network?)
 */
public BitBuffer(ByteBuffer buf,ByteOrder order){
  setByteBuffer(buf);
  setByteOrder(order);
  position(0);
}
Program: 91991
Project: 91991
Buggy source:
/** 
 * Suspend the thread
 */
public synchronized void suspend(){
  pausedLatch=new CountDownLatch(1);
  TmfCoreTracer.traceRequest(fRequest,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Suspend the thread
 */
public void suspend(){
  fIsPaused=true;
  TmfCoreTracer.traceRequest(fRequest,"String_Node_Str");
}
Program: 91992
Project: 91992
Buggy source:
/** 
 * Resume the thread
 */
public synchronized void resume(){
  pausedLatch.countDown();
  TmfCoreTracer.traceRequest(fRequest,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Resume the thread
 */
public void resume(){
  fIsPaused=false;
synchronized (fSynchObject) {
    fSynchObject.notifyAll();
  }
  TmfCoreTracer.traceRequest(fRequest,"String_Node_Str");
}
Program: 91993
Project: 91993
Buggy source:
/** 
 * @return The request execution state
 */
public synchronized boolean isPaused(){
  return (pausedLatch.getCount() > 0);
}

Fixed version (ground truth):
/** 
 * @return The request execution state
 */
public boolean isPaused(){
  return fIsPaused;
}
Program: 91994
Project: 91994
Buggy source:
@Override public void run(){
  TmfCoreTracer.traceRequest(fRequest,"String_Node_Str" + fProvider.getName());
  fRequest.start();
  int nbRequested=fRequest.getNbRequested();
  int nbRead=0;
  isCompleted=false;
  ITmfContext context=fProvider.armRequest(fRequest);
  if (context == null) {
    fRequest.cancel();
    return;
  }
  try {
    ITmfEvent event=fProvider.getNext(context);
    TmfCoreTracer.traceRequest(fRequest,"String_Node_Str");
    while (event != null && !fProvider.isCompleted(fRequest,event,nbRead)) {
      TmfCoreTracer.traceEvent(fProvider,fRequest,event);
      if (fRequest.getDataType().isInstance(event)) {
        fRequest.handleData(event);
      }
      pausedLatch.await();
      if (++nbRead < nbRequested) {
        event=fProvider.getNext(context);
      }
    }
    isCompleted=true;
    if (fRequest.isCancelled()) {
      fRequest.cancel();
    }
 else {
      fRequest.done();
    }
  }
 catch (  Exception e) {
    Activator.logError("String_Node_Str" + fProvider.getName() + "String_Node_Str"+ fRequest,e);
    fRequest.fail();
  }
  context.dispose();
}

Fixed version (ground truth):
@Override public void run(){
  TmfCoreTracer.traceRequest(fRequest,"String_Node_Str" + fProvider.getName());
  fRequest.start();
  int nbRequested=fRequest.getNbRequested();
  int nbRead=0;
  isCompleted=false;
  ITmfContext context=fProvider.armRequest(fRequest);
  if (context == null) {
    fRequest.cancel();
    return;
  }
  try {
    ITmfEvent event=fProvider.getNext(context);
    TmfCoreTracer.traceRequest(fRequest,"String_Node_Str");
    while (event != null && !fProvider.isCompleted(fRequest,event,nbRead)) {
      TmfCoreTracer.traceEvent(fProvider,fRequest,event);
      if (fRequest.getDataType().isInstance(event)) {
        fRequest.handleData(event);
      }
      while (fIsPaused) {
synchronized (fSynchObject) {
          try {
            fSynchObject.wait();
          }
 catch (          InterruptedException e) {
          }
        }
      }
      if (++nbRead < nbRequested) {
        event=fProvider.getNext(context);
      }
    }
    isCompleted=true;
    if (fRequest.isCancelled()) {
      fRequest.cancel();
    }
 else {
      fRequest.done();
    }
  }
 catch (  Exception e) {
    Activator.logError("String_Node_Str" + fProvider.getName() + "String_Node_Str"+ fRequest,e);
    fRequest.fail();
  }
  context.dispose();
}
Program: 91995
Project: 91995
Buggy source:
@Override public void handleData(final ITmfEvent event){
  super.handleData(event);
  if (fOrderList.isEmpty() || !fOrderList.get(fOrderList.size() - 1).equals(foregroundName)) {
    fOrderList.add(foregroundName);
  }
  ++nbEvents;
}

Fixed version (ground truth):
@Override public void handleData(final ITmfEvent event){
  super.handleData(event);
synchronized (fOrderList) {
    if (fOrderList.isEmpty() || !fOrderList.get(fOrderList.size() - 1).equals(foregroundName)) {
      fOrderList.add(foregroundName);
    }
  }
  ++nbEvents;
}
Program: 91996
Project: 91996
Buggy source:
/** 
 * Run the void setEventType(TraceEventType) method test.
 */
@Test public void testSetEventType_2(){
  BaseEventInfo fixture=new BaseEventInfo("String_Node_Str");
  fixture.setEventType(TraceEventType.TRACEPOINT);
  TraceEventType result=fixture.getEventType();
  assertNotNull(result);
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(0,result.ordinal());
  fixture.setEventType(TraceEventType.UNKNOWN);
  result=fixture.getEventType();
  assertNotNull(result);
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(3,result.ordinal());
  fixture.setEventType(TraceEventType.SYSCALL);
  result=fixture.getEventType();
  assertNotNull(result);
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(1,result.ordinal());
  fixture.setEventType(TraceEventType.PROBE);
  result=fixture.getEventType();
  assertNotNull(result);
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(2,result.ordinal());
}

Fixed version (ground truth):
/** 
 * Run the void setEventType(TraceEventType) method test.
 */
@Test public void testSetEventType_2(){
  BaseEventInfo fixture=new BaseEventInfo("String_Node_Str");
  fixture.setEventType(TraceEventType.TRACEPOINT);
  TraceEventType result=fixture.getEventType();
  assertNotNull(result);
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(0,result.ordinal());
  fixture.setEventType(TraceEventType.UNKNOWN);
  result=fixture.getEventType();
  assertNotNull(result);
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(4,result.ordinal());
  fixture.setEventType(TraceEventType.SYSCALL);
  result=fixture.getEventType();
  assertNotNull(result);
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(1,result.ordinal());
  fixture.setEventType(TraceEventType.PROBE);
  result=fixture.getEventType();
  assertNotNull(result);
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(2,result.ordinal());
  fixture.setEventType(TraceEventType.FUNCTION);
  result=fixture.getEventType();
  assertNotNull(result);
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(3,result.ordinal());
}
Program: 91997
Project: 91997
Buggy source:
/** 
 * Run the BaseEventInfo() constructor test.
 */
@Test public void testBaseEventInfo(){
  BaseEventInfo fixture=new BaseEventInfo("String_Node_Str");
  assertNotNull(fixture);
  TraceEventType result=fixture.getEventType();
  assertEquals("String_Node_Str",fixture.getName());
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(3,result.ordinal());
  TraceLogLevel level=fixture.getLogLevel();
  assertEquals("String_Node_Str",level.getInName());
  assertEquals("String_Node_Str",level.name());
  assertEquals("String_Node_Str",level.toString());
  assertEquals(14,level.ordinal());
}

Fixed version (ground truth):
/** 
 * Run the BaseEventInfo() constructor test.
 */
@Test public void testBaseEventInfo(){
  BaseEventInfo fixture=new BaseEventInfo("String_Node_Str");
  assertNotNull(fixture);
  TraceEventType result=fixture.getEventType();
  assertEquals("String_Node_Str",fixture.getName());
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(4,result.ordinal());
  TraceLogLevel level=fixture.getLogLevel();
  assertEquals("String_Node_Str",level.getInName());
  assertEquals("String_Node_Str",level.name());
  assertEquals("String_Node_Str",level.toString());
  assertEquals(14,level.ordinal());
}
Program: 91999
Project: 91999
Buggy source:
/** 
 * Run the BaseEventInfo() constructor test.
 */
@Test public void testBaseEventInfo(){
  EventInfo fixture=new EventInfo("String_Node_Str");
  assertNotNull(fixture);
  TraceEventType result=fixture.getEventType();
  assertEquals("String_Node_Str",fixture.getName());
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(3,result.ordinal());
  TraceEnablement state=fixture.getState();
  assertEquals("String_Node_Str",state.getInName());
  assertEquals("String_Node_Str",state.name());
  assertEquals("String_Node_Str",state.toString());
  assertEquals(0,state.ordinal());
}

Fixed version (ground truth):
/** 
 * Run the BaseEventInfo() constructor test.
 */
@Test public void testBaseEventInfo(){
  EventInfo fixture=new EventInfo("String_Node_Str");
  assertNotNull(fixture);
  TraceEventType result=fixture.getEventType();
  assertEquals("String_Node_Str",fixture.getName());
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(4,result.ordinal());
  TraceEnablement state=fixture.getState();
  assertEquals("String_Node_Str",state.getInName());
  assertEquals("String_Node_Str",state.name());
  assertEquals("String_Node_Str",state.toString());
  assertEquals(0,state.ordinal());
}
Program: 92002
Project: 92002
Buggy source:
/** 
 * Run the BaseEventInfo() constructor test.
 */
@Test public void testBaseEventInfo(){
  ProbeEventInfo fixture=new ProbeEventInfo("String_Node_Str");
  assertNotNull(fixture);
  TraceEventType result=fixture.getEventType();
  assertEquals("String_Node_Str",fixture.getName());
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(3,result.ordinal());
  TraceEnablement state=fixture.getState();
  assertEquals("String_Node_Str",state.getInName());
  assertEquals("String_Node_Str",state.name());
  assertEquals("String_Node_Str",state.toString());
  assertEquals(0,state.ordinal());
  assertNull(fixture.getAddress());
  assertNull(fixture.getOffset());
  assertNull(fixture.getSymbol());
}

Fixed version (ground truth):
/** 
 * Run the BaseEventInfo() constructor test.
 */
@Test public void testBaseEventInfo(){
  ProbeEventInfo fixture=new ProbeEventInfo("String_Node_Str");
  assertNotNull(fixture);
  TraceEventType result=fixture.getEventType();
  assertEquals("String_Node_Str",fixture.getName());
  assertEquals("String_Node_Str",result.getInName());
  assertEquals("String_Node_Str",result.name());
  assertEquals("String_Node_Str",result.toString());
  assertEquals(4,result.ordinal());
  TraceEnablement state=fixture.getState();
  assertEquals("String_Node_Str",state.getInName());
  assertEquals("String_Node_Str",state.name());
  assertEquals("String_Node_Str",state.toString());
  assertEquals(0,state.ordinal());
  assertNull(fixture.getAddress());
  assertNull(fixture.getOffset());
  assertNull(fixture.getSymbol());
}
Program: 92003
Project: 92003
Buggy source:
@Override public void setEventType(String typeName){
  if (TraceEventType.TRACEPOINT.getInName().equals(typeName)) {
    fEventType=TraceEventType.TRACEPOINT;
  }
 else   if (TraceEventType.SYSCALL.getInName().equals(typeName)) {
    fEventType=TraceEventType.SYSCALL;
  }
 else   if (TraceEventType.PROBE.getInName().equals(typeName)) {
    fEventType=TraceEventType.PROBE;
  }
 else {
    fEventType=TraceEventType.UNKNOWN;
  }
}

Fixed version (ground truth):
@Override public void setEventType(String typeName){
  if (TraceEventType.TRACEPOINT.getInName().equals(typeName)) {
    fEventType=TraceEventType.TRACEPOINT;
  }
 else   if (TraceEventType.SYSCALL.getInName().equals(typeName)) {
    fEventType=TraceEventType.SYSCALL;
  }
 else   if (TraceEventType.PROBE.getInName().equals(typeName)) {
    fEventType=TraceEventType.PROBE;
  }
 else   if (TraceEventType.FUNCTION.getInName().equals(typeName)) {
    fEventType=TraceEventType.FUNCTION;
  }
 else {
    fEventType=TraceEventType.UNKNOWN;
  }
}
Program: 92008
Project: 92008
Buggy source:
@Override public void open(IPath file){
  String projectName=ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(file).getProject().getName();
  ILaunchConfiguration config=createDefaultConfiguration(projectName);
  PerfCore.Report(config,null,null,null,file.toOSString(),null);
  PerfCore.RefreshView(file.toOSString());
}

Fixed version (ground truth):
@Override public void open(IPath file){
  String projectName=null;
  IFile location=ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(file);
  if (location == null) {
    IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    ISelection selection=page.getSelection();
    if (selection instanceof ITreeSelection) {
      Object element=((ITreeSelection)selection).getFirstElement();
      if (element instanceof IFile) {
        IProject project=((IFile)element).getProject();
        projectName=project.getName();
        URI fileURI=((IFile)element).getLocationURI();
        ILaunchConfiguration config=createDefaultConfiguration(projectName);
        PerfCore.Report(config,null,null,null,fileURI.getPath().toString(),null);
        PerfCore.RefreshView(fileURI.toString());
      }
    }
  }
 else {
    projectName=ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(file).getProject().getName();
    ILaunchConfiguration config=createDefaultConfiguration(projectName);
    PerfCore.Report(config,null,null,null,file.toOSString(),null);
    PerfCore.RefreshView(file.toOSString());
  }
}
Program: 92010
Project: 92010
Buggy source:
@Override public void controlResized(ControlEvent e){
  List<TreeItem> treeItems=getVisibleExpandedItems(tree);
  if (treeItems.size() == 0) {
    return;
  }
  TreeItem treeItem=treeItems.get(fTimeGraphViewer.getTopIndex());
  tree.setTopItem(treeItem);
}

Fixed version (ground truth):
@Override public void controlResized(ControlEvent e){
  List<TreeItem> treeItems=getVisibleExpandedItems(tree);
  int topIndex=fTimeGraphViewer.getTopIndex();
  if (topIndex >= treeItems.size()) {
    return;
  }
  TreeItem treeItem=treeItems.get(topIndex);
  tree.setTopItem(treeItem);
}
Program: 92011
Project: 92011
Buggy source:
/** 
 * Sets the current selection for this time graph combo.
 * @param selection the new selection
 */
public void setSelection(ITimeGraphEntry selection){
  fTimeGraphViewer.setSelection(selection);
  fInhibitTreeSelection=true;
  if (selection != null) {
    StructuredSelection structuredSelection=new StructuredSelection(selection);
    fTreeViewer.setSelection(structuredSelection);
  }
 else {
    fTreeViewer.setSelection(new StructuredSelection());
  }
  fInhibitTreeSelection=false;
  List<TreeItem> treeItems=getVisibleExpandedItems(fTreeViewer.getTree());
  if (treeItems.size() == 0) {
    return;
  }
  TreeItem treeItem=treeItems.get(fTimeGraphViewer.getTopIndex());
  fTreeViewer.getTree().setTopItem(treeItem);
}

Fixed version (ground truth):
/** 
 * Sets the current selection for this time graph combo.
 * @param selection the new selection
 */
public void setSelection(ITimeGraphEntry selection){
  fTimeGraphViewer.setSelection(selection);
  fInhibitTreeSelection=true;
  if (selection != null) {
    StructuredSelection structuredSelection=new StructuredSelection(selection);
    fTreeViewer.setSelection(structuredSelection);
  }
 else {
    fTreeViewer.setSelection(new StructuredSelection());
  }
  fInhibitTreeSelection=false;
  List<TreeItem> treeItems=getVisibleExpandedItems(fTreeViewer.getTree());
  int topIndex=fTimeGraphViewer.getTopIndex();
  if (topIndex >= treeItems.size()) {
    return;
  }
  TreeItem treeItem=treeItems.get(topIndex);
  fTreeViewer.getTree().setTopItem(treeItem);
}
Program: 92012
Project: 92012
Buggy source:
@Override public void mouseScrolled(MouseEvent e){
  List<TreeItem> treeItems=getVisibleExpandedItems(tree);
  if (treeItems.size() == 0) {
    return;
  }
  TreeItem treeItem=treeItems.get(fTimeGraphViewer.getTopIndex());
  tree.setTopItem(treeItem);
}

Fixed version (ground truth):
@Override public void mouseScrolled(MouseEvent e){
  List<TreeItem> treeItems=getVisibleExpandedItems(tree);
  int topIndex=fTimeGraphViewer.getTopIndex();
  if (topIndex >= treeItems.size()) {
    return;
  }
  TreeItem treeItem=treeItems.get(topIndex);
  tree.setTopItem(treeItem);
}
Program: 92013
Project: 92013
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  List<TreeItem> treeItems=getVisibleExpandedItems(tree);
  if (treeItems.size() == 0) {
    return;
  }
  TreeItem treeItem=treeItems.get(fTimeGraphViewer.getTopIndex());
  tree.setTopItem(treeItem);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  List<TreeItem> treeItems=getVisibleExpandedItems(tree);
  int topIndex=fTimeGraphViewer.getTopIndex();
  if (topIndex >= treeItems.size()) {
    return;
  }
  TreeItem treeItem=treeItems.get(topIndex);
  tree.setTopItem(treeItem);
}
Program: 92014
Project: 92014
Buggy source:
@Override public void selectionChanged(TimeGraphSelectionEvent event){
  ITimeGraphEntry entry=fTimeGraphViewer.getSelection();
  fInhibitTreeSelection=true;
  if (entry != null) {
    StructuredSelection selection=new StructuredSelection(entry);
    fTreeViewer.setSelection(selection);
  }
 else {
    fTreeViewer.setSelection(new StructuredSelection());
  }
  fInhibitTreeSelection=false;
  List<TreeItem> treeItems=getVisibleExpandedItems(tree);
  if (treeItems.size() == 0) {
    return;
  }
  TreeItem treeItem=treeItems.get(fTimeGraphViewer.getTopIndex());
  tree.setTopItem(treeItem);
}

Fixed version (ground truth):
@Override public void selectionChanged(TimeGraphSelectionEvent event){
  ITimeGraphEntry entry=fTimeGraphViewer.getSelection();
  fInhibitTreeSelection=true;
  if (entry != null) {
    StructuredSelection selection=new StructuredSelection(entry);
    fTreeViewer.setSelection(selection);
  }
 else {
    fTreeViewer.setSelection(new StructuredSelection());
  }
  fInhibitTreeSelection=false;
  List<TreeItem> treeItems=getVisibleExpandedItems(tree);
  int topIndex=fTimeGraphViewer.getTopIndex();
  if (topIndex >= treeItems.size()) {
    return;
  }
  TreeItem treeItem=treeItems.get(topIndex);
  tree.setTopItem(treeItem);
}
Program: 92016
Project: 92016
Buggy source:
/** 
 * Sets default value depending on Kernel or UST
 */
private void setDefaults(){
  fSwitchTimerText.setText(DEFAULT_TEXT);
  fSwitchTimerText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  fReadTimerText.setText(DEFAULT_TEXT);
  fReadTimerText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  fOverwriteModeButton.setSelection(IChannelInfo.DEFAULT_OVERWRITE_MODE);
  if (fTargetNodeComponent.isTraceFileRotationSupported()) {
    fMaxSizeTraceText.setText(DEFAULT_TEXT);
    fMaxSizeTraceText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
    fMaxNumberTraceText.setText(DEFAULT_TEXT);
    fMaxNumberTraceText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  }
  fSubBufferSizeText.setText(DEFAULT_TEXT);
  fSubBufferSizeText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  fNumberOfSubBuffersText.setText(DEFAULT_TEXT);
  fNumberOfSubBuffersText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  if (fTargetNodeComponent.isBufferTypeConfigSupported()) {
    fPIDBuffersButton.setSelection(false);
    fUIDBuffersButton.setSelection(false);
  }
}

Fixed version (ground truth):
/** 
 * Sets default value depending on Kernel or UST
 */
private void setDefaults(){
  fSwitchTimerText.setText(DEFAULT_TEXT);
  fSwitchTimerText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  fReadTimerText.setText(DEFAULT_TEXT);
  fReadTimerText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  fOverwriteModeButton.setSelection(IChannelInfo.DEFAULT_OVERWRITE_MODE);
  if (fTargetNodeComponent.isTraceFileRotationSupported()) {
    fMaxSizeTraceText.setText(DEFAULT_TEXT);
    fMaxSizeTraceText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
    fMaxNumberTraceText.setText(DEFAULT_TEXT);
    fMaxNumberTraceText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  }
  fSubBufferSizeText.setText(DEFAULT_TEXT);
  fSubBufferSizeText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  fNumberOfSubBuffersText.setText(DEFAULT_TEXT);
  fNumberOfSubBuffersText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
  if (fTargetNodeComponent.isBufferTypeConfigSupported()) {
    setBufferTypeButtonSelection();
  }
}
Program: 92020
Project: 92020
Buggy source:
@Override protected void okPressed(){
  if (fSessionsCombo.getSelectionIndex() < 0) {
    MessageDialog.openError(getShell(),Messages.TraceControl_EnableEventsDialogTitle,Messages.TraceControl_EnableEventsNoSessionError);
    return;
  }
  fSessionIndex=fSessionsCombo.getSelectionIndex();
  fChannel=null;
  if ((fChannels != null) && (fChannelsCombo.getSelectionIndex() >= 0)) {
    fChannel=fChannels[fChannelsCombo.getSelectionIndex()];
  }
  fFilterExpression=null;
  if (fSessions[0].isEventFilteringSupported() && !fIsKernel) {
    String tempFilter=fFilterText.getText();
    if (!tempFilter.matches("String_Node_Str")) {
      fFilterExpression=tempFilter;
    }
  }
  super.okPressed();
}

Fixed version (ground truth):
@Override protected void okPressed(){
  if (fSessionsCombo.getSelectionIndex() < 0) {
    MessageDialog.openError(getShell(),Messages.TraceControl_EnableEventsDialogTitle,Messages.TraceControl_EnableEventsNoSessionError);
    return;
  }
  fSessionIndex=fSessionsCombo.getSelectionIndex();
  fChannel=null;
  if ((fChannels != null) && (fChannelsCombo.getSelectionIndex() >= 0)) {
    fChannel=fChannels[fChannelsCombo.getSelectionIndex()];
  }
  fFilterExpression=null;
  if (fSessions[0].isEventFilteringSupported() && !fIsKernel) {
    String tempFilter=fFilterText.getText();
    if (!tempFilter.isEmpty() && !tempFilter.matches("String_Node_Str")) {
      fFilterExpression=tempFilter;
    }
  }
  super.okPressed();
}