Program: 952
Project: 952
Buggy source:
@Override public void reload(TextureData data){
  this.width=data.getWidth();
  this.height=data.getHeight();
  this.depth=data.getDepth();
  this.wrapMode=data.getWrapMode();
  this.filterMode=data.getFilterMode();
  this.textureType=data.getType();
  this.textureData=data;
  if (id == 0) {
    id=glGenTextures();
  }
switch (textureType) {
case TEXTURE2D:
    logger.debug("String_Node_Str",getURI(),id);
  glBindTexture(GL11.GL_TEXTURE_2D,id);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,getGLMode(wrapMode));
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,getGLMode(wrapMode));
GL11.glTexParameteri(GL_TEXTURE_2D,GL11.GL_TEXTURE_MIN_FILTER,getGlMinFilter(filterMode));
GL11.glTexParameteri(GL_TEXTURE_2D,GL11.GL_TEXTURE_MAG_FILTER,getGlMagFilter(filterMode));
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT,4);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D,GL12.GL_TEXTURE_MAX_LEVEL,data.getBuffers().length - 1);
if (data.getBuffers().length > 0) {
for (int i=0; i < data.getBuffers().length; i++) {
GL11.glTexImage2D(GL11.GL_TEXTURE_2D,i,GL11.GL_RGBA,width >> i,height >> i,0,GL11.GL_RGBA,GL11.GL_UNSIGNED_BYTE,data.getBuffers()[i]);
}
}
 else {
GL11.glTexImage2D(GL11.GL_TEXTURE_2D,0,GL11.GL_RGBA,width,height,0,GL11.GL_RGBA,GL11.GL_UNSIGNED_BYTE,(ByteBuffer)null);
}
break;
case TEXTURE3D:
logger.debug("String_Node_Str",getURI(),id);
glBindTexture(GL12.GL_TEXTURE_3D,id);
glTexParameterf(GL12.GL_TEXTURE_3D,GL_TEXTURE_WRAP_S,getGLMode(wrapMode));
glTexParameterf(GL12.GL_TEXTURE_3D,GL_TEXTURE_WRAP_T,getGLMode(wrapMode));
glTexParameterf(GL12.GL_TEXTURE_3D,GL12.GL_TEXTURE_WRAP_R,getGLMode(wrapMode));
GL11.glTexParameteri(GL12.GL_TEXTURE_3D,GL11.GL_TEXTURE_MIN_FILTER,getGlMinFilter(filterMode));
GL11.glTexParameteri(GL12.GL_TEXTURE_3D,GL11.GL_TEXTURE_MAG_FILTER,getGlMagFilter(filterMode));
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT,4);
GL11.glTexParameteri(GL12.GL_TEXTURE_3D,GL12.GL_TEXTURE_MAX_LEVEL,data.getBuffers().length - 1);
if (data.getBuffers().length > 0) {
for (int i=0; i < data.getBuffers().length; i++) {
GL12.glTexImage3D(GL12.GL_TEXTURE_3D,i,GL11.GL_RGBA,width,height,depth,0,GL11.GL_RGBA,GL11.GL_UNSIGNED_BYTE,data.getBuffers()[i]);
}
}
 else {
GL11.glTexImage2D(GL12.GL_TEXTURE_3D,0,GL11.GL_RGBA,width,height,0,GL11.GL_RGBA,GL11.GL_UNSIGNED_BYTE,(ByteBuffer)null);
}
break;
}
}

Fixed version (ground truth):
@Override public void reload(TextureData data){
  this.width=data.getWidth();
  this.height=data.getHeight();
  this.depth=data.getDepth();
  this.wrapMode=data.getWrapMode();
  this.filterMode=data.getFilterMode();
  this.textureType=data.getType();
  this.textureData=data;
  if (id == 0) {
    id=glGenTextures();
  }
switch (textureType) {
case TEXTURE2D:
    logger.debug("String_Node_Str",getURI(),id);
  glBindTexture(GL11.GL_TEXTURE_2D,id);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,getGLMode(wrapMode));
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,getGLMode(wrapMode));
GL11.glTexParameteri(GL_TEXTURE_2D,GL11.GL_TEXTURE_MIN_FILTER,getGlMinFilter(filterMode));
GL11.glTexParameteri(GL_TEXTURE_2D,GL11.GL_TEXTURE_MAG_FILTER,getGlMagFilter(filterMode));
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT,4);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D,GL12.GL_TEXTURE_MAX_LEVEL,data.getBuffers().length - 1);
if (data.getBuffers().length > 0) {
for (int i=0; i < data.getBuffers().length; i++) {
GL11.glTexImage2D(GL11.GL_TEXTURE_2D,i,GL11.GL_RGBA,width >> i,height >> i,0,GL11.GL_RGBA,GL11.GL_UNSIGNED_BYTE,data.getBuffers()[i]);
}
}
 else {
GL11.glTexImage2D(GL11.GL_TEXTURE_2D,0,GL11.GL_RGBA,width,height,0,GL11.GL_RGBA,GL11.GL_UNSIGNED_BYTE,(ByteBuffer)null);
}
break;
case TEXTURE3D:
logger.debug("String_Node_Str",getURI(),id);
glBindTexture(GL12.GL_TEXTURE_3D,id);
glTexParameterf(GL12.GL_TEXTURE_3D,GL_TEXTURE_WRAP_S,getGLMode(wrapMode));
glTexParameterf(GL12.GL_TEXTURE_3D,GL_TEXTURE_WRAP_T,getGLMode(wrapMode));
glTexParameterf(GL12.GL_TEXTURE_3D,GL12.GL_TEXTURE_WRAP_R,getGLMode(wrapMode));
GL11.glTexParameteri(GL12.GL_TEXTURE_3D,GL11.GL_TEXTURE_MIN_FILTER,getGlMinFilter(filterMode));
GL11.glTexParameteri(GL12.GL_TEXTURE_3D,GL11.GL_TEXTURE_MAG_FILTER,getGlMagFilter(filterMode));
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT,4);
GL11.glTexParameteri(GL12.GL_TEXTURE_3D,GL12.GL_TEXTURE_MAX_LEVEL,data.getBuffers().length - 1);
if (data.getBuffers().length > 0) {
for (int i=0; i < data.getBuffers().length; i++) {
GL12.glTexImage3D(GL12.GL_TEXTURE_3D,i,GL11.GL_RGBA,width,height,depth,0,GL11.GL_RGBA,GL11.GL_UNSIGNED_BYTE,data.getBuffers()[i]);
}
}
 else {
GL12.glTexImage3D(GL12.GL_TEXTURE_3D,0,GL11.GL_RGBA,width,height,depth,0,GL11.GL_RGBA,GL11.GL_UNSIGNED_BYTE,(ByteBuffer)null);
}
break;
}
}