diff --git a/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/reception/ResultConfiguratorFromMany.java b/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/reception/ResultConfiguratorFromMany.java index 7c140d52e3e..7c300daf238 100644 --- a/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/reception/ResultConfiguratorFromMany.java +++ b/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/reception/ResultConfiguratorFromMany.java @@ -94,16 +94,6 @@ public FunctionConfiguratorManyToOne resultAsDto(Class rClass) { return new FunctionConfiguratorManyToOne<>(requestHandlerManager, method, pClass, rClass); } - public ConsumerConfiguratorManyToNone

resultAsEmpty() { - LOGGER.debug( - "Configuring incoming request result: method: " - + method - + ", result object class: " - + Void.class); - - return new ConsumerConfiguratorManyToNone<>(requestHandlerManager, method, pClass); - } - public FunctionConfiguratorManyToOne resultAsString() { LOGGER.debug( "Configuring incoming request result: method: " diff --git a/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/reception/ResultConfiguratorFromOne.java b/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/reception/ResultConfiguratorFromOne.java index 653f4354c21..d16640540ac 100644 --- a/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/reception/ResultConfiguratorFromOne.java +++ b/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/reception/ResultConfiguratorFromOne.java @@ -51,7 +51,7 @@ public FunctionConfiguratorOneToMany resultAsListOfDto(Class rClass return new FunctionConfiguratorOneToMany<>(requestHandlerManager, method, pClass, rClass); } - public FunctionConfiguratorOneToOne resultAsDtoString() { + public FunctionConfiguratorOneToMany resultAsListOfString() { LOGGER.debug( "Configuring incoming request result: " + "method: " @@ -60,10 +60,10 @@ public FunctionConfiguratorOneToOne resultAsDtoString() { + "result list items class: " + String.class); - return new FunctionConfiguratorOneToOne<>(requestHandlerManager, method, pClass, String.class); + return new FunctionConfiguratorOneToMany<>(requestHandlerManager, method, pClass, String.class); } - public FunctionConfiguratorOneToOne resultAsDtoDouble() { + public FunctionConfiguratorOneToMany resultAsListOfDouble() { LOGGER.debug( "Configuring incoming request result: " + "method: " @@ -72,10 +72,10 @@ public FunctionConfiguratorOneToOne resultAsDtoDouble() { + "result list items class: " + Double.class); - return new FunctionConfiguratorOneToOne<>(requestHandlerManager, method, pClass, Double.class); + return new FunctionConfiguratorOneToMany<>(requestHandlerManager, method, pClass, Double.class); } - public FunctionConfiguratorOneToOne resultAsDtoBoolean() { + public FunctionConfiguratorOneToMany resultAsListOfBoolean() { LOGGER.debug( "Configuring incoming request result: " + "method: " @@ -84,7 +84,8 @@ public FunctionConfiguratorOneToOne resultAsDtoBoolean() { + "result list items class: " + Boolean.class); - return new FunctionConfiguratorOneToOne<>(requestHandlerManager, method, pClass, Boolean.class); + return new FunctionConfiguratorOneToMany<>( + requestHandlerManager, method, pClass, Boolean.class); } public FunctionConfiguratorOneToOne resultAsDto(Class rClass) { @@ -101,18 +102,6 @@ public FunctionConfiguratorOneToOne resultAsDto(Class rClass) { return new FunctionConfiguratorOneToOne<>(requestHandlerManager, method, pClass, rClass); } - public FunctionConfiguratorOneToOne resultAsEmpty() { - LOGGER.debug( - "Configuring incoming request result: " - + "method: " - + method - + ", " - + "result object class: " - + Void.class); - - return new FunctionConfiguratorOneToOne<>(requestHandlerManager, method, pClass, Void.class); - } - public FunctionConfiguratorOneToOne resultAsString() { LOGGER.debug( "Configuring incoming request result: " diff --git a/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromMany.java b/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromMany.java index df206d0b8e3..26374d7254e 100644 --- a/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromMany.java +++ b/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromMany.java @@ -169,6 +169,37 @@ public JsonRpcPromise sendAndReceiveResultAsBoolean(int timeoutInMillis endpointId, requestId, Boolean.class, timeoutInMillis); } + public JsonRpcPromise sendAndReceiveResultAsDouble() { + return sendAndReceiveResultAsDouble(0); + } + + public JsonRpcPromise sendAndReceiveResultAsDouble(int timeoutInMillis) { + final String requestId = transmitRequest(); + + LOGGER.debug( + "Transmitting request: " + + "endpoint ID: " + + endpointId + + ", " + + "request ID: " + + requestId + + ", " + + "method: " + + method + + ", " + + "params list items class: " + + pListValue.iterator().next().getClass() + + ", " + + "params list value" + + pListValue + + ", " + + "result object class: " + + Double.class); + + return dispatcher.registerPromiseForSingleObject( + endpointId, requestId, Double.class, timeoutInMillis); + } + public JsonRpcPromise> sendAndReceiveResultAsListOfDto(Class rClass) { return sendAndReceiveResultAsListOfDto(rClass, 0); } @@ -265,11 +296,11 @@ public JsonRpcPromise> sendAndReceiveResultAsListOfBoolean(int tim endpointId, requestId, Boolean.class, timeoutInMillis); } - public JsonRpcPromise sendAndReceiveResultAsEmpty() { - return sendAndReceiveResultAsEmpty(0); + public JsonRpcPromise> sendAndReceiveResultAsListOfDouble() { + return sendAndReceiveResultAsListOfDouble(0); } - public JsonRpcPromise sendAndReceiveResultAsEmpty(int timeoutInMillis) { + public JsonRpcPromise> sendAndReceiveResultAsListOfDouble(int timeoutInMillis) { final String requestId = transmitRequest(); LOGGER.debug( @@ -289,11 +320,11 @@ public JsonRpcPromise sendAndReceiveResultAsEmpty(int timeoutInMillis) { + "params list value" + pListValue + ", " - + "result object class: " - + Void.class); + + "result list items class: " + + Double.class); - return dispatcher.registerPromiseForSingleObject( - endpointId, requestId, Void.class, timeoutInMillis); + return dispatcher.registerPromiseForListOfObjects( + endpointId, requestId, Double.class, timeoutInMillis); } private void transmitNotification() { diff --git a/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromNone.java b/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromNone.java index 931b56346ee..0171b2455e2 100644 --- a/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromNone.java +++ b/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromNone.java @@ -235,11 +235,11 @@ public JsonRpcPromise> sendAndReceiveResultAsListOfBoolean(int tim endpointId, requestId, Boolean.class, timeInMillis); } - public JsonRpcPromise sendAndReceiveResultAsEmpty() { - return sendAndReceiveResultAsEmpty(0); + public JsonRpcPromise> sendAndReceiveResultAsListOfDouble() { + return sendAndReceiveResultAsListOfDouble(0); } - public JsonRpcPromise sendAndReceiveResultAsEmpty(int timeInMillis) { + public JsonRpcPromise> sendAndReceiveResultAsListOfDouble(int timeInMillis) { final String requestId = transmitRequest(); LOGGER.debug( @@ -254,10 +254,10 @@ public JsonRpcPromise sendAndReceiveResultAsEmpty(int timeInMillis) { + method + ", " + "result list items class: " - + Void.class); + + Double.class); - return dispatcher.registerPromiseForSingleObject( - endpointId, requestId, Void.class, timeInMillis); + return dispatcher.registerPromiseForListOfObjects( + endpointId, requestId, Double.class, timeInMillis); } private void transmitNotification() { diff --git a/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromOne.java b/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromOne.java index 7b2c7177bd6..de77b0c4a61 100644 --- a/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromOne.java +++ b/core/che-core-api-core/src/main/java/org/eclipse/che/api/core/jsonrpc/commons/transmission/SendConfiguratorFromOne.java @@ -281,11 +281,11 @@ public JsonRpcPromise> sendAndReceiveResultAsListOfBoolean(int tim endpointId, requestId, Boolean.class, timeoutInMillis); } - public JsonRpcPromise sendAndReceiveResultAsEmpty() { - return sendAndReceiveResultAsEmpty(0); + public JsonRpcPromise> sendAndReceiveResultAsListOfDouble() { + return sendAndReceiveResultAsListOfDouble(0); } - public JsonRpcPromise sendAndReceiveResultAsEmpty(int timeoutInMillis) { + public JsonRpcPromise> sendAndReceiveResultAsListOfDouble(int timeoutInMillis) { final String requestId = transmitRequest(); LOGGER.debug( @@ -304,10 +304,10 @@ public JsonRpcPromise sendAndReceiveResultAsEmpty(int timeoutInMillis) { + pValue + ", " + "result list items class: " - + Void.class); + + Double.class); - return dispatcher.registerPromiseForSingleObject( - endpointId, requestId, Void.class, timeoutInMillis); + return dispatcher.registerPromiseForListOfObjects( + endpointId, requestId, Double.class, timeoutInMillis); } private void transmitNotification() { diff --git a/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/event/ng/ClientServerEventService.java b/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/event/ng/ClientServerEventService.java index 59e332195ab..2fd88e81480 100644 --- a/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/event/ng/ClientServerEventService.java +++ b/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/event/ng/ClientServerEventService.java @@ -28,26 +28,26 @@ public interface ClientServerEventService { * * @param path the path to the specific file */ - Promise sendFileTrackingStartEvent(String path); + Promise sendFileTrackingStartEvent(String path); /** * Sends event on server side which tells to stop tracking specific file * * @param path the path to the specific file */ - Promise sendFileTrackingStopEvent(String path); + Promise sendFileTrackingStopEvent(String path); /** * Sends event on server side which tells to suspend tracking all files registered for specific * endpoint */ - Promise sendFileTrackingSuspendEvent(); + Promise sendFileTrackingSuspendEvent(); /** * Sends event on server side which tells to resume tracking all files registered for specific * endpoint */ - Promise sendFileTrackingResumeEvent(); + Promise sendFileTrackingResumeEvent(); /** * Sends event on server side which tells file that is being tracked should be moved (renamed) @@ -55,5 +55,5 @@ public interface ClientServerEventService { * @param oldPath the old path to the specific file * @param newPath the new path to the specific file */ - Promise sendFileTrackingMoveEvent(String oldPath, String newPath); + Promise sendFileTrackingMoveEvent(String oldPath, String newPath); } diff --git a/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/event/ng/ClientServerEventServiceImpl.java b/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/event/ng/ClientServerEventServiceImpl.java index 17a8d457a8a..1a9aab2ff17 100644 --- a/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/event/ng/ClientServerEventServiceImpl.java +++ b/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/event/ng/ClientServerEventServiceImpl.java @@ -19,7 +19,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import javax.inject.Inject; import javax.inject.Singleton; -import org.eclipse.che.api.core.jsonrpc.commons.JsonRpcPromise; import org.eclipse.che.api.core.jsonrpc.commons.RequestTransmitter; import org.eclipse.che.api.project.shared.dto.event.FileTrackingOperationDto; import org.eclipse.che.api.promises.client.Promise; @@ -29,6 +28,7 @@ /** @author Roman Nikitenko */ @Singleton public class ClientServerEventServiceImpl implements ClientServerEventService { + private static final String ENDPOINT_ID = "ws-agent"; private static final String OUTCOMING_METHOD = "track:editor-file"; @@ -45,55 +45,48 @@ public ClientServerEventServiceImpl( } @Override - public Promise sendFileTrackingStartEvent(String path) { + public Promise sendFileTrackingStartEvent(String path) { return transmit(path, "", START); } @Override - public Promise sendFileTrackingStopEvent(String path) { + public Promise sendFileTrackingStopEvent(String path) { return transmit(path, "", STOP); } @Override - public Promise sendFileTrackingSuspendEvent() { + public Promise sendFileTrackingSuspendEvent() { return transmit("", "", SUSPEND); } @Override - public Promise sendFileTrackingResumeEvent() { + public Promise sendFileTrackingResumeEvent() { return transmit("", "", RESUME); } @Override - public Promise sendFileTrackingMoveEvent(String oldPath, String newPath) { + public Promise sendFileTrackingMoveEvent(String oldPath, String newPath) { return transmit(oldPath, newPath, MOVE); } - private Promise transmit(String path, String oldPath, FileTrackingOperationDto.Type type) { + private Promise transmit( + String path, String oldPath, FileTrackingOperationDto.Type type) { final FileTrackingOperationDto dto = dtoFactory .createDto(FileTrackingOperationDto.class) .withPath(path) .withType(type) .withOldPath(oldPath); - return promises.create( - (AsyncCallback callback) -> { - JsonRpcPromise jsonRpcPromise = - requestTransmitter - .newRequest() - .endpointId(ENDPOINT_ID) - .methodName(OUTCOMING_METHOD) - .paramsAsDto(dto) - .sendAndReceiveResultAsEmpty(); - jsonRpcPromise.onSuccess( - aVoid -> { - callback.onSuccess(null); - }); - jsonRpcPromise.onFailure( - jsonRpcError -> { - callback.onFailure(new Throwable(jsonRpcError.getMessage())); - }); - }); + return promises.create( + (AsyncCallback callback) -> + requestTransmitter + .newRequest() + .endpointId(ENDPOINT_ID) + .methodName(OUTCOMING_METHOD) + .paramsAsDto(dto) + .sendAndReceiveResultAsBoolean() + .onSuccess(callback::onSuccess) + .onFailure(error -> callback.onFailure(new Throwable(error.getMessage())))); } } diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/autosave/AutoSaveModeImpl.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/autosave/AutoSaveModeImpl.java index 9c648332afc..0a672ab8d2b 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/autosave/AutoSaveModeImpl.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/autosave/AutoSaveModeImpl.java @@ -242,7 +242,7 @@ private void synchronizeWorkingCopy(String filePath, String projectPath) { editorWorkingCopySynchronizer .synchronize(filePath, projectPath, region) .onSuccess( - aVoid -> { + () -> { syncLock = false; synchronizeWorkingCopy(filePath, projectPath); }) diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/synchronization/workingCopy/EditorWorkingCopySynchronizer.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/synchronization/workingCopy/EditorWorkingCopySynchronizer.java index 33c51e1b78c..96892141216 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/synchronization/workingCopy/EditorWorkingCopySynchronizer.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/synchronization/workingCopy/EditorWorkingCopySynchronizer.java @@ -26,5 +26,5 @@ public interface EditorWorkingCopySynchronizer { * @param projectPath the path to the project which contains the file to sync * @param dirtyRegion describes a document range which has been changed */ - JsonRpcPromise synchronize(String filePath, String projectPath, DirtyRegion dirtyRegion); + JsonRpcPromise synchronize(String filePath, String projectPath, DirtyRegion dirtyRegion); } diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/synchronization/workingCopy/EditorWorkingCopySynchronizerImpl.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/synchronization/workingCopy/EditorWorkingCopySynchronizerImpl.java index 45a1bfc774d..7962bd83d31 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/synchronization/workingCopy/EditorWorkingCopySynchronizerImpl.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/synchronization/workingCopy/EditorWorkingCopySynchronizerImpl.java @@ -57,7 +57,7 @@ public void configureHandler(RequestHandlerConfigurator configurator) { .withConsumer(this::onError); } - public JsonRpcPromise synchronize( + public JsonRpcPromise synchronize( String filePath, String projectPath, DirtyRegion dirtyRegion) { Type type = dirtyRegion.getType().equals(DirtyRegion.INSERT) ? INSERT : REMOVE; EditorChangesDto changes = @@ -81,7 +81,7 @@ public JsonRpcPromise synchronize( .endpointId(ENDPOINT_ID) .methodName(EDITOR_CONTENT_CHANGES_METHOD) .paramsAsDto(changes) - .sendAndReceiveResultAsEmpty(); + .sendAndReceiveResultAsBoolean(); } private void onError(ServerError error) { diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/organizeimports/OrganizeImportsPresenterTest.java b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/organizeimports/OrganizeImportsPresenterTest.java index 20ac87db6c1..d9dcf6bd200 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/organizeimports/OrganizeImportsPresenterTest.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/organizeimports/OrganizeImportsPresenterTest.java @@ -74,14 +74,14 @@ public class OrganizeImportsPresenterTest { @Mock private Promise importsPromise; @Mock private Promise> resolveConflictsPromise; @Mock private Promise contentPromise; - @Mock private Promise fileTrackingSuspendEventPromise; + @Mock private Promise fileTrackingSuspendEventPromise; @Mock private OrganizeImportResult organizeImportResult; @Mock private Change change; @Captor private ArgumentCaptor> importsOperation; @Captor private ArgumentCaptor>> resolveConflictsOperation; @Captor private ArgumentCaptor> contentCaptor; - @Captor private ArgumentCaptor> clientServerSuspendOperation; + @Captor private ArgumentCaptor> clientServerSuspendOperation; private ConflictImportDTO conflict1; private ConflictImportDTO conflict2; @@ -103,7 +103,7 @@ public void setUp() throws Exception { when(clientServerEventService.sendFileTrackingSuspendEvent()) .thenReturn(fileTrackingSuspendEventPromise); - when(fileTrackingSuspendEventPromise.then(Matchers.>anyObject())) + when(fileTrackingSuspendEventPromise.then(Matchers.>anyObject())) .thenReturn(fileTrackingSuspendEventPromise); when(javaCodeAssistClient.organizeImports(anyString(), anyString())).thenReturn(importsPromise); diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/move/wizard/MovePresenterTest.java b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/move/wizard/MovePresenterTest.java index f27d86b5193..3c269a95acc 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/move/wizard/MovePresenterTest.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/move/wizard/MovePresenterTest.java @@ -113,7 +113,7 @@ public class MovePresenterTest { @Mock private Promise refactoringStatusPromise; @Mock private Promise refactoringResultPromise; @Mock private Promise updateAfterRefactoringPromise; - @Mock private Promise fileTrackingSuspendEventPromise; + @Mock private Promise fileTrackingSuspendEventPromise; @Mock private Promise handleMovingFilesPromise; @Mock private PromiseError promiseError; @Mock private ClientServerEventService clientServerEventService; @@ -128,7 +128,7 @@ public class MovePresenterTest { @Captor private ArgumentCaptor> refactoringStatusOperation; @Captor private ArgumentCaptor> refResultOperation; @Captor private ArgumentCaptor> promiseErrorCaptor; - @Captor private ArgumentCaptor> clientServerSuspendOperation; + @Captor private ArgumentCaptor> clientServerSuspendOperation; @Captor private ArgumentCaptor> updateAfterRefactoringOperation; private MovePresenter presenter; diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/preview/PreviewPresenterTest.java b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/preview/PreviewPresenterTest.java index 1fa04584c0a..a34880b92b6 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/preview/PreviewPresenterTest.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/preview/PreviewPresenterTest.java @@ -78,7 +78,7 @@ public class PreviewPresenterTest { @Mock private Promise refactoringStatusPromise; @Mock private Promise changePreviewPromise; @Mock private Promise updateAfterRefactoringPromise; - @Mock private Promise fileTrackingSuspendEventPromise; + @Mock private Promise fileTrackingSuspendEventPromise; @Mock private Promise handleMovingFilesPromise; @Mock private Promise changeEnableStatePromise; @Mock private ClientServerEventService clientServerEventService; @@ -87,7 +87,7 @@ public class PreviewPresenterTest { @Captor private ArgumentCaptor> refactoringStatusOperation; @Captor private ArgumentCaptor> changePreviewOperation; @Captor private ArgumentCaptor> changeEnableStateOperation; - @Captor private ArgumentCaptor> clientServerSuspendOperation; + @Captor private ArgumentCaptor> clientServerSuspendOperation; private PreviewPresenter presenter; diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/JavaRefactoringRenameTest.java b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/JavaRefactoringRenameTest.java index 6255160c98b..0fe17b3aae5 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/JavaRefactoringRenameTest.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/JavaRefactoringRenameTest.java @@ -129,16 +129,16 @@ public class JavaRefactoringRenameTest { @Mock private Document document; @Mock private HandlesUndoRedo undoRedo; @Mock private Promise updateAfterRefactoringPromise; - @Mock private Promise fileTrackingSuspendEventPromise; - @Mock private Promise fileTrackingResumeEventPromise; + @Mock private Promise fileTrackingSuspendEventPromise; + @Mock private Promise fileTrackingResumeEventPromise; @Mock private Promise handleMovingFilesPromise; @Captor private ArgumentCaptor> renameRefCaptor; @Captor private ArgumentCaptor inputArgumentCaptor; @Captor private ArgumentCaptor> refactoringStatusCaptor; @Captor private ArgumentCaptor> refactoringErrorCaptor; - @Captor private ArgumentCaptor> clientServerSuspendOperation; - @Captor private ArgumentCaptor> clientServerResumeOperation; + @Captor private ArgumentCaptor> clientServerSuspendOperation; + @Captor private ArgumentCaptor> clientServerResumeOperation; @Captor private ArgumentCaptor> updateAfterRefactoringOperation; @InjectMocks private JavaRefactoringRename refactoringRename; diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/wizard/RenamePresenterTest.java b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/wizard/RenamePresenterTest.java index 49f32637880..397876702aa 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/wizard/RenamePresenterTest.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/test/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/wizard/RenamePresenterTest.java @@ -118,7 +118,7 @@ public class RenamePresenterTest { @Mock private Promise changeCreationResultPromise; @Mock private Promise refactoringStatusPromise; @Mock private Promise updateAfterRefactoringPromise; - @Mock private Promise fileTrackingSuspendEventPromise; + @Mock private Promise fileTrackingSuspendEventPromise; @Mock private Promise handleMovingFilesPromise; @Captor @@ -131,7 +131,7 @@ public class RenamePresenterTest { @Captor private ArgumentCaptor> changeCreationResultCaptor; @Captor private ArgumentCaptor> refactoringStatusCaptor; - @Captor private ArgumentCaptor> clientServerSuspendOperation; + @Captor private ArgumentCaptor> clientServerSuspendOperation; @Captor private ArgumentCaptor> updateAfterRefactoringOperation; private RenamePresenter renamePresenter; diff --git a/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/project/server/EditorChangesTracker.java b/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/project/server/EditorChangesTracker.java index 280c4ffd5fa..a9105ed5af4 100644 --- a/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/project/server/EditorChangesTracker.java +++ b/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/project/server/EditorChangesTracker.java @@ -37,11 +37,11 @@ public void configureHandler(RequestHandlerConfigurator configurator) { .newConfiguration() .methodName(INCOMING_METHOD) .paramsAsDto(EditorChangesDto.class) - .resultAsEmpty() + .resultAsBoolean() .withBiFunction( (endpointId, changes) -> { editorWorkingCopyManager.onEditorContentUpdated(endpointId, changes); - return null; + return true; }); } } diff --git a/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/vfs/impl/file/event/detectors/EditorFileOperationHandler.java b/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/vfs/impl/file/event/detectors/EditorFileOperationHandler.java index 912d58986a4..271cffb4748 100644 --- a/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/vfs/impl/file/event/detectors/EditorFileOperationHandler.java +++ b/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/vfs/impl/file/event/detectors/EditorFileOperationHandler.java @@ -45,16 +45,20 @@ public void configureHandler(RequestHandlerConfigurator configurator) { .newConfiguration() .methodName(INCOMING_METHOD) .paramsAsDto(FileTrackingOperationDto.class) - .resultAsEmpty() - .withBiFunction(this::handleFileTrackingOperation); + .resultAsBoolean() + .withBiFunction( + (endpointId, operation) -> { + handleFileTrackingOperation(endpointId, operation); + return true; + }); } - private Void handleFileTrackingOperation(String endpointId, FileTrackingOperationDto operation) { + private void handleFileTrackingOperation(String endpointId, FileTrackingOperationDto operation) { try { Type operationType = operation.getType(); if (operationType == SUSPEND || operationType == RESUME) { eventService.publish(new FileTrackingOperationEvent(endpointId, operation)); - return null; + return; } String filePath = operation.getPath(); @@ -68,7 +72,6 @@ private Void handleFileTrackingOperation(String endpointId, FileTrackingOperatio } eventService.publish(new FileTrackingOperationEvent(endpointId, operation)); - return null; } catch (Exception e) { throw new JsonRpcException(500, "Can not handle file operation: " + e.getLocalizedMessage()); }