Program: 92033
Project: 92033
Buggy source:
/** 
 * Constructs a StreamInputPacketReader.
 * @param streamInputReader The StreamInputReader to which this packet reader belongs to.
 */
public StreamInputPacketReader(StreamInputReader streamInputReader){
  this.streamInputReader=streamInputReader;
  bitBuffer=new BitBuffer();
  bitBuffer.setByteOrder(streamInputReader.getByteOrder());
  events=streamInputReader.getStreamInput().getStream().getTrace().getEventDefs(streamInputReader.getStreamInput());
  lostSoFar=0;
  final Stream currentStream=streamInputReader.getStreamInput().getStream();
  StructDeclaration tracePacketHeaderDecl=currentStream.getTrace().getPacketHeader();
  if (tracePacketHeaderDecl != null) {
    tracePacketHeaderDef=tracePacketHeaderDecl.createDefinition(this,"String_Node_Str");
  }
 else {
    tracePacketHeaderDef=null;
  }
  StructDeclaration streamPacketContextDecl=currentStream.getPacketContextDecl();
  if (streamPacketContextDecl != null) {
    streamPacketContextDef=streamPacketContextDecl.createDefinition(this,"String_Node_Str");
  }
 else {
    streamPacketContextDef=null;
  }
  StructDeclaration streamEventHeaderDecl=currentStream.getEventHeaderDecl();
  if (streamEventHeaderDecl != null) {
    streamEventHeaderDef=streamEventHeaderDecl.createDefinition(this,"String_Node_Str");
  }
 else {
    streamEventHeaderDef=null;
  }
  StructDeclaration streamEventContextDecl=currentStream.getEventContextDecl();
  if (streamEventContextDecl != null) {
    streamEventContextDef=streamEventContextDecl.createDefinition(this,"String_Node_Str");
  }
 else {
    streamEventContextDef=null;
  }
  Collection<IEventDeclaration> eventDecls=streamInputReader.getStreamInput().getStream().getEvents().values();
  for (  IEventDeclaration event : eventDecls) {
    if (!events.containsKey(event.getId())) {
      EventDefinition eventDef=event.createDefinition(streamInputReader);
      events.put(event.getId(),eventDef);
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructs a StreamInputPacketReader.
 * @param streamInputReader The StreamInputReader to which this packet reader belongs to.
 */
public StreamInputPacketReader(StreamInputReader streamInputReader){
  this.streamInputReader=streamInputReader;
  bitBuffer=new BitBuffer();
  bitBuffer.setByteOrder(streamInputReader.getByteOrder());
  lostSoFar=0;
  final Stream currentStream=streamInputReader.getStreamInput().getStream();
  StructDeclaration tracePacketHeaderDecl=currentStream.getTrace().getPacketHeader();
  if (tracePacketHeaderDecl != null) {
    tracePacketHeaderDef=tracePacketHeaderDecl.createDefinition(this,"String_Node_Str");
  }
 else {
    tracePacketHeaderDef=null;
  }
  StructDeclaration streamPacketContextDecl=currentStream.getPacketContextDecl();
  if (streamPacketContextDecl != null) {
    streamPacketContextDef=streamPacketContextDecl.createDefinition(this,"String_Node_Str");
  }
 else {
    streamPacketContextDef=null;
  }
  StructDeclaration streamEventHeaderDecl=currentStream.getEventHeaderDecl();
  if (streamEventHeaderDecl != null) {
    streamEventHeaderDef=streamEventHeaderDecl.createDefinition(this,"String_Node_Str");
  }
 else {
    streamEventHeaderDef=null;
  }
  StructDeclaration streamEventContextDecl=currentStream.getEventContextDecl();
  if (streamEventContextDecl != null) {
    streamEventContextDef=streamEventContextDecl.createDefinition(this,"String_Node_Str");
  }
 else {
    streamEventContextDef=null;
  }
  Collection<IEventDeclaration> eventDecls=streamInputReader.getStreamInput().getStream().getEvents().values();
  for (  IEventDeclaration event : eventDecls) {
    if (!streamInputReader.getEventDefinitions().containsKey(event.getId())) {
      EventDefinition eventDef=event.createDefinition(streamInputReader);
      streamInputReader.addEventDefinition(event.getId(),eventDef);
    }
  }
}