Skip to content

Conversation

@menchauser
Copy link
Contributor

Currently Java codegen works successfully for property named 'class' but
fails on '_class', '__class', etc, because of 'Object.getClass()'
overloading.

This fix is intended to avoid all Object method overloading cases.

Fix is similar to #3177
Resolves: #4236

(Sample code regeneration caused big changeset)

Mukhamed Karanashev added 2 commits November 22, 2016 15:22
Currently Java codegen works successfully for property named 'class' but
fails on '_class', '__class', etc, because of 'Object.getClass()'
overloading.

This fix is intended to avoid all Object method overloading cases.
@menchauser
Copy link
Contributor Author

Seems like I've broken existing tests by regenerating samples.

@wing328
Copy link
Contributor

wing328 commented Nov 22, 2016

@menchauser thanks for the PR. Your suggested fix looks good to me.

The enum issue caused by updated Java petstore sample is not related to the change you made. I'll look into it.

@wing328 wing328 added this to the v2.2.2 milestone Nov 22, 2016
@wing328 wing328 merged commit 6ebc2fc into swagger-api:master Nov 22, 2016
@wing328
Copy link
Contributor

wing328 commented Nov 22, 2016

I fixed the test cases via #4329

This PR has been merged into master. Thanks for the contribution.

@wing328 wing328 changed the title Fix support for 'class' properties in Java codegen [Java] Fix support for 'class' properties in Java codegen Feb 20, 2017
davidgri pushed a commit to davidgri/swagger-codegen that referenced this pull request May 11, 2017
* Fix support for 'class' properties in Java codegen

Currently Java codegen works successfully for property named 'class' but
fails on '_class', '__class', etc, because of 'Object.getClass()'
overloading.

This fix is intended to avoid all Object method overloading cases.

* Regenerated samples for Java petstore-security-test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Java] Bug generating Java model with '_class' property

2 participants