Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

UnionDeserializationGenerator creates inconsistent "looksLike" method names #262

Closed
adjokic opened this issue May 24, 2017 · 1 comment
Closed

Comments

@adjokic
Copy link

adjokic commented May 24, 2017

Hello,
when a typeDeclaration.name() starts with a lowercase letter, the generated "looksLike" method name is transformed in UnionDeserializationGenerator.buildLooksLike() to camel case with the call Names.methodName("looksLike", typeDeclaration.name());

However, when generating the code that calls the "looksLike" methods, it is not transformed into camel case. I fixed this by changing UnionDeserializationGenerator:95 to be consistent with the above call:

      String name = Names.methodName("looksLike", typeDeclaration.name());
      deserialize.addStatement("if ( " + name + "(map) ) return new $T(mapper.convertValue(map, $T.class))",
                               unionTypeName, unionPossibility);
@jpbelang
Copy link
Contributor

Thanks: tomorrow, i'll apply your fix.

jpbelang pushed a commit that referenced this issue May 25, 2017
Change-Id: I27817c5c05d2e158c9417e02d394160cb737edf5
@jstoiko jstoiko closed this as completed Jul 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants