Skip to content

Commit

Permalink
Fix for issue resty-gwt#249
Browse files Browse the repository at this point in the history
The problem is described at resty-gwt#249
This fix is that by default if sourceName is null, we will use the decoding based on the classtype that we are generating the JsonEncocderDecoderClass for
  • Loading branch information
Nicholas Loke committed May 7, 2015
1 parent e731cfa commit ee23e21
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -451,8 +451,13 @@ private void generateDecodeMethod(JClassType classType,
}
p("object = toObjectFromWrapper(value, \"" + possibleType.tag + "\");");
} else if (!isLeaf) {
p("if(sourceName.equals(\"" + possibleType.tag + "\"))");
p("{");
if (classType.equals(possibleType.clazz)) {
p("if(sourceName == null || sourceName.equals(\"" + possibleType.tag + "\"))");
p("{");
} else {
p("if(sourceName != null && sourceName.equals(\"" + possibleType.tag + "\"))");
p("{");
}
}
}

Expand Down

0 comments on commit ee23e21

Please sign in to comment.