Source:
protected boolean harvestResults(GenericDialog gd) { String[] counts = new String[fp.getPrefixes().length]; String[] firsts = new String[counts.length]; String[] increments = new String[counts.length]; int[] count = fp.getCount(); boolean useRanges = counts.length > 0 ? gd.getNextBoolean() : false; boolean useRegex = gd.getNextBoolean(); for (int i=0; i<counts.length; i++) { counts[i] = gd.getNextString(); firsts[i] = gd.getNextString(); increments[i] = gd.getNextString(); } String contains = gd.getNextString(); String id = gd.getNextString(); if (useRegex) { if (contains.trim().length() > 0) { String dir = originalID.substring(0, originalID.lastIndexOf(File.separator) + 1); id = dir + ".*" + contains + ".*"; } } else if (useRanges) { StringBuffer pattern = new StringBuffer(); for (int i=0; i<counts.length; i++) { BigInteger first = new BigInteger(firsts[i]); BigInteger fileCount = new BigInteger(counts[i]); BigInteger increment = new BigInteger(increments[i]); FilePatternBlock block = new FilePatternBlock(fp.getBlock(i)); fileCount = fileCount.subtract(BigInteger.ONE).multiply(increment).add(first); pattern.append(fp.getPrefix(i)); pattern.append('<'); int firstPadding = paddingZeros[i] - first.toString().length() + 1; for (int zero=0; zero<firstPadding; zero++) { pattern.append('0'); } pattern.append(first); pattern.append('-'); int lastPadding = paddingZeros[i] - fileCount.toString().length() + 1; for (int zero=0; zero<lastPadding; zero++) { pattern.append('0'); } pattern.append(fileCount); pattern.append(':'); pattern.append(increment); pattern.append('>'); } id = pattern.toString() + fp.getSuffix(); } options.setId(id); return true; }

Target:
protected boolean harvestResults(GenericDialog gd) { String[] counts = new String[fp.getPrefixes().length]; String[] firsts = new String[counts.length]; String[] increments = new String[counts.length]; int[] count = fp.getCount(); boolean useRanges = counts.length > 0 ? gd.getNextBoolean() : false; boolean useRegex = gd.getNextBoolean(); for (int i=0; i<counts.length; i++) { counts[i] = gd.getNextString(); firsts[i] = gd.getNextString(); increments[i] = gd.getNextString(); } String contains = gd.getNextString(); String id = gd.getNextString(); if (useRegex) { if (contains.trim().length() > 0) { String dir = originalID.substring(0, originalID.lastIndexOf(File.separator) + 1); id = dir + ".*" + contains + ".*"; } } else if (useRanges) { StringBuilder pattern = new StringBuilder(); for (int i=0; i<counts.length; i++) { BigInteger first = new BigInteger(firsts[i]); BigInteger fileCount = new BigInteger(counts[i]); BigInteger increment = new BigInteger(increments[i]); FilePatternBlock block = new FilePatternBlock(fp.getBlock(i)); fileCount = fileCount.subtract(BigInteger.ONE).multiply(increment).add(first); pattern.append(fp.getPrefix(i)); pattern.append('<'); int firstPadding = paddingZeros[i] - first.toString().length() + 1; for (int zero=0; zero<firstPadding; zero++) { pattern.append('0'); } pattern.append(first); pattern.append('-'); int lastPadding = paddingZeros[i] - fileCount.toString().length() + 1; for (int zero=0; zero<lastPadding; zero++) { pattern.append('0'); } pattern.append(fileCount); pattern.append(':'); pattern.append(increment); pattern.append('>'); } pattern.append(fp.getSuffix()); id = pattern.toString(); } options.setId(id); return true; }