mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-67970 - CME: LiftShorterItemsClassifier.calculateToLift diagnostics
This commit is contained in:
+12
-7
@@ -99,17 +99,22 @@ public class LiftShorterItemsClassifier extends Classifier<LookupElement> {
|
||||
|
||||
private void calculateToLift(LookupElement element) {
|
||||
boolean hasChanges = false;
|
||||
for (String string : element.getAllLookupStrings()) {
|
||||
for (int len = 1; len < string.length(); len++) {
|
||||
String prefix = string.substring(0, len);
|
||||
for (LookupElement shorterElement : myElements.get(prefix)) {
|
||||
if (myCondition.shouldLift(shorterElement, element)) {
|
||||
hasChanges = true;
|
||||
myToLift.putValue(element, shorterElement);
|
||||
try {
|
||||
for (String string : element.getAllLookupStrings()) {
|
||||
for (int len = 1; len < string.length(); len++) {
|
||||
String prefix = string.substring(0, len);
|
||||
for (LookupElement shorterElement : myElements.get(prefix)) {
|
||||
if (myCondition.shouldLift(shorterElement, element)) {
|
||||
hasChanges = true;
|
||||
myToLift.putValue(element, shorterElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ConcurrentModificationException e) {
|
||||
throw new RuntimeException("Error while traversing lookup strings of " + element + " of " + element.getClass(), e);
|
||||
}
|
||||
if (hasChanges) {
|
||||
internListToLift(element);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user