Program: 11062
Project: 11062
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 firstZValue=0;
      data=BufferUtil.newFloatBuffer(xSize * ySize * zSize);
      top=0;
      String doublePattern="String_Node_Str";
      String nonCapturingDoublePattern="String_Node_Str";
      String spacerPattern="String_Node_Str";
      String lineRegex=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) {
            firstZValue=z;
          }
 else           if (positionIndex == xSize * ySize * (zSize - 1)) {
            depth=firstZValue - z;
          }
          data.put(value);
          positionIndex++;
        }
      }
    }
  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 (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 firstZValue=0;
      data=BufferUtil.newFloatBuffer(xSize * ySize * zSize);
      top=0;
      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) {
            firstZValue=z;
          }
 else           if (positionIndex == xSize * ySize * (zSize - 1)) {
            depth=firstZValue - z;
          }
          data.put(value);
          positionIndex++;
        }
      }
    }
  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;
}