EA-67970 - CME: LiftShorterItemsClassifier.calculateToLift diagnostics

This commit is contained in:
peter
2015-05-28 16:26:49 +02:00
parent de5f7f2832
commit 339bf5d09a
@@ -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);
}