Source:
<code>public void draw(GLAutoDrawable drawable, boolean idle, Point3d machineCoord, Point3d workCoord, Point3d focusMin, Point3d focusMax, double scaleFactor, Point3d mouseCoordinates, Point3d rotation) { if (!isDrawable) return; GL2 gl = drawable.getGL().getGL2(); boolean forceOldStyle = false; if(!forceOldStyle && gl.isFunctionAvailable( "glGenBuffers" ) && gl.isFunctionAvailable( "glBindBuffer" ) && gl.isFunctionAvailable( "glBufferData" ) && gl.isFunctionAvailable( "glDeleteBuffers" ) ) { <START> if (this.vertexBufferDirty) { <END> updateVertexBuffers(); this.vertexBufferDirty = false; } if (this.colorArrayDirty) { this.updateGLColorArray(drawable); this.colorArrayDirty = false; } if (this.vertexArrayDirty) { this.updateGLGeometryArray(drawable); this.vertexArrayDirty = false; } gl.glLineWidth(1.0f); gl.glEnableClientState(GL_VERTEX_ARRAY); gl.glEnableClientState(GL_COLOR_ARRAY); gl.glDrawArrays( GL.GL_LINES, 0, numberOfVertices); gl.glDisableClientState(GL_COLOR_ARRAY); gl.glDisableClientState(GL_VERTEX_ARRAY); } else { gl.glBegin(GL_LINES); gl.glLineWidth(1.0f); int verts = 0; int colors = 0; for(LineSegment ls : gcodeLineList) { gl.glColor3ub(lineColorData[colors++],lineColorData[colors++],lineColorData[colors++]); gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]); gl.glColor3ub(lineColorData[colors++],lineColorData[colors++],lineColorData[colors++]); gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]); } gl.glEnd(); } }</code><technical_language>this VertexBufferDirty && !vertexArrayDirty &&!colorArrayDirty</technical_language>

Target:
public void draw(GLAutoDrawable drawable, boolean idle, Point3d machineCoord, Point3d workCoord, Point3d focusMin, Point3d focusMax, double scaleFactor, Point3d mouseCoordinates, Point3d rotation) { if (!isDrawable) return; GL2 gl = drawable.getGL().getGL2(); boolean forceOldStyle = false; if(!forceOldStyle && gl.isFunctionAvailable( "glGenBuffers" ) && gl.isFunctionAvailable( "glBindBuffer" ) && gl.isFunctionAvailable( "glBufferData" ) && gl.isFunctionAvailable( "glDeleteBuffers" ) ) { if (this.vertexBufferDirty && !vertexArrayDirty && !colorArrayDirty) { updateVertexBuffers(); this.vertexBufferDirty = false; } if (this.colorArrayDirty) { this.updateGLColorArray(drawable); this.colorArrayDirty = false; } if (this.vertexArrayDirty) { this.updateGLGeometryArray(drawable); this.vertexArrayDirty = false; } gl.glLineWidth(1.0f); gl.glEnableClientState(GL_VERTEX_ARRAY); gl.glEnableClientState(GL_COLOR_ARRAY); gl.glDrawArrays( GL.GL_LINES, 0, numberOfVertices); gl.glDisableClientState(GL_COLOR_ARRAY); gl.glDisableClientState(GL_VERTEX_ARRAY); } else { gl.glBegin(GL_LINES); gl.glLineWidth(1.0f); int verts = 0; int colors = 0; for(LineSegment ls : gcodeLineList) { gl.glColor3ub(lineColorData[colors++],lineColorData[colors++],lineColorData[colors++]); gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]); gl.glColor3ub(lineColorData[colors++],lineColorData[colors++],lineColorData[colors++]); gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]); } gl.glEnd(); } }