Skip to content

Commit

Permalink
Replace "throws Exception" with the specific Exception(s) thrown.
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-lawrey committed Jun 28, 2015
1 parent 628d3ae commit bad7466
Show file tree
Hide file tree
Showing 38 changed files with 122 additions and 123 deletions.
4 changes: 2 additions & 2 deletions chronicle-demo/pom.xml
Expand Up @@ -46,12 +46,12 @@
<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle</artifactId>
<version>3.4.3-SNAPSHOT</version>
<version>3.4.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.openhft</groupId>
<artifactId>affinity</artifactId>
<version>2.3-SNAPSHOT</version>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Expand Up @@ -19,7 +19,7 @@

public class OffHeapDirectInstance extends OffHeapHelper {
/*
public static void main(String[] ignored) throws Exception {
public static void main(String[] ignored) {
final int items = 100;
final String path = System.getProperty("java.io.tmpdir") + "/direct-instance";
final Event event = newDirectInstance(Event.class);
Expand Down
Expand Up @@ -25,7 +25,7 @@

public class OffHeapDirectReference extends OffHeapHelper {

public static void main(String[] ignored) throws Exception {
public static void main(String[] ignored) {
final int items = 100;
final String path = System.getProperty("java.io.tmpdir") + "/direct-instance";
final Event event = newDirectReference(Event.class);
Expand Down
Expand Up @@ -30,7 +30,7 @@

public class OffHeapHelper {

protected static void process(Chronicle chronicle, int items) throws Exception {
protected static void process(Chronicle chronicle, int items) {
final int readers = items / 10;
ExecutorService ex = Executors.newFixedThreadPool(readers * 2);
for (int i = 0; i < readers * 2; i++) {
Expand Down
3 changes: 1 addition & 2 deletions chronicle-queue/pom.xml
Expand Up @@ -48,7 +48,7 @@
<groupId>net.openhft</groupId>
<artifactId>chronicle-bom</artifactId>
<type>pom</type>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.3</version>
<scope>import</scope>
</dependency>

Expand All @@ -70,7 +70,6 @@
<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle-values</artifactId>
<version>1.0.1-alpha-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down
Expand Up @@ -49,9 +49,9 @@ public Indexer(@NotNull final SingleChronicleQueue chronicle) {
/**
* Scans through every excerpts and records every 64th address in the index2index'
*
* @throws Exception
* @
*/
public synchronized void index() throws Exception {
public synchronized void index() {
final ExcerptTailer tailer = chronicle.createTailer();

for (long i = 0; i <= chronicle.lastIndex(); i++) {
Expand Down
Expand Up @@ -65,7 +65,7 @@ public void after() {
}

@Test
public void testWriteAndRead3SingleThreadedWrite() throws Exception {
public void testWriteAndRead3SingleThreadedWrite() {
try (NativeBytesStore<Void> nativeStore = NativeBytesStore.nativeStoreWithFixedCapacity(24)) {
final BytesRingBuffer bytesRingBuffer = new BytesRingBuffer(nativeStore.bytes());

Expand All @@ -87,7 +87,7 @@ private Bytes<ByteBuffer> data() {
}

@Test
public void testSimpledSingleThreadedWriteRead() throws Exception {
public void testSimpledSingleThreadedWriteRead() {

try (NativeBytesStore<Void> nativeStore = NativeBytesStore.nativeStoreWithFixedCapacity(150)) {
final BytesRingBuffer bytesRingBuffer = new BytesRingBuffer(nativeStore.bytes());
Expand All @@ -99,7 +99,7 @@ public void testSimpledSingleThreadedWriteRead() throws Exception {
}

@Test
public void testPollWithNoData() throws Exception {
public void testPollWithNoData() {
try (NativeBytesStore<Void> nativeStore = NativeBytesStore.nativeStoreWithFixedCapacity(150)) {
assert nativeStore.isNative();

Expand All @@ -112,7 +112,7 @@ public void testPollWithNoData() throws Exception {
}

@Test
public void testWriteAndRead() throws Exception {
public void testWriteAndRead() {
try (NativeBytesStore<Void> nativeStore = NativeBytesStore.nativeStoreWithFixedCapacity(150)) {
assert nativeStore.isNative();
final BytesRingBuffer bytesRingBuffer = new BytesRingBuffer(nativeStore.bytes());
Expand All @@ -124,7 +124,7 @@ public void testWriteAndRead() throws Exception {
}

@Test
public void testFlowAroundSingleThreadedWriteDifferentSizeBuffers() throws Exception {
public void testFlowAroundSingleThreadedWriteDifferentSizeBuffers() {
try (NativeBytesStore<Void> nativeStore = NativeBytesStore.nativeStoreWithFixedCapacity(150)) {
System.out.println(nativeStore.realCapacity());
System.out.println(nativeStore.capacity());
Expand All @@ -147,7 +147,7 @@ public void testFlowAroundSingleThreadedWriteDifferentSizeBuffers() throws Excep
}

@Test
public void testWrite3read3SingleThreadedWrite() throws Exception {
public void testWrite3read3SingleThreadedWrite() {
try (NativeBytesStore<Void> nativeStore = NativeBytesStore.nativeStoreWithFixedCapacity(150)) {
final BytesRingBuffer bytesRingBuffer = new BytesRingBuffer(nativeStore.bytes());

Expand Down Expand Up @@ -252,7 +252,7 @@ public void testMultiThreadedCheckAllEntriesReturnedAreValidText() throws Interr
// a" +
// " synchronized to ringbuffer.poll() and ringbuffer.offer()")
@Test
public void testMultiThreadedWithIntValues() throws Exception {
public void testMultiThreadedWithIntValues() {

try (NativeBytesStore allocate = NativeBytesStore.nativeStoreWithFixedCapacity(1000)) {
final BytesRingBuffer bytesRingBuffer = new BytesRingBuffer(allocate.bytes());
Expand Down
Expand Up @@ -38,7 +38,7 @@ public class ChronicleQueueTest {

@Ignore("ignored only because this is a performance test")
@Test
public void testCreateAppender() throws Exception {
public void testCreateAppender() {
for (int r = 0; r < 2; r++) {
for (int t = 1; t <= Runtime.getRuntime().availableProcessors(); t++) {
List<Future<?>> futureList = new ArrayList<>();
Expand Down
Expand Up @@ -54,7 +54,7 @@ public class DirectChronicleQueueStringTest {
public static final String TMP = new File("/tmp").isDirectory() ? "/tmp" : System.getProperty("java.io.tmpdir");

@Test
public void testCreateAppender() throws Exception {
public void testCreateAppender() {
for (int r = 0; r < 2; r++) {
long start = System.nanoTime();

Expand Down Expand Up @@ -102,7 +102,7 @@ private void readSome(DirectChronicleQueue chronicle) {
}

@Test
public void testCreateAppenderMT() throws Exception {
public void testCreateAppenderMT() {
for (int r = 0; r < 2; r++) {
for (int t = 1; t < Runtime.getRuntime().availableProcessors(); t++) {
List<Future<?>> futureList = new ArrayList<>();
Expand Down
Expand Up @@ -35,10 +35,10 @@ public class MappingReferenceCountTest {
/**
* tests that blocks are acquired and released as needed
*
* @throws Exception
* @
*/
@Test
public void testMappingReferenceCount() throws Exception {
public void testMappingReferenceCount() {

File tempFile = File.createTempFile("chronicle", "q");

Expand Down
Expand Up @@ -25,13 +25,13 @@
public class IndexOffsetTest {

@Test
public void testFindExcerpt2() throws Exception {
public void testFindExcerpt2() {

Assert.assertEquals(1 * 8, IndexOffset.toAddress0(1L << (17L + 6L)));
}

@Test
public void testFindExcerpt() throws Exception {
public void testFindExcerpt() {

Assert.assertEquals(1 * 8, IndexOffset.toAddress1(64));
Assert.assertEquals(1 * 8, IndexOffset.toAddress1(65));
Expand Down
Expand Up @@ -74,7 +74,7 @@ protected DirectChronicleQueue createQueue(File file) throws IOException {
// *************************************************************************

@Test
public void testSingleWire() throws Exception {
public void testSingleWire() {
final File file = createTempFile("testSingleWire");

try {
Expand All @@ -99,7 +99,7 @@ public void testSingleWire() throws Exception {
}

@Test
public void testSingleDirect() throws Exception {
public void testSingleDirect() {
final File file = createTempFile("testSingleDirect");

try {
Expand Down Expand Up @@ -127,7 +127,7 @@ public void testSingleDirect() throws Exception {
}

@Test
public void testLastWrittenIndexPerAppender() throws Exception {
public void testLastWrittenIndexPerAppender() {
final File file = createTempFile("testLastWrittenIndexPerAppender");
try {

Expand All @@ -142,7 +142,7 @@ public void testLastWrittenIndexPerAppender() throws Exception {
}

@Test(expected = IllegalStateException.class)
public void testLastWrittenIndexPerAppenderNoData() throws Exception {
public void testLastWrittenIndexPerAppenderNoData() {
final File file = createTempFile("testLastWrittenIndexPerAppenderNoData");
try {
final ChronicleQueue chronicle = createQueue(file);
Expand All @@ -154,7 +154,7 @@ public void testLastWrittenIndexPerAppenderNoData() throws Exception {
}

@Test
public void testLastIndexPerChronicle() throws Exception {
public void testLastIndexPerChronicle() {
final File file = createTempFile("testLastIndexPerChronicle");
try {
final DirectChronicleQueue chronicle = createQueue(file);
Expand All @@ -168,7 +168,7 @@ public void testLastIndexPerChronicle() throws Exception {
}

@Test(expected = IllegalStateException.class)
public void testLastIndexPerChronicleNoData() throws Exception {
public void testLastIndexPerChronicleNoData() {
final File file = createTempFile("testLastIndexPerChronicleNoData");
try {
final DirectChronicleQueue chronicle = createQueue(file);
Expand All @@ -180,7 +180,7 @@ public void testLastIndexPerChronicleNoData() throws Exception {
}

@Test
public void testReadAtIndexSingle() throws Exception {
public void testReadAtIndexSingle() {
final File file = createTempFile("testReadAtIndexSingle");
try {
final DirectChronicleQueue chronicle = createQueue(file);
Expand All @@ -205,7 +205,7 @@ public void testReadAtIndexSingle() throws Exception {
}

@Test
public void testReadAtIndex() throws Exception {
public void testReadAtIndex() {
final File file = createTempFile("testReadAtIndex");
try {
final DirectChronicleQueue chronicle = createQueue(file);
Expand Down Expand Up @@ -233,7 +233,7 @@ public void testReadAtIndex() throws Exception {
}

@Test
public void testReadAtIndexWithIndexes() throws Exception {
public void testReadAtIndexWithIndexes() {
final File file = createTempFile("testReadAtIndexWithIndexes");
try {
final SingleChronicleQueue chronicle = (SingleChronicleQueue)createQueue(file);
Expand Down Expand Up @@ -261,7 +261,7 @@ public void testReadAtIndexWithIndexes() throws Exception {
}

@Test
public void testReadAtIndexWithIndexesAtStart() throws Exception {
public void testReadAtIndexWithIndexesAtStart() {
final File file = createTempFile("testReadAtIndexWithIndexesAtStart");
try {
final SingleChronicleQueue chronicle = (SingleChronicleQueue)createQueue(file);
Expand Down Expand Up @@ -289,7 +289,7 @@ public void testReadAtIndexWithIndexesAtStart() throws Exception {
}

@Test
public void testScanFromLastKnownIndex() throws Exception {
public void testScanFromLastKnownIndex() {
final File file = createTempFile("testScanFromLastKnownIndex");
try {
final SingleChronicleQueue chronicle = (SingleChronicleQueue)createQueue(file);
Expand Down
Expand Up @@ -35,7 +35,7 @@
public class ZipBytesRingBufferTest {

@Test
public void testZipAndAppend() throws Exception {
public void testZipAndAppend() {
File file = null;

try {
Expand Down Expand Up @@ -82,14 +82,14 @@ public void testZipAndAppend() throws Exception {

}

public static Header getHeader(SingleChronicleQueue singleChronicleQueue) throws Exception {
public static Header getHeader(SingleChronicleQueue singleChronicleQueue) {
Field header = singleChronicleQueue.getClass().getDeclaredField("header");
header.setAccessible(true);

return (Header) header.get(singleChronicleQueue);
}

public static long lastWrite(SingleChronicleQueue chronicle) throws Exception {
public static long lastWrite(SingleChronicleQueue chronicle) {
return getHeader(chronicle).writeByte().getVolatileValue();
}
}
2 changes: 1 addition & 1 deletion chronicle/pom.xml
Expand Up @@ -44,7 +44,7 @@
<dependency>
<groupId>net.openhft</groupId>
<artifactId>lang</artifactId>
<version>6.6.7</version>
<version>6.6.10-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.openhft</groupId>
Expand Down
Expand Up @@ -26,13 +26,13 @@
public class ChronicleTestRunListener extends RunListener {
private static final Logger LOGGER = LoggerFactory.getLogger("HFT");

public void testStarted(Description description) throws Exception {
public void testStarted(Description description) {
if(Boolean.getBoolean("hft.test.printTestStarted")) {
LOGGER.info("TestStarted >> {}::{}", description.getClassName(), description.getMethodName());
}
}

public void testFinished(Description description) throws Exception {
public void testFinished(Description description) {
if(Boolean.getBoolean("hft.test.printTestFinished")) {
LOGGER.info("TestFinished << {}::{}", description.getClassName(), description.getMethodName());
}
Expand Down
Expand Up @@ -229,7 +229,7 @@ public void testTimeTenMillion() throws IOException {
* @author AndrasMilassin
*/
@Test
public void testBoolean() throws Exception {
public void testBoolean() {
final String basePath = getTestPath();
final Chronicle chronicle = ChronicleQueueBuilder.indexed(basePath).build();

Expand Down
Expand Up @@ -55,7 +55,7 @@ private static void close(ExcerptCommon excerpt) {
}

@Test
public void testLargeFile() throws Exception {
public void testLargeFile() {
Assume.assumeTrue(Jvm.is64Bit());

String basePath = getTestPath();
Expand Down
2 changes: 1 addition & 1 deletion chronicle/src/test/java/net/openhft/chronicle/Jira57.java
Expand Up @@ -58,7 +58,7 @@ public static TickDataTest readTickData(ExcerptTailer tailer) {
return new TickDataTest(timeStamp, price, volume, type);
}

public static void main(String[] args) throws Exception {
public static void main(String[] args) {
String dir = System.getProperty("java.io.tmpdir");
String basePath = dir + "/test123";
ChronicleTools.deleteOnExit(basePath);
Expand Down
Expand Up @@ -84,7 +84,7 @@ public void testMaxSize() throws IOException {

@Ignore
@Test
public void testMaxSizeTail() throws Exception {
public void testMaxSizeTail() {
final File root = tmpdir.newFolder(testName.getMethodName());
root.deleteOnExit();

Expand Down
Expand Up @@ -187,7 +187,7 @@ public void testVanillaFinishAfterClose() throws IOException {
* https://higherfrequencytrading.atlassian.net/browse/CHRON-92
*/
@Test
public void testJira92() throws Exception {
public void testJira92() {
final int RUNS = 10;
final int indicesPerFile = 2;

Expand Down

0 comments on commit bad7466

Please sign in to comment.