-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
PMD 6.0.0 #2771
PMD 6.0.0 #2771
Conversation
Move @SuppressWarnings closer to the problem to avoid suppressing future similar issues. Reduce amount of C-style (declare first and then use) variable definitions Make some variables final in tricky methods (enabled by above). Remove some unnecessary PMD suppressions Move PMD.OneDeclarationPerLine suppression for for loops into pmd config Small method extractions towards Clean Code Minor formatting/interface-impl enhancements in touched classes
…d#817) Fix hidden PMD violations
@@ -368,15 +368,15 @@ public synchronized void reset() throws IOException { | |||
*/ | |||
@Override | |||
public synchronized long skip(long byteCount) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swapped order to mimic java.io.InputStream#skip (i.e. don't throw when no bytes are skipped)
@@ -66,37 +68,43 @@ public int getOrientation(Uri uri) { | |||
} | |||
|
|||
public InputStream open(Uri uri) throws FileNotFoundException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extracted cursor handling to separate method and move up validation to look like guards
if (!TextUtils.isEmpty(values)) { | ||
combinedHeaders.put(entry.getKey(), sb.toString()); | ||
combinedHeaders.put(entry.getKey(), values); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extracted method to simplify code, and remove duplicate sb.toString
building.
@@ -274,19 +270,16 @@ private static int parseExifSegment(RandomAccessReader segmentData) { | |||
|
|||
int firstIfdOffset = segmentData.getInt32(headerOffsetSize + 4) + headerOffsetSize; | |||
int tagCount = segmentData.getInt16(firstIfdOffset); | |||
|
|||
int tagOffset, tagType, formatCode, componentCount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't just split them up, but moved them close to usage, thus can be final
LGTM, thanks for cleaning this up! |
I suggest a Squash Merge again. I suggest you take a look at the two revert commits and then the extra commits I added later. Please make sure you review thoroughly, hopefully rebase didn't mess anything up. Feel free to commit any amendments to the branch (you have write rights to all PR branches).
Description
Upgrade PMD from 5.8.1 to 6.0.0 based on https://github.com/sjudd/glide/tree/pmd_6_0_0 branch rebased onto #2762. Mostly PMD triggered fixes and refactors.
Motivation and Context
Better checks for finding hidden issues in the code.