Skip to content

Commit d91322d

Browse files
Return the changed classes as response of redefine classes command (#277)
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
1 parent c3a01e2 commit d91322d

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/HotCodeReplaceHandler.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2017 Microsoft Corporation and others.
2+
* Copyright (c) 2017-2019 Microsoft Corporation and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
@@ -25,6 +25,7 @@
2525
import com.microsoft.java.debug.core.protocol.Requests;
2626
import com.microsoft.java.debug.core.protocol.Requests.Arguments;
2727
import com.microsoft.java.debug.core.protocol.Requests.Command;
28+
import com.microsoft.java.debug.core.protocol.Responses;
2829

2930
public class HotCodeReplaceHandler implements IDebugRequestHandler {
3031
@Override
@@ -58,7 +59,10 @@ public CompletableFuture<Response> handle(Command command, Arguments arguments,
5859

5960
IHotCodeReplaceProvider provider = context.getProvider(IHotCodeReplaceProvider.class);
6061

61-
return provider.redefineClasses().thenApply(classNames -> response);
62+
return provider.redefineClasses().thenApply(classNames -> {
63+
response.body = new Responses.RedefineClassesResponse(classNames.toArray(new String[0]));
64+
return response;
65+
});
6266
}
6367

6468
}

com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/protocol/Responses.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2017 Microsoft Corporation and others.
2+
* Copyright (c) 2017-2019 Microsoft Corporation and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
@@ -245,4 +245,15 @@ public ExceptionInfoResponse(String exceptionId, String description, ExceptionBr
245245
this.details = details;
246246
}
247247
}
248+
249+
public static class RedefineClassesResponse extends ResponseBody {
250+
public String[] changedClasses = new String[0];
251+
252+
/**
253+
* Constructor.
254+
*/
255+
public RedefineClassesResponse(String[] changedClasses) {
256+
this.changedClasses = changedClasses;
257+
}
258+
}
248259
}

0 commit comments

Comments
 (0)