Skip to content

Commit

Permalink
[sre] Gson serializer is disabled becasue it cannot handle lambda ser…
Browse files Browse the repository at this point in the history
…ialization.

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Nov 27, 2018
1 parent 9f409b3 commit cbd6814
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Expand Up @@ -54,6 +54,7 @@

/**
* Serialize the {@link EventDispatch} content using GSON to generate the corresponding {@link EventEnvelope}.
* Caution: the Gson serializer is not able to serialize lambda expressions.
*
* <p>This implementation assumes that an {@link EventEncrypter} and {@link Gson} are injected.
*
Expand Down
Expand Up @@ -33,6 +33,7 @@
import io.janusproject.JanusConfig;
import io.janusproject.kernel.services.gson.GsonEventSerializer;
import io.janusproject.kernel.services.jdk.network.AESEventEncrypter;
import io.janusproject.kernel.services.jdk.network.JavaBinaryEventSerializer;
import io.janusproject.kernel.services.jdk.network.PlainTextEventEncrypter;
import io.janusproject.services.network.EventEncrypter;
import io.janusproject.services.network.EventSerializer;
Expand All @@ -49,7 +50,7 @@
*/
public class NetworkEventModule extends AbstractModule {

private static final Class<? extends EventSerializer> DEFAULT_EVENT_SERIALIZER = GsonEventSerializer.class;
private static final Class<? extends EventSerializer> DEFAULT_EVENT_SERIALIZER = JavaBinaryEventSerializer.class;

private static final Class<? extends EventEncrypter> DEFAULT_EVENT_ENCRYPTER = PlainTextEventEncrypter.class;

Expand Down
Expand Up @@ -27,7 +27,7 @@

import com.google.common.base.Charsets;

import io.janusproject.kernel.services.gson.GsonEventSerializer;
import io.janusproject.kernel.services.jdk.network.JavaBinaryEventSerializer;
import io.janusproject.kernel.services.jdk.network.PlainTextEventEncrypter;
import io.janusproject.services.network.NetworkConfig;
import io.janusproject.tests.testutils.AbstractJanusTest;
Expand All @@ -48,7 +48,7 @@ public void getDefaultValues() {

// Use hard-coded string to ensure retro compatibility
assertEquals("", defs.get("network.encrypter.aes.key")); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals(GsonEventSerializer.class.getName(), defs.get("network.serializer.class")); //$NON-NLS-1$
assertEquals(JavaBinaryEventSerializer.class.getName(), defs.get("network.serializer.class")); //$NON-NLS-1$
assertEquals(PlainTextEventEncrypter.class.getName(), defs.get("network.encrypter.class")); //$NON-NLS-1$
assertEquals(Charsets.UTF_8.name(), defs.get("network.serializer.charset")); //$NON-NLS-1$
}
Expand Down

0 comments on commit cbd6814

Please sign in to comment.