Program: 116912
Project: 116912
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.room_activity);
  this.weekView=(WeekView)findViewById(R.id.weekView1);
  this.roomNameLabel=(TextView)findViewById(R.id.roomNameLabel);
  this.trafficLights=(RoomTrafficLights)findViewById(R.id.roomTrafficLights);
  try {
    currentRoom=(Room)getIntent().getSerializableExtra(ROOM_EXTRA);
  }
 catch (  ClassCastException e) {
    throw new IllegalArgumentException("String_Node_Str" + ROOM_EXTRA);
  }
  if (currentRoom == null) {
    throw new IllegalArgumentException("String_Node_Str" + ROOM_EXTRA);
  }
  findViewById(R.id.seeAllRoomsButton).setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      RoomActivity.this.finish();
    }
  }
);
  weekView.setOnFreeTimeClickListener(new OnFreeTimeClickListener(){
    @Override public void onFreeTimeClick(    View v,    TimeSpan timeSpan,    DateTime touch){
      TimeSpan reservationTimeSpan=timeSpan;
      if (timeSpan.getLength() > 60 * 60000) {
        DateTime start=timeSpan.getStart();
        DateTime end=timeSpan.getEnd();
        DateTime now=new DateTime();
        touch=touch.stripMinutes();
        if (touch.before(start)) {
          touch=start;
        }
        if (touch.before(now) && now.before(end)) {
          touch=now;
        }
        reservationTimeSpan=new TimeSpan(touch,Calendar.HOUR,1);
        DateTime touchend=reservationTimeSpan.getEnd();
        touchend=touchend.set(Calendar.MINUTE,(touchend.get(Calendar.MINUTE) / 15) * 15);
        if (touchend.after(end)) {
          reservationTimeSpan.setEnd(end);
        }
      }
      final RoomReservationPopup d=new RoomReservationPopup(RoomActivity.this,timeSpan,reservationTimeSpan,currentRoom);
      d.setOnReserveCallback(new OnReserveListener(){
        @Override public void call(        LobbyReservationRowView v){
          d.dismiss();
          refreshData();
        }
      }
);
      RoomActivity.this.trafficLights.disable();
      d.setOnDismissListener(new OnDismissListener(){
        @Override public void onDismiss(        DialogInterface dialog){
          RoomActivity.this.trafficLights.enable();
        }
      }
);
      d.show();
    }
  }
);
  trafficLights.setBookNowListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (!currentRoom.isFree())       return;
      TimeSpan limits=currentRoom.getNextFreeTime();
      if (limits == null)       return;
      DateTime now=new DateTime();
      TimeSpan suggested=new TimeSpan(now,now.add(Calendar.MINUTE,DEFAULT_BOOK_NOW_DURATION));
      if (limits.getEnd().before(suggested.getEnd())) {
        suggested=limits;
      }
      final RoomReservationPopup d=new RoomReservationPopup(RoomActivity.this,limits,suggested,currentRoom);
      d.setOnReserveCallback(new OnReserveListener(){
        @Override public void call(        LobbyReservationRowView v){
          d.dismiss();
          refreshData();
        }
      }
);
      RoomActivity.this.trafficLights.disable();
      d.setOnDismissListener(new OnDismissListener(){
        @Override public void onDismiss(        DialogInterface dialog){
          RoomActivity.this.trafficLights.enable();
        }
      }
);
      d.show();
    }
  }
);
  weekView.setOnReservationClickListener(new OnReservationClickListener(){
    @Override public void onReservationClick(    View v,    Reservation reservation){
      final EditReservationPopup d=new EditReservationPopup(RoomActivity.this,reservation,currentRoom,new EditReservationPopup.OnReservationCancelledListener(){
        @Override public void onReservationCancelled(        Reservation r){
          refreshData();
        }
      }
);
      RoomActivity.this.trafficLights.disable();
      d.setOnDismissListener(new OnDismissListener(){
        @Override public void onDismiss(        DialogInterface dialog){
          RoomActivity.this.trafficLights.enable();
        }
      }
);
      d.show();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.room_activity);
  this.weekView=(WeekView)findViewById(R.id.weekView1);
  this.roomNameLabel=(TextView)findViewById(R.id.roomNameLabel);
  this.trafficLights=(RoomTrafficLights)findViewById(R.id.roomTrafficLights);
  try {
    currentRoom=(Room)getIntent().getSerializableExtra(ROOM_EXTRA);
  }
 catch (  ClassCastException e) {
    throw new IllegalArgumentException("String_Node_Str" + ROOM_EXTRA);
  }
  if (currentRoom == null) {
    throw new IllegalArgumentException("String_Node_Str" + ROOM_EXTRA);
  }
  findViewById(R.id.seeAllRoomsButton).setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      RoomActivity.this.finish();
    }
  }
);
  weekView.setOnFreeTimeClickListener(new OnFreeTimeClickListener(){
    @Override public void onFreeTimeClick(    View v,    TimeSpan timeSpan,    DateTime touch){
      TimeSpan reservationTimeSpan=timeSpan;
      if (timeSpan.getLength() > 60 * 60000) {
        DateTime start=timeSpan.getStart();
        DateTime end=timeSpan.getEnd();
        DateTime now=new DateTime();
        touch=touch.stripMinutes();
        if (touch.before(start)) {
          touch=start;
        }
        if (touch.before(now) && now.before(end)) {
          touch=now;
        }
        reservationTimeSpan=new TimeSpan(touch,Calendar.HOUR,1);
        DateTime touchend=reservationTimeSpan.getEnd();
        touchend=touchend.set(Calendar.MINUTE,(touchend.get(Calendar.MINUTE) / 15) * 15);
        if (touchend.after(end)) {
          reservationTimeSpan.setEnd(end);
        }
      }
      final RoomReservationPopup d=new RoomReservationPopup(RoomActivity.this,timeSpan,reservationTimeSpan,currentRoom);
      d.setOnReserveCallback(new OnReserveListener(){
        @Override public void call(        LobbyReservationRowView v){
          d.dismiss();
          refreshData();
        }
      }
);
      RoomActivity.this.trafficLights.disable();
      d.setOnDismissListener(new OnDismissListener(){
        @Override public void onDismiss(        DialogInterface dialog){
          RoomActivity.this.trafficLights.enable();
        }
      }
);
      d.show();
    }
  }
);
  trafficLights.setBookNowListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (!currentRoom.isFree())       return;
      TimeSpan limits=currentRoom.getNextFreeTime();
      DateTime now=new DateTime();
      TimeSpan suggested=new TimeSpan(now,now.add(Calendar.MINUTE,DEFAULT_BOOK_NOW_DURATION));
      if (limits == null) {
        limits=suggested;
      }
 else       if (limits.getEnd().before(suggested.getEnd())) {
        suggested=limits;
      }
      final RoomReservationPopup d=new RoomReservationPopup(RoomActivity.this,limits,suggested,currentRoom);
      d.setOnReserveCallback(new OnReserveListener(){
        @Override public void call(        LobbyReservationRowView v){
          d.dismiss();
          refreshData();
        }
      }
);
      RoomActivity.this.trafficLights.disable();
      d.setOnDismissListener(new OnDismissListener(){
        @Override public void onDismiss(        DialogInterface dialog){
          RoomActivity.this.trafficLights.enable();
        }
      }
);
      d.show();
    }
  }
);
  weekView.setOnReservationClickListener(new OnReservationClickListener(){
    @Override public void onReservationClick(    View v,    Reservation reservation){
      final EditReservationPopup d=new EditReservationPopup(RoomActivity.this,reservation,currentRoom,new EditReservationPopup.OnReservationCancelledListener(){
        @Override public void onReservationCancelled(        Reservation r){
          refreshData();
        }
      }
);
      RoomActivity.this.trafficLights.disable();
      d.setOnDismissListener(new OnDismissListener(){
        @Override public void onDismiss(        DialogInterface dialog){
          RoomActivity.this.trafficLights.enable();
        }
      }
);
      d.show();
    }
  }
);
}