Program: 11056
Project: 11056
Buggy source:
@Override protected boolean doLoadData(URL url,VolumeLayer layer){
  ZipFile zip=null;
  try {
    File file=URLUtil.urlToFile(url);
    InputStream sgInputStream=null;
    try {
      if (file.getName().toLowerCase().endsWith("String_Node_Str")) {
        zip=new ZipFile(file);
        Enumeration<? extends ZipEntry> entries=zip.entries();
        ZipEntry sgEntry=null;
        while (entries.hasMoreElements()) {
          ZipEntry entry=entries.nextElement();
          if (entry.getName().toLowerCase().endsWith("String_Node_Str")) {
            sgEntry=entry;
            break;
          }
        }
        if (sgEntry == null) {
          throw new IOException("String_Node_Str");
        }
        sgInputStream=zip.getInputStream(sgEntry);
      }
 else {
        sgInputStream=new FileInputStream(file);
      }
      BufferedReader reader=new BufferedReader(new InputStreamReader(sgInputStream));
      String line;
      while ((line=reader.readLine()) != null) {
        parseLine(line);
      }
    }
  finally {
      if (sgInputStream != null) {
        sgInputStream.close();
      }
    }
    if (asciiDataFile == null) {
      throw new IOException("String_Node_Str");
    }
    if (xSize == 0 || ySize == 0 || zSize == 0) {
      throw new IOException("String_Node_Str");
    }
    if (cellCentered) {
      xSize--;
      ySize--;
      zSize--;
    }
    InputStream dataInputStream=null;
    try {
      if (zip != null) {
        ZipEntry dataEntry=zip.getEntry(asciiDataFile);
        dataInputStream=zip.getInputStream(dataEntry);
      }
      if (dataInputStream == null) {
        File data=new File(file.getParent(),asciiDataFile);
        if (data.exists()) {
          dataInputStream=new FileInputStream(data);
        }
      }
      if (dataInputStream == null) {
        throw new IOException("String_Node_Str" + asciiDataFile + "String_Node_Str");
      }
      sector=null;
      double[] transformed=new double[3];
      CoordinateTransformation transformation=layer.getCoordinateTransformation();
      positions=new ArrayList<Position>(xSize * ySize);
      int positionIndex=0;
      double firstXValue=0, firstYValue=0, firstZValue=0;
      data=FloatBuffer.allocate(xSize * ySize * zSize);
      top=0;
      minValue=Float.MAX_VALUE;
      maxValue=-Float.MAX_VALUE;
      String doublePattern="String_Node_Str";
      String nonCapturingDoublePattern="String_Node_Str";
      String spacerPattern="String_Node_Str";
      String lineRegex="String_Node_Str" + doublePattern + spacerPattern+ doublePattern+ spacerPattern+ doublePattern;
      for (int property=1; property < paintedVariableId; property++) {
        lineRegex+=spacerPattern + nonCapturingDoublePattern;
      }
      lineRegex+=spacerPattern + doublePattern + "String_Node_Str";
      Pattern linePattern=Pattern.compile(lineRegex);
      BufferedReader reader=new BufferedReader(new InputStreamReader(dataInputStream));
      String line;
      while ((line=reader.readLine()) != null) {
        Matcher matcher=linePattern.matcher(line);
        if (matcher.matches()) {
          double x=Double.parseDouble(matcher.group(1));
          double y=Double.parseDouble(matcher.group(2));
          double z=Double.parseDouble(matcher.group(3));
          float value=Float.parseFloat(matcher.group(4));
          if (transformation != null) {
            transformation.TransformPoint(transformed,x,y,z);
            x=transformed[0];
            y=transformed[1];
            z=transformed[2];
          }
          if (positionIndex < xSize * ySize) {
            Position position=Position.fromDegrees(y,x,z);
            positions.add(position);
            top+=z / (double)(xSize * ySize);
            if (sector == null) {
              sector=new Sector(position.latitude,position.latitude,position.longitude,position.longitude);
            }
 else {
              sector=sector.union(position.latitude,position.longitude);
            }
          }
          if (positionIndex == 0) {
            firstXValue=x;
            firstYValue=y;
            firstZValue=z;
          }
 else           if (positionIndex == 1) {
            reverseX=x < firstXValue;
          }
 else           if (positionIndex == xSize) {
            reverseY=y < firstYValue;
          }
 else           if (positionIndex == xSize * ySize * (zSize - 1)) {
            reverseZ=z > firstZValue;
            depth=reverseZ ? z - firstZValue : firstZValue - z;
            top+=reverseZ ? depth : 0;
          }
          data.put(value);
          minValue=Math.min(minValue,value);
          maxValue=Math.max(maxValue,value);
          positionIndex++;
        }
      }
      if (positions.size() != xSize * ySize) {
        throw new IOException("String_Node_Str");
      }
      if (reverseX || reverseY || reverseZ) {
        if (reverseZ) {
          List<Position> oldPositions=positions;
          positions=new ArrayList<Position>(oldPositions.size());
          for (          Position position : oldPositions) {
            positions.add(new Position(position,position.elevation + depth));
          }
        }
        if (reverseX || reverseY) {
          List<Position> oldPositions=positions;
          positions=new ArrayList<Position>(oldPositions.size());
          for (int y=0; y < ySize; y++) {
            int ry=reverseY ? ySize - y - 1 : y;
            for (int x=0; x < xSize; x++) {
              int rx=reverseX ? xSize - x - 1 : x;
              positions.add(oldPositions.get(rx + ry * xSize));
            }
          }
        }
      }
    }
  finally {
      if (dataInputStream != null) {
        dataInputStream.close();
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
    return false;
  }
 finally {
    if (zip != null) {
      try {
        zip.close();
      }
 catch (      IOException e) {
      }
    }
  }
  layer.dataAvailable(this);
  return true;
}

Fixed version (ground truth):
@Override protected boolean doLoadData(URL url,VolumeLayer layer){
  ZipFile zip=null;
  try {
    File file=URLUtil.urlToFile(url);
    InputStream sgInputStream=null;
    try {
      if (file.getName().toLowerCase().endsWith("String_Node_Str")) {
        zip=new ZipFile(file);
        Enumeration<? extends ZipEntry> entries=zip.entries();
        ZipEntry sgEntry=null;
        while (entries.hasMoreElements()) {
          ZipEntry entry=entries.nextElement();
          if (entry.getName().toLowerCase().endsWith("String_Node_Str")) {
            sgEntry=entry;
            break;
          }
        }
        if (sgEntry == null) {
          throw new IOException("String_Node_Str");
        }
        sgInputStream=zip.getInputStream(sgEntry);
      }
 else {
        sgInputStream=new FileInputStream(file);
      }
      BufferedReader reader=new BufferedReader(new InputStreamReader(sgInputStream));
      String line;
      while ((line=reader.readLine()) != null) {
        parseLine(line);
      }
    }
  finally {
      if (sgInputStream != null) {
        sgInputStream.close();
      }
    }
    if (asciiDataFile == null) {
      throw new IOException("String_Node_Str");
    }
    if (cellCentered) {
      xSize--;
      ySize--;
      zSize--;
    }
    if (xSize == 0 || ySize == 0 || zSize == 0) {
      throw new IOException("String_Node_Str");
    }
    InputStream dataInputStream=null;
    try {
      if (zip != null) {
        ZipEntry dataEntry=zip.getEntry(asciiDataFile);
        dataInputStream=zip.getInputStream(dataEntry);
      }
      if (dataInputStream == null) {
        File data=new File(file.getParent(),asciiDataFile);
        if (data.exists()) {
          dataInputStream=new FileInputStream(data);
        }
      }
      if (dataInputStream == null) {
        throw new IOException("String_Node_Str" + asciiDataFile + "String_Node_Str");
      }
      sector=null;
      double[] transformed=new double[3];
      CoordinateTransformation transformation=layer.getCoordinateTransformation();
      positions=new ArrayList<Position>(xSize * ySize);
      int positionIndex=0;
      double firstXValue=0, firstYValue=0, firstZValue=0;
      data=FloatBuffer.allocate(xSize * ySize * zSize);
      top=0;
      minValue=Float.MAX_VALUE;
      maxValue=-Float.MAX_VALUE;
      String doublePattern="String_Node_Str";
      String nonCapturingDoublePattern="String_Node_Str";
      String spacerPattern="String_Node_Str";
      String lineRegex="String_Node_Str" + doublePattern + spacerPattern+ doublePattern+ spacerPattern+ doublePattern;
      for (int property=1; property < paintedVariableId; property++) {
        lineRegex+=spacerPattern + nonCapturingDoublePattern;
      }
      lineRegex+=spacerPattern + doublePattern + "String_Node_Str";
      Pattern linePattern=Pattern.compile(lineRegex);
      BufferedReader reader=new BufferedReader(new InputStreamReader(dataInputStream));
      String line;
      while ((line=reader.readLine()) != null) {
        Matcher matcher=linePattern.matcher(line);
        if (matcher.matches()) {
          double x=Double.parseDouble(matcher.group(1));
          double y=Double.parseDouble(matcher.group(2));
          double z=Double.parseDouble(matcher.group(3));
          float value=Float.parseFloat(matcher.group(4));
          if (transformation != null) {
            transformation.TransformPoint(transformed,x,y,z);
            x=transformed[0];
            y=transformed[1];
            z=transformed[2];
          }
          if (positionIndex < xSize * ySize) {
            Position position=Position.fromDegrees(y,x,z);
            positions.add(position);
            top+=z / (double)(xSize * ySize);
            if (sector == null) {
              sector=new Sector(position.latitude,position.latitude,position.longitude,position.longitude);
            }
 else {
              sector=sector.union(position.latitude,position.longitude);
            }
          }
          if (positionIndex == 0) {
            firstXValue=x;
            firstYValue=y;
            firstZValue=z;
          }
 else           if (positionIndex == 1) {
            reverseX=x < firstXValue;
          }
 else           if (positionIndex == xSize) {
            reverseY=y < firstYValue;
          }
 else           if (positionIndex == xSize * ySize * (zSize - 1)) {
            reverseZ=z > firstZValue;
            depth=reverseZ ? z - firstZValue : firstZValue - z;
            top+=reverseZ ? depth : 0;
          }
          data.put(value);
          minValue=Math.min(minValue,value);
          maxValue=Math.max(maxValue,value);
          positionIndex++;
        }
      }
      if (positions.size() != xSize * ySize) {
        throw new IOException("String_Node_Str");
      }
      if (reverseX || reverseY || reverseZ) {
        if (reverseZ) {
          List<Position> oldPositions=positions;
          positions=new ArrayList<Position>(oldPositions.size());
          for (          Position position : oldPositions) {
            positions.add(new Position(position,position.elevation + depth));
          }
        }
        if (reverseX || reverseY) {
          List<Position> oldPositions=positions;
          positions=new ArrayList<Position>(oldPositions.size());
          for (int y=0; y < ySize; y++) {
            int ry=reverseY ? ySize - y - 1 : y;
            for (int x=0; x < xSize; x++) {
              int rx=reverseX ? xSize - x - 1 : x;
              positions.add(oldPositions.get(rx + ry * xSize));
            }
          }
        }
      }
    }
  finally {
      if (dataInputStream != null) {
        dataInputStream.close();
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
    return false;
  }
 finally {
    if (zip != null) {
      try {
        zip.close();
      }
 catch (      IOException e) {
      }
    }
  }
  layer.dataAvailable(this);
  return true;
}