Skip to content

Commit c677028

Browse files
sungailasrossbach
authored andcommitted
[API] Move WatchdogServer and DocumentChecksum to core
The Saros/I versions of these classes were deleted; the remaining classes were altered to use the Core classes. The Handler cannot be moved easily due to specific editor dependencies. This is why further changes were made since it won't go away anytime soon. Also IsInconsistentObservable will be moved together with the Client. Change-Id: I71249f62ddc0bc581ee66b0804732474db17ce5e Reviewed-on: http://saros-build.imp.fu-berlin.de/gerrit/2959 Tested-by: Jenkins CI Reviewed-by: Stefan Rossbach <srossbach@arcor.de>
1 parent 054a772 commit c677028

File tree

7 files changed

+6
-427
lines changed

7 files changed

+6
-427
lines changed

de.fu_berlin.inf.dpp.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Export-Package: com.strangeberry.jmdns.tools,
4040
de.fu_berlin.inf.dpp.concurrent.jupiter.internal,
4141
de.fu_berlin.inf.dpp.concurrent.jupiter.internal.text,
4242
de.fu_berlin.inf.dpp.concurrent.management,
43+
de.fu_berlin.inf.dpp.concurrent.watchdog,
4344
de.fu_berlin.inf.dpp.editor,
4445
de.fu_berlin.inf.dpp.editor.colorstorage,
4546
de.fu_berlin.inf.dpp.editor.text,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,13 @@ private void updateChecksum(SPath docPath, Set<SPath> localEditors,
253253
String content = editorManager.getContent(checksum.getPath());
254254

255255
if (content == null) {
256-
if (localEditors.contains(checksum)) {
256+
if (localEditors.contains(checksum.getPath())) {
257257
LOG.error("EditorManager is in an inconsistent state. "
258258
+ "It is reporting a locally open editor but no"
259259
+ " document could be found in the underlying file system: "
260260
+ checksum);
261261
}
262-
if (!remoteEditors.contains(checksum)) {
262+
if (!remoteEditors.contains(checksum.getPath())) {
263263
/*
264264
* Since session participants do not report this document as
265265
* open, they are right (and our EditorPool might be confused)

de.fu_berlin.inf.dpp/src/de/fu_berlin/inf/dpp/concurrent/watchdog/DocumentChecksum.java renamed to de.fu_berlin.inf.dpp.core/src/de/fu_berlin/inf/dpp/concurrent/watchdog/DocumentChecksum.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public class DocumentChecksum {
1515
* doesn't exist).
1616
*/
1717
public static final int NOT_AVAILABLE = -1;
18-
1918
private SPath path;
2019
private int length;
2120
private int hash;

de.fu_berlin.inf.dpp.intellij/src/de/fu_berlin/inf/dpp/core/concurrent/ConsistencyWatchdogHandler.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import de.fu_berlin.inf.dpp.activities.ChecksumErrorActivity;
2828
import de.fu_berlin.inf.dpp.activities.RecoveryFileActivity;
2929
import de.fu_berlin.inf.dpp.activities.SPath;
30+
import de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum;
3031
import de.fu_berlin.inf.dpp.core.monitoring.IStatus;
3132
import de.fu_berlin.inf.dpp.core.monitoring.Status;
3233
import de.fu_berlin.inf.dpp.core.util.FileUtils;
@@ -236,13 +237,10 @@ void recoverFile(User from, final ISarosSession sarosSession,
236237
* verify the recovered file
237238
*/
238239
final DocumentChecksum checksum = new DocumentChecksum(path);
239-
checksum
240-
.bind(ResourceConverter.getDocument(path.getFullPath().toFile()));
241-
checksum.update();
240+
checksum.update(ResourceConverter.getDocument(path.getFullPath().toFile()).getText());
242241

243242
fireActivity(new ChecksumActivity(user, path, checksum.hashCode(),
244243
checksum.getLength(), null)
245244
);
246-
checksum.dispose();
247245
}
248246
}

de.fu_berlin.inf.dpp.intellij/src/de/fu_berlin/inf/dpp/core/concurrent/ConsistencyWatchdogServer.java

Lines changed: 0 additions & 267 deletions
This file was deleted.

0 commit comments

Comments
 (0)