gpu / JOCL

Java bindings for OpenCL
http://www.jocl.org
Other
187 stars 33 forks source link

Code quality improvements - squid:S1854, squid:S1197, squid:S1213, squid:S1192 #10

Closed georgekankava closed 8 years ago

georgekankava commented 8 years ago

This pull request is focused on resolving occurrences of Sonar rules squid:S1854 - Dead stores should be removed. squid:S1197 - Array designators "[]" should be on the type, not the variable. squid:S1213 - The members of an interface declaration or class should appear in a pre-defined order. squid:S1192 - String literals should not be duplicated. This pull request remove technical debt of 171 minutes. You can find more information about the issue here: https://dev.eclipse.org/sonar/rules/show/squid:S1854 https://dev.eclipse.org/sonar/rules/show/squid:S1197 https://dev.eclipse.org/sonar/rules/show/squid:S1213 https://dev.eclipse.org/sonar/rules/show/squid:S1192 Please let me know if you have any questions. George Kankava

gpu commented 8 years ago

I'd consider S1197 as rather minor (and the int array[] syntax as a tribute to C programmers), but the dead stores and the string literal deduplication certainly make sense, so I'd likely merge this one (after reviewing the others)

gpu commented 8 years ago

I merged this, with minor modifications. The JavaDocs for some of the methods actually stated wrong conditions for the exceptions to be thrown (and in hindsight, the null case should have been covered with a NullPointerException, but I won't change this for now for "backward compatibility"). Thanks for this contribution!

georgekankava commented 8 years ago

@gpu Thanks for merging.