Skip to content

Commit 7d13606

Browse files
authored
Removed deprecated ClusterSerializable support (#4739)
ClusterSerializable is no longer internal Signed-off-by: Thomas Segismont <[email protected]>
1 parent 6429bd8 commit 7d13606

File tree

10 files changed

+10
-156
lines changed

10 files changed

+10
-156
lines changed

src/main/java/io/vertx/core/eventbus/impl/CodecManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import io.vertx.core.eventbus.impl.codecs.*;
1919
import io.vertx.core.json.JsonArray;
2020
import io.vertx.core.json.JsonObject;
21-
import io.vertx.core.shareddata.impl.ClusterSerializable;
21+
import io.vertx.core.shareddata.ClusterSerializable;
2222

2323
import java.io.Serializable;
2424
import java.util.Objects;

src/main/java/io/vertx/core/eventbus/impl/codecs/ClusterSerializableCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import io.vertx.core.buffer.Buffer;
1616
import io.vertx.core.eventbus.MessageCodec;
1717
import io.vertx.core.eventbus.impl.CodecManager;
18-
import io.vertx.core.shareddata.impl.ClusterSerializable;
18+
import io.vertx.core.shareddata.ClusterSerializable;
1919

2020
import static io.vertx.core.impl.ClusterSerializableUtils.copy;
2121

src/main/java/io/vertx/core/impl/ClusterSerializableUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
package io.vertx.core.impl;
1313

1414
import io.vertx.core.buffer.Buffer;
15-
import io.vertx.core.shareddata.impl.ClusterSerializable;
15+
import io.vertx.core.shareddata.ClusterSerializable;
1616

1717
import java.lang.reflect.InvocationTargetException;
1818

src/main/java/io/vertx/core/shareddata/ClusterSerializable.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@
2222
*
2323
* @implSpec Implementations must have a public no-argument constructor.
2424
*/
25-
public interface ClusterSerializable extends io.vertx.core.shareddata.impl.ClusterSerializable {
25+
public interface ClusterSerializable {
2626

2727
/**
2828
* Method invoked when serializing this instance.
2929
*
3030
* @param buffer the {@link Buffer} where the serialized bytes must be written to
3131
*/
32-
@Override
3332
void writeToBuffer(Buffer buffer);
3433

3534
/**
@@ -39,6 +38,5 @@ public interface ClusterSerializable extends io.vertx.core.shareddata.impl.Clust
3938
* @param buffer the {@link Buffer} where the serialized bytes must be read from
4039
* @return the position after the last serialized byte
4140
*/
42-
@Override
4341
int readFromBuffer(int pos, Buffer buffer);
4442
}

src/main/java/io/vertx/core/shareddata/impl/Checker.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import io.vertx.core.impl.SerializableUtils;
1616
import io.vertx.core.impl.logging.Logger;
1717
import io.vertx.core.impl.logging.LoggerFactory;
18+
import io.vertx.core.shareddata.ClusterSerializable;
1819
import io.vertx.core.shareddata.Shareable;
1920

2021
import java.io.ObjectInputStream;

src/main/java/io/vertx/core/shareddata/impl/ClusterSerializable.java

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

src/test/java/io/vertx/core/eventbus/ClusteredEventBusTest.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@
1111

1212
package io.vertx.core.eventbus;
1313

14-
import io.vertx.core.Handler;
15-
import io.vertx.core.MultiMap;
16-
import io.vertx.core.Promise;
17-
import io.vertx.core.Vertx;
18-
import io.vertx.core.VertxOptions;
14+
import io.vertx.core.*;
1915
import io.vertx.core.impl.VertxInternal;
20-
import io.vertx.core.shareddata.AsyncMapTest.SomeClusterSerializableImplObject;
2116
import io.vertx.core.shareddata.AsyncMapTest.SomeClusterSerializableObject;
2217
import io.vertx.core.shareddata.AsyncMapTest.SomeSerializableObject;
2318
import io.vertx.core.spi.cluster.NodeSelector;
@@ -596,11 +591,6 @@ public void testRejectedClusterSerializableNotSent() {
596591
testRejectedNotSent(SomeClusterSerializableObject.class, new SomeClusterSerializableObject("bar"));
597592
}
598593

599-
@Test
600-
public void testRejectedClusterSerializableImplNotSent() {
601-
testRejectedNotSent(SomeClusterSerializableImplObject.class, new SomeClusterSerializableImplObject("bar"));
602-
}
603-
604594
@Test
605595
public void testRejectedSerializableNotSent() {
606596
testRejectedNotSent(SomeSerializableObject.class, new SomeSerializableObject("bar"));
@@ -628,11 +618,6 @@ public void testRejectedClusterSerializableNotReceived() {
628618
testRejectedNotReceived(SomeClusterSerializableObject.class, new SomeClusterSerializableObject("bar"));
629619
}
630620

631-
@Test
632-
public void testRejectedClusterSerializableImplNotReceived() {
633-
testRejectedNotReceived(SomeClusterSerializableImplObject.class, new SomeClusterSerializableImplObject("bar"));
634-
}
635-
636621
@Test
637622
public void testRejectedSerializableNotReceived() {
638623
testRejectedNotReceived(SomeSerializableObject.class, new SomeSerializableObject("bar"));

src/test/java/io/vertx/core/eventbus/EventBusTestBase.java

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
package io.vertx.core.eventbus;
1313

1414
import io.netty.util.CharsetUtil;
15-
import io.vertx.core.*;
15+
import io.vertx.core.AbstractVerticle;
16+
import io.vertx.core.Context;
17+
import io.vertx.core.DeploymentOptions;
18+
import io.vertx.core.Vertx;
1619
import io.vertx.core.buffer.Buffer;
1720
import io.vertx.core.json.JsonArray;
1821
import io.vertx.core.json.JsonObject;
19-
import io.vertx.core.shareddata.AsyncMapTest.SomeClusterSerializableImplObject;
2022
import io.vertx.core.shareddata.AsyncMapTest.SomeClusterSerializableObject;
2123
import io.vertx.core.shareddata.AsyncMapTest.SomeSerializableObject;
2224
import io.vertx.test.core.TestUtils;
@@ -381,33 +383,6 @@ public void testPublishClusterSerializable() throws Exception {
381383
});
382384
}
383385

384-
@Test
385-
public void testSendClusterSerializableImpl() throws Exception {
386-
SomeClusterSerializableImplObject obj = new SomeClusterSerializableImplObject(TestUtils.randomAlphaString(50));
387-
testSend(obj, (received) -> {
388-
assertEquals(obj, received);
389-
assertFalse(obj == received); // Make sure it's copied
390-
});
391-
}
392-
393-
@Test
394-
public void testReplyClusterSerializableImpl() throws Exception {
395-
SomeClusterSerializableImplObject obj = new SomeClusterSerializableImplObject(TestUtils.randomAlphaString(50));
396-
testReply(obj, (received) -> {
397-
assertEquals(obj, received);
398-
assertFalse(obj == received); // Make sure it's copied
399-
});
400-
}
401-
402-
@Test
403-
public void testPublishClusterSerializableImpl() throws Exception {
404-
SomeClusterSerializableImplObject obj = new SomeClusterSerializableImplObject(TestUtils.randomAlphaString(50));
405-
testPublish(obj, (received) -> {
406-
assertEquals(obj, received);
407-
assertFalse(obj == received); // Make sure it's copied
408-
});
409-
}
410-
411386
@Test
412387
public void testSendSerializable() throws Exception {
413388
SomeSerializableObject obj = new SomeSerializableObject(TestUtils.randomAlphaString(50));

src/test/java/io/vertx/core/shareddata/AsyncMapTest.java

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
package io.vertx.core.shareddata;
1313

14-
import io.vertx.core.CompositeFuture;
1514
import io.vertx.core.Future;
1615
import io.vertx.core.Promise;
1716
import io.vertx.core.Vertx;
@@ -105,11 +104,6 @@ public void testMapPutGetClusterSerializableObject() {
105104
testMapPutGet(new SomeClusterSerializableObject("bar"), new SomeClusterSerializableObject("bar"));
106105
}
107106

108-
@Test
109-
public void testMapPutGetClusterSerializableImplObject() {
110-
testMapPutGet(new SomeClusterSerializableImplObject("bar"), new SomeClusterSerializableImplObject("bar"));
111-
}
112-
113107
@Test
114108
public void testMapPutTtl() {
115109
SharedData sharedData = getVertx().sharedData();
@@ -235,11 +229,6 @@ public void testMapPutIfAbsentGetClusterSerializableObject() {
235229
testMapPutIfAbsentGet(new SomeClusterSerializableObject("bar"), new SomeClusterSerializableObject("bar"));
236230
}
237231

238-
@Test
239-
public void testMapPutIfAbsentGetClusterSerializableImplObject() {
240-
testMapPutIfAbsentGet(new SomeClusterSerializableImplObject("bar"), new SomeClusterSerializableImplObject("bar"));
241-
}
242-
243232
@Test
244233
public void testMapPutIfAbsentTtl() {
245234
SharedData sharedData = getVertx().sharedData();
@@ -333,11 +322,6 @@ public void testMapRemoveClusterSerializableObject() {
333322
testMapRemove(new SomeClusterSerializableObject("bar"), new SomeClusterSerializableObject("bar"));
334323
}
335324

336-
@Test
337-
public void testMapRemoveClusterSerializableImplObject() {
338-
testMapRemove(new SomeClusterSerializableImplObject("bar"), new SomeClusterSerializableImplObject("bar"));
339-
}
340-
341325
@Test
342326
public void testMapRemoveIfPresentByte() {
343327
testMapRemoveIfPresent((byte) 1, (byte) 2, (byte) 3, (byte) 4);
@@ -412,11 +396,6 @@ public void testMapRemoveIfPresentClusterSerializableObject() {
412396
testMapRemoveIfPresent(new SomeClusterSerializableObject("foo"), new SomeClusterSerializableObject("bar"), new SomeClusterSerializableObject("baz"), new SomeClusterSerializableObject("quux"));
413397
}
414398

415-
@Test
416-
public void testMapRemoveIfPresentClusterSerializableImplObject() {
417-
testMapRemoveIfPresent(new SomeClusterSerializableImplObject("foo"), new SomeClusterSerializableImplObject("bar"), new SomeClusterSerializableImplObject("baz"), new SomeClusterSerializableImplObject("quux"));
418-
}
419-
420399
@Test
421400
public void testMapReplaceByte() {
422401
testMapReplace((byte) 1, (byte) 2, (byte) 3);
@@ -489,11 +468,6 @@ public void testMapReplaceClusterSerializableObject() {
489468
testMapReplace(new SomeClusterSerializableObject("foo"), new SomeClusterSerializableObject("bar"), new SomeClusterSerializableObject("quux"));
490469
}
491470

492-
@Test
493-
public void testMapReplaceClusterSerializableImplObject() {
494-
testMapReplace(new SomeClusterSerializableImplObject("foo"), new SomeClusterSerializableImplObject("bar"), new SomeClusterSerializableImplObject("quux"));
495-
}
496-
497471
@Test
498472
public void testMapReplaceTtl() {
499473
SharedData sharedData = getVertx().sharedData();
@@ -590,11 +564,6 @@ public void testMapReplaceIfPresentClusterSerializableObject() {
590564
testMapReplaceIfPresent(new SomeClusterSerializableObject("foo"), new SomeClusterSerializableObject("bar"), new SomeClusterSerializableObject("quux"));
591565
}
592566

593-
@Test
594-
public void testMapReplaceIfPresentClusterSerializableImplObject() {
595-
testMapReplaceIfPresent(new SomeClusterSerializableImplObject("foo"), new SomeClusterSerializableImplObject("bar"), new SomeClusterSerializableImplObject("quux"));
596-
}
597-
598567
@Test
599568
public void testMapReplaceIfPresentTtl() {
600569
SharedData sharedData = getVertx().sharedData();
@@ -936,46 +905,4 @@ public int readFromBuffer(int pos, Buffer buffer) {
936905
return pos + 4 + length;
937906
}
938907
}
939-
940-
@Deprecated
941-
public static final class SomeClusterSerializableImplObject implements io.vertx.core.shareddata.impl.ClusterSerializable {
942-
private String str;
943-
// Trick smart data grid marshallers: make sure ClusterSerializable methods are the only way to serialize and deserialize this class
944-
@SuppressWarnings("unused")
945-
private final Object object = new Object();
946-
947-
public SomeClusterSerializableImplObject() {
948-
}
949-
950-
public SomeClusterSerializableImplObject(String str) {
951-
this.str = str;
952-
}
953-
954-
@Override
955-
public boolean equals(Object o) {
956-
if (this == o) return true;
957-
if (!(o instanceof SomeClusterSerializableImplObject)) return false;
958-
SomeClusterSerializableImplObject that = (SomeClusterSerializableImplObject) o;
959-
if (str != null ? !str.equals(that.str) : that.str != null) return false;
960-
return true;
961-
}
962-
963-
@Override
964-
public int hashCode() {
965-
return str != null ? str.hashCode() : 0;
966-
}
967-
968-
@Override
969-
public void writeToBuffer(Buffer buffer) {
970-
buffer.appendInt(str.length());
971-
buffer.appendString(str);
972-
}
973-
974-
@Override
975-
public int readFromBuffer(int pos, Buffer buffer) {
976-
int length = buffer.getInt(pos);
977-
str = buffer.getString(pos + 4, pos + 4 + length);
978-
return pos + 4 + length;
979-
}
980-
}
981908
}

src/test/java/io/vertx/core/shareddata/LocalSharedDataTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import io.vertx.core.buffer.Buffer;
1515
import io.vertx.core.json.JsonArray;
1616
import io.vertx.core.json.JsonObject;
17-
import io.vertx.core.shareddata.AsyncMapTest.SomeClusterSerializableImplObject;
1817
import io.vertx.core.shareddata.AsyncMapTest.SomeClusterSerializableObject;
1918
import io.vertx.core.shareddata.AsyncMapTest.SomeSerializableObject;
2019
import io.vertx.test.core.TestUtils;
@@ -270,12 +269,6 @@ public void testMapTypes() throws Exception {
270269
SomeClusterSerializableObject otherCso = (SomeClusterSerializableObject) map.get(key);
271270
assertEquals(cso, otherCso);
272271
assertNotSame(cso, otherCso);
273-
274-
SomeClusterSerializableImplObject csio = new SomeClusterSerializableImplObject(TestUtils.randomAlphaString(15));
275-
map.put(key, csio);
276-
SomeClusterSerializableImplObject otherCsio = (SomeClusterSerializableImplObject) map.get(key);
277-
assertEquals(csio, otherCsio);
278-
assertNotSame(csio, otherCsio);
279272
}
280273

281274
@Test

0 commit comments

Comments
 (0)