Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup issues discovered by FindBugs #210

Merged
merged 1 commit into from
Jul 24, 2015

Conversation

oleg-nenashev
Copy link
Collaborator

The change closes about 100 issues (mostly API ones), but there're also several changes for encodings and file streams

@reviewbybees @lanwen @KostyaSha

@ghost
Copy link

ghost commented Jul 19, 2015

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

}

public GHContentUpdateResponse createContent(String content, String commitMessage, String path, String branch) throws IOException {
return createContent(content.getBytes(), commitMessage, path, branch);
//TODO: UTF-8?
Copy link
Contributor

Choose a reason for hiding this comment

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

yep, plz change to utf8

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is it a standard for GitHub?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes. Content-type includes utf-8 as charset

@buildhive
Copy link

Kohsuke Kawaguchi » github-api #380 SUCCESS
This pull request looks good
(what's this?)

@@ -128,7 +129,9 @@
} else {
if (password!=null) {
String authorization = (login + ':' + password);
encodedAuthorization = "Basic "+new String(Base64.encodeBase64(authorization.getBytes()));
//TODO: UTF-8?
final Charset charset = Charset.defaultCharset();
Copy link
Contributor

Choose a reason for hiding this comment

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

@lanwen the same?

Copy link
Contributor

Choose a reason for hiding this comment

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

yep

@KostyaSha
Copy link
Contributor

👍

@@ -942,7 +949,7 @@ private void verifyMine() throws IOException {
if (!root.login.equals(owner.login))
throw new IOException("Operation not applicable to a repository owned by someone else: "+owner.login);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

typo?

@buildhive
Copy link

Kohsuke Kawaguchi » github-api #381 SUCCESS
This pull request looks good
(what's this?)

@KostyaSha
Copy link
Contributor

👍 and squash before merge please

@oleg-nenashev
Copy link
Collaborator Author

@KostyaSha
I've squashed the stuff

@buildhive
Copy link

Kohsuke Kawaguchi » github-api #382 SUCCESS
This pull request looks good
(what's this?)

@lanwen
Copy link
Contributor

lanwen commented Jul 20, 2015

👍

oleg-nenashev added a commit that referenced this pull request Jul 24, 2015
Cleanup issues discovered by FindBugs
@oleg-nenashev oleg-nenashev merged commit ec450b8 into hub4j:master Jul 24, 2015
@@ -180,7 +180,8 @@ GHThread fetch() {
private long calcNextCheckTime() {
String v = req.getResponseHeader("X-Poll-Interval");
if (v==null) v="60";
return System.currentTimeMillis()+Integer.parseInt(v)*1000;
long seconds = Integer.parseInt(v);
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't Long.parseLong() suit better here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Depends on what is in X-Poll-Interval but you may be right

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the same, I just noticed it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In any case this code does not handle parsing exceptions, which may strike back at some point

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.

7 participants