mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 19:02:13 +07:00
avoid NPE on progress indicator
This commit is contained in:
@@ -520,11 +520,10 @@ public class FileBasedIndexImpl extends FileBasedIndex {
|
||||
@Override
|
||||
public PersistentHashMap<Integer, Collection<K>> create() {
|
||||
try {
|
||||
ThrowableComputable<PersistentHashMap<Integer, Collection<K>>, IOException> process =
|
||||
final ThrowableComputable<PersistentHashMap<Integer, Collection<K>>, IOException> process =
|
||||
new ThrowableComputable<PersistentHashMap<Integer, Collection<K>>, IOException>() {
|
||||
@Override
|
||||
public PersistentHashMap<Integer, Collection<K>> compute() throws IOException {
|
||||
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
|
||||
return createIdToDataKeysIndex(indexId, keyDescriptor, storage);
|
||||
}
|
||||
};
|
||||
@@ -537,7 +536,13 @@ public class FileBasedIndexImpl extends FileBasedIndex {
|
||||
final ProgressIndicator currentProgress = progressManager.getProgressIndicator();
|
||||
if (currentProgress == null && ApplicationManager.getApplication().isDispatchThread()) {
|
||||
return progressManager.runProcessWithProgressSynchronously(
|
||||
process, LangBundle.message("compacting.indices.title"), false, null);
|
||||
new ThrowableComputable<PersistentHashMap<Integer, Collection<K>>, IOException>() {
|
||||
@Override
|
||||
public PersistentHashMap<Integer, Collection<K>> compute() throws IOException {
|
||||
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
|
||||
return process.compute();
|
||||
}
|
||||
}, LangBundle.message("compacting.indices.title"), false, null);
|
||||
}
|
||||
if (currentProgress != null) {
|
||||
// reuse existing progress indicator if available
|
||||
|
||||
Reference in New Issue
Block a user