Program: 170392
Project: 170392
Buggy source:
@Override protected Product readProductNodesImpl() throws IOException {
  productDirectory=RapidEyeL1ReaderPlugin.getInput(getInput());
  File selection=RapidEyeL1ReaderPlugin.getFileInput(getInput());
  String metadataFileName;
  File metadataFile;
  if (selection.isFile() && selection.getName().toLowerCase().endsWith(RapidEyeConstants.METADATA_FILE_SUFFIX)) {
    metadataFile=selection;
  }
 else {
    metadataFileName=productDirectory.findFirst(RapidEyeConstants.METADATA_FILE_SUFFIX);
    metadataFile=productDirectory.getFile(metadataFileName);
  }
  if (metadataFile.exists()) {
    logger.info("String_Node_Str");
    metadata=XmlMetadata.create(RapidEyeMetadata.class,metadataFile);
    if (metadata == null) {
      logger.warning(String.format("String_Node_Str",metadataFile.getName()));
    }
 else {
      metadata.setFileName(metadataFile.getName());
    }
  }
 else {
    logger.info("String_Node_Str");
  }
  if (metadata != null) {
    String metadataProfile=metadata.getMetadataProfile();
    if (metadataProfile == null || !metadataProfile.startsWith(RapidEyeConstants.PROFILE_L3)) {
      IOException ex=new IOException("String_Node_Str");
      logger.log(Level.SEVERE,ex.getMessage(),ex);
      throw ex;
    }
    if (metadata.getRasterWidth() > 0 && metadata.getRasterHeight() > 0) {
      createProduct(metadata.getRasterWidth(),metadata.getRasterHeight(),metadataProfile);
    }
    addBands(product,metadata);
    readMasks(productDirectory);
    product.setModified(false);
  }
 else {
    product.setModified(false);
  }
  return product;
}

Fixed version (ground truth):
@Override protected Product readProductNodesImpl() throws IOException {
  productDirectory=RapidEyeReader.getInput(getInput());
  File selection=RapidEyeReader.getFileInput(getInput());
  String metadataFileName;
  File metadataFile;
  if (selection.isFile() && selection.getName().toLowerCase().endsWith(RapidEyeConstants.METADATA_FILE_SUFFIX)) {
    metadataFile=selection;
  }
 else {
    metadataFileName=productDirectory.findFirst(RapidEyeConstants.METADATA_FILE_SUFFIX);
    metadataFile=productDirectory.getFile(metadataFileName);
  }
  if (metadataFile.exists()) {
    logger.info("String_Node_Str");
    metadata=XmlMetadata.create(RapidEyeMetadata.class,metadataFile);
    if (metadata == null) {
      logger.warning(String.format("String_Node_Str",metadataFile.getName()));
    }
 else {
      metadata.setFileName(metadataFile.getName());
    }
  }
 else {
    logger.info("String_Node_Str");
  }
  if (metadata != null) {
    String metadataProfile=metadata.getMetadataProfile();
    if (metadataProfile == null || !metadataProfile.startsWith(RapidEyeConstants.PROFILE_L3)) {
      IOException ex=new IOException("String_Node_Str");
      logger.log(Level.SEVERE,ex.getMessage(),ex);
      throw ex;
    }
    if (metadata.getRasterWidth() > 0 && metadata.getRasterHeight() > 0) {
      createProduct(metadata.getRasterWidth(),metadata.getRasterHeight(),metadataProfile);
    }
    addBands(product,metadata);
    readMasks(productDirectory);
    product.setModified(false);
  }
 else {
    product.setModified(false);
  }
  return product;
}