Program: 58810
Project: 58810
Buggy source:
private void renderRemoteLevelElement(final GL gl,RemoteLevelElement element,RemoteLevel level){
  if (element.getContainedElementID() == -1)   return;
  int iViewID=element.getContainedElementID();
  gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.REMOTE_LEVEL_ELEMENT,element.getID()));
  gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.VIEW_SELECTION,iViewID));
  AGLEventListener glEventListener=generalManager.getViewGLCanvasManager().getGLEventListener(iViewID);
  if (glEventListener == null)   throw new IllegalStateException("String_Node_Str");
  gl.glPushMatrix();
  Transform transform=element.getTransform();
  Vec3f translation=transform.getTranslation();
  Rotf rot=transform.getRotation();
  Vec3f scale=transform.getScale();
  Vec3f axis=new Vec3f();
  float fAngle=rot.get(axis);
  gl.glTranslatef(translation.x(),translation.y(),translation.z());
  gl.glRotatef(Vec3f.convertRadiant2Grad(fAngle),axis.x(),axis.y(),axis.z());
  gl.glScalef(scale.x(),scale.y(),scale.z());
  if (level == poolLevel) {
    String sRenderText=glEventListener.getShortInfo();
    int iMaxChars;
    if (layoutRenderStyle instanceof ListLayoutRenderStyle) {
      iMaxChars=80;
    }
 else {
      iMaxChars=20;
    }
    if (sRenderText.length() > iMaxChars && scale.x() < 0.03f) {
      sRenderText=sRenderText.subSequence(0,iMaxChars - 3) + "String_Node_Str";
    }
    float fTextScalingFactor=0.09f;
    float fTextXPosition=0f;
    if (element.getID() == iMouseOverObjectID) {
      renderPoolSelection(gl,translation.x() - 0.4f / fAspectRatio,translation.y() * scale.y() + 5.2f,(float)textRenderer.getBounds(sRenderText).getWidth() * 0.06f + 23,6f,element);
      gl.glTranslatef(0.8f,1.3f,0);
      fTextScalingFactor=0.075f;
      fTextXPosition=12f;
    }
 else {
      Texture tempTexture=iconTextureManager.getIconTexture(gl,EIconTextures.POOL_VIEW_BACKGROUND);
      tempTexture.enable();
      tempTexture.bind();
      float fFrameWidth=9.5f;
      TextureCoords texCoords=tempTexture.getImageTexCoords();
      gl.glColor4f(1,1,1,0.75f);
      gl.glBegin(GL.GL_POLYGON);
      gl.glTexCoord2f(texCoords.left(),texCoords.bottom());
      gl.glVertex3f(-0.7f,-0.6f + fFrameWidth,-0.01f);
      gl.glTexCoord2f(texCoords.left(),texCoords.top());
      gl.glVertex3f(-0.7f + fFrameWidth,-0.6f + fFrameWidth,-0.01f);
      gl.glTexCoord2f(texCoords.right(),texCoords.top());
      gl.glVertex3f(-0.7f + fFrameWidth,-0.6f,-0.01f);
      gl.glTexCoord2f(texCoords.right(),texCoords.bottom());
      gl.glVertex3f(-0.7f,-0.6f,-0.01f);
      gl.glEnd();
      tempTexture.disable();
      fTextXPosition=9.5f;
    }
    int iNumberOfGenesSelected=glEventListener.getNumberOfSelections(ESelectionType.SELECTION);
    int iNumberOfGenesMouseOver=glEventListener.getNumberOfSelections(ESelectionType.MOUSE_OVER);
    textRenderer.begin3DRendering();
    if (element.getID() == iMouseOverObjectID) {
      textRenderer.setColor(1,1,1,1);
    }
 else {
      textRenderer.setColor(0,0,0,1);
    }
    if (iNumberOfGenesMouseOver == 0 && iNumberOfGenesSelected == 0) {
      textRenderer.draw3D(sRenderText,fTextXPosition,3f,0,fTextScalingFactor);
    }
 else {
      textRenderer.draw3D(sRenderText,fTextXPosition,4.5f,0,fTextScalingFactor);
    }
    textRenderer.end3DRendering();
    gl.glLineWidth(4);
    if (element.getID() == iMouseOverObjectID) {
      gl.glTranslatef(2.2f,0.5f,0);
    }
    if (iNumberOfGenesMouseOver > 0) {
      if (element.getID() == iMouseOverObjectID) {
        gl.glTranslatef(-2.5f,0,0);
      }
      textRenderer.begin3DRendering();
      textRenderer.draw3D(Integer.toString(iNumberOfGenesMouseOver),fTextXPosition + 9,2.4f,0,fTextScalingFactor);
      textRenderer.end3DRendering();
      if (element.getID() == iMouseOverObjectID) {
        gl.glTranslatef(2.5f,0,0);
      }
      gl.glColor4fv(GeneralRenderStyle.MOUSE_OVER_COLOR,0);
      gl.glBegin(GL.GL_LINES);
      gl.glVertex3f(10,2.7f,0f);
      gl.glVertex3f(18,2.7f,0f);
      gl.glVertex3f(20,2.7f,0f);
      gl.glVertex3f(29,2.7f,0f);
      gl.glEnd();
    }
    if (iNumberOfGenesSelected > 0) {
      if (iNumberOfGenesMouseOver > 0) {
        gl.glTranslatef(0,-1.8f,0);
      }
      if (element.getID() == iMouseOverObjectID) {
        gl.glTranslatef(-2.5f,0,0);
      }
      textRenderer.begin3DRendering();
      textRenderer.draw3D(Integer.toString(iNumberOfGenesSelected),fTextXPosition + 9,2.5f,0,fTextScalingFactor);
      textRenderer.end3DRendering();
      if (element.getID() == iMouseOverObjectID) {
        gl.glTranslatef(2.5f,0,0);
      }
      gl.glColor4fv(GeneralRenderStyle.SELECTED_COLOR,0);
      gl.glBegin(GL.GL_LINES);
      gl.glVertex3f(10,2.9f,0f);
      gl.glVertex3f(18,2.9f,0f);
      gl.glVertex3f(20,2.9f,0f);
      gl.glVertex3f(29,2.9f,0f);
      gl.glEnd();
      if (iNumberOfGenesMouseOver > 0) {
        gl.glTranslatef(0,1.8f,0);
      }
    }
    if (element.getID() == iMouseOverObjectID) {
      gl.glTranslatef(-2.2f,-0.5f,0);
    }
  }
  if (level != externalSelectionLevel && level != poolLevel) {
    if (level.equals(focusLevel)) {
      renderBucketWall(gl,false,element);
    }
 else {
      renderBucketWall(gl,true,element);
    }
  }
  if (!bEnableNavigationOverlay || !level.equals(stackLevel)) {
    glEventListener.displayRemote(gl);
  }
 else {
    renderNavigationOverlay(gl,element.getID());
  }
  gl.glPopMatrix();
  gl.glPopName();
  gl.glPopName();
}

Fixed version (ground truth):
private void renderRemoteLevelElement(final GL gl,RemoteLevelElement element,RemoteLevel level){
  if (element.getContainedElementID() == -1)   return;
  int iViewID=element.getContainedElementID();
  gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.REMOTE_LEVEL_ELEMENT,element.getID()));
  gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.VIEW_SELECTION,iViewID));
  AGLEventListener glEventListener=generalManager.getViewGLCanvasManager().getGLEventListener(iViewID);
  if (glEventListener == null) {
    generalManager.getLogger().log(Level.WARNING,"String_Node_Str");
    return;
  }
  gl.glPushMatrix();
  Transform transform=element.getTransform();
  Vec3f translation=transform.getTranslation();
  Rotf rot=transform.getRotation();
  Vec3f scale=transform.getScale();
  Vec3f axis=new Vec3f();
  float fAngle=rot.get(axis);
  gl.glTranslatef(translation.x(),translation.y(),translation.z());
  gl.glRotatef(Vec3f.convertRadiant2Grad(fAngle),axis.x(),axis.y(),axis.z());
  gl.glScalef(scale.x(),scale.y(),scale.z());
  if (level == poolLevel) {
    String sRenderText=glEventListener.getShortInfo();
    int iMaxChars;
    if (layoutRenderStyle instanceof ListLayoutRenderStyle) {
      iMaxChars=80;
    }
 else {
      iMaxChars=20;
    }
    if (sRenderText.length() > iMaxChars && scale.x() < 0.03f) {
      sRenderText=sRenderText.subSequence(0,iMaxChars - 3) + "String_Node_Str";
    }
    float fTextScalingFactor=0.09f;
    float fTextXPosition=0f;
    if (element.getID() == iMouseOverObjectID) {
      renderPoolSelection(gl,translation.x() - 0.4f / fAspectRatio,translation.y() * scale.y() + 5.2f,(float)textRenderer.getBounds(sRenderText).getWidth() * 0.06f + 23,6f,element);
      gl.glTranslatef(0.8f,1.3f,0);
      fTextScalingFactor=0.075f;
      fTextXPosition=12f;
    }
 else {
      Texture tempTexture=iconTextureManager.getIconTexture(gl,EIconTextures.POOL_VIEW_BACKGROUND);
      tempTexture.enable();
      tempTexture.bind();
      float fFrameWidth=9.5f;
      TextureCoords texCoords=tempTexture.getImageTexCoords();
      gl.glColor4f(1,1,1,0.75f);
      gl.glBegin(GL.GL_POLYGON);
      gl.glTexCoord2f(texCoords.left(),texCoords.bottom());
      gl.glVertex3f(-0.7f,-0.6f + fFrameWidth,-0.01f);
      gl.glTexCoord2f(texCoords.left(),texCoords.top());
      gl.glVertex3f(-0.7f + fFrameWidth,-0.6f + fFrameWidth,-0.01f);
      gl.glTexCoord2f(texCoords.right(),texCoords.top());
      gl.glVertex3f(-0.7f + fFrameWidth,-0.6f,-0.01f);
      gl.glTexCoord2f(texCoords.right(),texCoords.bottom());
      gl.glVertex3f(-0.7f,-0.6f,-0.01f);
      gl.glEnd();
      tempTexture.disable();
      fTextXPosition=9.5f;
    }
    int iNumberOfGenesSelected=glEventListener.getNumberOfSelections(ESelectionType.SELECTION);
    int iNumberOfGenesMouseOver=glEventListener.getNumberOfSelections(ESelectionType.MOUSE_OVER);
    textRenderer.begin3DRendering();
    if (element.getID() == iMouseOverObjectID) {
      textRenderer.setColor(1,1,1,1);
    }
 else {
      textRenderer.setColor(0,0,0,1);
    }
    if (iNumberOfGenesMouseOver == 0 && iNumberOfGenesSelected == 0) {
      textRenderer.draw3D(sRenderText,fTextXPosition,3f,0,fTextScalingFactor);
    }
 else {
      textRenderer.draw3D(sRenderText,fTextXPosition,4.5f,0,fTextScalingFactor);
    }
    textRenderer.end3DRendering();
    gl.glLineWidth(4);
    if (element.getID() == iMouseOverObjectID) {
      gl.glTranslatef(2.2f,0.5f,0);
    }
    if (iNumberOfGenesMouseOver > 0) {
      if (element.getID() == iMouseOverObjectID) {
        gl.glTranslatef(-2.5f,0,0);
      }
      textRenderer.begin3DRendering();
      textRenderer.draw3D(Integer.toString(iNumberOfGenesMouseOver),fTextXPosition + 9,2.4f,0,fTextScalingFactor);
      textRenderer.end3DRendering();
      if (element.getID() == iMouseOverObjectID) {
        gl.glTranslatef(2.5f,0,0);
      }
      gl.glColor4fv(GeneralRenderStyle.MOUSE_OVER_COLOR,0);
      gl.glBegin(GL.GL_LINES);
      gl.glVertex3f(10,2.7f,0f);
      gl.glVertex3f(18,2.7f,0f);
      gl.glVertex3f(20,2.7f,0f);
      gl.glVertex3f(29,2.7f,0f);
      gl.glEnd();
    }
    if (iNumberOfGenesSelected > 0) {
      if (iNumberOfGenesMouseOver > 0) {
        gl.glTranslatef(0,-1.8f,0);
      }
      if (element.getID() == iMouseOverObjectID) {
        gl.glTranslatef(-2.5f,0,0);
      }
      textRenderer.begin3DRendering();
      textRenderer.draw3D(Integer.toString(iNumberOfGenesSelected),fTextXPosition + 9,2.5f,0,fTextScalingFactor);
      textRenderer.end3DRendering();
      if (element.getID() == iMouseOverObjectID) {
        gl.glTranslatef(2.5f,0,0);
      }
      gl.glColor4fv(GeneralRenderStyle.SELECTED_COLOR,0);
      gl.glBegin(GL.GL_LINES);
      gl.glVertex3f(10,2.9f,0f);
      gl.glVertex3f(18,2.9f,0f);
      gl.glVertex3f(20,2.9f,0f);
      gl.glVertex3f(29,2.9f,0f);
      gl.glEnd();
      if (iNumberOfGenesMouseOver > 0) {
        gl.glTranslatef(0,1.8f,0);
      }
    }
    if (element.getID() == iMouseOverObjectID) {
      gl.glTranslatef(-2.2f,-0.5f,0);
    }
  }
  if (level != externalSelectionLevel && level != poolLevel) {
    if (level.equals(focusLevel)) {
      renderBucketWall(gl,false,element);
    }
 else {
      renderBucketWall(gl,true,element);
    }
  }
  if (!bEnableNavigationOverlay || !level.equals(stackLevel)) {
    glEventListener.displayRemote(gl);
  }
 else {
    renderNavigationOverlay(gl,element.getID());
  }
  gl.glPopMatrix();
  gl.glPopName();
  gl.glPopName();
}