Buggy code:
public abstract class JOGLClearVolumeRenderer extends ClearVolumeRendererBase implements ClearGLEventListener { private static final long cMaxWaitingTimeForAcquiringDisplayLockInMs = 200 ; private static final GLMatrix cOverlay2dProjectionMatrix = GLMatrix . getOrthoProjectionMatrix ( ( - 1 ) , 1 , ( - 1 ) , 1 , 0 , 1000 ) ; private volatile ClearGLWindow mClearGLWindow ; private NewtCanvasAWT mNewtCanvasAWT ; private volatile int mLastWindowWidth ; private volatile int mLastWindowHeight ; protected final ReentrantLock mDisplayReentrantLock = new ReentrantLock ( true ) ; protected GLPixelBufferObject [ ] mPixelBufferObjects ; private final GLTexture < Byte > [ ] mLayerTextures ; private volatile int step = 0 ; private volatile long prevTimeNS = - 1 ; private final Map < String , Overlay > mOverlayMap = new ConcurrentHashMap < String , Overlay > ( ) ; private final String mWindowName ; private GLProgram mGLProgram ; private GLAttribute mPositionAttribute ; private GLVertexArray mQuadVertexArray ; private GLVertexAttributeArray mPositionAttributeArray ; private GLUniform mQuadProjectionMatrixUniform ; private GLAttribute mTexCoordAttribute ; private GLUniform [ ] mTexUnits ; private GLVertexAttributeArray mTexCoordAttributeArray ; private final GLMatrix mBoxModelViewMatrix = new GLMatrix ( ) ; private final GLMatrix mVolumeViewMatrix = new GLMatrix ( ) ; private final GLMatrix mQuadProjectionMatrix = new GLMatrix ( ) ; private final int mTextureWidth ; private final int mTextureHeight ; protected boolean mUsePBOs = true ; private final GLVideoRecorder mGLVideoRecorder = new GLVideoRecorder ( new File ( SystemUtils . USER_HOME , "Videos//ClearVolume" ) ) ; public JOGLClearVolumeRenderer ( final String pWindowName , final int pWindowWidth , final int pWindowHeight ) { } public JOGLClearVolumeRenderer ( final String pWindowName , final int pWindowWidth , final int pWindowHeight , final int pBytesPerVoxel ) { } public JOGLClearVolumeRenderer ( final String pWindowName , final int pWindowWidth , final int pWindowHeight , final int pBytesPerVoxel , final int pMaxTextureWidth , final int pMaxTextureHeight ) { } public JOGLClearVolumeRenderer ( final String pWindowName , final int pWindowWidth , final int pWindowHeight , final int pBytesPerVoxel , final int pMaxTextureWidth , final int pMaxTextureHeight , final boolean useInCanvas ) { } public JOGLClearVolumeRenderer ( final String pWindowName , final int pWindowWidth , final int pWindowHeight , final int pBytesPerVoxel , final int pMaxTextureWidth , final int pMaxTextureHeight , final int pNumberOfRenderLayers ) { } @ SuppressWarnings ( "unchecked" ) public JOGLClearVolumeRenderer ( final String pWindowName , final int pWindowWidth , final int pWindowHeight , final int pBytesPerVoxel , final int pMaxTextureWidth , final int pMaxTextureHeight , final int pNumberOfRenderLayers , final boolean pUseInCanvas ) { } @ Override public void setClearGLWindow ( final ClearGLWindow pClearGLWindow ) { } @ Override public ClearGLWindow getClearGLWindow ( ) { } @ Override public void close ( ) { } @ Override public boolean isShowing ( ) { } @ Override public void setVisible ( final boolean pIsVisible ) { } @ Override public String getWindowName ( ) { } @ Override public int getWindowWidth ( ) { } @ Override public int getWindowHeight ( ) { } public int getTextureWidth ( ) { } public int getTextureHeight ( ) { } @ Override public void init ( final GLAutoDrawable drawable ) { final GL4 lGL4 = drawable . getGL ( ) . getGL4 ( ) ; lGL4 . setSwapInterval ( 1 ) ; lGL4 . glDisable ( GL_DEPTH_TEST ) ; lGL4 . glEnable ( GL_BLEND ) ; lGL4 . glDisable ( GL_STENCIL_TEST ) ; lGL4 . glClearColor ( 0.0F , 0.0F , 0.0F , 1.0F ) ; lGL4 . glClear ( ( ( GL4 . GL_COLOR_BUFFER_BIT ) | ( GL4 . GL_DEPTH_BUFFER_BIT ) ) ) ; if ( initVolumeRenderer ( ) ) { try { final InputStream lVertexShaderResourceAsStream = JOGLClearVolumeRenderer . class . getResourceAsStream ( "shaders//tex_vert.glsl" ) ; final InputStream lFragmentShaderResourceAsStream = JOGLClearVolumeRenderer . class . getResourceAsStream ( "shaders//tex_frag.glsl" ) ; final String lVertexShaderSource = IOUtils . toString ( lVertexShaderResourceAsStream , "UTF-8" ) ; String lFragmentShaderSource = IOUtils . toString ( lFragmentShaderResourceAsStream , "UTF-8" ) ; for ( int i = 1 ; i < ( getNumberOfRenderLayers ( ) ) ; i ++ ) { <START_BUG> final String lStringToInsert1 = String . format ( "uniform<seq2seq4repair_space>sampler2D<seq2seq4repair_space>texUnit%d;<seq2seq4repair_space>\n////insertpoin1t" , i ) ; <END_BUG> final String lStringToInsert2 = String . format ( "tempOutColor<seq2seq4repair_space>=<seq2seq4repair_space>max(tempOutColor,texture(texUnit%d,<seq2seq4repair_space>ftexcoord));\n////insertpoint2" , i ) ; lFragmentShaderSource = lFragmentShaderSource . replace ( "////insertpoint1" , lStringToInsert1 ) ; lFragmentShaderSource = lFragmentShaderSource . replace ( "////insertpoint2" , lStringToInsert2 ) ; } mGLProgram = GLProgram . buildProgram ( lGL4 , lVertexShaderSource , lFragmentShaderSource ) ; mQuadProjectionMatrixUniform = mGLProgram . getUniform ( "projection" ) ; mPositionAttribute = mGLProgram . getAtribute ( "position" ) ; mTexCoordAttribute = mGLProgram . getAtribute ( "texcoord" ) ; mTexUnits = new GLUniform [ getNumberOfRenderLayers ( ) ] ; for ( int i = 0 ; i < ( getNumberOfRenderLayers ( ) ) ; i ++ ) { mTexUnits [ i ] = mGLProgram . getUniform ( ( "texUnit" + i ) ) ; mTexUnits [ i ] . set ( i ) ; } mQuadVertexArray = new GLVertexArray ( mGLProgram ) ; mQuadVertexArray . bind ( ) ; mPositionAttributeArray = new GLVertexAttributeArray ( mPositionAttribute , 4 ) ; final GLFloatArray lVerticesFloatArray = new GLFloatArray ( 6 , 4 ) ; lVerticesFloatArray . add ( ( - 1 ) , ( - 1 ) , 0 , 1 ) ; lVerticesFloatArray . add ( 1 , ( - 1 ) , 0 , 1 ) ; lVerticesFloatArray . add ( 1 , 1 , 0 , 1 ) ; lVerticesFloatArray . add ( ( - 1 ) , ( - 1 ) , 0 , 1 ) ; lVerticesFloatArray . add ( 1 , 1 , 0 , 1 ) ; lVerticesFloatArray . add ( ( - 1 ) , 1 , 0 , 1 ) ; mQuadVertexArray . addVertexAttributeArray ( mPositionAttributeArray , lVerticesFloatArray . getFloatBuffer ( ) ) ; mTexCoordAttributeArray = new GLVertexAttributeArray ( mTexCoordAttribute , 2 ) ; final GLFloatArray lTexCoordFloatArray = new GLFloatArray ( 6 , 2 ) ; lTexCoordFloatArray . add ( 0 , 0 ) ; lTexCoordFloatArray . add ( 1 , 0 ) ;

Fix:
final String lStringToInsert1 = String . format ( "uniform<seq2seq4repair_space>sampler2D<seq2seq4repair_space>texUnit%d;<seq2seq4repair_space>\n////insertpoint1" , i ) ;