Skip to content

Commit

Permalink
Upgrade checkstyle and checkstyle plugin
Browse files Browse the repository at this point in the history
    - The upgrade allows ignoring the missing suppression.xml file
      - The file is copied and provided by the plugin
      - It is needed so that mvn can run from a different directory
    - Also fixes the RedundantModifier problem detected by newer checkstyle
  • Loading branch information
chtyim committed Aug 4, 2016
1 parent 0ca2e35 commit e9dce3f
Show file tree
Hide file tree
Showing 85 changed files with 127 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public interface StreamEventDecoder<K, V> {
* @param <V> Type of value.
*/
@NotThreadSafe
static final class DecodeResult<K, V> {
final class DecodeResult<K, V> {
private K key;
private V value;

Expand Down
2 changes: 1 addition & 1 deletion cdap-api/src/main/java/co/cask/cdap/api/common/Scope.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public enum Scope {
/**
* Private constructor to force using the enum values.
*/
private Scope(String name) {
Scope(String name) {
displayName = name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public enum Data {
private final int dataType;
private final String name;

private Data(int type, String prettyName) {
Data(int type, String prettyName) {
this.dataType = type;
this.name = prettyName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public final class VerifyResult {
/**
* Status of verification.
*/
public static enum Status {
public enum Status {
SUCCESS,
FAILED
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ private static class AppClassKey {
private final NamespaceId namespace;
private final String className;

public AppClassKey(NamespaceId namespace, String className) {
AppClassKey(NamespaceId namespace, String className) {
this.namespace = namespace;
this.className = className;
}
Expand Down Expand Up @@ -1088,7 +1088,7 @@ private static class ArtifactData {
private final URI locationURI;
private final ArtifactMeta meta;

public ArtifactData(Location location, ArtifactMeta meta) {
ArtifactData(Location location, ArtifactMeta meta) {
this.locationURI = location.toURI();
this.meta = meta;
}
Expand All @@ -1100,7 +1100,7 @@ private static class PluginData {
private final ArtifactRange usableBy;
private final URI artifactLocationURI;

public PluginData(PluginClass pluginClass, ArtifactRange usableBy, Location artifactLocation) {
PluginData(PluginClass pluginClass, ArtifactRange usableBy, Location artifactLocation) {
this.pluginClass = pluginClass;
this.usableBy = usableBy;
this.artifactLocationURI = artifactLocation.toURI();
Expand All @@ -1112,7 +1112,7 @@ private static class AppData {
private final ApplicationClass appClass;
private final URI artifactLocationURI;

public AppData(ApplicationClass appClass, Location artifactLocation) {
AppData(ApplicationClass appClass, Location artifactLocation) {
this.appClass = appClass;
this.artifactLocationURI = artifactLocation.toURI();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private static final class SplitReaderRecordReader<KEY, VALUE> extends RecordRea

private final SplitReader<KEY, VALUE> splitReader;

public SplitReaderRecordReader(final SplitReader<KEY, VALUE> splitReader) {
SplitReaderRecordReader(final SplitReader<KEY, VALUE> splitReader) {
this.splitReader = splitReader;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private static class MeteredRecordWriter<K, V> extends RecordWriter<K, V> {
private final String counterName;
private final TaskInputOutputContext context;

public MeteredRecordWriter(RecordWriter<K, V> writer, TaskInputOutputContext context) {
MeteredRecordWriter(RecordWriter<K, V> writer, TaskInputOutputContext context) {
this.writer = writer;
this.context = context;
this.groupName = TaskCounter.class.getName();
Expand Down Expand Up @@ -299,7 +299,7 @@ private static class WrappedStatusReporter extends StatusReporter {

TaskAttemptContext context;

public WrappedStatusReporter(TaskAttemptContext context) {
WrappedStatusReporter(TaskAttemptContext context) {
this.context = context;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ private static final class ConfigFieldSetter extends FieldVisitor {
private final ArtifactId artifactId;
private final Set<String> macroFields;

public ConfigFieldSetter(PluginClass pluginClass, ArtifactId artifactId,
ConfigFieldSetter(PluginClass pluginClass, ArtifactId artifactId,
PluginProperties properties, Set<String> macroFields) {
this.pluginClass = pluginClass;
this.artifactId = artifactId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ private TriggerStatusV2(OperableTrigger trigger, Trigger.TriggerState state) {
this.state = state;
}

public TriggerStatusV2() {
TriggerStatusV2() {
// no-op
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private static final class ProgramRunDetails {
private final ProgramType programType;
private final List<Long> programRunList;

public ProgramRunDetails(String name, ProgramType programType, List<Long> programRunList) {
ProgramRunDetails(String name, ProgramType programType, List<Long> programRunList) {
this.name = name;
this.programType = programType;
this.programRunList = programRunList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ApplicationPermissionCollection extends PermissionCollection {
/**
* Constructor that defines some predefined {@link Permission}
*/
public ApplicationPermissionCollection() {
ApplicationPermissionCollection() {
perms.add(new RuntimePermission("getenv.*"));
perms.add(new RuntimePermission("setContextClassLoader"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static Credentials obtainToken(Configuration configuration, Credentials c
*/
private static class MRClientCache extends ClientCache {

public MRClientCache(Configuration conf, ResourceMgrDelegate rm) {
MRClientCache(Configuration conf, ResourceMgrDelegate rm) {
super(conf, rm);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class LocalDistributedCacheManagerWithFix {
private boolean setupCalled = false;
private JobID jobId;

public LocalDistributedCacheManagerWithFix(JobID jobId) {
LocalDistributedCacheManagerWithFix(JobID jobId) {
this.jobId = jobId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ private static final class AppMasterTwillZKPathService extends TwillZKPathServic
private static final Logger LOG = LoggerFactory.getLogger(AppMasterTwillZKPathService.class);
private final ZKClient zkClient;

public AppMasterTwillZKPathService(ZKClient zkClient, RunId runId) {
AppMasterTwillZKPathService(ZKClient zkClient, RunId runId) {
super(zkClient, runId);
this.zkClient = zkClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MultiOutputWriter<KEY_OUT, VAL_OUT> extends OutputWriter<KEY_OUT, VAL_OUT>
// sink name -> outputs for that sink
private final Map<String, SinkOutput> sinkOutputs;

public MultiOutputWriter(MapReduceTaskContext<KEY_OUT, VAL_OUT> context, Map<String, SinkOutput> sinkOutputs) {
MultiOutputWriter(MapReduceTaskContext<KEY_OUT, VAL_OUT> context, Map<String, SinkOutput> sinkOutputs) {
super(context);
this.sinkOutputs = sinkOutputs;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
abstract class OutputWriter<KEY_OUT, VAL_OUT> {
protected final MapReduceTaskContext<KEY_OUT, VAL_OUT> context;

public OutputWriter(MapReduceTaskContext<KEY_OUT, VAL_OUT> context) {
OutputWriter(MapReduceTaskContext<KEY_OUT, VAL_OUT> context) {
this.context = context;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ public int hashCode() {

/**
* Builder for creating configs.
*
* @param <T> The actual builder type
*/
@SuppressWarnings("unchecked")
public abstract static class Builder<T extends Builder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private interface MathNode {
private static class ValueNode implements MathNode {
private long value;

public ValueNode(long value) {
ValueNode(long value) {
this.value = value;
}

Expand All @@ -128,7 +128,7 @@ private static class AddNode implements MathNode {
private final MathNode left;
private final MathNode right;

public AddNode(MathNode left, MathNode right) {
AddNode(MathNode left, MathNode right) {
this.left = left;
this.right = right;
}
Expand All @@ -143,7 +143,7 @@ private static class SubtractNode implements MathNode {
private final MathNode left;
private final MathNode right;

public SubtractNode(MathNode left, MathNode right) {
SubtractNode(MathNode left, MathNode right) {
this.left = left;
this.right = right;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static class StageEvent implements ILoggingEvent {
private final String eventMessage;
private final String formattedMessage;

public StageEvent(ILoggingEvent event) {
StageEvent(ILoggingEvent event) {
this.event = event;
Map<String, String> mdcMap = event.getMDCPropertyMap();
String stage = mdcMap.get(LogContext.STAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ public static Builder builder() {

/**
* Base builder for creating pipeline specs.
*
* @param <T> the actual builder type
*/
@SuppressWarnings("unchecked")
public static class Builder<T extends Builder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ public int hashCode() {

/**
* Builder for creating configs.
*
* @param <T> The actual builder type
*/
@SuppressWarnings("unchecked")
public abstract static class Builder<T extends Builder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ public UpgradeableConfig upgrade(UpgradeContext upgradeContext) {

/**
* Builder for creating configs.
*
* @param <T> The actual builder type
*/
@SuppressWarnings("unchecked")
public abstract static class Builder<T extends Builder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private static class AggregateTransform<GROUP_KEY, GROUP_VAL, OUT_VAL>
implements Transformation<Tuple2<GROUP_KEY, Iterable<GROUP_VAL>>, OUT_VAL> {
private final BatchAggregator<GROUP_KEY, GROUP_VAL, OUT_VAL> aggregator;

public AggregateTransform(BatchAggregator<GROUP_KEY, GROUP_VAL, OUT_VAL> aggregator) {
AggregateTransform(BatchAggregator<GROUP_KEY, GROUP_VAL, OUT_VAL> aggregator) {
this.aggregator = aggregator;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private static class GroupByTransform<GROUP_KEY, GROUP_VAL>
private final BatchAggregator<GROUP_KEY, GROUP_VAL, ?> aggregator;
private final DefaultEmitter<GROUP_KEY> keyEmitter;

public GroupByTransform(BatchAggregator<GROUP_KEY, GROUP_VAL, ?> aggregator) {
GroupByTransform(BatchAggregator<GROUP_KEY, GROUP_VAL, ?> aggregator) {
this.aggregator = aggregator;
this.keyEmitter = new DefaultEmitter<>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static class JoinOnTransform<JOIN_KEY, INPUT, OUT>
implements Transformation<Tuple2<JOIN_KEY, List<JoinElement<INPUT>>>, OUT> {
private final BatchJoiner<JOIN_KEY, INPUT, OUT> joiner;

public JoinOnTransform(BatchJoiner<JOIN_KEY, INPUT, OUT> joiner) {
JoinOnTransform(BatchJoiner<JOIN_KEY, INPUT, OUT> joiner) {
this.joiner = joiner;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static class JoinOnTransform<INPUT, JOIN_KEY> implements Transformation<
private final BatchJoiner<JOIN_KEY, INPUT, ?> joiner;
private final String inputStageName;

public JoinOnTransform(BatchJoiner<JOIN_KEY, INPUT, ?> joiner, String inputStageName) {
JoinOnTransform(BatchJoiner<JOIN_KEY, INPUT, ?> joiner, String inputStageName) {
this.joiner = joiner;
this.inputStageName = inputStageName;
}
Expand Down
2 changes: 1 addition & 1 deletion cdap-cli/src/main/java/co/cask/cdap/cli/CLIConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private class UserAccessToken {
private final AccessToken accessToken;
private final String username;

public UserAccessToken(AccessToken accessToken, String username) {
UserAccessToken(AccessToken accessToken, String username) {
this.accessToken = accessToken;
this.username = username;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private static final class HistogramProcessor implements StatsProcessor {
private static final int BUCKET_SIZE = 100;
private final CLIConfig cliConfig;

public HistogramProcessor(CLIConfig cliConfig) {
HistogramProcessor(CLIConfig cliConfig) {
this.cliConfig = cliConfig;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private static final class ListWorkflowSchedulesCommand extends AbstractCommand
private final ScheduleClient scheduleClient;

@Inject
public ListWorkflowSchedulesCommand(CLIConfig cliConfig, ScheduleClient scheduleClient) {
ListWorkflowSchedulesCommand(CLIConfig cliConfig, ScheduleClient scheduleClient) {
super(cliConfig);
this.scheduleClient = scheduleClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static class SimpleFlow extends AbstractFlow {
private final String streamName;
private final String datasetName;

public SimpleFlow(String streamName, String datasetName) {
SimpleFlow(String streamName, String datasetName) {
this.streamName = streamName;
this.datasetName = datasetName;
}
Expand All @@ -108,7 +108,7 @@ private static class SimpleFlowlet extends AbstractFlowlet {
@Property
private final String datasetName;

public SimpleFlowlet(String datasetName) {
SimpleFlowlet(String datasetName) {
this.datasetName = datasetName;
}

Expand All @@ -124,7 +124,7 @@ private static class DefaultWorker extends AbstractWorker {
private final String streamName;
private volatile boolean stopped;

public DefaultWorker(String streamName) {
DefaultWorker(String streamName) {
this.streamName = streamName;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private static class Floh extends AbstractFlow {
private final String stream;
private final String dataset;

public Floh(String name, String stream, String dataset) {
Floh(String name, String stream, String dataset) {
this.name = name;
this.stream = stream;
this.dataset = dataset;
Expand All @@ -100,7 +100,7 @@ private static class Flohlet extends AbstractFlowlet {

private KeyValueTable keyValueTable;

public Flohlet(String datasetName) {
Flohlet(String datasetName) {
this.datasetName = datasetName;
}

Expand All @@ -122,7 +122,7 @@ private static class Wurker extends AbstractWorker {
private final String streamName;
private volatile boolean running;

public Wurker(String streamName) {
Wurker(String streamName) {
this.streamName = streamName;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private static class Floh extends AbstractFlow {
private final String stream;
private final String dataset;

public Floh(String name, String stream, String dataset) {
Floh(String name, String stream, String dataset) {
this.name = name;
this.stream = stream;
this.dataset = dataset;
Expand All @@ -107,7 +107,7 @@ private static class Flohlet extends AbstractFlowlet {

private KeyValueTable keyValueTable;

public Flohlet(String datasetName) {
Flohlet(String datasetName) {
this.datasetName = datasetName;
}

Expand All @@ -129,7 +129,7 @@ private static class Wurker extends AbstractWorker {
private final String streamName;
private volatile boolean running;

public Wurker(String streamName) {
Wurker(String streamName) {
this.streamName = streamName;
}

Expand Down
Loading

0 comments on commit e9dce3f

Please sign in to comment.