Skip to content

Commit

Permalink
pmd: enable migrating rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdan authored and QuantumBadger committed Dec 7, 2016
1 parent 0471612 commit 62099e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions config/pmd/rules.xml
Expand Up @@ -15,6 +15,7 @@
<rule ref="rulesets/java/android.xml"/>
<rule ref="rulesets/java/clone.xml"/>
<rule ref="rulesets/java/finalizers.xml"/>
<rule ref="rulesets/java/migrating.xml"/>
<rule ref="rulesets/java/unnecessary.xml">
<exclude name="UselessParentheses"/> <!--Too nitpicky-->
</rule>
Expand All @@ -23,6 +24,9 @@
<rule ref="rulesets/java/optimizations.xml/UseArraysAsList"/>
<rule ref="rulesets/java/optimizations.xml/UnnecessaryWrapperObjectCreation"/>

<rule ref="rulesets/java/controversial.xml/UnnecessaryConstructor"/>
<rule ref="rulesets/java/controversial.xml/UnnecessaryParentheses"/>

<rule ref="rulesets/java/design.xml/FinalFieldCouldBeStatic"/>
<rule ref="rulesets/java/design.xml/CloseResource"/>
<rule ref="rulesets/java/design.xml/DefaultLabelNotLastInSwitchStmt"/>
Expand Down
Expand Up @@ -21,7 +21,8 @@

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Hashtable;
import java.util.HashMap;
import java.util.Map;


public final class RedditThing {
Expand All @@ -30,10 +31,10 @@ public static enum Kind {
POST, USER, COMMENT, MESSAGE, SUBREDDIT, MORE_COMMENTS, LISTING
}

private static final Hashtable<String, Kind> kinds;
private static final Map<String, Kind> kinds;

static {
kinds = new Hashtable<>();
kinds = new HashMap<>();
kinds.put("t1", Kind.COMMENT);
kinds.put("t2", Kind.USER);
kinds.put("t3", Kind.POST);
Expand Down
Expand Up @@ -45,7 +45,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Vector;
import java.util.List;
import java.util.ArrayList;

/**
* Created by vishna on 22/07/15.
Expand Down Expand Up @@ -162,7 +163,7 @@ public void onPrepared(MediaPlayer mp) {
}
}
};
private Vector<Pair<InputStream, MediaFormat>> mPendingSubtitleTracks;
private List<Pair<InputStream, MediaFormat>> mPendingSubtitleTracks;
private final MediaPlayer.OnCompletionListener mCompletionListener =
new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
Expand Down Expand Up @@ -379,7 +380,7 @@ private void initVideoView() {
setFocusable(true);
setFocusableInTouchMode(true);
requestFocus();
mPendingSubtitleTracks = new Vector<>();
mPendingSubtitleTracks = new ArrayList<>();
mCurrentState = STATE_IDLE;
mTargetState = STATE_IDLE;
}
Expand Down

0 comments on commit 62099e0

Please sign in to comment.