mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't load data for obsolete suspend context
This commit is contained in:
@@ -48,6 +48,10 @@ public abstract class DeclarativeScope<VALUE_LOADER extends ValueManager> extend
|
||||
}
|
||||
|
||||
protected final void loadScopeObjectProperties(@NotNull ObjectValue value, @NotNull final AsyncResult<List<? extends Variable>> result) {
|
||||
if (valueManager.rejectIfObsolete(result)) {
|
||||
return;
|
||||
}
|
||||
|
||||
value.getProperties().doWhenDone(new Consumer<List<Variable>>() {
|
||||
@Override
|
||||
public void consume(List<Variable> variables) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.jetbrains.debugger.values;
|
||||
|
||||
import com.intellij.openapi.util.ActionCallback;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@@ -40,4 +41,12 @@ public abstract class ValueManager {
|
||||
public final void markObsolete() {
|
||||
obsolete = true;
|
||||
}
|
||||
|
||||
public final boolean rejectIfObsolete(@NotNull ActionCallback result) {
|
||||
if (isObsolete()) {
|
||||
result.reject("Obsolete context");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user