nus-yam/ex-repair huggingface dataset:
Program: 99055
Project: 99055
Buggy source:
@Test public void testShouldRetrieveMBean() throws Exception {
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  ObjectName name=new ObjectName("String_Node_Str");
  StatControllerMBean statController=MBeanServerInvocationHandler.newProxyInstance(mbs,name,StatControllerMBean.class,false);
  assertNotNull(statController);
  assertEquals(0,statController.getActiveConnectionCount());
  statController.startRecording();
  Connection connection=dataSource.getConnection();
  assertEquals(1,statController.getActiveConnectionCount());
  connection.close();
  assertEquals(0,statController.getActiveConnectionCount());
}

Fixed version (ground truth):
@Test public void testShouldRetrieveMBean() throws Exception {
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  ObjectName name=new ObjectName("String_Node_Str");
  StatControllerMBean statController=MBeanServerInvocationHandler.newProxyInstance(mbs,name,StatControllerMBean.class,false);
  assertNotNull(statController);
  statController.startRecording();
  statController.resetConnectionCounts();
  long activeConnectionCount=statController.getActiveConnectionCount();
  System.out.println("String_Node_Str" + activeConnectionCount);
  Connection connection=dataSource.getConnection();
  assertEquals(activeConnectionCount + 1,statController.getActiveConnectionCount());
  connection.close();
  assertEquals(activeConnectionCount,statController.getActiveConnectionCount());
}
Program: 99056
Project: 99056
Buggy source:
/** 
 * @param lastConnectionTiming in nano second.
 */
public void setLastConnectionTiming(long lastConnectionTiming){
  this.lastConnectionTiming=lastConnectionTiming;
  averageConnectionTiming=(averageConnectionTiming * totalConnectionUsed.get() + lastConnectionTiming) / totalConnectionUsed.get() + 1;
}

Fixed version (ground truth):
/** 
 * @param lastConnectionTiming in nano second.
 */
public void setLastConnectionTiming(long lastConnectionTiming){
  this.lastConnectionTiming=lastConnectionTiming;
  averageConnectionTiming=(averageConnectionTiming * totalConnectionUsed.get() + lastConnectionTiming) / (totalConnectionUsed.get() + 1);
}
Program: 99057
Project: 99057
Buggy source:
public Map<String,Long> getSlowestQueries(){
  return Collections.unmodifiableMap(queryRecorder.slowestQueries);
}

Fixed version (ground truth):
@Override public Map<String,Long> getSlowestQueries(){
  return Collections.unmodifiableMap(queryRecorder.slowestQueries);
}
Program: 99058
Project: 99058
Buggy source:
@Override public void resetConnectionCounts(){
  activeConnectionCount.set(0);
  totalConnectionUsed.set(0);
}

Fixed version (ground truth):
@Override public void resetConnectionCounts(){
  totalConnectionUsed.set(0);
  lastConnectionTiming=0;
  averageConnectionTiming=0;
}
Program: 99059
Project: 99059
Buggy source:
public long getLastConnectionTiming(){
  return lastConnectionTiming;
}

Fixed version (ground truth):
@Override public long getLastConnectionTiming(){
  return lastConnectionTiming;
}
Program: 99060
Project: 99060
Buggy source:
private Object proceed(ProceedingJoinPoint pjp,String sql) throws Throwable {
  controller.newQuery();
  return pjp.proceed();
}

Fixed version (ground truth):
private Object proceed(ProceedingJoinPoint pjp,String sql) throws Throwable {
  controller.newQuery();
  long delay=System.nanoTime();
  Object proceed=pjp.proceed();
  controller.recordQueryTime(sql,System.nanoTime() - delay);
  return proceed;
}
Program: 99062
Project: 99062
Buggy source:
private void restartTimer(int posi){
  status=Status.STARTED;
  this.pausedTime=System.currentTimeMillis() - this.pauseTime;
  handler.post(countdown);
}

Fixed version (ground truth):
private void restartTimer(int posi){
  status=Status.STARTED;
  this.pausedTime=System.currentTimeMillis() - this.pauseTime;
  handler.post(Countdown);
}
Program: 99063
Project: 99063
Buggy source:
private void startTimer(int posi){
  try {
    status=Status.STARTED;
    startTime=System.currentTimeMillis();
    TimeUnits time=timerModel.get(posi);
    countdownTime=time.getMillisFromHour(0);
    handler.post(countdown);
  }
 catch (  IndexOutOfBoundsException e) {
    this.stopTimer();
  }
}

Fixed version (ground truth):
private void startTimer(int posi){
  try {
    status=Status.STARTED;
    startTime=System.currentTimeMillis();
    TimeUnits time=timerModel.get(posi);
    countdownTime=time.getMillisFromHour(0);
    handler.post(Countdown);
  }
 catch (  IndexOutOfBoundsException e) {
    this.stopTimer();
  }
}
Program: 99064
Project: 99064
Buggy source:
private void stopTimer(){
  status=Status.STOPPED;
  handler.removeCallbacks(countdown);
  this.clearTimer();
  this.posi=0;
}

Fixed version (ground truth):
private void stopTimer(){
  status=Status.STOPPED;
  handler.removeCallbacks(Countdown);
  this.clearTimer();
  this.posi=0;
}
Program: 99065
Project: 99065
Buggy source:
private void pauseTimer(){
  status=Status.PAUSED;
  this.pauseTime=System.currentTimeMillis();
  handler.removeCallbacks(countdown);
}

Fixed version (ground truth):
private void pauseTimer(){
  status=Status.PAUSED;
  this.pauseTime=System.currentTimeMillis();
  handler.removeCallbacks(Countdown);
}
Program: 99066
Project: 99066
Buggy source:
private void initiate(Bundle savedInstanceState){
  if (savedInstanceState != null) {
    this.getController().selectRoutine(savedInstanceState.getString("String_Node_Str"));
  }
}

Fixed version (ground truth):
private void initiate(Bundle savedInstanceState){
  Log.d(TAG,"String_Node_Str");
  if (savedInstanceState != null) {
    this.getController().selectRoutine(savedInstanceState.getString("String_Node_Str"));
  }
}
Program: 99067
Project: 99067
Buggy source:
@Override public void onPause(){
  super.onPause();
  SharedPreferences settings=getSharedPreferences(PREFS_NAME,0);
  SharedPreferences.Editor editor=settings.edit();
  editor.putString(getString(R.string.selected_routine_key),this.getController().getSelectedRoutine());
  editor.commit();
}

Fixed version (ground truth):
@Override public void onPause(){
  super.onPause();
  this.setPreference();
}
Program: 99068
Project: 99068
Buggy source:
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (resultCode == RESULT_OK) {
    getController().handleInput(requestCode,data);
  }
}

Fixed version (ground truth):
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (resultCode == RESULT_OK) {
    getController().handleInput(requestCode,data);
    this.setPreference();
  }
}
Program: 99069
Project: 99069
Buggy source:
@Override public void onResume(){
  super.onResume();
  SharedPreferences settings=getSharedPreferences(PREFS_NAME,0);
  String selectedRoutine=settings.getString(getString(R.string.selected_routine_key),null);
  if (selectedRoutine != null) {
    this.getController().selectRoutine(selectedRoutine);
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  Log.d(TAG,"String_Node_Str");
  SharedPreferences settings=getSharedPreferences(PREFS_NAME,0);
  String selectedRoutine=settings.getString(getString(R.string.selected_routine_key),null);
  if (selectedRoutine != null) {
    this.getController().selectRoutine(selectedRoutine);
  }
}
Program: 99070
Project: 99070
Buggy source:
/** 
 * Initiate of routine spinner object. Generate the default if no routine was stored in the database.
 */
private void loadRoutineSpinner(){
  List<String> list=storeController.getRoutines();
  if (list.size() < 1) {
    list.add(getActivity().getString(R.string.default_routine_name));
  }
  ((InteractiveListView)listView).populateSpinner(list);
}

Fixed version (ground truth):
/** 
 * Initiate of routine spinner object. Generate the default if no routine was stored in the database.
 */
private void loadRoutineSpinner(){
  Log.d(TAG,"String_Node_Str");
  List<String> list=storeController.getRoutines();
  if (list.size() < 1) {
    list.add(getActivity().getString(R.string.default_routine_name));
  }
  ((InteractiveListView)listView).populateSpinner(list);
}
Program: 99071
Project: 99071
Buggy source:
public void handleInput(int requestCode,Intent data){
  if (requestCode == CountdownTimerController.TIME_ADD_CODE || requestCode == CountdownTimerController.TIME_EDIT_CODE) {
    TimeUnits units=new TimeUnits();
    units.add(data.getStringExtra("String_Node_Str"));
    units.add(data.getStringExtra("String_Node_Str"));
    units.add(data.getStringExtra("String_Node_Str"));
switch (requestCode) {
case (CountdownTimerController.TIME_ADD_CODE):
      this.addTime(units);
    break;
case (CountdownTimerController.TIME_EDIT_CODE):
  this.editTime(data.getExtras().getInt("String_Node_Str"),units);
break;
}
this.saveRoutine(this.getSelectedRoutine());
}
 else {
String text=data.getStringExtra("String_Node_Str");
if (text == null || text.length() < 1) {
Toast.makeText(this.getActivity().getApplicationContext(),this.getActivity().getString(R.string.no_text_warning),Toast.LENGTH_SHORT).show();
}
switch (requestCode) {
case (CountdownTimerController.TEXT_ADD_CODE):
this.addRoutine(text);
this.loadListView(text);
break;
case (CountdownTimerController.TEXT_EDIT_CODE):
String originalText=data.getStringExtra("String_Node_Str");
this.editRoutine(originalText,text);
this.loadListView(text);
break;
}
}
}

Fixed version (ground truth):
/** 
 * Handle both time and text input from external activity
 * @param requestCode
 * @param data
 */
public void handleInput(int requestCode,Intent data){
  if (requestCode == CountdownTimerController.TIME_ADD_CODE || requestCode == CountdownTimerController.TIME_EDIT_CODE) {
    TimeUnits units=new TimeUnits();
    units.add(data.getStringExtra("String_Node_Str"));
    units.add(data.getStringExtra("String_Node_Str"));
    units.add(data.getStringExtra("String_Node_Str"));
switch (requestCode) {
case (CountdownTimerController.TIME_ADD_CODE):
      this.addTime(units);
    break;
case (CountdownTimerController.TIME_EDIT_CODE):
  this.editTime(data.getExtras().getInt("String_Node_Str"),units);
break;
}
this.saveRoutine(this.getSelectedRoutine());
}
 else {
String text=data.getStringExtra("String_Node_Str");
if (text == null || text.length() < 1) {
Toast.makeText(this.getActivity().getApplicationContext(),this.getActivity().getString(R.string.no_text_warning),Toast.LENGTH_SHORT).show();
}
switch (requestCode) {
case (CountdownTimerController.TEXT_ADD_CODE):
this.addRoutine(text);
this.loadListView(text);
Log.d(TAG,"String_Node_Str");
break;
case (CountdownTimerController.TEXT_EDIT_CODE):
String originalText=data.getStringExtra("String_Node_Str");
this.editRoutine(originalText,text);
this.loadListView(text);
break;
}
}
}
Program: 99072
Project: 99072
Buggy source:
/** 
 * Given the name of the intentional select routine item, reload the routine spinner,  select the routine item, and load the routine time units from the listview.
 * @param text name of the intentional selection routine.
 */
private void loadListView(String text){
  this.loadRoutineSpinner();
  this.selectRoutine(text);
  this.loadRoutine();
}

Fixed version (ground truth):
/** 
 * Given the name of the intentional select routine item, reload the routine spinner,  select the routine item, and load the routine time units from the listview.
 * @param text name of the intentional selection routine.
 */
private void loadListView(String text){
  Log.d(TAG,"String_Node_Str" + text);
  this.loadRoutineSpinner();
  this.selectRoutine(text);
  this.loadRoutine();
}
Program: 99073
Project: 99073
Buggy source:
public void selectRoutine(String text){
  ((InteractiveListView)listView).selectSpinner(text);
}

Fixed version (ground truth):
public void selectRoutine(String text){
  Log.d(TAG,"String_Node_Str" + text);
  ((InteractiveListView)listView).selectSpinner(text);
}
Program: 99074
Project: 99074
Buggy source:
/** 
 * Save the routine in the database, given the name of the routine.
 * @param name Routine name.
 */
private void addRoutine(String name){
  storeController.storeRoutine(name);
}

Fixed version (ground truth):
/** 
 * Save the routine in the database, given the name of the routine.
 * @param name Routine name.
 */
private void addRoutine(String name){
  Log.d(TAG,"String_Node_Str");
  storeController.storeRoutine(name);
}
Program: 99075
Project: 99075
Buggy source:
/** 
 * Determine the currently selected item from the routine spinner, and update the routine list, given the routine selected.
 */
private void loadRoutine(){
  this.loadRoutine(this.getSelectedRoutine());
}

Fixed version (ground truth):
/** 
 * Determine the currently selected item from the routine spinner, and update the routine list, given the routine selected.
 */
private void loadRoutine(){
  Log.d(TAG,"String_Node_Str");
  this.loadRoutine(this.getSelectedRoutine());
}
Program: 99076
Project: 99076
Buggy source:
public String getSelectedRoutine(){
  return ((InteractiveListView)listView).getSelectedRoutine();
}

Fixed version (ground truth):
public String getSelectedRoutine(){
  Log.d(TAG,"String_Node_Str");
  return ((InteractiveListView)listView).getSelectedRoutine();
}
Program: 99077
Project: 99077
Buggy source:
/** 
 * Store the routine given the name of the routine, and return the store ID of the routine. If the given name already exist, it return the ID of the  stored routine.
 * @param routineName name of the routine.
 * @return ID of the routine, given the name.
 */
public long storeRoutine(String routineName) throws ClassCastException {
  RoutineSQL storedRoutine=this.retrieveStoredRoutine(routineName);
  if (storedRoutine == null) {
    Log.d("String_Node_Str","String_Node_Str");
    RoutineSQL routine=new RoutineSQL(null,routineName);
    routineDao.insert(routine);
    return routine.getId();
  }
  return storedRoutine.getId();
}

Fixed version (ground truth):
/** 
 * Store the routine given the name of the routine, and return the store ID of the routine. If the given name already exist, it return the ID of the  stored routine.
 * @param routineName name of the routine.
 * @return ID of the routine, given the name.
 */
public long storeRoutine(String routineName) throws ClassCastException {
  RoutineSQL storedRoutine=this.retrieveStoredRoutine(routineName);
  if (storedRoutine == null) {
    RoutineSQL routine=new RoutineSQL(null,routineName);
    routineDao.insert(routine);
    return routine.getId();
  }
  return storedRoutine.getId();
}
Program: 99078
Project: 99078
Buggy source:
public CountdownTimerModel retrieveTimerModel(String routineName){
  Log.d("String_Node_Str","String_Node_Str" + routineName);
  RoutineSQL storedRoutine=this.retrieveStoredRoutine(routineName);
  CountdownTimerModel model=new CountdownTimerModel();
  if (storedRoutine != null) {
    List<TimeUnitSQL> storedUnits=this.retrieveStoredTimeUnits(storedRoutine.getId());
    for (    TimeUnitSQL unit : storedUnits) {
      Log.d("String_Node_Str","String_Node_Str" + unit.getTimeunit());
      model.add(new TimeUnits(unit.getTimeunit()));
    }
  }
  return model;
}

Fixed version (ground truth):
public CountdownTimerModel retrieveTimerModel(String routineName){
  RoutineSQL storedRoutine=this.retrieveStoredRoutine(routineName);
  CountdownTimerModel model=new CountdownTimerModel();
  if (storedRoutine != null) {
    List<TimeUnitSQL> storedUnits=this.retrieveStoredTimeUnits(storedRoutine.getId());
    for (    TimeUnitSQL unit : storedUnits) {
      Log.d("String_Node_Str","String_Node_Str" + unit.getTimeunit());
      model.add(new TimeUnits(unit.getTimeunit()));
    }
  }
  return model;
}
Program: 99079
Project: 99079
Buggy source:
/** 
 * Store the count down timer routine (CountdownTimerModel) with the given  routine name.
 * @param model A given routine count down timer model.
 * @param routineName Name of the routine.
 */
public void storeTimerModel(CountdownTimerModel model,String routineName){
  long routineId=this.storeRoutine(routineName);
  Log.d("String_Node_Str",routineName + "String_Node_Str" + routineId);
  this.deleteTimeUnitsByRoutineId(routineId);
  for (int i=model.size() - 1; i >= 0; i--) {
    this.storeTimeUnit(model.get(i).toString(),i,routineId);
  }
}

Fixed version (ground truth):
/** 
 * Store the count down timer routine (CountdownTimerModel) with the given  routine name.
 * @param model A given routine count down timer model.
 * @param routineName Name of the routine.
 */
public void storeTimerModel(CountdownTimerModel model,String routineName){
  long routineId=this.storeRoutine(routineName);
  this.deleteTimeUnitsByRoutineId(routineId);
  for (int i=model.size() - 1; i >= 0; i--) {
    this.storeTimeUnit(model.get(i).toString(),i,routineId);
  }
}
Program: 99080
Project: 99080
Buggy source:
private long storeTimeUnit(String unitString,int order,long routineId){
  Log.d("String_Node_Str","String_Node_Str" + unitString + "String_Node_Str"+ order+ "String_Node_Str"+ routineId);
  TimeUnitSQL storedTimeUnit=this.retrieveStoredTimeUnits(routineId,order);
  if (storedTimeUnit == null) {
    TimeUnitSQL unit=new TimeUnitSQL(null,unitString,order,routineId);
    unitDao.insert(unit);
    Log.d("String_Node_Str","String_Node_Str" + unit.getId());
    return unit.getId();
  }
 else {
    storedTimeUnit.setTimeunit(unitString);
    unitDao.update(storedTimeUnit);
    Log.d("String_Node_Str","String_Node_Str" + storedTimeUnit.getId());
    return storedTimeUnit.getId();
  }
}

Fixed version (ground truth):
private long storeTimeUnit(String unitString,int order,long routineId){
  TimeUnitSQL storedTimeUnit=this.retrieveStoredTimeUnits(routineId,order);
  if (storedTimeUnit == null) {
    TimeUnitSQL unit=new TimeUnitSQL(null,unitString,order,routineId);
    unitDao.insert(unit);
    return unit.getId();
  }
 else {
    storedTimeUnit.setTimeunit(unitString);
    unitDao.update(storedTimeUnit);
    return storedTimeUnit.getId();
  }
}
Program: 99081
Project: 99081
Buggy source:
/** 
 * Return a list of stored routine given the routine name. (The design  should only have one routine with a given name).
 * @param routineName
 * @return
 */
private RoutineSQL retrieveStoredRoutine(String routineName){
  Log.d("String_Node_Str","String_Node_Str" + routineName);
  return routineDao.queryBuilder().where(com.hook38.sporttimer.model.sql.RoutineSQLDao.Properties.Name.eq(routineName)).unique();
}

Fixed version (ground truth):
/** 
 * Return a list of stored routine given the routine name. (The design  should only have one routine with a given name).
 * @param routineName
 * @return
 */
private RoutineSQL retrieveStoredRoutine(String routineName){
  return routineDao.queryBuilder().where(com.hook38.sporttimer.model.sql.RoutineSQLDao.Properties.Name.eq(routineName)).unique();
}
Program: 99082
Project: 99082
Buggy source:
/** 
 * Return the selected spinner
 * @return Name of the selected spinner
 */
public String getSelectedRoutine(){
  return routine_spinner.getSelectedItem().toString();
}

Fixed version (ground truth):
/** 
 * Return the selected spinner
 * @return Name of the selected spinner
 */
public String getSelectedRoutine(){
  try {
    return routine_spinner.getSelectedItem().toString();
  }
 catch (  IndexOutOfBoundsException e) {
    return routine_spinner.getItemAtPosition(0).toString();
  }
}
Program: 99086
Project: 99086
Buggy source:
public void addQuestionResult(QuestionResult result){
  results.lastElement().addQuestionResult(result);
}

Fixed version (ground truth):
public void addQuestionResult(QuestionResult result){
  results.lastElement().setQuestionResult(result);
}
Program: 99087
Project: 99087
Buggy source:
@Override public void OnWordChange(int wordIndex,String word,long eventTime,long timeSinceLastChange,int relativePosition,int pxWidth){
  if (wordIndex == -1 && result.wordEvents.size() > 0 && result.wordEvents.lastElement().wordIndex == -1) {
    return;
  }
  WordEvent e=new WordEvent();
  e.wordIndex=wordIndex;
  if (result.wordEvents.size() > 0) {
    e.wordIndexDelta=wordIndex - result.wordEvents.lastElement().wordIndex;
    result.wordEvents.lastElement().timeSpent=timeSinceLastChange;
  }
  e.word=word;
  e.pxWidth=pxWidth;
  e.time=eventTime;
  e.tDelta=timeSinceLastChange;
  e.relativePosition=relativePosition;
  result.wordEvents.add(e);
}

Fixed version (ground truth):
@Override public void OnWordChange(int wordIndex,String word,long eventTime,long timeSinceLastChange,int relativePosition,int pxWidth){
  if (wordIndex == -1 && result.getNumWordEvents() > 0 && result.getLastWordEvent().wordIndex == -1) {
    return;
  }
  WordEvent e=new WordEvent();
  e.wordIndex=wordIndex;
  if (result.getNumWordEvents() > 0) {
    e.wordIndexDelta=wordIndex - result.getLastWordEvent().wordIndex;
    result.getLastWordEvent().timeSpent=timeSinceLastChange;
  }
  e.word=word;
  e.pxWidth=pxWidth;
  e.time=eventTime;
  e.tDelta=timeSinceLastChange;
  e.relativePosition=relativePosition;
  result.addWordEvent(e);
}
Program: 99088
Project: 99088
Buggy source:
@Override public void OnCharChange(int charIndex,String character,long eventTime,long timeSinceLastChange,int relativePosition){
  if (charIndex == -1 && result.charEvents.size() > 0 && result.charEvents.lastElement().charIndex == -1) {
    return;
  }
  CharEvent e=new CharEvent();
  e.charIndex=charIndex;
  if (result.charEvents.size() > 0) {
    e.charIndexDelta=charIndex - result.charEvents.lastElement().charIndex;
    result.charEvents.lastElement().timeSpent=timeSinceLastChange;
  }
  e.character=character;
  e.time=eventTime;
  e.tDelta=timeSinceLastChange;
  e.relativePosition=relativePosition;
  result.charEvents.add(e);
}

Fixed version (ground truth):
@Override public void OnCharChange(int charIndex,String character,long eventTime,long timeSinceLastChange,int relativePosition){
  if (charIndex == -1 && result.getNumCharEvents() > 0 && result.getLastCharEvent().charIndex == -1) {
    return;
  }
  CharEvent e=new CharEvent();
  e.charIndex=charIndex;
  if (result.getNumCharEvents() > 0) {
    e.charIndexDelta=charIndex - result.getLastCharEvent().charIndex;
    result.getLastCharEvent().timeSpent=timeSinceLastChange;
  }
  e.character=character;
  e.time=eventTime;
  e.tDelta=timeSinceLastChange;
  e.relativePosition=relativePosition;
  result.addCharEvent(e);
}
Program: 99089
Project: 99089
Buggy source:
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  sentenceView.giveFingerPosition((int)(progress + seekBar.getX()));
  SeekEvent e=new SeekEvent();
  e.time=System.currentTimeMillis();
  if (result.seekEvents.size() > 0) {
    e.tDelta=e.time - result.seekEvents.lastElement().time;
  }
 else {
    e.tDelta=e.time - baseSeekTime;
  }
  int fingerXPos=progress - seekBarMargin;
  if (fingerXPos < 0) {
    e.relativePosition=SeekEvent.ANTE_SENTENTIUM;
  }
 else   if (fingerXPos >= seekBarMax - 2 * seekBarMargin) {
    e.relativePosition=SeekEvent.POST_SENTENTIUM;
  }
 else {
    e.relativePosition=SeekEvent.IN_SENTENTIUM;
  }
  e.x=fingerXPos;
  e.word=sentenceView.getWord();
  e.character=sentenceView.getChar();
  e.wordIndex=sentenceView.getWordIndex();
  e.charIndex=sentenceView.getCharIndex();
  if (result.seekEvents.size() > 0) {
    e.xDelta=e.x - result.seekEvents.lastElement().x;
    e.wordIndexDelta=e.wordIndex - result.seekEvents.lastElement().wordIndex;
    e.charIndexDelta=e.charIndex - result.seekEvents.lastElement().charIndex;
  }
  result.seekEvents.add(e);
}

Fixed version (ground truth):
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  sentenceView.giveFingerPosition((int)(progress + seekBar.getX()));
  SeekEvent e=new SeekEvent();
  e.time=System.currentTimeMillis();
  if (result.getNumCharEvents() > 0) {
    e.tDelta=e.time - result.getLastSeekEvent().time;
  }
 else {
    e.tDelta=e.time - baseSeekTime;
  }
  int fingerXPos=progress - seekBarMargin;
  if (fingerXPos < 0) {
    e.relativePosition=SeekEvent.ANTE_SENTENTIUM;
  }
 else   if (fingerXPos >= seekBarMax - 2 * seekBarMargin) {
    e.relativePosition=SeekEvent.POST_SENTENTIUM;
  }
 else {
    e.relativePosition=SeekEvent.IN_SENTENTIUM;
  }
  e.x=fingerXPos;
  e.word=sentenceView.getWord();
  e.character=sentenceView.getChar();
  e.wordIndex=sentenceView.getWordIndex();
  e.charIndex=sentenceView.getCharIndex();
  if (result.getNumCharEvents() > 0) {
    e.xDelta=e.x - result.getLastSeekEvent().x;
    e.wordIndexDelta=e.wordIndex - result.getLastSeekEvent().wordIndex;
    e.charIndexDelta=e.charIndex - result.getLastSeekEvent().charIndex;
  }
  result.addSeekEvent(e);
}
Program: 99090
Project: 99090
Buggy source:
@Override public void onStopTrackingTouch(SeekBar seekBar){
  if (result.seekEvents.lastElement().x == seekBarMax - seekBarMargin) {
    main.addSentenceResult(result);
    if (!showQuestion()) {
      nextSentence();
    }
  }
}

Fixed version (ground truth):
@Override public void onStopTrackingTouch(SeekBar seekBar){
  if (result.getLastSeekEvent().x == seekBarMax - seekBarMargin) {
    main.addSentenceResult(result);
    if (!showQuestion()) {
      nextSentence();
    }
  }
}
Program: 99091
Project: 99091
Buggy source:
public void draw(Canvas canvas){
  if (this.isPlaying) {
    long elapsed=(System.currentTimeMillis() - last_tick);
    if (elapsed >= DURATION) {
      if (frame <= fcount) {
        last_tick=System.currentTimeMillis();
        frame++;
      }
 else {
        this.isPlaying=false;
      }
    }
    drawFrame(canvas);
    if (frame <= fcount)     view.repaint();
  }
}

Fixed version (ground truth):
public void draw(Canvas canvas){
  if (isPlaying) {
    long elapsed=(System.currentTimeMillis() - last_tick);
    if (elapsed >= DURATION) {
      if (frame <= fcount) {
        last_tick=System.currentTimeMillis();
        frame++;
      }
 else {
        isPlaying=false;
      }
    }
    drawFrame(canvas);
    if (frame <= fcount)     view.repaint();
  }
}
Program: 99092
Project: 99092
Buggy source:
private void changePicture(String pose,int frame_count){
  this.pose=pose;
  this.fcount=frame_count;
  this.frame=1;
  this.last_tick=0;
  this.isPlaying=true;
  view.repaint();
}

Fixed version (ground truth):
private void changePicture(String pose,int frame_count){
  this.pose=pose;
  this.fcount=frame_count;
  this.frame=1;
  this.last_tick=0;
  isPlaying=true;
  view.repaint();
}
Program: 99093
Project: 99093
Buggy source:
@Override public void onBackPressed(){
  if (view.running)   view.running=false;
  view.program=null;
  view.repaint();
  return;
}

Fixed version (ground truth):
@Override public void onBackPressed(){
  if (view.running)   view.running=false;
  Roberto.isPlaying=false;
  view.program=null;
  view.repaint();
  return;
}
Program: 99094
Project: 99094
Buggy source:
public void run(){
  long temp, clock=System.currentTimeMillis();
  boolean stopped=false;
  while (!stopped) {
    stopped=true;
    for (    Process p : processes) {
      if (p.isRunning()) {
        if (p.run()) {
          stopped=false;
        }
 else {
          notifyProcessStopped(p);
        }
      }
    }
    if (stopped)     break;
    try {
      Thread.sleep(200);
    }
 catch (    InterruptedException ix) {
      ;
    }
    temp=clock;
    clock=System.currentTimeMillis();
    updateTimers((int)(clock - temp));
  }
}

Fixed version (ground truth):
public void run(){
  long temp, clock=System.currentTimeMillis();
  boolean stopped=false;
  this.running=true;
  while (!stopped) {
    stopped=true;
    for (    Process p : processes) {
      if (p.isRunning()) {
        if (p.run()) {
          stopped=false;
        }
 else {
          notifyProcessStopped(p);
        }
      }
    }
    if (stopped)     break;
    try {
      Thread.sleep(200);
    }
 catch (    InterruptedException ix) {
      ;
    }
    temp=clock;
    clock=System.currentTimeMillis();
    updateTimers((int)(clock - temp));
  }
  this.running=false;
}
Program: 99095
Project: 99095
Buggy source:
/** 
 * Stop the interpreter thread
 */
public void stop(){
  for (  Process p : processes) {
    if (p.isRunning()) {
      p.stop();
    }
  }
  if (robot != null) {
    robot.allStop();
  }
  sleep(100);
}

Fixed version (ground truth):
/** 
 * Stop the interpreter thread
 */
public void stop(){
  for (  Process p : processes) {
    if (p.isRunning()) {
      p.stop();
    }
  }
  if (robot != null) {
    robot.allStop();
  }
  while (this.running) {
    sleep(50);
  }
}
Program: 99096
Project: 99096
Buggy source:
/** 
 * @see HttpServlet#doPost(HttpServletRequest request,HttpServletResponse response)
 */
protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String firstName=request.getParameter("String_Node_Str");
  String lastName=request.getParameter("String_Node_Str");
  String email=request.getParameter("String_Node_Str");
  String address1=request.getParameter("String_Node_Str");
  String address2=request.getParameter("String_Node_Str");
  String zipcode=request.getParameter("String_Node_Str");
  String city=request.getParameter("String_Node_Str");
  String state=request.getParameter("String_Node_Str");
  Customer customer=new Customer(firstName,lastName,email,address1,address2,zipcode,city,state);
  request.setAttribute("String_Node_Str",customer);
  String url="String_Node_Str";
  RequestDispatcher dispatcher=getServletContext().getRequestDispatcher(url);
  dispatcher.forward(request,response);
}

Fixed version (ground truth):
/** 
 * @see HttpServlet#doPost(HttpServletRequest request,HttpServletResponse response)
 */
protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String firstName=request.getParameter("String_Node_Str");
  String lastName=request.getParameter("String_Node_Str");
  String email=request.getParameter("String_Node_Str");
  String address1=request.getParameter("String_Node_Str");
  String address2=request.getParameter("String_Node_Str");
  String zipcode=request.getParameter("String_Node_Str");
  String city=request.getParameter("String_Node_Str");
  String state=request.getParameter("String_Node_Str");
  String password=request.getParameter("String_Node_Str");
  Customer customer=new Customer(firstName,lastName,email,password,address1,address2,zipcode,city,state);
  request.setAttribute("String_Node_Str",customer);
  String url="String_Node_Str";
  RequestDispatcher dispatcher=getServletContext().getRequestDispatcher(url);
  dispatcher.forward(request,response);
}
Program: 99097
Project: 99097
Buggy source:
@github.com ResultSet validate(String email,String password){
  ResultSet res=null;
  try {
    String query="String_Node_Str" + email + "String_Node_Str"+ password+ "String_Node_Str";
    stmnt=CONN.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
    res=stmnt.executeQuery(query);
  }
 catch (  SQLException ex) {
    handleSqlExceptions(ex);
  }
  return res;
}

Fixed version (ground truth):
public ResultSet validate(String email,String password){
  ResultSet res=null;
  try {
    String query="String_Node_Str" + email + "String_Node_Str"+ password+ "String_Node_Str";
    stmnt=CONN.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
    res=stmnt.executeQuery(query);
  }
 catch (  SQLException ex) {
    handleSqlExceptions(ex);
  }
  return res;
}
Program: 99098
Project: 99098
Buggy source:
public void addQuantity(int quantity){
  quantity+=Math.abs(quantity);
}

Fixed version (ground truth):
public void addQuantity(int quantity){
  this.quantity+=Math.abs(quantity);
}
Program: 99099
Project: 99099
Buggy source:
@Override protected void onDestroy(){
  super.onDestroy();
  if (currentScene != null) {
    currentScene.onDestroy();
  }
  if (mainGame == this) {
    mainGame=null;
    this.gameObjectManager.destroy();
    this.touchEventManager.removeAll();
  }
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  super.onDestroy();
  if (currentScene != null) {
    currentScene.onDestroy();
  }
  if (mainGame == this) {
    mainGame=null;
    isExited=false;
    this.gameObjectManager.destroy();
    this.touchEventManager.removeAll();
  }
}
Program: 99100
Project: 99100
Buggy source:
@Override protected void copyTo(GameObject gameObject){
  super.copyTo(gameObject);
  Node node=(Node)gameObject;
  if (hasAnimation) {
    node.animation=this.animation.clone();
  }
  node.hasAnimation=this.hasAnimation;
  node.childCount=this.childCount;
  node.children=new Node[this.childCount];
  for (int i=0; i < childCount; i++) {
    node.children[i]=this.children[i].instantiate();
  }
}

Fixed version (ground truth):
@Override protected void copyTo(GameObject gameObject){
  super.copyTo(gameObject);
  Node node=(Node)gameObject;
  node.hasAnimation=this.hasAnimation;
  if (hasAnimation) {
    node.animation=this.animation.clone();
  }
  node.childCount=this.childCount;
  node.children=new Node[this.childCount];
  for (int i=0; i < childCount; i++) {
    node.children[i]=this.children[i].instantiate();
  }
}
Program: 99101
Project: 99101
Buggy source:
public static AnimationPlayer getInstance(){
  return instance;
}

Fixed version (ground truth):
public static AnimationPlayer getInstance(){
  if (instance == null) {
    instance=new AnimationPlayer();
  }
  return instance;
}
Program: 99102
Project: 99102
Buggy source:
@Override protected final void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  instance=this;
  this.gameObjectManager=GameObjectManager.getInstance();
  this.animationPlayer=AnimationPlayer.getInstance();
  this.touchEventManager=TouchEventManager.getInstance();
  this.gameTime=GameTime.getInstance();
  if (mainGame == null) {
    Scene.setMainCamera(new Camera("String_Node_Str"));
    Screen.w=getWindowManager().getDefaultDisplay().getWidth();
    Screen.h=getWindowManager().getDefaultDisplay().getHeight();
    this.gameObjectManager.setContext(this);
    this.gameObjectManager.initialize();
    mainGame=this;
  }
  this.onInitialize(savedInstanceState);
  this.glSurfaceView=new GLSurfaceView(this);
  this.glSurfaceView.setEGLContextClientVersion(2);
  this.glSurfaceView.setRenderer(new GLRenderer());
  this.setContentView(glSurfaceView);
}

Fixed version (ground truth):
@Override protected final void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  instance=this;
  this.gameObjectManager=GameObjectManager.getInstance();
  this.animationPlayer=AnimationPlayer.getInstance();
  this.touchEventManager=TouchEventManager.getInstance();
  this.gameTime=GameTime.getInstance();
  if (mainGame == null) {
    Scene.setMainCamera(new Camera("String_Node_Str"));
    Screen.w=getWindowManager().getDefaultDisplay().getWidth();
    Screen.h=getWindowManager().getDefaultDisplay().getHeight();
    this.gameObjectManager.setContext(this);
    this.gameObjectManager.initialize();
    mainGame=this;
  }
  System.gc();
  this.onInitialize(savedInstanceState);
  this.glSurfaceView=new GLSurfaceView(this);
  this.glSurfaceView.setEGLContextClientVersion(2);
  this.glSurfaceView.setRenderer(new GLRenderer());
  this.setContentView(glSurfaceView);
}
Program: 99103
Project: 99103
Buggy source:
@Override protected void onDestroy(){
  super.onDestroy();
  if (currentScene != null) {
    currentScene.onDestroy();
  }
  if (mainGame == this) {
    mainGame=null;
    isExited=false;
    this.gameObjectManager.destroy();
    this.touchEventManager.removeAll();
  }
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  super.onDestroy();
  if (currentScene != null) {
    currentScene.onDestroy();
  }
  if (mainGame == this) {
    mainGame=null;
    isExited=false;
    this.gameObjectManager.destroy();
    this.touchEventManager.removeAll();
    this.touchEventManager.destroy();
    this.animationPlayer.destroy();
    this.animationPlayer=null;
    this.gameObjectManager=null;
    this.touchEventManager=null;
  }
  instance=null;
  System.gc();
}
Program: 99104
Project: 99104
Buggy source:
public void destroy(){
  Log.e("String_Node_Str","String_Node_Str");
  assetFileNames.clear();
  texturesList.clear();
  scenePrefabs.clear();
  terrains.clear();
  isInitialized=false;
}

Fixed version (ground truth):
public void destroy(){
  Log.e("String_Node_Str","String_Node_Str");
  assetFileNames.clear();
  for (  Texture2D texture2d : texturesList.values()) {
    texture2d.destroy();
  }
  texturesList.clear();
  terrains.clear();
  getNormalQueue.clear();
  for (  ScenePrefab scenePrefab : scenePrefabs.values()) {
    scenePrefab.destroy();
  }
  scenePrefabs.clear();
  bitmapList.clear();
  isInitialized=false;
  instance=null;
}
Program: 99105
Project: 99105
Buggy source:
static GameObjectManager getInstance(){
  return instance;
}

Fixed version (ground truth):
static GameObjectManager getInstance(){
  if (instance == null) {
    instance=new GameObjectManager();
  }
  return instance;
}
Program: 99106
Project: 99106
Buggy source:
public static TouchEventManager getInstance(){
  return instance;
}

Fixed version (ground truth):
public static TouchEventManager getInstance(){
  if (instance == null) {
    instance=new TouchEventManager();
  }
  return instance;
}
Program: 99107
Project: 99107
Buggy source:
public void onDestroy(){
}

Fixed version (ground truth):
public void onDestroy(){
  sprites.clear();
  models.clear();
  terrains.clear();
  lights.clear();
  sprites=null;
  models=null;
  terrains=null;
  lights=null;
}
Program: 99109
Project: 99109
Buggy source:
private void collision(SphereCollider b){
  indx[0]=getClosetPlaneIndex(b);
  indx[1]=indx[0] - 1;
  indx[2]=indx[0] + 1;
  if (indx[1] < 0) {
    indx[1]=getPlaneCount() - 1;
  }
  if (indx[2] == getPlaneCount()) {
    indx[2]=0;
  }
  Log.e("String_Node_Str",indx[0] + "String_Node_Str" + indx[1]+ "String_Node_Str"+ indx[2]);
  Color3 color=new Color3(1,0,0);
  for (int i=0; i < indx.length; i++) {
    Vector3[] plane=getCorner(indx[i]);
    Vector3 c1=Vector3.add(Vector3.add(plane[0],plane[1]),Vector3.add(plane[2],plane[3]));
    Vector3 center=new Vector3(c1.x / 4f,c1.y / 4f,c1.z / 4f);
    Debug.drawLine(plane[0],plane[1],color);
    Debug.drawLine(plane[1],plane[2],color);
    Debug.drawLine(plane[2],plane[3],color);
    Debug.drawLine(plane[3],plane[0],color);
    boolean isOverlap=Collider.intersect(b,center,plane[0],plane[3],plane[2],plane[1]);
    Log.e("String_Node_Str",center.toString());
    if (isOverlap) {
      Log.e("String_Node_Str",b.getName());
      Vector3 v1=Vector3.subtract(plane[2],plane[0]);
      Vector3 v2=Vector3.subtract(plane[3],plane[0]);
      Vector3 n=Vector3.cross(v1,v2);
      Vector3 forward=b.getForward();
      Vector3 reflect=Vector3.reflect(forward,n);
      b.setForward(reflect);
    }
  }
}

Fixed version (ground truth):
private void collision(SphereCollider b){
  indx[0]=getClosetPlaneIndex(b);
  indx[1]=indx[0] - 1;
  indx[2]=indx[0] + 1;
  if (indx[1] < 0) {
    indx[1]=getPlaneCount() - 1;
  }
  if (indx[2] == getPlaneCount()) {
    indx[2]=0;
  }
  Color3 color=new Color3(1,0,0);
  for (int i=0; i < indx.length; i++) {
    Vector3[] plane=getCorner(indx[i]);
    Vector3 c1=Vector3.add(Vector3.add(plane[0],plane[1]),Vector3.add(plane[2],plane[3]));
    Vector3 center=new Vector3(c1.x / 4f,c1.y / 4f,c1.z / 4f);
    Debug.drawLine(plane[0],plane[1],color);
    Debug.drawLine(plane[1],plane[2],color);
    Debug.drawLine(plane[2],plane[3],color);
    Debug.drawLine(plane[3],plane[0],color);
    boolean isOverlap=Collider.intersect(b,center,plane[0],plane[3],plane[2],plane[1]);
    if (isOverlap) {
      Log.e("String_Node_Str",b.getName());
      Vector3 v1=Vector3.subtract(plane[2],plane[0]);
      Vector3 v2=Vector3.subtract(plane[3],plane[0]);
      Vector3 n=Vector3.cross(v1,v2);
      Vector3 up=new Vector3(0,0,1);
      Vector3 ford=Vector3.cross(up,n);
      if (!b.isRoot()) {
        Vector3 forward=b.parent.getForward();
        Vector3 reflect=Vector3.reflect(forward,n);
        b.parent.setForward(ford);
      }
 else {
        Vector3 forward=b.getForward();
        Vector3 reflect=Vector3.reflect(forward,n);
        b.setForward(ford);
      }
    }
  }
}
Program: 99110
Project: 99110
Buggy source:
public void update(){
  if (!isStarted) {
    isStarted=true;
  }
  PlaneCollider chkp=checkpoint.get(currentCheckPoint);
  SphereCollider sphr=vehicle.getCollider();
  vehicle.accelerate(1);
  if (Collider.intersect(chkp,sphr)) {
    currentCheckPoint++;
    if (currentCheckPoint >= checkpoint.size()) {
      currentCheckPoint-=checkpoint.size();
    }
  }
}

Fixed version (ground truth):
public void update(){
  if (!isStarted) {
    isStarted=true;
  }
  PlaneCollider chkp=checkpoint.get(currentCheckPoint);
  SphereCollider sphr=(SphereCollider)vehicle.getObject().getCollider();
  vehicle.accelerate(1);
  if (Collider.intersect(chkp,sphr)) {
    currentCheckPoint++;
    if (currentCheckPoint >= checkpoint.size()) {
      currentCheckPoint-=checkpoint.size();
    }
  }
}
Program: 99112
Project: 99112
Buggy source:
public void onUpdate(){
  vehicle.update();
  PlaneCollider chp=checkpoint.get(currentCheckpoint);
  SphereCollider spr=vehicle.getCollider();
  if (Collider.intersect(chp,spr)) {
    currentCheckpoint++;
    checkpointCount++;
    if (currentCheckpoint >= checkpoint.size()) {
      currentCheckpoint-=checkpoint.size();
    }
    if (checkpointCount > checkpoint.size()) {
      if (!isEnd) {
        layer2.addChild(endSprite);
        isEnd=true;
      }
    }
  }
  debuging();
}

Fixed version (ground truth):
public void onUpdate(){
  vehicle.update();
  PlaneCollider chp=checkpoint.get(currentCheckpoint);
  SphereCollider spr=(SphereCollider)buffy.getCollider();
  if (Collider.intersect(chp,spr)) {
    currentCheckpoint++;
    checkpointCount++;
    if (currentCheckpoint >= checkpoint.size()) {
      currentCheckpoint-=checkpoint.size();
    }
    if (checkpointCount > checkpoint.size()) {
      if (!isEnd) {
        layer2.addChild(endSprite);
        isEnd=true;
      }
    }
  }
  debuging();
}
Program: 99113
Project: 99113
Buggy source:
public Matrix4 getWorldMatrix(){
  if (isRoot()) {
    return local;
  }
  return world;
}

Fixed version (ground truth):
public Matrix4 getWorldMatrix(){
  if (parent == null) {
    return local;
  }
  return world;
}
Program: 99114
Project: 99114
Buggy source:
@Override public final boolean addChild(Group child){
  if (child.parent == null) {
    boolean b=super.addChild(child);
    if (b) {
      child.parent=this;
    }
    return b;
  }
  return false;
}

Fixed version (ground truth):
public final void addChild(Group... children){
  for (  Group child : children) {
    addChild(child);
  }
}
Program: 99116
Project: 99116
Buggy source:
public void drawScene(){
  if (hasChangedProjection) {
    if (mainCamera.getProjectionType() == Camera.PERSPECTIVE) {
      Matrix4.createFrustum(projectionMatrix,-ratio,ratio,-1,1,1,mainCamera.getRange());
    }
 else {
      Matrix4.createOrtho(projectionMatrix,-ratio,ratio,-1,1,1,mainCamera.getRange());
    }
    hasChangedProjection=false;
  }
  if (hasChangedModelView) {
    Vector3 eye=mainCamera.getPosition();
    Vector3 forward=mainCamera.getForward();
    target.x=eye.x + (forward.x * 10);
    target.y=eye.y + (forward.y * 10);
    target.z=eye.z + (forward.z * 10);
    Vector3 up=mainCamera.getUp();
    Matrix4.createLookAt(modelViewMatrix,eye,target,up);
    hasChangedModelView=false;
  }
  Matrix4.multiply(modelViewProjectionMatrix,projectionMatrix,modelViewMatrix);
  for (int i=0; i < getLayerCount(); i++) {
    recursiveLayer(getLayer(i));
  }
  GLES20.glEnable(GLES20.GL_DEPTH_TEST);
  GLES20.glDisable(GLES20.GL_CULL_FACE);
  drawTerrains();
  GLES20.glEnable(GLES20.GL_CULL_FACE);
  for (int i=0; i < models.size(); i++) {
    drawModel(models.get(i));
  }
  for (int i=0; i < imageViews.size(); i++) {
    drawImageView(imageViews.get(i));
  }
  imageViews.clear();
  models.clear();
  terrains.clear();
  lights.clear();
  float end=(System.nanoTime() - start) / 1000000f;
  Log.d("String_Node_Str",(1000f / end) + "String_Node_Str");
  start=System.nanoTime();
}

Fixed version (ground truth):
public void drawScene(){
  if (hasChangedProjection) {
    if (mainCamera.getProjectionType() == Camera.PERSPECTIVE) {
      Matrix4.createFrustum(projectionMatrix,-ratio,ratio,-1,1,1,mainCamera.getRange());
    }
 else {
      Matrix4.createOrtho(projectionMatrix,-ratio,ratio,-1,1,1,mainCamera.getRange());
    }
    hasChangedProjection=false;
  }
  if (hasChangedModelView) {
    Matrix4 world=mainCamera.getWorldMatrix();
    Vector3 eye=world.getTranslation();
    Vector3 forward=world.getForward();
    target.x=eye.x + (forward.x * 10);
    target.y=eye.y + (forward.y * 10);
    target.z=eye.z + (forward.z * 10);
    Vector3 up=world.getUp();
    Matrix4.createLookAt(modelViewMatrix,eye,target,up);
    hasChangedModelView=false;
  }
  Matrix4.multiply(modelViewProjectionMatrix,projectionMatrix,modelViewMatrix);
  for (int i=0; i < getLayerCount(); i++) {
    recursiveLayer(getLayer(i));
  }
  GLES20.glEnable(GLES20.GL_DEPTH_TEST);
  GLES20.glDisable(GLES20.GL_CULL_FACE);
  drawTerrains();
  GLES20.glEnable(GLES20.GL_CULL_FACE);
  for (int i=0; i < models.size(); i++) {
    drawModel(models.get(i));
  }
  for (int i=0; i < imageViews.size(); i++) {
    drawImageView(imageViews.get(i));
  }
  imageViews.clear();
  models.clear();
  terrains.clear();
  lights.clear();
  float end=(System.nanoTime() - start) / 1000000f;
  Log.d("String_Node_Str",(1000f / end) + "String_Node_Str");
  start=System.nanoTime();
}
Program: 99117
Project: 99117
Buggy source:
private void setLightUniform(int program,ArrayList<Light> lights){
  int lightCount=lights.size();
  GLES20.glUniform1f(GLES20.glGetUniformLocation(program,"String_Node_Str"),lightCount);
  for (int i=0; i < lightCount; i++) {
    Light light=lights.get(i);
    int lt=light.getLightType();
    if (lt == Light.DIRECTIONAL_LIGHT) {
      Vector3 forward=light.getForward();
      lightPosTemp.set(-forward.x,-forward.y,-forward.z,0);
    }
 else {
      lightPosTemp.set(light.getPosition(),1);
    }
    Matrix4.multiply(lightPos4,modelViewMatrix,lightPosTemp);
    GLES20.glUniform4f(GLES20.glGetUniformLocation(program,"String_Node_Str" + i + "String_Node_Str"),lightPos4.x,lightPos4.y,lightPos4.z,lt);
    Color3 color=light.getColor();
    GLES20.glUniform4f(GLES20.glGetUniformLocation(program,"String_Node_Str" + i + "String_Node_Str"),color.r,color.g,color.b,1);
    GLES20.glUniform1f(GLES20.glGetUniformLocation(program,"String_Node_Str" + i + "String_Node_Str"),light.getRange());
    GLES20.glUniform1f(GLES20.glGetUniformLocation(program,"String_Node_Str" + i + "String_Node_Str"),light.getIntensity());
  }
}

Fixed version (ground truth):
private void setLightUniform(int program,ArrayList<Light> lights){
  int lightCount=lights.size();
  GLES20.glUniform1f(GLES20.glGetUniformLocation(program,"String_Node_Str"),lightCount);
  for (int i=0; i < lightCount; i++) {
    Light light=lights.get(i);
    Matrix4 world=light.getWorldMatrix();
    int lt=light.getLightType();
    if (lt == Light.DIRECTIONAL_LIGHT) {
      Vector3 forward=world.getForward();
      lightPosTemp.set(-forward.x,-forward.y,-forward.z,0);
    }
 else {
      lightPosTemp.set(world.getTranslation(),1);
    }
    Matrix4.multiply(lightPos4,modelViewMatrix,lightPosTemp);
    GLES20.glUniform4f(GLES20.glGetUniformLocation(program,"String_Node_Str" + i + "String_Node_Str"),lightPos4.x,lightPos4.y,lightPos4.z,lt);
    Color3 color=light.getColor();
    GLES20.glUniform4f(GLES20.glGetUniformLocation(program,"String_Node_Str" + i + "String_Node_Str"),color.r,color.g,color.b,1);
    GLES20.glUniform1f(GLES20.glGetUniformLocation(program,"String_Node_Str" + i + "String_Node_Str"),light.getRange());
    GLES20.glUniform1f(GLES20.glGetUniformLocation(program,"String_Node_Str" + i + "String_Node_Str"),light.getIntensity());
  }
}