Program: 170386
Project: 170386
Buggy source:
private L1bMetadata(InputStream stream,File file,String parent) throws DataConversionException {
  try {
    Level1B_User_Product product=(Level1B_User_Product)L1bMetadataProc.readJaxbFromFilename(stream);
    productCharacteristics=L1bMetadataProc.getProductOrganization(product);
    Collection<String> tileNames=L1bMetadataProc.getTiles(product);
    List<File> fullTileNamesList=new ArrayList<File>();
    tileList=new ArrayList<Tile>();
    for (    String granuleName : tileNames) {
      FileInputStream fi=(FileInputStream)stream;
      File nestedMetadata=new File(parent,"String_Node_Str" + File.separator + granuleName);
      logger.log(Level.WARNING,"String_Node_Str" + nestedMetadata.getAbsolutePath());
      if (nestedMetadata.exists()) {
        S2L1bGranuleDirFilename aGranuleDir=S2L1bGranuleDirFilename.create(granuleName);
        Guardian.assertNotNull("String_Node_Str",aGranuleDir);
        String theName=aGranuleDir.getMetadataFilename().name;
        File nestedGranuleMetadata=new File(parent,"String_Node_Str" + File.separator + granuleName+ File.separator+ theName);
        if (nestedGranuleMetadata.exists()) {
          fullTileNamesList.add(nestedGranuleMetadata);
        }
 else {
          String errorMessage="String_Node_Str" + granuleName + "String_Node_Str";
          logger.log(Level.WARNING,errorMessage);
        }
      }
 else {
        logger.log(Level.SEVERE,"String_Node_Str" + nestedMetadata.getAbsolutePath());
      }
    }
    int index=0;
    for (    File aGranuleMetadataFile : fullTileNamesList) {
      long startTime=System.currentTimeMillis();
      Level1B_Granule aGranule=(Level1B_Granule)L1bMetadataProc.readJaxbFromFilename(new FileInputStream(aGranuleMetadataFile));
      long endTime=System.currentTimeMillis();
      logger.log(Level.SEVERE,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
      startTime=System.currentTimeMillis();
      Map<Integer,TileGeometry> geoms=L1bMetadataProc.getGranuleGeometries(aGranule);
      endTime=System.currentTimeMillis();
      logger.log(Level.SEVERE,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
      Tile t=new Tile(aGranule.getGeneral_Info().getGRANULE_ID().getValue());
      t.tileGeometry10M=geoms.get(10);
      t.tileGeometry20M=geoms.get(20);
      t.tileGeometry60M=geoms.get(60);
      tileList.add(t);
      index=index + 1;
      logger.log(Level.WARNING,"String_Node_Str" + index);
    }
    S2L1bDatastripFilename stripName=L1bMetadataProc.getDatastrip(product);
    S2L1bDatastripDirFilename dirStripName=L1bMetadataProc.getDatastripDir(product);
    File dataStripMetadata=new File(parent,"String_Node_Str" + File.separator + dirStripName.name+ File.separator+ stripName.name);
    metadataElement=new MetadataElement("String_Node_Str");
    MetadataElement userProduct=parseAll(new SAXBuilder().build(file).getRootElement());
    MetadataElement dataStrip=parseAll(new SAXBuilder().build(dataStripMetadata).getRootElement());
    metadataElement.addElement(userProduct);
    metadataElement.addElement(dataStrip);
    MetadataElement granulesMetaData=new MetadataElement("String_Node_Str");
    for (    File aGranuleMetadataFile : fullTileNamesList) {
      MetadataElement aGranule=parseAll(new SAXBuilder().build(aGranuleMetadataFile).getRootElement());
      granulesMetaData.addElement(aGranule);
    }
    metadataElement.addElement(granulesMetaData);
  }
 catch (  JAXBException e) {
    logger.severe(Utils.getStackTrace(e));
  }
catch (  FileNotFoundException e) {
    logger.severe(Utils.getStackTrace(e));
  }
catch (  JDOMException e) {
    logger.severe(Utils.getStackTrace(e));
  }
catch (  IOException e) {
    logger.severe(Utils.getStackTrace(e));
  }
}

Fixed version (ground truth):
private L1bMetadata(InputStream stream,File file,String parent) throws DataConversionException {
  try {
    context=L1bMetadataProc.getJaxbContext();
    unmarshaller=context.createUnmarshaller();
    Object ob=unmarshaller.unmarshal(stream);
    Object casted=((JAXBElement)ob).getValue();
    Level1B_User_Product product=(Level1B_User_Product)casted;
    productCharacteristics=L1bMetadataProc.getProductOrganization(product);
    Collection<String> tileNames=L1bMetadataProc.getTiles(product);
    List<File> fullTileNamesList=new ArrayList<File>();
    tileList=new ArrayList<Tile>();
    for (    String granuleName : tileNames) {
      File nestedMetadata=new File(parent,"String_Node_Str" + File.separator + granuleName);
      logger.log(Level.WARNING,"String_Node_Str" + nestedMetadata.getAbsolutePath());
      if (nestedMetadata.exists()) {
        S2L1bGranuleDirFilename aGranuleDir=S2L1bGranuleDirFilename.create(granuleName);
        Guardian.assertNotNull("String_Node_Str",aGranuleDir);
        String theName=aGranuleDir.getMetadataFilename().name;
        File nestedGranuleMetadata=new File(parent,"String_Node_Str" + File.separator + granuleName+ File.separator+ theName);
        if (nestedGranuleMetadata.exists()) {
          fullTileNamesList.add(nestedGranuleMetadata);
        }
 else {
          String errorMessage="String_Node_Str" + granuleName + "String_Node_Str";
          logger.log(Level.WARNING,errorMessage);
        }
      }
 else {
        logger.log(Level.SEVERE,"String_Node_Str" + nestedMetadata.getAbsolutePath());
      }
    }
    int index=0;
    for (    File aGranuleMetadataFile : fullTileNamesList) {
      long startTime=System.currentTimeMillis();
      Object aob=unmarshaller.unmarshal(new FileInputStream(aGranuleMetadataFile));
      Object acasted=((JAXBElement)aob).getValue();
      Level1B_Granule aGranule=(Level1B_Granule)acasted;
      long endTime=System.currentTimeMillis();
      logger.log(Level.SEVERE,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
      startTime=System.currentTimeMillis();
      Map<Integer,TileGeometry> geoms=L1bMetadataProc.getGranuleGeometries(aGranule);
      endTime=System.currentTimeMillis();
      logger.log(Level.SEVERE,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
      Tile t=new Tile(aGranule.getGeneral_Info().getGRANULE_ID().getValue());
      t.tileGeometry10M=geoms.get(10);
      t.tileGeometry20M=geoms.get(20);
      t.tileGeometry60M=geoms.get(60);
      tileList.add(t);
      index=index + 1;
      logger.log(Level.WARNING,"String_Node_Str" + index);
    }
    S2L1bDatastripFilename stripName=L1bMetadataProc.getDatastrip(product);
    S2L1bDatastripDirFilename dirStripName=L1bMetadataProc.getDatastripDir(product);
    File dataStripMetadata=new File(parent,"String_Node_Str" + File.separator + dirStripName.name+ File.separator+ stripName.name);
    metadataElement=new MetadataElement("String_Node_Str");
    MetadataElement userProduct=parseAll(new SAXBuilder().build(file).getRootElement());
    MetadataElement dataStrip=parseAll(new SAXBuilder().build(dataStripMetadata).getRootElement());
    metadataElement.addElement(userProduct);
    metadataElement.addElement(dataStrip);
    MetadataElement granulesMetaData=new MetadataElement("String_Node_Str");
    for (    File aGranuleMetadataFile : fullTileNamesList) {
      MetadataElement aGranule=parseAll(new SAXBuilder().build(aGranuleMetadataFile).getRootElement());
      granulesMetaData.addElement(aGranule);
    }
    metadataElement.addElement(granulesMetaData);
  }
 catch (  JAXBException e) {
    logger.severe(Utils.getStackTrace(e));
  }
catch (  FileNotFoundException e) {
    logger.severe(Utils.getStackTrace(e));
  }
catch (  JDOMException e) {
    logger.severe(Utils.getStackTrace(e));
  }
catch (  IOException e) {
    logger.severe(Utils.getStackTrace(e));
  }
}