Commit bd436488 authored by Matija Obreza's avatar Matija Obreza
Browse files

Fix: Regexp matcher bug when replace text contains '$'

parent ee8118de
...@@ -173,7 +173,8 @@ public class RowConverter { ...@@ -173,7 +173,8 @@ public class RowConverter {
Matcher replaceMat = REGEXP_REPLACE_PATTERN.matcher(groupPattern); Matcher replaceMat = REGEXP_REPLACE_PATTERN.matcher(groupPattern);
while (replaceMat.find()) { while (replaceMat.find()) {
int group = Integer.parseInt(replaceMat.group(1)); int group = Integer.parseInt(replaceMat.group(1));
res = res.replaceAll("\\$" + group, matcher.group(group)); // StringUtils.replace() -- because of $ characters (problematic $1) replace text
res = StringUtils.replace(res, "$" + group, matcher.group(group));
} }
} }
// System.err.println("Pattern=" + pattern + " groups=" + // System.err.println("Pattern=" + pattern + " groups=" +
......
...@@ -640,7 +640,11 @@ public class PushDialog extends Dialog { ...@@ -640,7 +640,11 @@ public class PushDialog extends Dialog {
// Filter only for specific INSTCODES // Filter only for specific INSTCODES
final Set<String> instCodesFilter = settings.getInstCodeSettings().getInstCodes(); final Set<String> instCodesFilter = settings.getInstCodeSettings().getInstCodes();
final boolean isBlackList = settings.getInstCodeSettings().isBlackList(); final boolean isBlackList = settings.getInstCodeSettings().isBlackList();
_log.warn("Running upload for " + instCodesFilter.toString()); if (isBlackList) {
_log.warn("Excluding upload for " + instCodesFilter.toString());
} else {
_log.warn("Running upload for " + instCodesFilter.toString());
}
try (RowReader rowReader = dataSourceLoader.createRowReader(dataSourceSheet, dataSource)) { try (RowReader rowReader = dataSourceLoader.createRowReader(dataSourceSheet, dataSource)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment