Skip to content

fix java warnings#1900

Merged
fehguy merged 42 commits intoswagger-api:masterfrom
hiveship:fix-java-warnings
Jan 23, 2016
Merged

fix java warnings#1900
fehguy merged 42 commits intoswagger-api:masterfrom
hiveship:fix-java-warnings

Conversation

@hiveship
Copy link
Copy Markdown
Contributor

Do not impact any feature. Just correct some Java warnings (static
methods, unused imports or parameters...).

Refers to #1855 @wing328 @fehguy

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...).
@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Jan 16, 2016

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
@hiveship
Copy link
Copy Markdown
Contributor Author

@wing328 just done :)

@hiveship
Copy link
Copy Markdown
Contributor Author

@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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know why the null check for out is removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
    }

wing328 and others added 10 commits January 21, 2016 11:13
* 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`
@hiveship
Copy link
Copy Markdown
Contributor Author

@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) :(
Where I'm wrong ?

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Jan 21, 2016

@hiveship did you do a rebase? If yes, how did you do it ?

@hiveship
Copy link
Copy Markdown
Contributor Author

I'm using the "Github for windows" GUI to manage the project. i did a "Update project from swagger-api/master" and "sync"

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Jan 21, 2016

Please check the usage of "sync" and Github for Windows. I don't think the operation did the right thing.

@hiveship
Copy link
Copy Markdown
Contributor Author

@fehguy could you please re-start the build on this PR too ?

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Jan 22, 2016

@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
@fehguy
Copy link
Copy Markdown
Contributor

fehguy commented Jan 22, 2016

@hiveship looks like the tests are all passing now

@hiveship
Copy link
Copy Markdown
Contributor Author

hiveship commented Jan 22, 2016 via email

@fehguy
Copy link
Copy Markdown
Contributor

fehguy commented Jan 23, 2016

OK that was a huge commit. Yes, I've gone through everything and it looks fine--thank you.

fehguy added a commit that referenced this pull request Jan 23, 2016
@fehguy fehguy merged commit ee8547f into swagger-api:master Jan 23, 2016
@wing328 wing328 added this to the v2.1.6 milestone Jan 23, 2016
@hiveship hiveship deleted the fix-java-warnings branch January 25, 2016 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants