Correct some Java Warnings#1855
Correct some Java Warnings#1855hiveship wants to merge 34 commits intoswagger-api:masterfrom hiveship:master
Conversation
Just correct some Java warnings (static methods, useless imports, unused parameters...). Don't impact any features. Tests are OK.
Tests OK.
*-SNAPSHOT are only available while using the local source. Refers to the latests on the Maven Central if using distant project.
|
Thanks for the PR. Instead of using tab, please use 4-space for indentation instead. I notice that you convert many private instance method into static one. Is that a reason for making that change? Is that based on some Java best practices? |
|
It's a Java Best practice that a method which do not need any instance variable may be declared as static. I only did that on private method since no one will be allow to override it in any other class. |
|
Thanks. Do you have the URL to the section in best practice that we can find out more? |
|
I don't have a link to the oracle website yet but: See the accepted answer: http://stackoverflow.com/questions/11240178/what-is-the-gain-from-declaring-a-method-as-static |
generated in Java using "java.util.UUID" class instead of a classical String.
|
I added a commit to handle UUID generation in a Java code. |
…resent. Clean responses mechanism using volley default's
This last change was producing a wrong swagger spec @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md "The value MUST start with a leading slash (/)"
Inspired by ClojureClientCodegen.java, it is interesting to use projectName from info.title swagger spec to fill up package.json name attribute
io.swagger.models.Info dependency added
projectName was already defined so never overriden.
… options Adds option to use DateTimeOffset to model datetime fields instead of DateTime to allow preservation of timezone information. Modifies ApiClient.ParameterToString to support DateTimeOffset. Also adds sourceFolder option.
A swagger file that contains a definition named "object" compiles into a class named Object. This is technically not a problem as it lives in a different package than java.lang.Object, but this requires the templates to refer to Java's Object using its fully qualified name.
for ApiClient and upgrade OkHttp
|
The change looks reasonable to me after reading the SO link you provided. @fehguy do you have any concern switching private instance methods to private static methods? |
|
Hi, I can't merge with tabs vs. spaces, it makes it very painful to diff and doesn't follow our coding standards. The guts of the PR, from the comments, sound fine--but please try to send a PR with just your changes. If formatting is a problem, it's best to send formatting changes in a different PR. |
|
@hiveship seems like there's an issue with "rebase" as the PR contains 60+ commits. Let me know if you need help fixing that (e.g. using cherry-pick with a new branch) |
Added basics files. Compiling, tests OK but not tested yet.
|
@hiveship please try the following: Check the files to confirm the change is present and cherry-pick more commits if needed. |
# Conflicts: # modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PerlClientCodegen.java
# Conflicts: # modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java # modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JaxRSServerCodegen.java
|
@wing328 all failed and now my local project is in a very bad state (can not commit or pull anything). Is there is way to delete all my local project and reclone again ? (without loosing my work ?) |
|
Can close this PR. Too complicated to extract the commits and revert the original code formatting. I will continue my work on the Apache CXF support and I'll send a new pull request when it's finished. (See my question #1888) |
|
@wing328 if you prefer, I can delete my fork and fork again. I can apply again my changes in a new branch and then ask for a pull request on this branch. I can do the same for my other works;
|
|
@hiveship well I just want to save you some time in manually applying those changes in a newly-forked repo. I'll leave it up to you on how you would like to proceed. One suggestion is to create a new branch and avoid making change directly in the master. |
|
Thank you but I think it could be better to apply change is a newly-forked repo since I am working on other features in the codegen, and the problem will be the same for next PR. |
Just correct some Java warnings (static methods, useless imports, unused
parameters...). Don't impact any features. Tests are OK.