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

squid:S00108 - Nested blocks of code should not be left empty #67

Conversation

georgekankava
Copy link
Contributor

This pull request is focused on resolving occurrences of Sonar rule squid:S00108 - Nested blocks of code should not be left empty.
You can find more information about the issue here:
https://dev.eclipse.org/sonar/coding_rules#q=squid%3AS00108
Please let me know if you have any questions.
George Kankava

@saudet
Copy link
Member

saudet commented Jan 30, 2016

Thanks for the recommendations! A couple of things though:

  1. I've dealt with InterruptedException in a different way for the issue at Throwing Away The Interrupt Flag by catching the InterruptedException javacv#315.
  2. The comment in Parser for IllegalAccessException actually applies to the two other types of exceptions as well, so I think it's alright the way it is now?
  3. On error, Pointer.offsetof() returns -1, so we don't need to log anything. I guess we could put return -1 in the catch block to make this more explicit?
    The rest is fine, so I'll be happy to merge that once adjusted! Thanks

@georgekankava
Copy link
Contributor Author

Fixed. Thanks! If there is any issue please let me know.

@saudet
Copy link
Member

saudet commented Feb 3, 2016

Could you make one commit out of this? The easiest way is to git reset master your branch, recommit, and git push --force.

And do the same for the other other pull requests! Thanks

@georgekankava georgekankava force-pushed the staging/nested-blocks-of-code-should-not-be-left-empty-fix-1 branch from 159341f to 8005a0e Compare February 3, 2016 16:14
@georgekankava
Copy link
Contributor Author

Done Sir.

@saudet
Copy link
Member

saudet commented Feb 4, 2016

Thanks! But there is still a problem with the "fail silently" part. It isn't supposed to report or log anything. Would you have a suggestion about how to make that fact clearer for all the types of exceptions thrown there, without repeating the comment three times, if possible? thanks!

@saudet
Copy link
Member

saudet commented Feb 17, 2016

Any updates?

@georgekankava
Copy link
Contributor Author

Why not to catch general Exception not to repeat empty blocks 3 times or Java 7 multi catch clause can also be used.

@saudet
Copy link
Member

saudet commented Feb 18, 2016

Multicatch is a good idea I think! It should have no problem on Android as well.

@georgekankava georgekankava force-pushed the staging/nested-blocks-of-code-should-not-be-left-empty-fix-1 branch from 8005a0e to 7858f2e Compare February 18, 2016 08:02
@georgekankava
Copy link
Contributor Author

Please take a loot at changes. Hope this is what was expected.

@saudet
Copy link
Member

saudet commented Feb 18, 2016

Looks good, thanks!

saudet added a commit that referenced this pull request Feb 18, 2016
…de-should-not-be-left-empty-fix-1

Do at least something for exceptions we swallow but do not expect
@saudet saudet merged commit 4b738fa into bytedeco:master Feb 18, 2016
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.

2 participants