Fix issue5425 (#5483)

* issue 5425 : [Android] Bug generating parcelables constructors for custom classes ( missing getClassLoader() )

* issue 5425 : changes in generated code

* ran ./bin/java-petstore-all.sh and committed the changes
This commit is contained in:
guidovezzoni
2017-04-27 18:23:32 +01:00
committed by wing328
parent 2324e927bd
commit 663db1b72a
18 changed files with 2245 additions and 2251 deletions

View File

@@ -178,17 +178,12 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
{{classname}}(Parcel in) {
{{#parent}} super(in); {{/parent}}
{{#vars}}
{{#isContainer}}
{{#complexType}}
{{#isPrimitiveType}}
{{name}} = ({{{datatypeWithEnum}}})in.readValue(null);
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader());
{{/complexType}}
{{^complexType}}
{{name}} = ({{{datatypeWithEnum}}})in.readValue(null);
{{/complexType}}
{{/isContainer}}
{{^isContainer}}
{{name}} = ({{{datatypeWithEnum}}})in.readValue(null);
{{/isContainer}}
{{/isPrimitiveType}}
{{/vars}}
}