У меня есть набор модульных тестов в проекте, основанном на hybris, каждый раз, когда я пытаюсь настроить набор тестов из IDE, я получаю следующую трассировку стека, в которой говорится, что java.lang.StackOverflowError
произошло.
Error:Hybris Model Source Generating Compiler: Error: java.lang.StackOverflowError
java.lang.StackOverflowError
at java.util.regex.Pattern.range(Pattern.java:2635)
at java.util.regex.Pattern.clazz(Pattern.java:2564)
at java.util.regex.Pattern.sequence(Pattern.java:2065)
at java.util.regex.Pattern.expr(Pattern.java:1998)
at java.util.regex.Pattern.compile(Pattern.java:1698)
at java.util.regex.Pattern.<init>(Pattern.java:1351)
at java.util.regex.Pattern.compile(Pattern.java:1028)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:589)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
at de.hybris.bootstrap.config.ConfigUtil.expandProperty(ConfigUtil.java:603)
Это код для de.hybris.bootstrap.config.ConfigUtil.expandProperty
private static void expandProperty(String value, PlatformConfig platformConfig, Properties props, String key) {
String replacement = "";
int lastIndex = 0;
Pattern pattern = Pattern.compile("\\$\\{[^\\}]*\\}");
Matcher matcher = pattern.matcher(value);
for(String newKey = null; matcher.find(); lastIndex = matcher.end()) {
replacement = replacement + value.substring(lastIndex, matcher.start());
newKey = matcher.group().substring(2, matcher.group().length() - 1);
String newValue = platformConfig.getSystemConfig().getDir(newKey);
if (newValue == null) {
newValue = props.getProperty(newKey);
if (newValue != null && newValue.contains("${")) {
expandProperty(newValue, platformConfig, props, newKey);
newValue = props.getProperty(newKey);
}
}
if (newValue == null) {
replacement = replacement + matcher.group();
} else {
replacement = replacement + newValue;
}
}
if (lastIndex < value.length()) {
replacement = replacement + value.substring(lastIndex, value.length());
}
if (key != null) {
props.put(key, replacement);
}
}