Skip to content

Commit

Permalink
Update to Checkstyle 8.2 and Gradle 4.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeb01 committed Sep 28, 2017
1 parent eff62d4 commit 22b3cf6
Show file tree
Hide file tree
Showing 31 changed files with 43 additions and 48 deletions.
9 changes: 3 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ repositories {
}

dependencies {
checkstyle 'com.puppycrawl.tools:checkstyle:8.2'
testCompile 'junit:junit:4.12'
perfCompile 'org.hdrhistogram:HdrHistogram:1.2.1'
}

idea.module {
testSourceDirs += sourceSets.perf.allSource.getSrcDirs()
testSourceDirs += sourceSets.perf.allSource.srcDirs
scopes.TEST.plus += [ configurations.perfCompile ]
}

Expand Down Expand Up @@ -165,10 +166,6 @@ uploadArchives {

build.dependsOn perfClasses

task listJars << {
configurations.perfCompile.each { file -> println file.name }
}

task perfJar(type: Jar) {
baseName = project.name + '-perf'
from { configurations.perfCompile.collect { it.isDirectory() ? it : zipTree(it) } }
Expand All @@ -178,7 +175,7 @@ task perfJar(type: Jar) {
}

task wrapper(type: Wrapper) {
gradleVersion = '2.8'
gradleVersion = '4.2'
}

class Version {
Expand Down
2 changes: 0 additions & 2 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@

<module name="UpperEll" />

<module name="JUnitTestCase" />

<module name="IllegalType">
<property name="legalAbstractClassNames"
value="AbstractBeanDefinition, AbstractAccountEvInstruction, AbstractEmsInstruction, AbstractEvInstruction, AbstractEmsAction, AbstractInstrumentAction, AbstractEntry" />
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Feb 21 18:25:26 NZDT 2017
#Thu Sep 28 12:54:38 NZDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-all.zip
2 changes: 1 addition & 1 deletion src/main/java/com/lmax/disruptor/BatchStartAware.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public interface BatchStartAware
{
void onBatchStart(final long batchSize);
void onBatchStart(long batchSize);
}
2 changes: 1 addition & 1 deletion src/main/java/com/lmax/disruptor/EventTranslator.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ public interface EventTranslator<T>
* @param event into which the data should be translated.
* @param sequence that is assigned to event.
*/
void translateTo(final T event, long sequence);
void translateTo(T event, long sequence);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ public interface EventTranslatorOneArg<T, A>
* @param sequence that is assigned to event.
* @param arg0 The first user specified argument to the translator
*/
void translateTo(final T event, long sequence, final A arg0);
void translateTo(T event, long sequence, A arg0);
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ public interface EventTranslatorThreeArg<T, A, B, C>
* @param arg1 The second user specified argument to the translator
* @param arg2 The third user specified argument to the translator
*/
void translateTo(final T event, long sequence, final A arg0, final B arg1, final C arg2);
void translateTo(T event, long sequence, A arg0, B arg1, C arg2);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ public interface EventTranslatorTwoArg<T, A, B>
* @param arg0 The first user specified argument to the translator
* @param arg1 The second user specified argument to the translator
*/
void translateTo(final T event, long sequence, final A arg0, final B arg1);
void translateTo(T event, long sequence, A arg0, B arg1);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ public interface EventTranslatorVararg<T>
* @param sequence that is assigned to event.
* @param args The array of user arguments.
*/
void translateTo(final T event, long sequence, final Object... args);
void translateTo(T event, long sequence, Object... args);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class ProcessingSequenceBarrier implements SequenceBarrier
private final Sequence cursorSequence;
private final Sequencer sequencer;

public ProcessingSequenceBarrier(
ProcessingSequenceBarrier(
final Sequencer sequencer,
final WaitStrategy waitStrategy,
final Sequence cursorSequence,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ public interface SequenceReportingEventHandler<T>
*
* @param sequenceCallback callback on which to notify the {@link BatchEventProcessor} that the sequence has progressed.
*/
void setSequenceCallback(final Sequence sequenceCallback);
void setSequenceCallback(Sequence sequenceCallback);
}
2 changes: 1 addition & 1 deletion src/main/java/com/lmax/disruptor/Sequenced.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface Sequenced
* @param requiredCapacity in the buffer
* @return true if the buffer has the capacity to allocate the next sequence otherwise false.
*/
boolean hasAvailableCapacity(final int requiredCapacity);
boolean hasAvailableCapacity(int requiredCapacity);

/**
* Get the remaining capacity for this sequencer.
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/lmax/disruptor/SingleProducerSequencer.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@ abstract class SingleProducerSequencerPad extends AbstractSequencer
{
protected long p1, p2, p3, p4, p5, p6, p7;

public SingleProducerSequencerPad(int bufferSize, WaitStrategy waitStrategy)
SingleProducerSequencerPad(int bufferSize, WaitStrategy waitStrategy)
{
super(bufferSize, waitStrategy);
}
}

abstract class SingleProducerSequencerFields extends SingleProducerSequencerPad
{
public SingleProducerSequencerFields(int bufferSize, WaitStrategy waitStrategy)
SingleProducerSequencerFields(int bufferSize, WaitStrategy waitStrategy)
{
super(bufferSize, waitStrategy);
}

/**
* Set to -1 as sequence starting point
*/
protected long nextValue = Sequence.INITIAL_VALUE;
protected long cachedValue = Sequence.INITIAL_VALUE;
long nextValue = Sequence.INITIAL_VALUE;
long cachedValue = Sequence.INITIAL_VALUE;
}

/**
Expand All @@ -61,7 +61,7 @@ public final class SingleProducerSequencer extends SingleProducerSequencerFields
* @param bufferSize the size of the buffer that this will sequence over.
* @param waitStrategy for those waiting on sequences.
*/
public SingleProducerSequencer(int bufferSize, final WaitStrategy waitStrategy)
public SingleProducerSequencer(int bufferSize, WaitStrategy waitStrategy)
{
super(bufferSize, waitStrategy);
}
Expand All @@ -70,7 +70,7 @@ public SingleProducerSequencer(int bufferSize, final WaitStrategy waitStrategy)
* @see Sequencer#hasAvailableCapacity(int)
*/
@Override
public boolean hasAvailableCapacity(final int requiredCapacity)
public boolean hasAvailableCapacity(int requiredCapacity)
{
return hasAvailableCapacity(requiredCapacity, false);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/lmax/disruptor/dsl/WorkerPoolInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class WorkerPoolInfo<T> implements ConsumerInfo
private final SequenceBarrier sequenceBarrier;
private boolean endOfChain = true;

public WorkerPoolInfo(final WorkerPool<T> workerPool, final SequenceBarrier sequenceBarrier)
WorkerPoolInfo(final WorkerPool<T> workerPool, final SequenceBarrier sequenceBarrier)
{
this.workerPool = workerPool;
this.sequenceBarrier = sequenceBarrier;
Expand All @@ -35,7 +35,7 @@ public boolean isEndOfChain()
}

@Override
public void start(final Executor executor)
public void start(Executor executor)
{
workerPool.start(executor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private static class QueuePinger implements Runnable
private long counter;
private final long maxEvents;

public QueuePinger(
QueuePinger(
final BlockingQueue<Long> pingQueue, final BlockingQueue<Long> pongQueue, final long maxEvents,
final long pauseTimeNs)
{
Expand Down Expand Up @@ -188,7 +188,7 @@ private static class QueuePonger implements Runnable
private final BlockingQueue<Long> pongQueue;
private CyclicBarrier barrier;

public QueuePonger(final BlockingQueue<Long> pingQueue, final BlockingQueue<Long> pongQueue)
QueuePonger(final BlockingQueue<Long> pingQueue, final BlockingQueue<Long> pongQueue)
{
this.pingQueue = pingQueue;
this.pongQueue = pongQueue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private static class MyRunnable implements Runnable
Sequence sequence = new Sequence(-1);
private final SequenceBarrier barrier;

public MyRunnable(Sequencer sequencer)
MyRunnable(Sequencer sequencer)
{
this.barrier = sequencer.newBarrier();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private static class MyRunnable implements Runnable
Sequence sequence = new Sequence(-1);
private final SequenceBarrier barrier;

public MyRunnable(Sequencer sequencer)
MyRunnable(Sequencer sequencer)
{
this.barrier = sequencer.newBarrier();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private static class PollRunnable implements Runnable, EventPoller.Handler<Value
private CountDownLatch latch;
private long count;

public PollRunnable(EventPoller<ValueEvent> poller)
PollRunnable(EventPoller<ValueEvent> poller)
{
this.poller = poller;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private static class Pinger implements EventHandler<ValueEvent>, LifecycleAware
private Histogram histogram;
private long t0;

public Pinger(final RingBuffer<ValueEvent> buffer, final long maxEvents, final long pauseTimeNs)
Pinger(final RingBuffer<ValueEvent> buffer, final long maxEvents, final long pauseTimeNs)
{
this.buffer = buffer;
this.maxEvents = maxEvents;
Expand Down Expand Up @@ -228,7 +228,7 @@ private static class Ponger implements EventHandler<ValueEvent>, LifecycleAware

private CyclicBarrier barrier;

public Ponger(final RingBuffer<ValueEvent> buffer)
Ponger(final RingBuffer<ValueEvent> buffer)
{
this.buffer = buffer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ public long op(final long lhs, final long rhs)
}
};

public abstract long op(final long lhs, final long rhs);
public abstract long op(long lhs, long rhs);
}
4 changes: 2 additions & 2 deletions src/test/java/com/lmax/disruptor/BatchEventProcessorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private static class LatchEventHandler implements EventHandler<StubEvent>
{
private final CountDownLatch latch;

public LatchEventHandler(CountDownLatch latch)
LatchEventHandler(CountDownLatch latch)
{
this.latch = latch;
}
Expand All @@ -108,7 +108,7 @@ private static class LatchExceptionHandler implements ExceptionHandler<StubEvent
{
private final CountDownLatch latch;

public LatchExceptionHandler(CountDownLatch latch)
LatchExceptionHandler(CountDownLatch latch)
{
this.latch = latch;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/lmax/disruptor/BatchingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private static class ParallelEventHandler implements EventHandler<LongEvent>
private long tempValue;
private volatile long processed;

public ParallelEventHandler(long mask, long ordinal)
ParallelEventHandler(long mask, long ordinal)
{
this.mask = mask;
this.ordinal = ordinal;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/lmax/disruptor/DisruptorStressTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private static class TestEventHandler implements EventHandler<TestEvent>
public int failureCount = 0;
public int messagesSeen = 0;

public TestEventHandler()
TestEventHandler()
{
}

Expand Down Expand Up @@ -126,7 +126,7 @@ private static class Publisher implements Runnable

public boolean failed = false;

public Publisher(
Publisher(
RingBuffer<TestEvent> ringBuffer,
int iterations,
CyclicBarrier barrier,
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/lmax/disruptor/RingBufferTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ private static final class TestEventProcessor implements EventProcessor
private final AtomicBoolean running = new AtomicBoolean();


public TestEventProcessor(final SequenceBarrier sequenceBarrier)
TestEventProcessor(final SequenceBarrier sequenceBarrier)
{
this.sequenceBarrier = sequenceBarrier;
}
Expand Down Expand Up @@ -1354,7 +1354,7 @@ private static class ArrayFactory implements EventFactory<Object[]>
{
private final int size;

public ArrayFactory(int size)
ArrayFactory(int size)
{
this.size = size;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private static class ByteArrayTranslator implements EventTranslator<byte[]>

private final byte[] bytes;

public ByteArrayTranslator(byte[] bytes)
ByteArrayTranslator(byte[] bytes)
{
this.bytes = bytes;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/lmax/disruptor/WorkerStressTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private static class Publisher implements Runnable

public boolean failed = false;

public Publisher(
Publisher(
RingBuffer<TestEvent> ringBuffer,
int iterations,
CyclicBarrier barrier,
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/lmax/disruptor/example/Pipeliner.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private static class ParallelHandler implements EventHandler<PipelinerEvent>
private final int ordinal;
private final int totalHandlers;

public ParallelHandler(int ordinal, int totalHandlers)
ParallelHandler(int ordinal, int totalHandlers)
{
this.ordinal = ordinal;
this.totalHandlers = totalHandlers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class BatchedPoller<T>
private final int maxBatchSize;
private final BatchedData<T> polledData;

public BatchedPoller(RingBuffer<BatchedPoller.DataEvent<T>> ringBuffer, int batchSize)
BatchedPoller(RingBuffer<BatchedPoller.DataEvent<T>> ringBuffer, int batchSize)
{
this.poller = ringBuffer.newPoller();
ringBuffer.addGatingSequences(poller.getSequence());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private static class Handler implements EventHandler<LongEvent>, LifecycleAware
{
private final CountDownLatch latch;

public Handler(CountDownLatch latch)
Handler(CountDownLatch latch)
{
this.latch = latch;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SequenceUpdater implements Runnable
private final long sleepTime;
private WaitStrategy waitStrategy;

public SequenceUpdater(long sleepTime, WaitStrategy waitStrategy)
SequenceUpdater(long sleepTime, WaitStrategy waitStrategy)
{
this.sleepTime = sleepTime;
this.waitStrategy = waitStrategy;
Expand Down

0 comments on commit 22b3cf6

Please sign in to comment.