Program: 70879
Project: 70879
Buggy source:
private int createProgram(GL3 gl,GLSLInfo key){
  String[] shaders=GLSLGenerator.getShaderScripts(key);
  int vs=gl.glCreateShader(GL3.GL_VERTEX_SHADER);
  gl.glShaderSource(vs,1,new String[]{shaders[0]},null,0);
  gl.glCompileShader(vs);
  boolean success=glCheckShaderCompilation(gl,vs);
  if (!success) {
    throw new RuntimeException("String_Node_Str" + shaders[0]);
  }
  int fs=gl.glCreateShader(GL3.GL_FRAGMENT_SHADER);
  gl.glShaderSource(fs,1,new String[]{shaders[1]},null,0);
  gl.glCompileShader(fs);
  success=glCheckShaderCompilation(gl,fs);
  if (!success) {
    throw new RuntimeException("String_Node_Str" + shaders[1]);
  }
  int prog=gl.glCreateProgram();
  gl.glAttachShader(prog,vs);
  gl.glBindAttribLocation(prog,GL3VertexAttribute.VERTEX_POSITION.index(),GL3VertexAttribute.VERTEX_POSITION.name());
  if (key.hasVertexNormals() && key.getShading() != Shading.NONE) {
    gl.glBindAttribLocation(prog,GL3VertexAttribute.VERTEX_NORMAL.index(),GL3VertexAttribute.VERTEX_NORMAL.name());
  }
  if (key.hasVertexColors() && key.getColorInterpolation() != ColorInterpolation.NONE) {
    gl.glBindAttribLocation(prog,GL3VertexAttribute.VERTEX_COLOR.index(),GL3VertexAttribute.VERTEX_COLOR.name());
  }
  if (key.hasVertexTextures()) {
    gl.glBindAttribLocation(prog,GL3VertexAttribute.VERTEX_TEXTURE.index(),GL3VertexAttribute.VERTEX_TEXTURE.name());
  }
switch (key.getInstancedRendering()) {
case POINTS:
    gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_SCALE.index(),GL3VertexAttribute.INSTANCE_SCALE.name());
  gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_POSITION.index(),GL3VertexAttribute.INSTANCE_POSITION.name());
break;
case FRAMES:
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_SCALE.index(),GL3VertexAttribute.INSTANCE_SCALE.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_POSITION.index(),GL3VertexAttribute.INSTANCE_POSITION.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_ORIENTATION.index(),GL3VertexAttribute.INSTANCE_ORIENTATION.name());
break;
case AFFINES:
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_AFFINE_MATRIX.index(),GL3VertexAttribute.INSTANCE_AFFINE_MATRIX.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_NORMAL_MATRIX.index(),GL3VertexAttribute.INSTANCE_NORMAL_MATRIX.name());
break;
case LINES:
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_RADIUS.index(),GL3VertexAttribute.LINE_RADIUS.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_BOTTOM_POSITION.index(),GL3VertexAttribute.LINE_BOTTOM_POSITION.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_TOP_POSITION.index(),GL3VertexAttribute.LINE_TOP_POSITION.name());
break;
case NONE:
break;
}
switch (key.getInstancedRendering()) {
case POINTS:
case FRAMES:
case AFFINES:
if (key.getColorInterpolation() != ColorInterpolation.NONE && key.hasInstanceColors()) {
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_COLOR.index(),GL3VertexAttribute.INSTANCE_COLOR.name());
}
if (key.hasInstanceTextures()) {
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_TEXTURE.index(),GL3VertexAttribute.INSTANCE_TEXTURE.name());
}
break;
case LINES:
if (key.hasLineLengthOffset()) {
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_LENGTH_OFFSET.index(),GL3VertexAttribute.LINE_LENGTH_OFFSET.name());
}
if (key.getColorInterpolation() != ColorInterpolation.NONE && key.hasLineColors()) {
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_BOTTOM_COLOR.index(),GL3VertexAttribute.LINE_BOTTOM_COLOR.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_TOP_COLOR.index(),GL3VertexAttribute.LINE_TOP_COLOR.name());
}
if (key.hasLineTextures()) {
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_BOTTOM_TEXTURE.index(),GL3VertexAttribute.LINE_BOTTOM_TEXTURE.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_TOP_TEXTURE.index(),GL3VertexAttribute.LINE_TOP_TEXTURE.name());
}
break;
case NONE:
break;
}
gl.glAttachShader(prog,fs);
gl.glLinkProgram(prog);
gl.glDetachShader(prog,vs);
gl.glDeleteShader(vs);
gl.glDetachShader(prog,fs);
gl.glDeleteShader(fs);
return prog;
}

Fixed version (ground truth):
private int createProgram(GL3 gl,GLSLInfo key){
  String[] shaders=GLSLGenerator.getShaderScripts(key);
  int vs=gl.glCreateShader(GL3.GL_VERTEX_SHADER);
  gl.glShaderSource(vs,1,new String[]{shaders[0]},null,0);
  gl.glCompileShader(vs);
  boolean success=glCheckShaderCompilation(gl,vs);
  if (!success) {
    throw new RuntimeException("String_Node_Str" + shaders[0]);
  }
  int fs=gl.glCreateShader(GL3.GL_FRAGMENT_SHADER);
  gl.glShaderSource(fs,1,new String[]{shaders[1]},null,0);
  gl.glCompileShader(fs);
  success=glCheckShaderCompilation(gl,fs);
  if (!success) {
    System.out.println("String_Node_Str" + shaders[0]);
    System.out.println("String_Node_Str" + shaders[1]);
    shaders=GLSLGenerator.getShaderScripts(key);
    throw new RuntimeException("String_Node_Str" + shaders[1]);
  }
  int prog=gl.glCreateProgram();
  gl.glAttachShader(prog,vs);
  gl.glBindAttribLocation(prog,GL3VertexAttribute.VERTEX_POSITION.index(),GL3VertexAttribute.VERTEX_POSITION.name());
  if (key.hasVertexNormals() && key.getShading() != Shading.NONE) {
    gl.glBindAttribLocation(prog,GL3VertexAttribute.VERTEX_NORMAL.index(),GL3VertexAttribute.VERTEX_NORMAL.name());
  }
  if (key.hasVertexColors() && key.getColorInterpolation() != ColorInterpolation.NONE) {
    gl.glBindAttribLocation(prog,GL3VertexAttribute.VERTEX_COLOR.index(),GL3VertexAttribute.VERTEX_COLOR.name());
  }
  if (key.hasVertexTextures()) {
    gl.glBindAttribLocation(prog,GL3VertexAttribute.VERTEX_TEXTURE.index(),GL3VertexAttribute.VERTEX_TEXTURE.name());
  }
switch (key.getInstancedRendering()) {
case POINTS:
    gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_SCALE.index(),GL3VertexAttribute.INSTANCE_SCALE.name());
  gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_POSITION.index(),GL3VertexAttribute.INSTANCE_POSITION.name());
break;
case FRAMES:
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_SCALE.index(),GL3VertexAttribute.INSTANCE_SCALE.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_POSITION.index(),GL3VertexAttribute.INSTANCE_POSITION.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_ORIENTATION.index(),GL3VertexAttribute.INSTANCE_ORIENTATION.name());
break;
case AFFINES:
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_AFFINE_MATRIX.index(),GL3VertexAttribute.INSTANCE_AFFINE_MATRIX.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_NORMAL_MATRIX.index(),GL3VertexAttribute.INSTANCE_NORMAL_MATRIX.name());
break;
case LINES:
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_RADIUS.index(),GL3VertexAttribute.LINE_RADIUS.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_BOTTOM_POSITION.index(),GL3VertexAttribute.LINE_BOTTOM_POSITION.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_TOP_POSITION.index(),GL3VertexAttribute.LINE_TOP_POSITION.name());
break;
case NONE:
break;
}
switch (key.getInstancedRendering()) {
case POINTS:
case FRAMES:
case AFFINES:
if (key.getColorInterpolation() != ColorInterpolation.NONE && key.hasInstanceColors()) {
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_COLOR.index(),GL3VertexAttribute.INSTANCE_COLOR.name());
}
if (key.hasInstanceTextures()) {
gl.glBindAttribLocation(prog,GL3VertexAttribute.INSTANCE_TEXTURE.index(),GL3VertexAttribute.INSTANCE_TEXTURE.name());
}
break;
case LINES:
if (key.hasLineLengthOffset()) {
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_LENGTH_OFFSET.index(),GL3VertexAttribute.LINE_LENGTH_OFFSET.name());
}
if (key.getColorInterpolation() != ColorInterpolation.NONE && key.hasLineColors()) {
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_BOTTOM_COLOR.index(),GL3VertexAttribute.LINE_BOTTOM_COLOR.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_TOP_COLOR.index(),GL3VertexAttribute.LINE_TOP_COLOR.name());
}
if (key.hasLineTextures()) {
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_BOTTOM_TEXTURE.index(),GL3VertexAttribute.LINE_BOTTOM_TEXTURE.name());
gl.glBindAttribLocation(prog,GL3VertexAttribute.LINE_TOP_TEXTURE.index(),GL3VertexAttribute.LINE_TOP_TEXTURE.name());
}
break;
case NONE:
break;
}
gl.glAttachShader(prog,fs);
gl.glLinkProgram(prog);
gl.glDetachShader(prog,vs);
gl.glDeleteShader(vs);
gl.glDetachShader(prog,fs);
gl.glDeleteShader(fs);
return prog;
}