ArrayList<ModulesKey> newKeys = new ArrayList<ModulesKey>();
ArrayList<ModulesKey> removedKeys = new ArrayList<ModulesKey>();
//temporary
CompleteIndexKey tempKey = new CompleteIndexKey((ModulesKey) null);
Iterator<ModulesKey> it = keysFound.values().iterator();
while (it.hasNext()) {
ModulesKey next = it.next();
if (next.file != null) {
long lastModified = next.file.lastModified();
if (lastModified != 0) {
tempKey.key = next;
CompleteIndexKey completeIndexKey = keys.get(tempKey);
boolean canAddAstInfoFor = PythonPathHelper.canAddAstInfoFor(next);
if (completeIndexKey == null) {
if (canAddAstInfoFor) {
newKeys.add(next);
}
} else {
if (canAddAstInfoFor) {
if (completeIndexKey.lastModified != lastModified) {
//Just re-add it if the time changed!
newKeys.add(next);
}
} else {
//It's there but it's not valid: Remove it!
removedKeys.add(next);
}
}
}
}
}
Iterator<CompleteIndexKey> it2 = keys.values().iterator();
while (it2.hasNext()) {
CompleteIndexKey next = it2.next();
if (!keysFound.containsKey(next.key) || !PythonPathHelper.canAddAstInfoFor(next.key)) {
removedKeys.add(next.key);
}
}