mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-57372 & IDEA-126616 (Structural Search: throwable at com.intellij.structuralsearch.plugin.ui.SearchDialog$2.run)
This commit is contained in:
+8
-1
@@ -325,7 +325,11 @@ public class PatternCompiler {
|
||||
|
||||
@Override
|
||||
public String getPrefix(int varIndex) {
|
||||
return myPrefixes[varIndex];
|
||||
try {
|
||||
return myPrefixes[varIndex];
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,6 +355,9 @@ public class PatternCompiler {
|
||||
final String name = template.getSegmentName(i);
|
||||
|
||||
final String prefix = prefixProvider.getPrefix(i);
|
||||
if (prefix == null) {
|
||||
throw new MalformedPatternException();
|
||||
}
|
||||
|
||||
buf.append(text.substring(prevOffset,offset));
|
||||
buf.append(prefix);
|
||||
|
||||
Reference in New Issue
Block a user