mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
catch process canceled exception of pattern match calculation - fix review comment for WEB-22649 JSON Schema: patternProperties does not work.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.jetbrains.jsonSchema.impl;
|
||||
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.containers.SLRUMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -509,10 +510,14 @@ public class JsonSchemaObject {
|
||||
final List<String> strings = new ArrayList<>(myPatternProperties.keySet());
|
||||
Collections.sort(strings);
|
||||
for (final String pattern : strings) {
|
||||
final boolean matches = Pattern.compile(adaptSchemaPattern(pattern)).matcher(StringUtil.newBombedCharSequence(name, 1000)).matches();
|
||||
if (matches) {
|
||||
myCachedPatternProperties.put(name, pattern);
|
||||
return myPatternProperties.get(pattern);
|
||||
try {
|
||||
final boolean matches = Pattern.compile(adaptSchemaPattern(pattern)).matcher(StringUtil.newBombedCharSequence(name, 1000)).matches();
|
||||
if (matches) {
|
||||
myCachedPatternProperties.put(name, pattern);
|
||||
return myPatternProperties.get(pattern);
|
||||
}
|
||||
} catch (ProcessCanceledException e) {
|
||||
//ignored
|
||||
}
|
||||
}
|
||||
myCachedPatternProperties.put(name, "");
|
||||
|
||||
Reference in New Issue
Block a user