mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
set "scan required" flag in DebugSession if hotswap was cancelled
This commit is contained in:
@@ -155,6 +155,10 @@ public class HotSwapManager extends AbstractProjectComponent {
|
||||
}
|
||||
|
||||
private void reloadClasses(DebuggerSession session, Map<String, HotSwapFile> classesToReload, HotSwapProgress progress) {
|
||||
if (progress.isCancelled()) {
|
||||
session.setModifiedClassesScanRequired(true);
|
||||
return;
|
||||
}
|
||||
final long newSwapTime = System.currentTimeMillis();
|
||||
new ReloadClassesWorker(session, progress).reloadClasses(classesToReload);
|
||||
setTimeStamp(session, newSwapTime);
|
||||
@@ -220,7 +224,13 @@ public class HotSwapManager extends AbstractProjectComponent {
|
||||
swapProgress.setTitle(DebuggerBundle.message("progress.hotswap.scanning.classes"));
|
||||
scanClassesCommand.run();
|
||||
|
||||
return swapProgress.isCancelled() ? new HashMap<DebuggerSession, Map<String, HotSwapFile>>() : modifiedClasses;
|
||||
if (swapProgress.isCancelled()) {
|
||||
for (DebuggerSession session : sessions) {
|
||||
session.setModifiedClassesScanRequired(true);
|
||||
}
|
||||
return new HashMap<DebuggerSession, Map<String, HotSwapFile>>();
|
||||
}
|
||||
return modifiedClasses;
|
||||
}
|
||||
|
||||
public static void reloadModifiedClasses(final Map<DebuggerSession, Map<String, HotSwapFile>> modifiedClasses, final HotSwapProgress reloadClassesProgress) {
|
||||
@@ -240,6 +250,10 @@ public class HotSwapManager extends AbstractProjectComponent {
|
||||
debuggerSession, modifiedClasses.get(debuggerSession), reloadClassesProgress
|
||||
);
|
||||
}
|
||||
|
||||
protected void commandCancelled() {
|
||||
debuggerSession.setModifiedClassesScanRequired(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@ import com.intellij.debugger.engine.DebugProcessImpl;
|
||||
import com.intellij.debugger.engine.events.DebuggerCommandImpl;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class MultiProcessCommand implements Runnable{
|
||||
private final List<Pair<DebugProcessImpl, DebuggerCommandImpl>> myCommands = new ArrayList<Pair<DebugProcessImpl, DebuggerCommandImpl>>();
|
||||
private final List<Pair<DebugProcessImpl, DebuggerCommandImpl>> myCommands = new LinkedList<Pair<DebugProcessImpl, DebuggerCommandImpl>>();
|
||||
|
||||
public void run() {
|
||||
while(true) {
|
||||
@@ -40,7 +40,10 @@ public class MultiProcessCommand implements Runnable{
|
||||
|
||||
public void cancel() {
|
||||
synchronized(myCommands) {
|
||||
myCommands.clear();
|
||||
while (!myCommands.isEmpty()) {
|
||||
Pair<DebugProcessImpl, DebuggerCommandImpl> pair = myCommands.remove(0);
|
||||
pair.getSecond().notifyCancelled();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user