fix java warnings#1900
fix java warnings#1900fehguy merged 42 commits intoswagger-api:masterfrom hiveship:fix-java-warnings
Conversation
A property defined as "type: string & format: uuid" is now generated in Java using "java.util.UUID" class instead of a classical String. In the Java, the UUID class do not provide a constructor. You may use the method UUID.fromString(<uuid_string>) to construct your UUID object.
Do not impact any feature. Juste correct some Java warnings (static methods, unused imports or parameters...).
|
Please rebase on the latest master to resolve the merge conflicts. Ref: http://nathanleclaire.com/blog/2014/09/14/dont-be-scared-of-git-rebase/ |
…ix-java-warnings # Conflicts: # modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JaxRSServerCodegen.java
|
@wing328 just done :) |
|
@wing328 @fehguy Do you use Eclipse to develop ? Do you want me to provide an Eclipse Code Formatter for the Swagger Codegen project . it can be usefull to use once, since it can auto format the source code before commits/push and can avoid diff due to the formatting (if all developers agree to use it of course). |
Handle the Swagger "default" value for a parameter with the JAX-RS @DefaultValue annotation. This correction will also be reported in the new JAX-RS CXF Codegen.
There was a problem hiding this comment.
May I know why the null check for out is removed?
There was a problem hiding this comment.
The "out" object can't be null at this location since the constructor of the class FileOutputStream can't give a null object (but may throw exception if error occur) and is always called before the null comparison.
public FileOutputStream(File file, boolean append)
throws FileNotFoundException
{
String name = (file != null ? file.getPath() : null);
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkWrite(name);
}
if (name == null) {
throw new NullPointerException();
}
if (file.isInvalid()) {
throw new FileNotFoundException("Invalid file path");
}
this.fd = new FileDescriptor();
this.append = append;
this.path = name;
fd.incrementAndGetUseCount();
open(name, append);
}ApiClient.Default
* Replace jQuery with SuperAgent which works in both Node.js and browser * Use UMD pattern (returnExports.js) to make the module exporting compatible with all major systems: AMD, Node.js (CommonJS) and browser * Implement support of header and form parameters. Closes #1736 * Move HTTP requesting code to `ApiClient` and allow customizing options in it, e.g. "basePath" * Update unit tests accordingly and add some tests for `ApiClient`
by using random and atomically increasing IDs
…ix-java-warnings # Conflicts: # modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java
|
@wing328 I created a new branch "fix-java-warnings" and did not ask for a PR on master, but now there is also more commits added by other persons (you) :( |
|
@hiveship did you do a rebase? If yes, how did you do it ? |
|
I'm using the "Github for windows" GUI to manage the project. i did a "Update project from swagger-api/master" and "sync" |
|
Please check the usage of "sync" and Github for Windows. I don't think the operation did the right thing. |
|
@fehguy could you please re-start the build on this PR too ? |
|
@hiveship I believe you can do it in travis-ci.org given that you're the PR owner. |
…ix-java-warnings # Conflicts: # modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java
|
@hiveship looks like the tests are all passing now |
|
Ye, thank you :)
Do you think you will accept this PR ? Do I need to change something ?
|
|
OK that was a huge commit. Yes, I've gone through everything and it looks fine--thank you. |
Do not impact any feature. Just correct some Java warnings (static
methods, unused imports or parameters...).
Refers to #1855 @wing328 @fehguy