Program: 58701
Project: 58701
Buggy source:
/** 
 * Handles drag&drop of groups in experiment dimension
 * @param gl
 */
private void handleDragDropGroupExperiments(final GL gl){
  Point currentPoint=glMouseListener.getPickedPoint();
  float[] fArTargetWorldCoordinates=new float[3];
  int iTargetIdx=0;
  int iNrSamples=storageVA.size();
  float fgaps=0;
  if (bSkipLevel1)   fgaps=GAP_LEVEL2_3 + 0.2f;
 else   fgaps=GAP_LEVEL1_2 + GAP_LEVEL2_3;
  float fleftOffset=0.075f + fgaps + viewFrustum.getWidth() / 4f * fAnimationScale;
  float fWidthSample=fWidthEHM / iNrSamples;
  int currentElement;
  fArTargetWorldCoordinates=GLCoordinateUtils.convertWindowCoordinatesToWorldCoordinates(gl,currentPoint.x,currentPoint.y);
  IGroupList groupList=storageVA.getGroupList();
  int iNrElementsInGroup=groupList.get(iExpGroupToDrag).getNrElements();
  float currentWidth=fWidthSample * iNrElementsInGroup;
  float fHeight=viewFrustum.getHeight();
  if (fArTargetWorldCoordinates[0] > fleftOffset && fArTargetWorldCoordinates[0] < fleftOffset + fWidthEHM) {
    gl.glBegin(GL.GL_QUADS);
    gl.glVertex3f(fArTargetWorldCoordinates[0],fHeight,0);
    gl.glVertex3f(fArTargetWorldCoordinates[0],fHeight - 0.1f,0);
    gl.glVertex3f(fArTargetWorldCoordinates[0] + currentWidth,fHeight - 0.1f,0);
    gl.glVertex3f(fArTargetWorldCoordinates[0] + currentWidth,fHeight,0);
    gl.glEnd();
  }
  float fXPosRelease=fArTargetWorldCoordinates[0] - fleftOffset;
  currentElement=(int)Math.ceil(fXPosRelease / fWidthSample);
  int iElemOffset=0;
  int cnt=0;
  if (groupList == null) {
    System.out.println("String_Node_Str");
    return;
  }
  for (  Group currentGroup : groupList) {
    if (currentElement < (iElemOffset + currentGroup.getNrElements())) {
      iTargetIdx=cnt;
      break;
    }
    cnt++;
    iElemOffset+=currentGroup.getNrElements();
  }
  float fPosDropMarker=fleftOffset + fWidthSample * iElemOffset;
  gl.glLineWidth(6f);
  gl.glColor3f(1,0,0);
  gl.glBegin(GL.GL_LINES);
  gl.glVertex3f(fPosDropMarker,fHeight,0);
  gl.glVertex3f(fPosDropMarker,fHeight - 0.2f,0);
  gl.glEnd();
  if (glMouseListener.wasMouseReleased()) {
    if (groupList.move(storageVA,iExpGroupToDrag,iTargetIdx) == false)     System.out.println("String_Node_Str");
    bDragDropExpGroup=false;
    bActivateDraggingExperiments=false;
    bRedrawTextures=true;
    setDisplayListDirty();
  }
}

Fixed version (ground truth):
/** 
 * Handles drag&drop of groups in experiment dimension
 * @param gl
 */
private void handleDragDropGroupExperiments(final GL gl){
  Point currentPoint=glMouseListener.getPickedPoint();
  float[] fArTargetWorldCoordinates=new float[3];
  int iTargetIdx=0;
  int iNrSamples=storageVA.size();
  float fgaps=0;
  if (bSkipLevel1)   fgaps=GAP_LEVEL2_3 + 0.2f;
 else   fgaps=GAP_LEVEL1_2 + GAP_LEVEL2_3;
  float fleftOffset=0.075f + fgaps + viewFrustum.getWidth() / 4f * fAnimationScale;
  float fWidthSample=fWidthEHM / iNrSamples;
  int currentElement;
  fArTargetWorldCoordinates=GLCoordinateUtils.convertWindowCoordinatesToWorldCoordinates(gl,currentPoint.x,currentPoint.y);
  IGroupList groupList=storageVA.getGroupList();
  int iNrElementsInGroup=groupList.get(iExpGroupToDrag).getNrElements();
  float currentWidth=fWidthSample * iNrElementsInGroup;
  float fHeight=viewFrustum.getHeight();
  if (fArTargetWorldCoordinates[0] > fleftOffset && fArTargetWorldCoordinates[0] < fleftOffset + fWidthEHM) {
    gl.glBegin(GL.GL_QUADS);
    gl.glVertex3f(fArTargetWorldCoordinates[0],fHeight,0);
    gl.glVertex3f(fArTargetWorldCoordinates[0],fHeight - 0.1f,0);
    gl.glVertex3f(fArTargetWorldCoordinates[0] + currentWidth,fHeight - 0.1f,0);
    gl.glVertex3f(fArTargetWorldCoordinates[0] + currentWidth,fHeight,0);
    gl.glEnd();
  }
  float fXPosRelease=fArTargetWorldCoordinates[0] - fleftOffset;
  currentElement=(int)Math.ceil(fXPosRelease / fWidthSample);
  int iElemOffset=0;
  int cnt=0;
  if (groupList == null) {
    System.out.println("String_Node_Str");
    return;
  }
  for (  Group currentGroup : groupList) {
    if (currentElement < (iElemOffset + currentGroup.getNrElements())) {
      iTargetIdx=cnt;
      if (iExpGroupToDrag < iTargetIdx)       iElemOffset+=currentGroup.getNrElements();
      break;
    }
    cnt++;
    iElemOffset+=currentGroup.getNrElements();
  }
  float fPosDropMarker=fleftOffset + fWidthSample * iElemOffset;
  gl.glLineWidth(6f);
  gl.glColor3f(1,0,0);
  gl.glBegin(GL.GL_LINES);
  gl.glVertex3f(fPosDropMarker,fHeight,0);
  gl.glVertex3f(fPosDropMarker,fHeight - 0.2f,0);
  gl.glEnd();
  if (glMouseListener.wasMouseReleased()) {
    if (groupList.move(storageVA,iExpGroupToDrag,iTargetIdx) == false)     System.out.println("String_Node_Str");
    bDragDropExpGroup=false;
    bActivateDraggingExperiments=false;
    bRedrawTextures=true;
    setDisplayListDirty();
  }
}