diff --git a/build.gradle b/build.gradle
index 4bae452b3..3395a21b2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -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 ]
}
@@ -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) } }
@@ -178,7 +175,7 @@ task perfJar(type: Jar) {
}
task wrapper(type: Wrapper) {
- gradleVersion = '2.8'
+ gradleVersion = '4.2'
}
class Version {
diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index c9f26eb17..9d26ee31b 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -117,8 +117,6 @@
-
-
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index f23816889..aed214c18 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index b672092ce..43645467e 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -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
diff --git a/src/main/java/com/lmax/disruptor/BatchStartAware.java b/src/main/java/com/lmax/disruptor/BatchStartAware.java
index 5c447e8bc..bc3c2806a 100644
--- a/src/main/java/com/lmax/disruptor/BatchStartAware.java
+++ b/src/main/java/com/lmax/disruptor/BatchStartAware.java
@@ -2,5 +2,5 @@
public interface BatchStartAware
{
- void onBatchStart(final long batchSize);
+ void onBatchStart(long batchSize);
}
diff --git a/src/main/java/com/lmax/disruptor/EventTranslator.java b/src/main/java/com/lmax/disruptor/EventTranslator.java
index 07ca169fc..ecad6f9a9 100644
--- a/src/main/java/com/lmax/disruptor/EventTranslator.java
+++ b/src/main/java/com/lmax/disruptor/EventTranslator.java
@@ -32,5 +32,5 @@ public interface EventTranslator
* @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);
}
diff --git a/src/main/java/com/lmax/disruptor/EventTranslatorOneArg.java b/src/main/java/com/lmax/disruptor/EventTranslatorOneArg.java
index aa5c493db..0bec6b769 100644
--- a/src/main/java/com/lmax/disruptor/EventTranslatorOneArg.java
+++ b/src/main/java/com/lmax/disruptor/EventTranslatorOneArg.java
@@ -30,5 +30,5 @@ public interface EventTranslatorOneArg
* @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);
}
diff --git a/src/main/java/com/lmax/disruptor/EventTranslatorThreeArg.java b/src/main/java/com/lmax/disruptor/EventTranslatorThreeArg.java
index bc7848732..bdc01bea8 100644
--- a/src/main/java/com/lmax/disruptor/EventTranslatorThreeArg.java
+++ b/src/main/java/com/lmax/disruptor/EventTranslatorThreeArg.java
@@ -32,5 +32,5 @@ public interface EventTranslatorThreeArg
* @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);
}
diff --git a/src/main/java/com/lmax/disruptor/EventTranslatorTwoArg.java b/src/main/java/com/lmax/disruptor/EventTranslatorTwoArg.java
index 122fb039f..0d2e8782a 100644
--- a/src/main/java/com/lmax/disruptor/EventTranslatorTwoArg.java
+++ b/src/main/java/com/lmax/disruptor/EventTranslatorTwoArg.java
@@ -31,5 +31,5 @@ public interface EventTranslatorTwoArg
* @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);
}
diff --git a/src/main/java/com/lmax/disruptor/EventTranslatorVararg.java b/src/main/java/com/lmax/disruptor/EventTranslatorVararg.java
index 879ca9ebf..11414ea88 100644
--- a/src/main/java/com/lmax/disruptor/EventTranslatorVararg.java
+++ b/src/main/java/com/lmax/disruptor/EventTranslatorVararg.java
@@ -30,5 +30,5 @@ public interface EventTranslatorVararg
* @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);
}
diff --git a/src/main/java/com/lmax/disruptor/ProcessingSequenceBarrier.java b/src/main/java/com/lmax/disruptor/ProcessingSequenceBarrier.java
index cee725f8f..14d270be1 100644
--- a/src/main/java/com/lmax/disruptor/ProcessingSequenceBarrier.java
+++ b/src/main/java/com/lmax/disruptor/ProcessingSequenceBarrier.java
@@ -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,
diff --git a/src/main/java/com/lmax/disruptor/SequenceReportingEventHandler.java b/src/main/java/com/lmax/disruptor/SequenceReportingEventHandler.java
index d668fcc1e..a16296120 100644
--- a/src/main/java/com/lmax/disruptor/SequenceReportingEventHandler.java
+++ b/src/main/java/com/lmax/disruptor/SequenceReportingEventHandler.java
@@ -33,5 +33,5 @@ public interface SequenceReportingEventHandler
*
* @param sequenceCallback callback on which to notify the {@link BatchEventProcessor} that the sequence has progressed.
*/
- void setSequenceCallback(final Sequence sequenceCallback);
+ void setSequenceCallback(Sequence sequenceCallback);
}
diff --git a/src/main/java/com/lmax/disruptor/Sequenced.java b/src/main/java/com/lmax/disruptor/Sequenced.java
index b6d808bd2..3c8ba6946 100644
--- a/src/main/java/com/lmax/disruptor/Sequenced.java
+++ b/src/main/java/com/lmax/disruptor/Sequenced.java
@@ -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.
diff --git a/src/main/java/com/lmax/disruptor/SingleProducerSequencer.java b/src/main/java/com/lmax/disruptor/SingleProducerSequencer.java
index 6f2063ab6..fcf6ce252 100644
--- a/src/main/java/com/lmax/disruptor/SingleProducerSequencer.java
+++ b/src/main/java/com/lmax/disruptor/SingleProducerSequencer.java
@@ -23,7 +23,7 @@ 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);
}
@@ -31,7 +31,7 @@ public SingleProducerSequencerPad(int bufferSize, WaitStrategy waitStrategy)
abstract class SingleProducerSequencerFields extends SingleProducerSequencerPad
{
- public SingleProducerSequencerFields(int bufferSize, WaitStrategy waitStrategy)
+ SingleProducerSequencerFields(int bufferSize, WaitStrategy waitStrategy)
{
super(bufferSize, waitStrategy);
}
@@ -39,8 +39,8 @@ public SingleProducerSequencerFields(int bufferSize, WaitStrategy 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;
}
/**
@@ -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);
}
@@ -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);
}
diff --git a/src/main/java/com/lmax/disruptor/dsl/WorkerPoolInfo.java b/src/main/java/com/lmax/disruptor/dsl/WorkerPoolInfo.java
index b37e63674..f92eda10d 100644
--- a/src/main/java/com/lmax/disruptor/dsl/WorkerPoolInfo.java
+++ b/src/main/java/com/lmax/disruptor/dsl/WorkerPoolInfo.java
@@ -10,7 +10,7 @@ class WorkerPoolInfo implements ConsumerInfo
private final SequenceBarrier sequenceBarrier;
private boolean endOfChain = true;
- public WorkerPoolInfo(final WorkerPool workerPool, final SequenceBarrier sequenceBarrier)
+ WorkerPoolInfo(final WorkerPool workerPool, final SequenceBarrier sequenceBarrier)
{
this.workerPool = workerPool;
this.sequenceBarrier = sequenceBarrier;
@@ -35,7 +35,7 @@ public boolean isEndOfChain()
}
@Override
- public void start(final Executor executor)
+ public void start(Executor executor)
{
workerPool.start(executor);
}
diff --git a/src/perftest/java/com/lmax/disruptor/queue/PingPongQueueLatencyTest.java b/src/perftest/java/com/lmax/disruptor/queue/PingPongQueueLatencyTest.java
index 20b422b55..ff2dab8c8 100644
--- a/src/perftest/java/com/lmax/disruptor/queue/PingPongQueueLatencyTest.java
+++ b/src/perftest/java/com/lmax/disruptor/queue/PingPongQueueLatencyTest.java
@@ -127,7 +127,7 @@ private static class QueuePinger implements Runnable
private long counter;
private final long maxEvents;
- public QueuePinger(
+ QueuePinger(
final BlockingQueue pingQueue, final BlockingQueue pongQueue, final long maxEvents,
final long pauseTimeNs)
{
@@ -188,7 +188,7 @@ private static class QueuePonger implements Runnable
private final BlockingQueue pongQueue;
private CyclicBarrier barrier;
- public QueuePonger(final BlockingQueue pingQueue, final BlockingQueue pongQueue)
+ QueuePonger(final BlockingQueue pingQueue, final BlockingQueue pongQueue)
{
this.pingQueue = pingQueue;
this.pongQueue = pongQueue;
diff --git a/src/perftest/java/com/lmax/disruptor/raw/OneToOneRawBatchThroughputTest.java b/src/perftest/java/com/lmax/disruptor/raw/OneToOneRawBatchThroughputTest.java
index 736034e31..030678472 100644
--- a/src/perftest/java/com/lmax/disruptor/raw/OneToOneRawBatchThroughputTest.java
+++ b/src/perftest/java/com/lmax/disruptor/raw/OneToOneRawBatchThroughputTest.java
@@ -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();
}
diff --git a/src/perftest/java/com/lmax/disruptor/raw/OneToOneRawThroughputTest.java b/src/perftest/java/com/lmax/disruptor/raw/OneToOneRawThroughputTest.java
index 1a600d622..af8e1eb9b 100644
--- a/src/perftest/java/com/lmax/disruptor/raw/OneToOneRawThroughputTest.java
+++ b/src/perftest/java/com/lmax/disruptor/raw/OneToOneRawThroughputTest.java
@@ -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();
}
diff --git a/src/perftest/java/com/lmax/disruptor/sequenced/OneToOneSequencedPollerThroughputTest.java b/src/perftest/java/com/lmax/disruptor/sequenced/OneToOneSequencedPollerThroughputTest.java
index 062dbd919..6f43484cf 100644
--- a/src/perftest/java/com/lmax/disruptor/sequenced/OneToOneSequencedPollerThroughputTest.java
+++ b/src/perftest/java/com/lmax/disruptor/sequenced/OneToOneSequencedPollerThroughputTest.java
@@ -96,7 +96,7 @@ private static class PollRunnable implements Runnable, EventPoller.Handler poller)
+ PollRunnable(EventPoller poller)
{
this.poller = poller;
}
diff --git a/src/perftest/java/com/lmax/disruptor/sequenced/PingPongSequencedLatencyTest.java b/src/perftest/java/com/lmax/disruptor/sequenced/PingPongSequencedLatencyTest.java
index 03e227505..6cb598f76 100644
--- a/src/perftest/java/com/lmax/disruptor/sequenced/PingPongSequencedLatencyTest.java
+++ b/src/perftest/java/com/lmax/disruptor/sequenced/PingPongSequencedLatencyTest.java
@@ -152,7 +152,7 @@ private static class Pinger implements EventHandler, LifecycleAware
private Histogram histogram;
private long t0;
- public Pinger(final RingBuffer buffer, final long maxEvents, final long pauseTimeNs)
+ Pinger(final RingBuffer buffer, final long maxEvents, final long pauseTimeNs)
{
this.buffer = buffer;
this.maxEvents = maxEvents;
@@ -228,7 +228,7 @@ private static class Ponger implements EventHandler, LifecycleAware
private CyclicBarrier barrier;
- public Ponger(final RingBuffer buffer)
+ Ponger(final RingBuffer buffer)
{
this.buffer = buffer;
}
diff --git a/src/perftest/java/com/lmax/disruptor/support/Operation.java b/src/perftest/java/com/lmax/disruptor/support/Operation.java
index 5f1cec249..5a9da997c 100644
--- a/src/perftest/java/com/lmax/disruptor/support/Operation.java
+++ b/src/perftest/java/com/lmax/disruptor/support/Operation.java
@@ -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);
}
diff --git a/src/test/java/com/lmax/disruptor/BatchEventProcessorTest.java b/src/test/java/com/lmax/disruptor/BatchEventProcessorTest.java
index ee2bee021..b7bdb495f 100644
--- a/src/test/java/com/lmax/disruptor/BatchEventProcessorTest.java
+++ b/src/test/java/com/lmax/disruptor/BatchEventProcessorTest.java
@@ -92,7 +92,7 @@ private static class LatchEventHandler implements EventHandler
{
private final CountDownLatch latch;
- public LatchEventHandler(CountDownLatch latch)
+ LatchEventHandler(CountDownLatch latch)
{
this.latch = latch;
}
@@ -108,7 +108,7 @@ private static class LatchExceptionHandler implements ExceptionHandler
private long tempValue;
private volatile long processed;
- public ParallelEventHandler(long mask, long ordinal)
+ ParallelEventHandler(long mask, long ordinal)
{
this.mask = mask;
this.ordinal = ordinal;
diff --git a/src/test/java/com/lmax/disruptor/DisruptorStressTest.java b/src/test/java/com/lmax/disruptor/DisruptorStressTest.java
index a066b3c53..cf8f27371 100644
--- a/src/test/java/com/lmax/disruptor/DisruptorStressTest.java
+++ b/src/test/java/com/lmax/disruptor/DisruptorStressTest.java
@@ -98,7 +98,7 @@ private static class TestEventHandler implements EventHandler
public int failureCount = 0;
public int messagesSeen = 0;
- public TestEventHandler()
+ TestEventHandler()
{
}
@@ -126,7 +126,7 @@ private static class Publisher implements Runnable
public boolean failed = false;
- public Publisher(
+ Publisher(
RingBuffer ringBuffer,
int iterations,
CyclicBarrier barrier,
diff --git a/src/test/java/com/lmax/disruptor/RingBufferTest.java b/src/test/java/com/lmax/disruptor/RingBufferTest.java
index 170fd34af..e25c05c75 100644
--- a/src/test/java/com/lmax/disruptor/RingBufferTest.java
+++ b/src/test/java/com/lmax/disruptor/RingBufferTest.java
@@ -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;
}
@@ -1354,7 +1354,7 @@ private static class ArrayFactory implements EventFactory