diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java index 4f769ff5cc..025e8b4d40 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java @@ -97,6 +97,7 @@ import com.raytheon.uf.common.util.FileUtil; * Mar 21, 2014 2835 rjpeter Optimized getDisplayData to only scan directories to the depth required to * populate the display label. * Apr 29, 2014 3036 rferrel Check for missing archive root directories. + * May 22, 2014 3181 rferrel Add check for valid array index. * * * @author rferrel @@ -658,6 +659,14 @@ public class ArchiveConfigManager { tmpDirs.clear(); int subExprIndex = 0; + /* + * Will never match when pattern's directories shorter then + * directories being scanned. + */ + if ((tokens.length - rootFileDepth) > subExpr.length) { + continue DIR_PATTERN_LOOP; + } + for (int i = rootFileDepth; i < tokens.length; i++) { Pattern subPattern = Pattern.compile("^" + subExpr[subExprIndex++] + "$");