Author: [log in to unmask]
Date: Tue Jul 7 13:27:22 2015
New Revision: 3245
Log:
Fix issue when max files is greater than number of files in list.
Modified:
java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunProcessor.java
Modified: java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunProcessor.java
=============================================================================
--- java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunProcessor.java (original)
+++ java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunProcessor.java Tue Jul 7 13:27:22 2015
@@ -163,8 +163,12 @@
// Get the list of files to process, taking into account the max files setting.
List<File> files = this.runSummary.getEvioFileList();
if (this.maxFiles != -1) {
- LOGGER.info("limiting processing to first " + this.maxFiles + " files from max files setting");
- files = files.subList(0, this.maxFiles);
+ LOGGER.info("limiting files to max " + this.maxFiles);
+ int toIndex = this.maxFiles;
+ if (toIndex > files.size()) {
+ toIndex = files.size();
+ }
+ files = files.subList(0, toIndex);
LOGGER.info("using file list with size " + files.size());
}
return files;
@@ -337,7 +341,7 @@
/**
* Set the maximum number of files to process.
* <p>
- * This is primarily used for debugging purposes.
+ * This is intended primarily for debugging.
*
* @param maxFiles the maximum number of files to process
*/
@@ -391,7 +395,7 @@
LOGGER.config("added extra EVIO processor " + processor.getClass().getName());
}
- // Process all of the runs files.
+ // Process all of the run's files.
runProcessor.process();
}
}
|