Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonSerializationContext.Builder override not working as expected #152

Open
llowrey opened this issue Feb 4, 2019 · 0 comments
Open

JsonSerializationContext.Builder override not working as expected #152

llowrey opened this issue Feb 4, 2019 · 0 comments

Comments

@llowrey
Copy link

llowrey commented Feb 4, 2019

I have a JsonDeserializationContext.Builder override working as expected but the serialization builder isn't working.

Here's what I have in my module:

<replace-with class="net.somedomain.poc.web.client.jackson.JsonSerializationContextBuilder">
	<when-type-assignable class="com.github.nmorel.gwtjackson.client.JsonSerializationContext.Builder"/>
</replace-with>

The javascript ends up looking like this:

function builder_2_g$(){
  $clinit_JsonSerializationContext_0_g$();
  return castTo_0_g$(new JsonSerializationContext$DefaultBuilder_1_g$, 40);
}

It's instantiating an instance of DefaultBuilder instead of my builder.

But, I know that my 'replace-with' works because I can do this:

Builder builder = GWT.create(com.github.nmorel.gwtjackson.client.JsonSerializationContext.Builder.class);

log.debug("builder serializeNulls? {}", builder.build().isSerializeNulls());
log.debug("builder serializeNulls? {}", JsonSerializationContext.builder().build().isSerializeNulls());

... and the output is ...

builder serialzeNulls? false
builder serialzeNulls? true

So, the GWT.create() statement in my code does what's expected but the same GWT.create() call in JsonSerializationContext.builder() doesn't. Crazily, Everything works as expected for the deserialization versions.

Any ideas as to what is happening?

This is with GWT 2.8.2 and devmode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant