ctf: rename CTFReaderException to CTFException
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Mon, 20 Apr 2015 22:30:57 +0000 (18:30 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Tue, 21 Apr 2015 21:31:01 +0000 (17:31 -0400)
CTFIOExceptions are now only thrown by *Readers and not types or other

Change-Id: Id352ef121d3c94b4004e6c5fbe70c282bd131261
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/46134
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
67 files changed:
org.eclipse.tracecompass.ctf.core.tests/perf/org/eclipse/tracecompass/ctf/core/tests/perf/trace/CTFTraceCallsitePerformanceTest.java
org.eclipse.tracecompass.ctf.core.tests/perf/org/eclipse/tracecompass/ctf/core/tests/perf/trace/TraceReadBenchmark.java
org.eclipse.tracecompass.ctf.core.tests/perf/org/eclipse/tracecompass/ctf/core/tests/perf/trace/TraceSeekBenchmark.java
org.eclipse.tracecompass.ctf.core.tests/shared/org/eclipse/tracecompass/ctf/core/tests/shared/CtfTestTrace.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/ctftestsuite/CtfTestSuiteTests.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/event/CTFEventFieldTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/io/BitBufferIntTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/io/BitBufferTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/CTFStreamInputPacketIndexEntryTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/CTFStreamInputPacketIndexTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/CTFStreamInputReaderTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/CTFStreamInputTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/CTFStreamTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/CTFTraceGrowingStreamTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/CTFTraceGrowingTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/CTFTraceReaderTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/CTFTraceTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/IOstructgenTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/MetadataTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/TraceReadAllTracesTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/ArrayDeclaration2Test.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/ArrayDefinition2Test.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/EnumDeclarationTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/EventDeclarationTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/EventHeaderDeclarationTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/FloatDefinitionTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/IntegerDefinitionTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/IntegerEndiannessTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/SequenceDeclaration2Test.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/SequenceDefinition2Test.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/StringDeclarationTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/StringDefinitionTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/StructDeclarationTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/StructDefinitionTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/VariantDeclarationTest.java
org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/VariantDefinitionTest.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/CTFException.java [new file with mode: 0644]
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/CTFReaderException.java [deleted file]
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/IEventDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/io/BitBuffer.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/Declaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/EnumDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/FloatDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/IDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/IntegerDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StringDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StructDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/VariantDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/trace/CTFIOException.java [new file with mode: 0644]
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/trace/CTFStream.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/trace/CTFStreamInput.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/trace/CTFStreamInputPacketReader.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/trace/CTFStreamInputReader.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/trace/CTFTrace.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/trace/CTFTraceReader.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/trace/Metadata.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/trace/Utils.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/EventDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/metadata/exceptions/CtfAntlrException.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/SequenceDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/composite/EventHeaderCompactDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/composite/EventHeaderLargeDeclaration.java
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/trace/StreamInputPacketIndex.java
org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/event/CtfTmfEventFieldTest.java
org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/trace/iterator/CtfIterator.java
org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java

index 5ed9ab47707c39dbf14786be94481680d4576837..bd87f15494f43fa3cb8870c88abb61aa001c2dd6 100644 (file)
@@ -20,7 +20,7 @@ import java.util.TreeSet;
 import org.eclipse.test.performance.Dimension;
 import org.eclipse.test.performance.Performance;
 import org.eclipse.test.performance.PerformanceMeter;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.CTFCallsite;
 import org.eclipse.tracecompass.ctf.core.tests.shared.CtfTestTrace;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
@@ -75,7 +75,7 @@ public class CTFTraceCallsitePerformanceTest {
     /**
      * sets up the test by making a new trace.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             an exception from the reader
      * @throws SecurityException
      *             an exception from accessing files illegally
@@ -83,7 +83,7 @@ public class CTFTraceCallsitePerformanceTest {
      *             an exception for passing bad values
      */
     @Before
-    public void setup() throws CTFReaderException, SecurityException,
+    public void setup() throws CTFException, SecurityException,
             IllegalArgumentException {
         assumeTrue(testTrace.exists());
         fTrace = new CTFTrace(testTrace.getPath());
index e4ac9ab1ed838cb1232af8a2d4bdb48a5ade6748..5fbd027f4d0e3c6c1636d1c64f53ec2a3ef70a54 100644 (file)
@@ -19,7 +19,7 @@ import static org.junit.Assume.assumeTrue;
 import org.eclipse.test.performance.Dimension;
 import org.eclipse.test.performance.Performance;
 import org.eclipse.test.performance.PerformanceMeter;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
 import org.eclipse.tracecompass.ctf.core.tests.shared.CtfTestTrace;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
@@ -78,7 +78,7 @@ public class TraceReadBenchmark {
                         traceReader.advance();
                     }
                 }
-            } catch (CTFReaderException e) {
+            } catch (CTFException e) {
                 /* Should not happen if assumeTrue() passed above */
                 fail("Test failed at iteration " + loop + ':' + e.getMessage());
             }
index 2f869d7e2a22d42d990dbc0e97d55d65c08317ff..4d6c0951df888e29c7983fce7f2c903a46a29110 100644 (file)
@@ -23,7 +23,7 @@ import java.util.Random;
 import org.eclipse.test.performance.Dimension;
 import org.eclipse.test.performance.Performance;
 import org.eclipse.test.performance.PerformanceMeter;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
 import org.eclipse.tracecompass.ctf.core.tests.shared.CtfTestTrace;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
@@ -56,15 +56,15 @@ public class TraceSeekBenchmark {
     /**
      * Run the benchmark scenario for the trace "kernel"
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Should not happen
      */
     @Test
-    public void testKernelTrace() throws CTFReaderException {
+    public void testKernelTrace() throws CTFException {
         readAndSeekTrace(CtfTestTrace.KERNEL, "trace-kernel", true);
     }
 
-    private static void readAndSeekTrace(CtfTestTrace testTrace, String testName, boolean inGlobalSummary) throws CTFReaderException {
+    private static void readAndSeekTrace(CtfTestTrace testTrace, String testName, boolean inGlobalSummary) throws CTFException {
         assumeTrue(testTrace.exists());
 
         Performance perf = Performance.getDefault();
@@ -108,7 +108,7 @@ public class TraceSeekBenchmark {
                 }
                 pm.stop();
 
-            } catch (CTFReaderException e) {
+            } catch (CTFException e) {
                 /* Should not happen if assumeTrue() passed above */
                 fail("Test failed at iteration " + loop + ':' + e.getMessage());
             }
index 3cc60ba2721512f4af887d3ea9dc71da7431cae4..13f6cb3f28840a57eedeefd83df2e2c55a70b44b 100644 (file)
@@ -13,7 +13,7 @@ package org.eclipse.tracecompass.ctf.core.tests.shared;
 
 import java.io.File;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.tests.synthetictraces.LttngKernelTraceGenerator;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
 
@@ -256,10 +256,10 @@ public enum CtfTestTrace {
      * before calling this!
      *
      * @return The CTFTrace object
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If the trace cannot be found.
      */
-    public CTFTrace getTrace() throws CTFReaderException {
+    public CTFTrace getTrace() throws CTFException {
         if (fTrace == null) {
             fTrace = new CTFTrace(fPath);
         }
@@ -271,10 +271,10 @@ public enum CtfTestTrace {
      * before calling this!
      *
      * @return The CTFTrace object
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If the trace cannot be found.
      */
-    public CTFTrace getTraceFromFile() throws CTFReaderException {
+    public CTFTrace getTraceFromFile() throws CTFException {
         if (fTraceFromFile == null) {
             fTraceFromFile = new CTFTrace(new File(fPath));
         }
@@ -289,7 +289,7 @@ public enum CtfTestTrace {
     public boolean exists() {
         try {
             getTrace();
-        } catch (CTFReaderException e) {
+        } catch (CTFException e) {
             return false;
         }
         return true;
index a5c8d3584db3d2683a71fa76415c540214b87dd3..db8b121caa97c6f25f3c17e5f91339ed9e979753 100644 (file)
@@ -23,7 +23,7 @@ import java.nio.file.Paths;
 import java.util.LinkedList;
 import java.util.List;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTraceReader;
 import org.junit.Rule;
@@ -191,7 +191,7 @@ public class CtfTestSuiteTests {
 
                 checkIfWeShoudlSucceed();
             }
-        } catch (CTFReaderException e) {
+        } catch (CTFException e) {
             checkIfWeShouldFail(e);
         } catch (OutOfMemoryError e) {
             checkIfWeShouldFail(e);
index 1f9a3eeee79a5d4f34467b044d391cfaac6bdd49..7a4d5477652d7929c147d08752717a0fd1b672df 100644 (file)
@@ -18,7 +18,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.types.Definition;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
@@ -50,10 +50,10 @@ public class CTFEventFieldTest {
     /**
      * Run the CTFEventField parseField(Definition,String) method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
-    public void testParseField_complex() throws CTFReaderException {
+    public void testParseField_complex() throws CTFException {
         int len = 32;
         IntegerDeclaration id = IntegerDeclaration.createDeclaration(
                 len,
@@ -101,10 +101,10 @@ public class CTFEventFieldTest {
     /**
      * Run the CTFEventField parseField(Definition,String) method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
-    public void testParseField_simple() throws CTFReaderException {
+    public void testParseField_simple() throws CTFException {
         final StringDeclaration elemType = StringDeclaration.getStringDeclaration(Encoding.UTF8);
         byte[] bytes = { 'T', 'e', 's', 't', '\0' };
         ByteBuffer bb = testMemory(ByteBuffer.wrap(bytes));
index 71537dc6671917870949591ba439b92e237c997d..2f1d9bb35396fc372629bd34484aa2940639c01f 100644 (file)
@@ -17,7 +17,7 @@ import static org.junit.Assert.assertEquals;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.junit.Before;
 import org.junit.Test;
@@ -36,11 +36,11 @@ public class BitBufferIntTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Out of bounds, won't happen
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         ByteBuffer allocateDirect = ByteBuffer.allocateDirect(128);
         if (allocateDirect == null) {
             throw new IllegalStateException("Failed to allocate memory");
@@ -50,11 +50,11 @@ public class BitBufferIntTest {
         fixture = createBuffer();
     }
 
-    private static BitBuffer createBuffer() throws CTFReaderException {
+    private static BitBuffer createBuffer() throws CTFException {
         return createBuffer(16);
     }
 
-    private static BitBuffer createBuffer(int j) throws CTFReaderException {
+    private static BitBuffer createBuffer(int j) throws CTFException {
         final byte[] bytes = new byte[j];
         for (int i = 0; i < j; i++) {
             bytes[i] = (byte) (i % 0xff);
@@ -71,11 +71,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#getInt} with a basic value
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testGetInt_base() throws CTFReaderException {
+    public void testGetInt_base() throws CTFException {
         int result = fixture.getInt();
         assertEquals(0x020406, result);
     }
@@ -83,11 +83,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#getInt} with explicit seek at pos 0.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testGetInt_pos0() throws CTFReaderException {
+    public void testGetInt_pos0() throws CTFException {
         fixture.position(0);
         int result = fixture.getInt();
         assertEquals(0x010203, result);
@@ -96,11 +96,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#get} with seek at pos 1.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testGetInt_pos1() throws CTFReaderException {
+    public void testGetInt_pos1() throws CTFException {
         fixture.position(1);
 
         long result = fixture.get(1, true);
@@ -110,11 +110,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#get} with seek at pos 2.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testGetInt_pos2() throws CTFReaderException {
+    public void testGetInt_pos2() throws CTFException {
         fixture.position(2);
 
         long result = fixture.get(0, true);
@@ -124,11 +124,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#get} with explicit little-endian reading.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testGetInt_le2() throws CTFReaderException {
+    public void testGetInt_le2() throws CTFException {
         BitBuffer leFixture = createBuffer(128);
         leFixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         leFixture.position(0);
@@ -140,11 +140,11 @@ public class BitBufferIntTest {
      * Test {@link BitBuffer#get} with explicit little-endian reading, with an
      * offset.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testGetInt_le1() throws CTFReaderException {
+    public void testGetInt_le1() throws CTFException {
         BitBuffer leFixture = createBuffer(128);
         leFixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         leFixture.position(1);
@@ -156,11 +156,11 @@ public class BitBufferIntTest {
      * Test {@link BitBuffer#get} with a 32-bit out-of-bounds read. Should throw
      * an exception.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Expected
      */
-    @Test(expected = CTFReaderException.class)
-    public void testGetInt_invalid() throws CTFReaderException {
+    @Test(expected = CTFException.class)
+    public void testGetInt_invalid() throws CTFException {
         BitBuffer smallFixture = createBuffer(2);
         smallFixture.setByteOrder(ByteOrder.BIG_ENDIAN);
 
@@ -174,11 +174,11 @@ public class BitBufferIntTest {
      * Test {@link BitBuffer#get} with a 64-bit out-of-bounds read. Should throw
      * an exception.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Expected
      */
-    @Test(expected = CTFReaderException.class)
-    public void testGetInt_invalid2() throws CTFReaderException {
+    @Test(expected = CTFException.class)
+    public void testGetInt_invalid2() throws CTFException {
         BitBuffer smallFixture = createBuffer(2);
         smallFixture.setByteOrder(ByteOrder.BIG_ENDIAN);
 
@@ -191,11 +191,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#getLong}.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetLong_pos0() throws CTFReaderException {
+    public void testGetLong_pos0() throws CTFException {
         fixture.position(0);
         long result = fixture.getLong();
         assertEquals(0x01020304050607L, result);
@@ -204,11 +204,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#getLong} with an offset of 7.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetLong_pos7() throws CTFReaderException {
+    public void testGetLong_pos7() throws CTFException {
         fixture.position(7);
         long result = fixture.getLong();
         assertEquals(0x81018202830384L, result);
@@ -217,11 +217,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#getLong} with an offset of 8.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetLong_pos8() throws CTFReaderException {
+    public void testGetLong_pos8() throws CTFException {
         fixture.position(8);
         long result = fixture.getLong();
         assertEquals(0x0102030405060708L, result);
@@ -230,11 +230,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#getLong} with a little-endian buffer.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetLong_pos0LE() throws CTFReaderException {
+    public void testGetLong_pos0LE() throws CTFException {
         fixture.position(0);
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         long result = fixture.getLong();
@@ -244,11 +244,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#getLong} with a little-endian buffer at pos 7.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetLong_pos7LE() throws CTFReaderException {
+    public void testGetLong_pos7LE() throws CTFException {
         fixture.position(7);
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         long result = fixture.getLong();
@@ -258,11 +258,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#getLong} with a little-endian buffer at pos 8.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetLong_pos8LE() throws CTFReaderException {
+    public void testGetLong_pos8LE() throws CTFException {
         fixture.position(8);
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         long result = fixture.getLong();
@@ -272,11 +272,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#get} for >32 bits in length.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGet35_pos0BE() throws CTFReaderException {
+    public void testGet35_pos0BE() throws CTFException {
         fixture.position(0);
         long result = fixture.get(35, false);
         assertEquals(0x081018L, result);
@@ -285,11 +285,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#get} for >32 bits in length at an offset position.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGet35_pos8BE() throws CTFReaderException {
+    public void testGet35_pos8BE() throws CTFException {
         fixture.position(8);
         long result = fixture.get(35, false);
         assertEquals(0x08101820L, result);
@@ -298,11 +298,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#get} for >32 bits in length in little-endian.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGet35_pos0LE() throws CTFReaderException {
+    public void testGet35_pos0LE() throws CTFException {
         fixture.position(0);
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         long result = fixture.get(35, false);
@@ -313,11 +313,11 @@ public class BitBufferIntTest {
      * Test {@link BitBuffer#get} for >32 bits in length, in little-endian, at
      * position 7.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetLong35_pos7LE() throws CTFReaderException {
+    public void testGetLong35_pos7LE() throws CTFException {
         fixture.position(7);
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         long result = fixture.get(35, false);
@@ -328,11 +328,11 @@ public class BitBufferIntTest {
      * Test {@link BitBuffer#get} for >32 bits in length, in little-endian, at
      * position 8.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetLong35_pos8LE() throws CTFReaderException {
+    public void testGetLong35_pos8LE() throws CTFException {
         fixture.position(8);
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         long result = fixture.get(35, false);
@@ -343,11 +343,11 @@ public class BitBufferIntTest {
      * Test {@link BitBuffer#get} for >32 bits in length, in little-endian, for
      * a signed value.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetLong35s_pos0LE() throws CTFReaderException {
+    public void testGetLong35s_pos0LE() throws CTFException {
         fixture.position(0);
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         long result = fixture.get(35, true);
@@ -358,11 +358,11 @@ public class BitBufferIntTest {
      * Test {@link BitBuffer#get} for >32 bits in length, in little-endian, for
      * a signed value, at position 7.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetLong35s_pos7LE() throws CTFReaderException {
+    public void testGetLong35s_pos7LE() throws CTFException {
         fixture.position(7);
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         long result = fixture.get(35, true);
@@ -373,11 +373,11 @@ public class BitBufferIntTest {
      * Test {@link BitBuffer#get} for >32 bits in length, in little-endian, for
      * a signed value, at position 8.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetLong35s_pos8LE() throws CTFReaderException {
+    public void testGetLong35s_pos8LE() throws CTFException {
         fixture.position(8);
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         long result = fixture.get(35, true);
@@ -387,11 +387,11 @@ public class BitBufferIntTest {
     /**
      * Test reading negative values as signed values.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetSigned() throws CTFReaderException {
+    public void testGetSigned() throws CTFException {
         fixture.position(0);
         fixture.putInt(-1);
         fixture.putInt(-1);
@@ -405,11 +405,11 @@ public class BitBufferIntTest {
     /**
      * Test reading negative values as unsigned values.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetUnsigned() throws CTFReaderException {
+    public void testGetUnsigned() throws CTFException {
         fixture.position(0);
         fixture.putInt(-1);
         fixture.putInt(-1);
@@ -423,11 +423,11 @@ public class BitBufferIntTest {
     /**
      * Test reading 24 bits of a 32-bit negative value as a signed value.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGet24Signed() throws CTFReaderException {
+    public void testGet24Signed() throws CTFException {
         fixture.position(0);
         fixture.putInt(-1);
         fixture.putInt(-1);
@@ -441,11 +441,11 @@ public class BitBufferIntTest {
     /**
      * Test reading 24 bits of a 32-bit negative value as an unsigned value.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGet24Unsigned() throws CTFReaderException {
+    public void testGet24Unsigned() throws CTFException {
         fixture.position(0);
         fixture.putInt(-1);
         fixture.putInt(-1);
@@ -459,11 +459,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#putInt(int)}
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testPutInt() throws CTFReaderException {
+    public void testPutInt() throws CTFException {
         fixture.position(1);
         fixture.putInt(1);
     }
@@ -471,11 +471,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#putInt(int, int)}
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testPutInt_length1() throws CTFReaderException {
+    public void testPutInt_length1() throws CTFException {
         fixture.position(1);
         fixture.putInt(1, 1);
     }
@@ -483,11 +483,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#putInt(int, int)} with length = 0.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testPutInt_length0() throws CTFReaderException {
+    public void testPutInt_length0() throws CTFException {
         fixture.position(1);
         fixture.putInt(0, 1);
     }
@@ -495,11 +495,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#putInt(int)} Little endian
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testPutIntLe() throws CTFReaderException {
+    public void testPutIntLe() throws CTFException {
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         fixture.position(1);
         fixture.putInt(1);
@@ -508,11 +508,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#putInt(int, int)} Little endian
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testPutIntLe_length1() throws CTFReaderException {
+    public void testPutIntLe_length1() throws CTFException {
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         fixture.position(1);
         fixture.putInt(1, 1);
@@ -521,11 +521,11 @@ public class BitBufferIntTest {
     /**
      * Test {@link BitBuffer#putInt(int, int)} with length = 0. Little endian
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testPutIntLe_length0() throws CTFReaderException {
+    public void testPutIntLe_length0() throws CTFException {
         fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN);
         fixture.position(1);
         fixture.putInt(0, 1);
@@ -534,11 +534,11 @@ public class BitBufferIntTest {
     /**
      * Test writing and reading a value defined in hex format.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Not expected
      */
     @Test
-    public void testPutInt_hex() throws CTFReaderException {
+    public void testPutInt_hex() throws CTFException {
         final int value = 0x010203;
 
         for (int i = 0; i <= 32; i++) {
@@ -556,11 +556,11 @@ public class BitBufferIntTest {
      * Test {@link BitBuffer#putInt} with an out-of-bounds length. An exception
      * should be thrown.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Expected
      */
-    @Test(expected = CTFReaderException.class)
-    public void testPutInt_invalid() throws CTFReaderException {
+    @Test(expected = CTFException.class)
+    public void testPutInt_invalid() throws CTFException {
         BitBuffer fixture2;
         fixture2 = createBuffer(4);
         fixture2.setByteOrder(ByteOrder.BIG_ENDIAN);
index cb67aa9f77fbda98bf35e30393a1244fc182b6d2..76196cdf3425ec30bfbcfe0d23bc28f9624e8666 100644 (file)
@@ -18,7 +18,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.junit.Before;
 import org.junit.Test;
@@ -37,11 +37,11 @@ public class BitBufferTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             An error that cannot happen (position is under 128)
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         fixture = new BitBuffer(Util.testMemory(ByteBuffer.allocateDirect(1)));
         fixture.setByteOrder(ByteOrder.BIG_ENDIAN);
         fixture.position(1);
@@ -152,11 +152,11 @@ public class BitBufferTest {
     /**
      * Run the void position(int) method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             out of bounds? won't happen
      */
     @Test
-    public void testSetPosition() throws CTFReaderException {
+    public void testSetPosition() throws CTFException {
         int newPosition = 1;
         fixture.position(newPosition);
     }
@@ -194,11 +194,11 @@ public class BitBufferTest {
     /**
      * Test the get function
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             won't happen but we seek in a buffer
      */
     @Test
-    public void testGetBytesMiddle() throws CTFReaderException {
+    public void testGetBytesMiddle() throws CTFException {
         @NonNull
         byte[] data = new byte[5];
         // this string has been carefully selected and tested... don't change
index ad9b4ebd306dafd31248871982aec46002584fe2..b1ef3459cff593256e197d6c0c3bc795645d7a02 100644 (file)
@@ -20,7 +20,7 @@ import static org.junit.Assert.assertTrue;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.ILexicalScope;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
@@ -72,11 +72,11 @@ public class CTFStreamInputPacketIndexEntryTest {
     /**
      * Test the constructor
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             exception
      */
     @Test
-    public void testStreamInputPacketIndexEntryConstructor1() throws CTFReaderException {
+    public void testStreamInputPacketIndexEntryConstructor1() throws CTFException {
         StructDeclaration sd = new StructDeclaration(8);
         sd.addField("timestamp_begin", IntegerDeclaration.INT_32B_DECL);
         sd.addField("timestamp_end", IntegerDeclaration.INT_32B_DECL);
@@ -101,11 +101,11 @@ public class CTFStreamInputPacketIndexEntryTest {
     /**
      * Test the constructor
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             exception
      */
     @Test
-    public void testStreamInputPacketIndexEntryConstructor2() throws CTFReaderException {
+    public void testStreamInputPacketIndexEntryConstructor2() throws CTFException {
         StructDeclaration sd = new StructDeclaration(8);
         sd.addField("timestamp_begin", IntegerDeclaration.INT_32B_DECL);
         sd.addField("timestamp_end", IntegerDeclaration.INT_32B_DECL);
@@ -130,11 +130,11 @@ public class CTFStreamInputPacketIndexEntryTest {
     /**
      * Test the constructor
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             exception
      */
     @Test
-    public void testStreamInputPacketIndexEntryConstructor3() throws CTFReaderException {
+    public void testStreamInputPacketIndexEntryConstructor3() throws CTFException {
         StructDeclaration sd = new StructDeclaration(8);
         sd.addField("timestamp_begin", IntegerDeclaration.INT_32B_DECL);
         sd.addField("timestamp_end", IntegerDeclaration.INT_32B_DECL);
@@ -163,11 +163,11 @@ public class CTFStreamInputPacketIndexEntryTest {
     /**
      * Test the constructor
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             exception
      */
     @Test
-    public void testStreamInputPacketIndexEntryConstructor4() throws CTFReaderException {
+    public void testStreamInputPacketIndexEntryConstructor4() throws CTFException {
         StructDeclaration sd = new StructDeclaration(8);
         sd.addField("content_size", IntegerDeclaration.INT_32B_DECL);
         sd.addField("target", StringDeclaration.getStringDeclaration(Encoding.ASCII));
@@ -188,11 +188,11 @@ public class CTFStreamInputPacketIndexEntryTest {
     /**
      * Test the constructor
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             exception
      */
     @Test
-    public void testStreamInputPacketIndexEntryConstructor5() throws CTFReaderException {
+    public void testStreamInputPacketIndexEntryConstructor5() throws CTFException {
         StructDeclaration sd = new StructDeclaration(8);
         sd.addField("timestamp_end", IntegerDeclaration.INT_32B_DECL);
         sd.addField("content_size", IntegerDeclaration.INT_32B_DECL);
@@ -216,11 +216,11 @@ public class CTFStreamInputPacketIndexEntryTest {
     /**
      * Test the constructor
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             exception
      */
     @Test
-    public void testStreamInputPacketIndexEntryConstructor6() throws CTFReaderException {
+    public void testStreamInputPacketIndexEntryConstructor6() throws CTFException {
         StructDeclaration sd = new StructDeclaration(8);
         sd.addField("timestamp_end", IntegerDeclaration.INT_32B_DECL);
         sd.addField("content_size", IntegerDeclaration.INT_32B_DECL);
@@ -246,11 +246,11 @@ public class CTFStreamInputPacketIndexEntryTest {
     /**
      * Run the String toString() method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             won't happen
      */
     @Test
-    public void testToString() throws CTFReaderException {
+    public void testToString() throws CTFException {
 
         String expectedResult = "StreamInputPacketIndexEntry [offsetBits=0, timestampBegin=0, timestampEnd=0]";
         StructDeclaration sd = new StructDeclaration(8);
index 0291dfea3f601a56c2d8e51aeca93c15e1bff9d6..2d505fce3d14044f0e2c1bd4cfdbe87789aa597f 100644 (file)
@@ -13,7 +13,7 @@ package org.eclipse.tracecompass.ctf.core.tests.trace;
 
 import static org.junit.Assert.assertNotNull;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.internal.ctf.core.trace.StreamInputPacketIndex;
 import org.eclipse.tracecompass.internal.ctf.core.trace.StreamInputPacketIndexEntry;
 import org.junit.Before;
@@ -34,10 +34,10 @@ public class CTFStreamInputPacketIndexTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         fixture = new StreamInputPacketIndex();
         fixture.append(new StreamInputPacketIndexEntry(1L,0L));
     }
index 1e5b6fe84ae74c5b7eee3dcd1f9915c0979b561c..8cc449d60ca4fc6e0f6f4e60f0b2d098f8f41fa9 100644 (file)
@@ -19,7 +19,7 @@ import java.io.File;
 import java.io.IOException;
 import java.util.Set;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
 import org.eclipse.tracecompass.ctf.core.event.types.Definition;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
@@ -60,10 +60,10 @@ public class CTFStreamInputReaderTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         fixture = getStreamInputReader();
         fixture.setName(1);
         fixture.setCurrentEvent(new EventDefinition(new EventDeclaration(),
@@ -78,7 +78,7 @@ public class CTFStreamInputReaderTest {
                 );
     }
 
-    private static CTFStreamInputReader getStreamInputReader() throws CTFReaderException {
+    private static CTFStreamInputReader getStreamInputReader() throws CTFException {
         assumeTrue(testTrace.exists());
         CTFTrace trace = testTrace.getTrace();
         CTFStream s = trace.getStream((long) 0);
@@ -110,11 +110,11 @@ public class CTFStreamInputReaderTest {
      * Run the StreamInputReader(StreamInput) constructor test, with an invalid
      * trace.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      * @throws IOException
      */
-    @Test(expected = CTFReaderException.class)
-    public void testStreamInputReader_invalid() throws CTFReaderException, IOException {
+    @Test(expected = CTFException.class)
+    public void testStreamInputReader_invalid() throws CTFException, IOException {
         CTFStreamInput streamInput = new CTFStreamInput(new CTFStream(new CTFTrace("")), new File(""));
         try (CTFStreamInputReader result = new CTFStreamInputReader(streamInput)) {
             assertNotNull(result);
@@ -160,11 +160,11 @@ public class CTFStreamInputReaderTest {
     /**
      * Run the void goToLastEvent() method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGoToLastEvent1() throws CTFReaderException {
+    public void testGoToLastEvent1() throws CTFException {
         final long endTimestamp = goToEnd();
         final long endTime = 4287422460315L;
         assertEquals(endTime, endTimestamp);
@@ -173,11 +173,11 @@ public class CTFStreamInputReaderTest {
     /**
      * Run the void goToLastEvent() method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGoToLastEvent2() throws CTFReaderException {
+    public void testGoToLastEvent2() throws CTFException {
         long timestamp = -1;
         while (fixture.readNextEvent().equals(CTFResponse.OK)) {
             timestamp = fixture.getCurrentEvent().getTimestamp();
@@ -186,7 +186,7 @@ public class CTFStreamInputReaderTest {
         assertEquals(0, timestamp - endTimestamp);
     }
 
-    private long goToEnd() throws CTFReaderException {
+    private long goToEnd() throws CTFException {
         fixture.goToLastEvent();
         return fixture.getCurrentEvent().getTimestamp();
     }
@@ -194,22 +194,22 @@ public class CTFStreamInputReaderTest {
     /**
      * Run the boolean readNextEvent() method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testReadNextEvent() throws CTFReaderException {
+    public void testReadNextEvent() throws CTFException {
         assertEquals(CTFResponse.OK, fixture.readNextEvent());
     }
 
     /**
      * Run the void seek(long) method test. Seek by direct timestamp
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testSeek_timestamp() throws CTFReaderException {
+    public void testSeek_timestamp() throws CTFException {
         long timestamp = 1L;
         fixture.seek(timestamp);
     }
@@ -218,10 +218,10 @@ public class CTFStreamInputReaderTest {
      * Run the seek test. Seek by passing an EventDefinition to which we've
      * given the timestamp we want.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
-    public void testSeek_eventDefinition() throws CTFReaderException {
+    public void testSeek_eventDefinition() throws CTFException {
         EventDefinition eventDefinition = new EventDefinition(
                 new EventDeclaration(), getStreamInputReader(), 1L, null, null, null, null);
         fixture.setCurrentEvent(eventDefinition);
index e778c30f6cee1f03de5162fb533d6cb14311f261..25424dde7d8f7dffefa5c8cb80cbb4215c4b79d7 100644 (file)
@@ -22,7 +22,7 @@ import java.io.File;
 import java.io.FilenameFilter;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.types.IDefinition;
 import org.eclipse.tracecompass.ctf.core.tests.shared.CtfTestTrace;
 import org.eclipse.tracecompass.ctf.core.trace.CTFStream;
@@ -47,10 +47,10 @@ public class CTFStreamInputTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         assumeTrue(testTrace.exists());
         fixture = new CTFStreamInput(new CTFStream(testTrace.getTrace()), createFile());
         fixture.setTimestampEnd(1L);
@@ -140,14 +140,14 @@ public class CTFStreamInputTest {
     CTFStreamInput s2;
 
     @Test
-    public void testEquals1() throws CTFReaderException {
+    public void testEquals1() throws CTFException {
         s1 = new CTFStreamInput(new CTFStream(testTrace.getTrace()),
                 createFile());
         assertFalse(s1.equals(null));
     }
 
     @Test
-    public void testEquals2() throws CTFReaderException {
+    public void testEquals2() throws CTFException {
         s1 = new CTFStreamInput(new CTFStream(testTrace.getTrace()),
                 createFile());
         assertFalse(s1.equals(new Long(23L)));
@@ -155,7 +155,7 @@ public class CTFStreamInputTest {
     }
 
     @Test
-    public void testEquals3() throws CTFReaderException {
+    public void testEquals3() throws CTFException {
         s1 = new CTFStreamInput(new CTFStream(testTrace.getTrace()),
                 createFile());
         assertEquals(s1, s1);
@@ -163,7 +163,7 @@ public class CTFStreamInputTest {
     }
 
     @Test
-    public void testEquals4() throws CTFReaderException {
+    public void testEquals4() throws CTFException {
         s1 = new CTFStreamInput(new CTFStream(testTrace.getTrace()),
                 createFile());
         s2 = new CTFStreamInput(new CTFStream(testTrace.getTrace()),
index f2afdf386bb58df801196edbc484302cfdd5214e..8d6102056c6aed732a9cf5fd200b056a47fbaf90 100644 (file)
@@ -20,7 +20,7 @@ import java.io.FilenameFilter;
 import java.util.Set;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.types.IDeclaration;
 import org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration;
 import org.eclipse.tracecompass.ctf.core.tests.shared.CtfTestTrace;
@@ -57,10 +57,10 @@ public class CTFStreamTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         fixture = new CTFStream(testTrace.getTrace());
         fixture.setEventContext(new StructDeclaration(1L));
         fixture.setPacketContext(new StructDeclaration(1L));
@@ -91,10 +91,10 @@ public class CTFStreamTest {
     /**
      * Run the Stream(CTFTrace) constructor test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
-    public void testStream() throws CTFReaderException {
+    public void testStream() throws CTFException {
         CTFTrace trace = testTrace.getTrace();
         CTFStream result = new CTFStream(trace);
         assertNotNull(result);
index 2937a0c2795afaed275c7d827d0a8506b92c32eb..f7342b54e56559cbc80e7ed60e195f2a64e2689f 100644 (file)
@@ -25,7 +25,7 @@ import java.nio.file.Path;
 import java.nio.file.attribute.FileAttribute;
 import java.util.UUID;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTraceReader;
 import org.junit.Before;
@@ -49,10 +49,10 @@ public class CTFTraceGrowingStreamTest {
      * Run before every test
      *
      * @throws IOException won't happen
-     * @throws CTFReaderException won't happen
+     * @throws CTFException won't happen
      */
     @Before
-    public void init() throws IOException, CTFReaderException {
+    public void init() throws IOException, CTFException {
         fCtfDirectory = Files.createTempDirectory("temptrace", new FileAttribute<?>[] {});
         File metadata = new File(fCtfDirectory.toString() + "/" + "metadata");
         fGrowingStream = new File(fCtfDirectory.toString() + "/" + "stream");
@@ -116,12 +116,12 @@ public class CTFTraceGrowingStreamTest {
     /**
      * Test a growing stream
      *
-     * @throws CTFReaderException won't happen
+     * @throws CTFException won't happen
      * @throws IOException won't happen
      * @throws FileNotFoundException won't happen
      */
     @Test
-    public void testGrowingLive() throws CTFReaderException, FileNotFoundException, IOException {
+    public void testGrowingLive() throws CTFException, FileNotFoundException, IOException {
         try (CTFTraceReader reader = new CTFTraceReader(fFixture);) {
             reader.setLive(true);
             assertEquals("0x29", reader.getCurrentEventDef().getFields().getDefinition("f").toString());
@@ -138,12 +138,12 @@ public class CTFTraceGrowingStreamTest {
     /**
      * Test a growing stream
      *
-     * @throws CTFReaderException won't happen
+     * @throws CTFException won't happen
      * @throws IOException won't happen
      * @throws FileNotFoundException won't happen
      */
     @Test
-    public void testGrowingNotLive() throws CTFReaderException, FileNotFoundException, IOException {
+    public void testGrowingNotLive() throws CTFException, FileNotFoundException, IOException {
         try (CTFTraceReader reader = new CTFTraceReader(fFixture);) {
             reader.setLive(false);
             assertEquals("0x29", reader.getCurrentEventDef().getFields().getDefinition("f").toString());
index 8543fd06505a43762d89245221cdd841e3d20aba..c46e217f7333e85623f61fe6ce13acdd8d256fb0 100644 (file)
@@ -23,7 +23,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStreamReader;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
 import org.eclipse.tracecompass.ctf.core.tests.shared.CtfTestTrace;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
@@ -50,11 +50,11 @@ public class CTFTraceGrowingTest {
      *             an IO error
      * @throws FileNotFoundException
      *             file's not there
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error in metadata
      */
     @Before
-    public void init() throws FileNotFoundException, IOException, CTFReaderException {
+    public void init() throws FileNotFoundException, IOException, CTFException {
         Metadata md = new Metadata(fixture);
         File metadata = new File(fPathName + "/" + "metadata");
 
@@ -73,11 +73,11 @@ public class CTFTraceGrowingTest {
     /**
      * Empty trace test
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             will not happen
      */
     @Test
-    public void testEmptyStream() throws CTFReaderException {
+    public void testEmptyStream() throws CTFException {
         try (CTFTraceReader reader = new CTFTraceReader(fixture);) {
             assertNull(reader.getCurrentEventDef());
         }
@@ -86,11 +86,11 @@ public class CTFTraceGrowingTest {
     /**
      * Add a stream
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             should not happen
      */
     @Test
-    public void testAddStream() throws CTFReaderException {
+    public void testAddStream() throws CTFException {
         File stream = new File(fPathName + "/" + "channel1");
         try (CTFTraceReader reader = new CTFTraceReader(fixture);) {
             fixture.addStreamFile(stream);
@@ -103,11 +103,11 @@ public class CTFTraceGrowingTest {
     /**
      * Adds two a stream
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             should not happen
      */
     @Test
-    public void testAddTwoStreams1() throws CTFReaderException {
+    public void testAddTwoStreams1() throws CTFException {
         File stream = new File(fPathName + "/" + "channel1");
         try (CTFTraceReader reader = new CTFTraceReader(fixture);) {
             fixture.addStreamFile(stream);
@@ -124,11 +124,11 @@ public class CTFTraceGrowingTest {
     /**
      * Adds two a stream
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             should not happen
      */
     @Test
-    public void testAddTwoStreams2() throws CTFReaderException {
+    public void testAddTwoStreams2() throws CTFException {
         File stream = new File(fPathName + "/" + "channel1");
         try (CTFTraceReader reader = new CTFTraceReader(fixture);) {
             fixture.addStreamFile(stream);
@@ -147,11 +147,11 @@ public class CTFTraceGrowingTest {
     /**
      * Tests that update does not change the position
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             should not happen
      */
     @Test
-    public void testAddTwoStreams3() throws CTFReaderException {
+    public void testAddTwoStreams3() throws CTFException {
         File stream = new File(fPathName + "/" + "channel1");
         try (CTFTraceReader reader = new CTFTraceReader(fixture);) {
             fixture.addStreamFile(stream);
@@ -175,11 +175,11 @@ public class CTFTraceGrowingTest {
     /**
      * Test adding a bad stream
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             should happen
      */
-    @Test(expected = CTFReaderException.class)
-    public void testAddStreamFail() throws CTFReaderException {
+    @Test(expected = CTFException.class)
+    public void testAddStreamFail() throws CTFException {
         File stream = new File(fPathName + "/" + "metadata");
         try (CTFTraceReader reader = new CTFTraceReader(fixture);) {
             fixture.addStreamFile(stream);
index 65c4480f2d74580e4a36586d1b1d1d537b813730..28a394b6659bff4cedf06ad18ef22af4e3e6a0e4 100644 (file)
@@ -17,7 +17,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assume.assumeTrue;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
 import org.eclipse.tracecompass.ctf.core.tests.shared.CtfTestTrace;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
@@ -42,10 +42,10 @@ public class CTFTraceReaderTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         assumeTrue(testTrace.exists());
         fixture = new CTFTraceReader(testTrace.getTrace());
     }
@@ -54,10 +54,10 @@ public class CTFTraceReaderTest {
      * Run the CTFTraceReader(CTFTrace) constructor test. Open a known good
      * trace.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
-    public void testOpen_existing() throws CTFReaderException {
+    public void testOpen_existing() throws CTFException {
         CTFTrace trace = testTrace.getTrace();
         try (CTFTraceReader result = new CTFTraceReader(trace);) {
             assertNotNull(result);
@@ -68,10 +68,10 @@ public class CTFTraceReaderTest {
      * Run the CTFTraceReader(CTFTrace) constructor test. Open a non-existing
      * trace, expect the exception.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
-    @Test(expected = org.eclipse.tracecompass.ctf.core.CTFReaderException.class)
-    public void testOpen_nonexisting() throws CTFReaderException {
+    @Test(expected = org.eclipse.tracecompass.ctf.core.CTFException.class)
+    public void testOpen_nonexisting() throws CTFException {
         CTFTrace trace = new CTFTrace("badfile.bad");
         try (CTFTraceReader result = new CTFTraceReader(trace);) {
             assertNotNull(result);
@@ -82,10 +82,10 @@ public class CTFTraceReaderTest {
      * Run the CTFTraceReader(CTFTrace) constructor test. Try to pen an invalid
      * path, expect exception.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
-    @Test(expected = org.eclipse.tracecompass.ctf.core.CTFReaderException.class)
-    public void testOpen_invalid() throws CTFReaderException {
+    @Test(expected = org.eclipse.tracecompass.ctf.core.CTFException.class)
+    public void testOpen_invalid() throws CTFException {
         CTFTrace trace = new CTFTrace("");
         try (CTFTraceReader result = new CTFTraceReader(trace);) {
             assertNotNull(result);
@@ -95,11 +95,11 @@ public class CTFTraceReaderTest {
     /**
      * Run the boolean advance() method test. Test advancing normally.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testAdvance_normal() throws CTFReaderException {
+    public void testAdvance_normal() throws CTFException {
         boolean result = fixture.advance();
         assertTrue(result);
     }
@@ -108,11 +108,11 @@ public class CTFTraceReaderTest {
      * Run the boolean advance() method test. Test advancing when we're at the
      * end, so we expect that there is no more events.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testAdvance_end() throws CTFReaderException {
+    public void testAdvance_end() throws CTFException {
         int i = 0;
         boolean result = fixture.advance();
         while (result) {
@@ -135,11 +135,11 @@ public class CTFTraceReaderTest {
     /**
      * Run the CTFTraceReader copy constructor test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testCopyFrom() throws CTFReaderException {
+    public void testCopyFrom() throws CTFException {
         try (CTFTraceReader result = fixture.copyFrom();) {
             assertNotNull(result);
         }
@@ -161,10 +161,10 @@ public class CTFTraceReaderTest {
      * Both trace reader are different objects, so they shouldn't "equals" each
      * other.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
-    public void testEquals() throws CTFReaderException {
+    public void testEquals() throws CTFException {
         try (CTFTraceReader fixture2 = new CTFTraceReader(testTrace.getTrace());) {
             assertEquals(fixture, fixture2);
         }
@@ -184,11 +184,11 @@ public class CTFTraceReaderTest {
      * Run the getCurrentEventDef() method test. Get the last event's
      * definition.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGetCurrentEventDef_last() throws CTFReaderException {
+    public void testGetCurrentEventDef_last() throws CTFException {
         fixture.goToLastEvent();
         EventDefinition result = fixture.getCurrentEventDef();
         assertNotNull(result);
@@ -215,11 +215,11 @@ public class CTFTraceReaderTest {
     /**
      * Run the void goToLastEvent() method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testGoToLastEvent() throws CTFReaderException {
+    public void testGoToLastEvent() throws CTFException {
         fixture.goToLastEvent();
         long ts1 = getTimestamp();
         long ts2 = fixture.getEndTime();
@@ -229,7 +229,7 @@ public class CTFTraceReaderTest {
     /**
      * Run the boolean hasMoreEvents() method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
     public void testHasMoreEvents() {
@@ -240,11 +240,11 @@ public class CTFTraceReaderTest {
     /**
      * Run the void printStats() method test with no 'width' parameter.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testPrintStats_noparam() throws CTFReaderException {
+    public void testPrintStats_noparam() throws CTFException {
         fixture.advance();
         fixture.printStats();
     }
@@ -252,11 +252,11 @@ public class CTFTraceReaderTest {
     /**
      * Run the void printStats(int) method test with width = 0.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testPrintStats_width0() throws CTFReaderException {
+    public void testPrintStats_width0() throws CTFException {
         fixture.advance();
         fixture.printStats(0);
     }
@@ -264,11 +264,11 @@ public class CTFTraceReaderTest {
     /**
      * Run the void printStats(int) method test with width = 1.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testPrintStats_width1() throws CTFReaderException {
+    public void testPrintStats_width1() throws CTFException {
         fixture.advance();
         fixture.printStats(1);
     }
@@ -276,11 +276,11 @@ public class CTFTraceReaderTest {
     /**
      * Run the void printStats(int) method test with width = 2.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testPrintStats_width2() throws CTFReaderException {
+    public void testPrintStats_width2() throws CTFException {
         fixture.advance();
         fixture.printStats(2);
     }
@@ -288,11 +288,11 @@ public class CTFTraceReaderTest {
     /**
      * Run the void printStats(int) method test with width = 10.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testPrintStats_width10() throws CTFReaderException {
+    public void testPrintStats_width10() throws CTFException {
         fixture.advance();
         fixture.printStats(10);
     }
@@ -300,11 +300,11 @@ public class CTFTraceReaderTest {
     /**
      * Run the void printStats(int) method test with width = 100.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testPrintStats_100() throws CTFReaderException {
+    public void testPrintStats_100() throws CTFException {
         for (int i = 0; i < 1000; i++) {
             fixture.advance();
         }
@@ -314,11 +314,11 @@ public class CTFTraceReaderTest {
     /**
      * Run the boolean seek(long) method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testSeek() throws CTFReaderException {
+    public void testSeek() throws CTFException {
         long timestamp = 1L;
         boolean result = fixture.seek(timestamp);
         assertTrue(result);
index 6fa4abcadcd5413cd53a7280715299e751ea795c..78031d78ffe156caf3ae01f6017bb7d6d3d8bde6 100644 (file)
@@ -25,7 +25,7 @@ import java.io.File;
 import java.nio.ByteOrder;
 import java.util.UUID;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.CTFClock;
 import org.eclipse.tracecompass.ctf.core.event.types.IDefinition;
 import org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration;
@@ -56,7 +56,7 @@ public class CTFTraceTest {
         assumeTrue(testTrace.exists());
         try {
             fixture = testTrace.getTraceFromFile();
-        } catch (CTFReaderException e) {
+        } catch (CTFException e) {
             /* If the assumeTrue() call passed, this should not happen. */
             fail();
         }
@@ -75,7 +75,7 @@ public class CTFTraceTest {
         try {
             CTFTrace result = testTrace.getTraceFromFile();
             assertNotNull(result.getUUID());
-        } catch (CTFReaderException e) {
+        } catch (CTFException e) {
             fail();
         }
     }
@@ -83,11 +83,11 @@ public class CTFTraceTest {
     /**
      * Run the CTFTrace(File) constructor test with an invalid path.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             is expected
      */
-    @Test(expected = org.eclipse.tracecompass.ctf.core.CTFReaderException.class)
-    public void testOpen_invalid() throws CTFReaderException {
+    @Test(expected = org.eclipse.tracecompass.ctf.core.CTFException.class)
+    public void testOpen_invalid() throws CTFException {
         File path = new File("");
         CTFTrace result = new CTFTrace(path);
         assertNotNull(result);
@@ -116,7 +116,7 @@ public class CTFTraceTest {
             CTFStream stream = new CTFStream(testTrace.getTrace());
             stream.setId(1234);
             fixture.addStream(stream);
-        } catch (CTFReaderException e) {
+        } catch (CTFException e) {
             fail();
         } catch (ParseException e) {
             fail();
@@ -265,7 +265,7 @@ public class CTFTraceTest {
 
             boolean result = fixture2.packetHeaderIsSet();
             assertFalse(result);
-        } catch (CTFReaderException e) {
+        } catch (CTFException e) {
             fail();
         }
     }
@@ -390,11 +390,11 @@ public class CTFTraceTest {
     /**
      * Test for getCallsite(eventName, ip)
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             not expected
      */
     @Test
-    public void callsitePosition() throws CTFReaderException {
+    public void callsitePosition() throws CTFException {
         long ip1 = 2;
         long ip2 = 5;
         long ip3 = 7;
index 7d021f402299f9e171e694ffbd6cbca7b3b285df..370b2af456c7b079981c8fe75455552a4a1f0e67 100644 (file)
@@ -24,7 +24,7 @@ import java.nio.ByteOrder;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
 import org.eclipse.tracecompass.ctf.core.tests.CtfCoreTestPlugin;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
@@ -415,11 +415,11 @@ public class IOstructgenTest {
     /**
      * Simple test (only the minimum)
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             something wrong happened
      */
     @Test
-    public void TSDLSimpleTest() throws CTFReaderException {
+    public void TSDLSimpleTest() throws CTFException {
         createDummyTrace(simpleTSDL);
         trace = new CTFTrace(tempTraceDir);
         assertNotNull(trace);
@@ -428,11 +428,11 @@ public class IOstructgenTest {
     /**
      * Test with environment variables
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             something wrong happened
      */
     @Test
-    public void TSDLEnvironmentTest() throws CTFReaderException {
+    public void TSDLEnvironmentTest() throws CTFException {
         createDummyTrace(envTSDL);
         trace = new CTFTrace(tempTraceDir);
         assertNotNull(trace);
@@ -441,11 +441,11 @@ public class IOstructgenTest {
     /**
      * Test with Clocks
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             something wrong happened
      */
     @Test
-    public void TSDLEnumTest() throws CTFReaderException {
+    public void TSDLEnumTest() throws CTFException {
         createDummyTrace(enumTSDL);
         trace = new CTFTrace(tempTraceDir);
         assertNotNull(trace);
@@ -454,11 +454,11 @@ public class IOstructgenTest {
     /**
      * Test with Clocks
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             something wrong happened
      */
     @Test
-    public void TSDLClockTest() throws CTFReaderException {
+    public void TSDLClockTest() throws CTFException {
         createDummyTrace(clockTSDL);
         trace = new CTFTrace(tempTraceDir);
         assertNotNull(trace);
@@ -467,11 +467,11 @@ public class IOstructgenTest {
     /**
      * Test with Contexts
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             something wrong happened
      */
     @Test
-    public void TSDLContextTest() throws CTFReaderException {
+    public void TSDLContextTest() throws CTFException {
         createDummyTrace(contextTSDL);
         trace = new CTFTrace(tempTraceDir);
         assertNotNull(trace);
@@ -480,11 +480,11 @@ public class IOstructgenTest {
     /**
      * Test with Callsites
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             something wrong happened
      */
     @Test
-    public void TSDLCallsiteTest() throws CTFReaderException {
+    public void TSDLCallsiteTest() throws CTFException {
         createDummyTrace(callsiteTSDL);
         trace = new CTFTrace(tempTraceDir);
         assertNotNull(trace);
@@ -493,11 +493,11 @@ public class IOstructgenTest {
     /**
      * Test everything
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             something wrong happened
      */
     @Test
-    public void TSDLAllTest() throws CTFReaderException {
+    public void TSDLAllTest() throws CTFException {
         createDummyTrace(allDressedTSDL);
         trace = new CTFTrace(tempTraceDir);
         assertNotNull(trace);
index e1c125458170eaf992df5bdea3fbd29e65a1512e..1345371c13f0df0756af8c246964384b2e4c327b 100644 (file)
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
 import org.eclipse.tracecompass.ctf.core.tests.shared.CtfTestTrace;
 import org.eclipse.tracecompass.ctf.core.trace.CTFStream;
@@ -167,10 +167,10 @@ public class MetadataTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         assumeTrue(testTrace.exists());
         fixture = new Metadata(testTrace.getTrace());
     }
@@ -184,11 +184,11 @@ public class MetadataTest {
     }
 
     @Test
-    public void testTextMD() throws CTFReaderException {
+    public void testTextMD() throws CTFException {
         testSingleFragment();
     }
 
-    protected CTFTrace testSingleFragment() throws CTFReaderException {
+    protected CTFTrace testSingleFragment() throws CTFException {
         fixture = new Metadata();
         CTFTrace trace = fixture.getTrace();
         for (CTFStream s : trace.getStreams()) {
@@ -206,7 +206,7 @@ public class MetadataTest {
     }
 
     @Test
-    public void testStreamTextMD() throws CTFReaderException {
+    public void testStreamTextMD() throws CTFException {
         CTFTrace trace = testSingleFragment();
         fixture.parseTextFragment(mdSecond);
         final List<IEventDeclaration> eventDeclarations = new ArrayList<>(trace.getEventDeclarations(0L));
@@ -217,10 +217,10 @@ public class MetadataTest {
     /**
      * Run the ByteOrder getDetectedByteOrder() method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
-    public void testGetDetectedByteOrder() throws CTFReaderException {
+    public void testGetDetectedByteOrder() throws CTFException {
         setUp();
         ByteOrder result = fixture.getDetectedByteOrder();
         assertNull(result);
@@ -229,10 +229,10 @@ public class MetadataTest {
     /**
      * Test toString
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
-    public void testToString() throws CTFReaderException {
+    public void testToString() throws CTFException {
         setUp();
         String result = fixture.toString();
         assertNotNull(result);
@@ -241,10 +241,10 @@ public class MetadataTest {
     /**
      * Run the void parse() method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
-    public void testParse() throws CTFReaderException {
+    public void testParse() throws CTFException {
         setUp();
         assertEquals(new UUID(0xd18e637435a1cd42L, 0x8e70a9cffa712793L), testTrace.getTrace().getUUID());
         assertEquals(1332166405241713920.0, testTrace.getTrace().getClock().getClockOffset(), 200.0);
index 6670e0177f34b90c46bdf7a99f5c565641aa3672..fccfecb85c49e55b7f58c738d5ab088006267cef 100644 (file)
@@ -19,7 +19,7 @@ import static org.junit.Assume.assumeTrue;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.CTFStrings;
 import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
 import org.eclipse.tracecompass.ctf.core.event.types.IntegerDefinition;
@@ -101,7 +101,7 @@ public class TraceReadAllTracesTest {
                 }
                 assertEquals("Event count", fTraceEnum.getNbEvents(), count);
                 assertEquals("Trace duration", fTraceEnum.getDuration(), (end - start) / 1000000000.0, 1.0);
-            } catch (CTFReaderException e) {
+            } catch (CTFException e) {
                 fail(fTraceEnum.getPath() + " " + e.getMessage());
             }
         } else {
index 9aed828adf1f640411c2a16844b2da20d9dc47b1..91be8f34bbec70feeca6f4b73f30ee096444dff6 100644 (file)
@@ -20,7 +20,7 @@ import static org.junit.Assert.assertTrue;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.AbstractArrayDefinition;
@@ -73,11 +73,11 @@ public class ArrayDeclaration2Test {
      * Run the ArrayDefinition createDefinition(DefinitionScope,String) method
      * test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error in the bitbuffer
      */
     @Test
-    public void testCreateDefinition() throws CTFReaderException {
+    public void testCreateDefinition() throws CTFException {
         String fieldName = "";
         IDefinitionScope definitionScope = null;
         AbstractArrayDefinition result;
index d688c1aa58cdbf622b658c869914cab95d081593..a1ae1217f6b2d86ff7d1c54026a3f53522e05f20 100644 (file)
@@ -20,7 +20,7 @@ import java.util.Arrays;
 import java.util.List;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.scope.LexicalScope;
@@ -201,11 +201,11 @@ public class ArrayDefinition2Test {
     /**
      * Run the void read(BitBuffer) method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void testRead_noDefs() throws CTFReaderException {
+    public void testRead_noDefs() throws CTFException {
         BitBuffer input = new BitBuffer(Util.testMemory(ByteBuffer.allocateDirect(128)));
         charArrayFixture.getDeclaration().createDefinition(null, "test", input);
     }
index 807156788350db3cf7a01201bf7873b97e1389de..88802aa0bfe9d530daf497ff807cb94198036942 100644 (file)
@@ -20,7 +20,7 @@ import static org.junit.Assert.assertTrue;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
@@ -84,11 +84,11 @@ public class EnumDeclarationTest {
      * Run the EnumDefinition createDefinition(DefinitionScope,String) method
      * test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             out of bounds error, won't happen
      */
     @Test
-    public void testCreateDefinition() throws CTFReaderException {
+    public void testCreateDefinition() throws CTFException {
         IDefinitionScope definitionScope = null;
         String fieldName = "";
         byte[] array = { 't', 'e', 's', 't', '\0', 't', 'h', 'i', 's', '\0' };
index 31944ae360adb41c5c54ad1b916199e8934d0cc3..7545050c98395097c1573c8d20884ae421ea27e3 100644 (file)
@@ -18,7 +18,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assume.assumeTrue;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
 import org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration;
 import org.eclipse.tracecompass.ctf.core.tests.shared.CtfTestTrace;
@@ -46,10 +46,10 @@ public class EventDeclarationTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         assumeTrue(testTrace.exists());
         fixture = new EventDeclaration();
         fixture.setContext(new StructDeclaration(1L));
@@ -91,10 +91,10 @@ public class EventDeclarationTest {
     /**
      * Run the boolean equals(Object) method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
-    public void testEquals() throws CTFReaderException {
+    public void testEquals() throws CTFException {
         EventDeclaration obj = new EventDeclaration();
         obj.setContext(new StructDeclaration(1L));
         obj.setId(1L);
@@ -311,10 +311,10 @@ public class EventDeclarationTest {
     /**
      * Test for the EventDefinition class
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Test
-    public void testEventDefinition() throws CTFReaderException {
+    public void testEventDefinition() throws CTFException {
         CTFTrace trace = testTrace.getTrace();
         EventDefinition ed = null;
         try (CTFTraceReader tr = new CTFTraceReader(trace);) {
index f25ab5d8c01b8290c18161f679afc52fd0b80061..9b62c33f382cd23fb3c91b5b797e02420851c729 100644 (file)
@@ -18,7 +18,7 @@ import java.nio.ByteOrder;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
 import org.eclipse.tracecompass.ctf.core.event.types.EnumDeclaration;
@@ -324,11 +324,11 @@ public class EventHeaderDeclarationTest {
     /**
      * Test an compact compact header
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if {@link BitBuffer} is null
      */
     @Test
-    public void testCompactCompact() throws CTFReaderException {
+    public void testCompactCompact() throws CTFException {
         ByteBuffer buffer = ByteBuffer.allocate(16);
         buffer.putInt(0x80000042);
         byte[] validCompact1 = buffer.array();
@@ -345,11 +345,11 @@ public class EventHeaderDeclarationTest {
     /**
      * Test an extended compact header
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if {@link BitBuffer} is null
      */
     @Test
-    public void testCompactExtended() throws CTFReaderException {
+    public void testCompactExtended() throws CTFException {
         ByteBuffer buffer = ByteBuffer.allocate(16);
         buffer.put((byte) 0xFF);
         buffer.putInt(ID);
@@ -368,11 +368,11 @@ public class EventHeaderDeclarationTest {
     /**
      * Test an compact large header
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if {@link BitBuffer} is null
      */
     @Test
-    public void testLargeCompact() throws CTFReaderException {
+    public void testLargeCompact() throws CTFException {
         ByteBuffer buffer = ByteBuffer.allocate(16);
         buffer.putShort((short) ID);
         buffer.putInt(TIMESTAMP);
@@ -392,11 +392,11 @@ public class EventHeaderDeclarationTest {
     /**
      * Test an large large header
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if {@link BitBuffer} is null
      */
     @Test
-    public void testLargeExtended() throws CTFReaderException {
+    public void testLargeExtended() throws CTFException {
         ByteBuffer buffer = ByteBuffer.allocate(16);
         buffer.putShort((short) -1);
         buffer.putInt(ID);
index d5386e2e6542c549a9ad8223eee9ff741a71b3e0..c5ef4fc6edfa20d8386b67b90e5ae2f2859e9cc4 100644 (file)
@@ -18,7 +18,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.types.FloatDeclaration;
 import org.eclipse.tracecompass.ctf.core.event.types.FloatDefinition;
@@ -46,17 +46,17 @@ public class FloatDefinitionTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error creating floats
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         testFloat248();
         testFloat5311();
     }
 
     @Test
-    public void testFloat248() throws CTFReaderException {
+    public void testFloat248() throws CTFException {
         parent = new FloatDeclaration(8, 24, ByteOrder.nativeOrder(), 0);
         BitBuffer bb = create32BitFloatByteBuffer();
         singleFixture = parent.createDefinition(null, fieldName, bb);
@@ -64,7 +64,7 @@ public class FloatDefinitionTest {
     }
 
     @Test
-    public void testFloat5311() throws CTFReaderException {
+    public void testFloat5311() throws CTFException {
         parent = new FloatDeclaration(11, 53, ByteOrder.nativeOrder(), 0);
         BitBuffer bb = create64BitFloatByteBuffer();
         doubleFixture = parent.createDefinition(null, fieldName, bb);
@@ -72,7 +72,7 @@ public class FloatDefinitionTest {
     }
 
     @Test
-    public void testFloat32Bit() throws CTFReaderException {
+    public void testFloat32Bit() throws CTFException {
         for (int i = 1; i < 31; i++) {
             parent = new FloatDeclaration(i, 32 - i, ByteOrder.nativeOrder(), 0);
 
@@ -83,7 +83,7 @@ public class FloatDefinitionTest {
     }
 
     @Test
-    public void testFloat64Bit() throws CTFReaderException {
+    public void testFloat64Bit() throws CTFException {
         for (int i = 1; i < 63; i++) {
             parent = new FloatDeclaration(i, 64 - i, ByteOrder.nativeOrder(), 0);
             fixture = parent.createDefinition(null, fieldName, create64BitFloatByteBuffer());
@@ -100,7 +100,7 @@ public class FloatDefinitionTest {
     }
 
     @Test
-    public void testFloat48Bit() throws CTFReaderException {
+    public void testFloat48Bit() throws CTFException {
         parent = new FloatDeclaration(12, 32, ByteOrder.nativeOrder(), 0);
         fixture = parent.createDefinition(null, fieldName, create64BitFloatByteBuffer());
         assertNotNull(fixture);
index 4c1cb173f71644bca13cf30d1d9cdf8cc49801b1..bfeb474acedcc9c471ab0138b85d94fd0531b99e 100644 (file)
@@ -18,7 +18,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
@@ -43,11 +43,11 @@ public class IntegerDefinitionTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             won't happen
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         IntegerDeclaration id = IntegerDeclaration.createDeclaration(1, false, 1, ByteOrder.BIG_ENDIAN, Encoding.NONE, clockName, 8);
         ByteBuffer byb = ByteBuffer.allocate(128);
         byb.mark();
index 8a3a0497bc2dada8f44da54ef8f95ed34573ebe7..695376316bb4c19924e58914c51b075e830d3d91 100644 (file)
@@ -20,7 +20,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
 import org.eclipse.tracecompass.ctf.core.event.types.IntegerDeclaration;
@@ -67,11 +67,11 @@ public class IntegerEndiannessTest {
     /**
      * Read 32-bits BE
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void test32BE() throws CTFReaderException {
+    public void test32BE() throws CTFException {
         IntegerDeclaration be = IntegerDeclaration.createDeclaration(32, true, 1, ByteOrder.BIG_ENDIAN, Encoding.NONE, clockName, 8);
         IntegerDefinition fixture_be = be.createDefinition(null, name, input);
         assertEquals(0xabcdef12, fixture_be.getValue());
@@ -80,11 +80,11 @@ public class IntegerEndiannessTest {
     /**
      * Read 64-bits BE
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void test64BE() throws CTFReaderException {
+    public void test64BE() throws CTFException {
         IntegerDeclaration be = IntegerDeclaration.createDeclaration(64, true, 1, ByteOrder.BIG_ENDIAN, Encoding.NONE, clockName, 8);
         IntegerDefinition fixture_be = be.createDefinition(null, name, input);
         assertEquals(0xabcdef123456789aL, fixture_be.getValue());
@@ -93,11 +93,11 @@ public class IntegerEndiannessTest {
     /**
      * Read 32-bits LE
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void test32LE() throws CTFReaderException {
+    public void test32LE() throws CTFException {
         IntegerDeclaration le = IntegerDeclaration.createDeclaration(32, true, 1, ByteOrder.LITTLE_ENDIAN, Encoding.NONE, clockName, 8);
         IntegerDefinition fixture_le = le.createDefinition(null, name, input);
         assertEquals(0x12efcdab, fixture_le.getValue());
@@ -106,11 +106,11 @@ public class IntegerEndiannessTest {
     /**
      * Read 64-bits LE
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Test
-    public void test64LE() throws CTFReaderException {
+    public void test64LE() throws CTFException {
         IntegerDeclaration le = IntegerDeclaration.createDeclaration(64, true, 1, ByteOrder.LITTLE_ENDIAN, Encoding.NONE, clockName, 8);
         IntegerDefinition fixture_le = le.createDefinition(null, name, input);
         assertEquals(0x9a78563412efcdabL, fixture_le.getValue());
index 60158a5362dc52cf2a683219dee4728466189af8..79d389695b69ea71f8a251fe22f40de764b78b45 100644 (file)
@@ -21,7 +21,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.types.AbstractArrayDefinition;
 import org.eclipse.tracecompass.ctf.core.event.types.Definition;
@@ -84,11 +84,11 @@ public class SequenceDeclaration2Test {
      * Run the SequenceDefinition createDefinition(DefinitionScope,String)
      * method test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             an error in the bitbuffer
      */
     @Test
-    public void testCreateDefinition() throws CTFReaderException {
+    public void testCreateDefinition() throws CTFException {
         long seqLen = 2;
         IntegerDeclaration id = IntegerDeclaration.createDeclaration(8, false, 8,
                 ByteOrder.LITTLE_ENDIAN, Encoding.UTF8, "", 32);
index d90f26387cf46e2c36fc86512800c32c739bd73c..e6728abc6ab8543cc8374f098770fddeadddd5a1 100644 (file)
@@ -16,7 +16,7 @@ import static org.junit.Assert.assertNotNull;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.types.Definition;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
@@ -52,14 +52,14 @@ public class SequenceDefinition2Test {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         fixture = initString();
     }
 
-    private static ByteArrayDefinition initString() throws CTFReaderException {
+    private static ByteArrayDefinition initString() throws CTFException {
         StructDeclaration structDec;
         StructDefinition structDef;
 
index ac855a2c4cb95e942531333d747c72ac4aeddaf7..701672c8303d8b09b127f859eda7c2305777bc91 100644 (file)
@@ -17,7 +17,7 @@ import static org.junit.Assert.assertNotNull;
 
 import java.nio.ByteBuffer;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
@@ -74,11 +74,11 @@ public class StringDeclarationTest {
      * Run the StringDefinition createDefinition(DefinitionScope,String) method
      * test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             out of buffer exception
      */
     @Test
-    public void testCreateDefinition() throws CTFReaderException {
+    public void testCreateDefinition() throws CTFException {
         IDefinitionScope definitionScope = null;
         String fieldName = "id";
         ByteBuffer allocate = ByteBuffer.allocate(100);
index a1718c51e320a5daaf9213fcce1c4c20a90f854e..ed77cbe5ed719edbc2acbe42a6efaad9309d4f76 100644 (file)
@@ -16,7 +16,7 @@ import static org.junit.Assert.assertNotNull;
 
 import java.nio.ByteBuffer;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
@@ -40,11 +40,11 @@ public class StringDefinitionTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             won't happen
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         String name = "testString";
         StringDeclaration stringDec = StringDeclaration.getStringDeclaration(Encoding.UTF8);
         ByteBuffer byteBuffer = ByteBuffer.allocate(100);
index 205dab8d0fa9d8384705052176a99985400eaa40..ce8d5149f673ef0c11f231b8a519958d84d6883a 100644 (file)
@@ -19,7 +19,7 @@ import static org.junit.Assert.assertTrue;
 
 import java.nio.ByteBuffer;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
 import org.eclipse.tracecompass.ctf.core.event.types.IDeclaration;
@@ -75,11 +75,11 @@ public class StructDeclarationTest {
      * Run the StructDefinition createDefinition(DefinitionScope,String) method
      * test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             out of bounds
      */
     @Test
-    public void testCreateDefinition() throws CTFReaderException {
+    public void testCreateDefinition() throws CTFException {
         String fieldName = "";
         ByteBuffer allocate = ByteBuffer.allocate(100);
         if (allocate == null) {
index e563e827bf3befd6e9c84cee7512245841871574..cb13f142f3c6348901ba92c5da260964da53a50d 100644 (file)
@@ -18,7 +18,7 @@ import static org.junit.Assert.assertNull;
 import java.nio.ByteBuffer;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.types.AbstractArrayDefinition;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
@@ -65,11 +65,11 @@ public class StructDefinitionTest {
     /**
      * Perform pre-test initialization.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             won't happen
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         StructDeclaration sDec = new StructDeclaration(12);
         IntegerDeclaration id = IntegerDeclaration.INT_32B_DECL;
         IntegerDeclaration lenDec = IntegerDeclaration.UINT_8_DECL;
index f994aba93dd75a16584dc7f15688183b3a14da4e..f8564e82843670c7b0745e82d8f9464ba63b302f 100644 (file)
@@ -18,7 +18,7 @@ import static org.junit.Assume.assumeTrue;
 
 import java.nio.ByteBuffer;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.Definition;
@@ -61,7 +61,7 @@ public class VariantDeclarationTest {
         fixture = new VariantDeclaration();
     }
 
-    private static IDefinitionScope createDefinitionScope() throws CTFReaderException {
+    private static IDefinitionScope createDefinitionScope() throws CTFException {
         assumeTrue(testTrace.exists());
         StructDeclaration declaration = new StructDeclaration(8);
         VariantDeclaration variantDeclaration = new VariantDeclaration();
@@ -133,11 +133,11 @@ public class VariantDeclarationTest {
      * Run the VariantDefinition createDefinition(DefinitionScope,String) method
      * test.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Should not happen
      */
     @Test
-    public void testCreateDefinition() throws CTFReaderException {
+    public void testCreateDefinition() throws CTFException {
         fixture.setTag("tag");
         fixture.addField("a", IntegerDeclaration.UINT_64B_DECL);
         IDefinitionScope definitionScope = createDefinitionScope();
index 6f6a56dc6aaa4f49861b2f2748194028120b4fe9..7e9bd86cfd8407d1e0cebcab784c325a5b8742ba 100644 (file)
@@ -19,7 +19,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.AbstractArrayDefinition;
@@ -75,11 +75,11 @@ public class VariantDefinitionTest {
      *
      * Not sure it needs to be that complicated, oh well...
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             won't happen
      */
     @Before
-    public void setUp() throws CTFReaderException {
+    public void setUp() throws CTFException {
         StructDeclaration sDec = new StructDeclaration(12);
         StructDeclaration smallStruct = new StructDeclaration(8);
         IntegerDeclaration iDec = IntegerDeclaration.createDeclaration(32, false, 32, ByteOrder.BIG_ENDIAN, Encoding.NONE, "", 8);
@@ -124,11 +124,11 @@ public class VariantDefinitionTest {
     /**
      * Run the VariantDefinition(VariantDeclaration,DefinitionScope,String)
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             should not happen
      */
     @Test
-    public void testVariantDefinition() throws CTFReaderException {
+    public void testVariantDefinition() throws CTFException {
         VariantDeclaration declaration = new VariantDeclaration();
         declaration.setTag("");
         VariantDeclaration variantDeclaration = new VariantDeclaration();
diff --git a/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/CTFException.java b/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/CTFException.java
new file mode 100644 (file)
index 0000000..ae11e0f
--- /dev/null
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2014 Ericsson, Ecole Polytechnique de Montreal
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Alexandre Montplaisir - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.ctf.core;
+
+/**
+ * General exception that is thrown when there is a problem somewhere with the
+ * CTF trace reader.
+ *
+ * @author Alexandre Montplaisir
+ * @since 1.0
+ */
+public class CTFException extends Exception {
+
+    private static final long serialVersionUID = 2065258365219777672L;
+
+    /**
+     * Default constructor with no message.
+     */
+    public CTFException() {
+        super();
+    }
+
+    /**
+     * Constructor with an attached message.
+     *
+     * @param message
+     *            The message attached to this exception
+     */
+    public CTFException(String message) {
+        super(message);
+    }
+
+    /**
+     * Re-throw an exception into this type.
+     *
+     * @param e
+     *            The previous Exception we caught
+     */
+    public CTFException(Exception e) {
+        super(e);
+    }
+
+    /**
+     * Constructor with an attached message and re-throw an exception into this type.
+     *
+     * @param message
+     *            The message attached to this exception
+     * @param exception
+     *            The previous Exception caught
+     */
+    public CTFException(String message, Throwable exception) {
+        super(message, exception);
+    }
+
+}
diff --git a/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/CTFReaderException.java b/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/CTFReaderException.java
deleted file mode 100644 (file)
index 94050d7..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2014 Ericsson, Ecole Polytechnique de Montreal
- *
- * All rights reserved. This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.ctf.core;
-
-/**
- * General exception that is thrown when there is a problem somewhere with the
- * CTF trace reader.
- *
- * @author Alexandre Montplaisir
- * @since 1.0
- */
-public class CTFReaderException extends Exception {
-
-    private static final long serialVersionUID = 2065258365219777672L;
-
-    /**
-     * Default constructor with no message.
-     */
-    public CTFReaderException() {
-        super();
-    }
-
-    /**
-     * Constructor with an attached message.
-     *
-     * @param message
-     *            The message attached to this exception
-     */
-    public CTFReaderException(String message) {
-        super(message);
-    }
-
-    /**
-     * Re-throw an exception into this type.
-     *
-     * @param e
-     *            The previous Exception we caught
-     */
-    public CTFReaderException(Exception e) {
-        super(e);
-    }
-
-    /**
-     * Constructor with an attached message and re-throw an exception into this type.
-     *
-     * @param message
-     *            The message attached to this exception
-     * @param exception
-     *            The previous Exception caught
-     */
-    public CTFReaderException(String message, Throwable exception) {
-        super(message, exception);
-    }
-
-}
index 5af3ec7b221a03fe2c4eab299521cd97b2236efc..f29856bf1968e6abe3f4d18f8dfa279f2f217ee4 100644 (file)
@@ -14,7 +14,7 @@ package org.eclipse.tracecompass.ctf.core.event;
 import java.util.Set;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration;
 import org.eclipse.tracecompass.ctf.core.trace.CTFStream;
@@ -38,11 +38,11 @@ public interface IEventDeclaration {
      * @param timestamp
      *            The timestamp when the event was taken
      * @return A new EventDefinition.
-     * @throws CTFReaderException
+     * @throws CTFException
      *             As a bitbuffer is used to read, it could have wrapped
      *             IOExceptions.
      */
-    EventDefinition createDefinition(CTFStreamInputReader streamInputReader, @NonNull BitBuffer input, long timestamp) throws CTFReaderException;
+    EventDefinition createDefinition(CTFStreamInputReader streamInputReader, @NonNull BitBuffer input, long timestamp) throws CTFException;
 
     /**
      * Gets the name of an event declaration
index 3dde68f85185a402af9830b5b75777a5461519d4..b889473a82d97eed6a7a831f039b77d1d8da1c56 100644 (file)
@@ -22,7 +22,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 
 /**
  * <b><u>BitBuffer</u></b>
@@ -107,11 +107,11 @@ public final class BitBuffer {
      * byte order.
      *
      * @return The int value (signed) read from the buffer
-     * @throws CTFReaderException
+     * @throws CTFException
      *             An error occurred reading the long. This exception can be
      *             raised if the buffer tries to read out of bounds
      */
-    public int getInt() throws CTFReaderException {
+    public int getInt() throws CTFException {
         return getInt(BIT_INT, true);
     }
 
@@ -122,11 +122,11 @@ public final class BitBuffer {
      * byte order.
      *
      * @return The long value (signed) read from the buffer
-     * @throws CTFReaderException
+     * @throws CTFException
      *             An error occurred reading the long. This exception can be
      *             raised if the buffer tries to read out of bounds
      */
-    public long getLong() throws CTFReaderException {
+    public long getLong() throws CTFException {
         return get(BIT_LONG, true);
     }
 
@@ -142,14 +142,14 @@ public final class BitBuffer {
      * @param signed
      *            The sign extended flag
      * @return The long value read from the buffer
-     * @throws CTFReaderException
+     * @throws CTFException
      *             An error occurred reading the data. If more than 64 bits at a
      *             time are read, or the buffer is read beyond its end, this
      *             exception will be raised.
      */
-    public long get(int length, boolean signed) throws CTFReaderException {
+    public long get(int length, boolean signed) throws CTFException {
         if (length > BIT_LONG) {
-            throw new CTFReaderException("Cannot read a long longer than 64 bits. Rquested: " + length); //$NON-NLS-1$
+            throw new CTFException("Cannot read a long longer than 64 bits. Rquested: " + length); //$NON-NLS-1$
         }
         if (length > BIT_INT) {
             final int highShift = length - BIT_INT;
@@ -205,11 +205,11 @@ public final class BitBuffer {
      * @param signed
      *            The sign extended flag
      * @return The int value read from the buffer
-     * @throws CTFReaderException
+     * @throws CTFException
      *             An error occurred reading the data. When the buffer is read
      *             beyond its end, this exception will be raised.
      */
-    private int getInt(int length, boolean signed) throws CTFReaderException {
+    private int getInt(int length, boolean signed) throws CTFException {
 
         /* Nothing to read. */
         if (length == 0) {
@@ -218,7 +218,7 @@ public final class BitBuffer {
 
         /* Validate that the buffer has enough bits. */
         if (!canRead(length)) {
-            throw new CTFReaderException("Cannot read the integer, " + //$NON-NLS-1$
+            throw new CTFException("Cannot read the integer, " + //$NON-NLS-1$
                     "the buffer does not have enough remaining space. " + //$NON-NLS-1$
                     "Requested:" + length); //$NON-NLS-1$
         }
@@ -402,11 +402,11 @@ public final class BitBuffer {
      *
      * @param value
      *            The int value to write
-     * @throws CTFReaderException
+     * @throws CTFException
      *             An error occurred writing the data. If the buffer is written
      *             beyond its end, this exception will be raised.
      */
-    public void putInt(int value) throws CTFReaderException {
+    public void putInt(int value) throws CTFException {
         putInt(BIT_INT, value);
     }
 
@@ -423,15 +423,15 @@ public final class BitBuffer {
      *            The number of bits to write
      * @param value
      *            The value to write
-     * @throws CTFReaderException
+     * @throws CTFException
      *             An error occurred writing the data. If the buffer is written
      *             beyond its end, this exception will be raised.
      */
-    public void putInt(int length, int value) throws CTFReaderException {
+    public void putInt(int length, int value) throws CTFException {
         final long curPos = fPosition;
 
         if (!canRead(length)) {
-            throw new CTFReaderException("Cannot write to bitbuffer, " //$NON-NLS-1$
+            throw new CTFException("Cannot write to bitbuffer, " //$NON-NLS-1$
                     + "insufficient space. Requested: " + length); //$NON-NLS-1$
         }
         if (length == 0) {
@@ -618,13 +618,13 @@ public final class BitBuffer {
      *
      * @param newPosition
      *            The new position of the buffer.
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Thrown on out of bounds exceptions
      */
-    public void position(long newPosition) throws CTFReaderException {
+    public void position(long newPosition) throws CTFException {
 
         if (newPosition > fBitCapacity) {
-            throw new CTFReaderException("Out of bounds exception on a position move, attempting to access position: " + newPosition); //$NON-NLS-1$
+            throw new CTFException("Out of bounds exception on a position move, attempting to access position: " + newPosition); //$NON-NLS-1$
         }
         fPosition = newPosition;
     }
index 018acd24b149718f76fb9439aeedfd612c9f45bb..58dbf33dba7b01c2fcf9ec67c16c0dcf14d0d111 100644 (file)
@@ -12,7 +12,7 @@
 package org.eclipse.tracecompass.ctf.core.event.types;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.scope.ILexicalScope;
@@ -53,10 +53,10 @@ public abstract class Declaration implements IDeclaration {
      *
      * @param input
      *            The bitbuffer that is being read
-     * @throws CTFReaderException
+     * @throws CTFException
      *             Happens when there is an out of bounds exception
      */
-    protected final void alignRead(BitBuffer input) throws CTFReaderException {
+    protected final void alignRead(BitBuffer input) throws CTFException {
         long mask = getAlignment() - 1;
         /*
          * The alignment is a power of 2
index 619cc541e52d332106eabb1e87a1ea5da6b1c0ce..5e697f9eb064d9ab6ede2a5db9c6b8cf1fdbc5d9 100644 (file)
@@ -19,7 +19,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 
@@ -87,7 +87,7 @@ public final class EnumDeclaration extends Declaration implements ISimpleDatatyp
     // ------------------------------------------------------------------------
 
     @Override
-    public EnumDefinition createDefinition(@Nullable IDefinitionScope definitionScope, String fieldName, BitBuffer input) throws CTFReaderException {
+    public EnumDefinition createDefinition(@Nullable IDefinitionScope definitionScope, String fieldName, BitBuffer input) throws CTFException {
         alignRead(input);
         IntegerDefinition value = getContainerType().createDefinition(definitionScope, fieldName, input);
         return new EnumDefinition(this, definitionScope, fieldName, value);
index 683bf978e975246bfa79c6ce43c291bf891258f3..cd19941b599b2df3fb3156ce6b2abbd12d976684 100644 (file)
@@ -15,7 +15,7 @@ import java.nio.ByteOrder;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 
@@ -109,7 +109,7 @@ public final class FloatDeclaration extends Declaration implements ISimpleDataty
 
     @Override
     public FloatDefinition createDefinition(@Nullable IDefinitionScope definitionScope,
-            String fieldName, BitBuffer input) throws CTFReaderException {
+            String fieldName, BitBuffer input) throws CTFException {
         ByteOrder byteOrder = input.getByteOrder();
         input.setByteOrder(fByteOrder);
         double value = read(input);
@@ -123,7 +123,7 @@ public final class FloatDeclaration extends Declaration implements ISimpleDataty
         return "[declaration] float[" + Integer.toHexString(hashCode()) + ']'; //$NON-NLS-1$
     }
 
-    private double read(BitBuffer input) throws CTFReaderException {
+    private double read(BitBuffer input) throws CTFException {
         /* Offset the buffer position wrt the current alignment */
         alignRead(input);
         final int exp = getExponent();
@@ -138,13 +138,13 @@ public final class FloatDeclaration extends Declaration implements ISimpleDataty
     }
 
     private static double readRawFloat32(BitBuffer input, final int manBits,
-            final int expBits) throws CTFReaderException {
+            final int expBits) throws CTFException {
         long temp = input.get(32, false);
         return createFloat(temp, manBits - 1, expBits);
     }
 
     private static double readRawFloat64(BitBuffer input, final int manBits,
-            final int expBits) throws CTFReaderException {
+            final int expBits) throws CTFException {
         long temp = input.get(64, false);
         return createFloat(temp, manBits - 1, expBits);
     }
index be778153cf0d20fa4b07ba66f0f11e51cdf80901..9496337a5188629caa15b2aa0d788fe9582e3433 100644 (file)
@@ -13,7 +13,7 @@
 package org.eclipse.tracecompass.ctf.core.event.types;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.scope.ILexicalScope;
@@ -44,10 +44,10 @@ public interface IDeclaration {
      * @param input
      *            a bitbuffer to read from
      * @return a reference to the definition
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error in reading
      */
-    Definition createDefinition(IDefinitionScope definitionScope, @NonNull String fieldName, @NonNull BitBuffer input) throws CTFReaderException;
+    Definition createDefinition(IDefinitionScope definitionScope, @NonNull String fieldName, @NonNull BitBuffer input) throws CTFException;
 
     /**
      * Get the path of a definition
index 8dfec6457d4897f9c90557315651fb81f8038429..eb03d3bfcd2772dc2dfa9c27249149016f0f8842 100644 (file)
@@ -21,7 +21,7 @@ import java.nio.ByteOrder;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 
@@ -347,7 +347,7 @@ public final class IntegerDeclaration extends Declaration implements ISimpleData
 
     @Override
     public IntegerDefinition createDefinition(@Nullable IDefinitionScope definitionScope,
-            String fieldName, BitBuffer input) throws CTFReaderException {
+            String fieldName, BitBuffer input) throws CTFException {
         ByteOrder byteOrder = input.getByteOrder();
         input.setByteOrder(fByteOrder);
         long value = read(input);
@@ -400,7 +400,7 @@ public final class IntegerDeclaration extends Declaration implements ISimpleData
         return checkNotNull(BigInteger.ONE.shiftLeft(significantBits).negate());
     }
 
-    private long read(BitBuffer input) throws CTFReaderException {
+    private long read(BitBuffer input) throws CTFException {
         /* Offset the buffer position wrt the current alignment */
         alignRead(input);
 
@@ -419,7 +419,7 @@ public final class IntegerDeclaration extends Declaration implements ISimpleData
         }
 
         if (length > SIZE_64) {
-            throw new CTFReaderException("Cannot read an integer with over 64 bits. Length given: " + length); //$NON-NLS-1$
+            throw new CTFException("Cannot read an integer with over 64 bits. Length given: " + length); //$NON-NLS-1$
         }
 
         bits = input.get(length, signed);
index 302b7bfcaa97c0dd5f10fed46d0f64ad334be876..045e12d3e50cc0bd8e4850e2d1093c8f7d87d66f 100644 (file)
@@ -15,7 +15,7 @@ package org.eclipse.tracecompass.ctf.core.event.types;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.common.core.NonNullUtils;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 
@@ -123,12 +123,12 @@ public class StringDeclaration extends Declaration {
 
     @Override
     public StringDefinition createDefinition(@Nullable IDefinitionScope definitionScope,
-            String fieldName, BitBuffer input) throws CTFReaderException {
+            String fieldName, BitBuffer input) throws CTFException {
         String value = read(input);
         return new StringDefinition(this, definitionScope, fieldName, value);
     }
 
-    private String read(BitBuffer input) throws CTFReaderException {
+    private String read(BitBuffer input) throws CTFException {
         /* Offset the buffer position wrt the current alignment */
         alignRead(input);
 
index 809a26aff3fcbc0f794a60744d13e890a6c0f122..6ac65cd786b8757f8fd205b137810b202e2f1b0d 100644 (file)
@@ -23,7 +23,7 @@ import java.util.Map.Entry;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.scope.ILexicalScope;
@@ -158,7 +158,7 @@ public class StructDeclaration extends Declaration {
 
     @Override
     public StructDefinition createDefinition(IDefinitionScope definitionScope,
-            String fieldName, BitBuffer input) throws CTFReaderException {
+            String fieldName, BitBuffer input) throws CTFException {
         alignRead(input);
         final Definition[] myFields = new Definition[fFieldMap.size()];
         StructDefinition structDefinition = new StructDefinition(this, definitionScope, fieldName, fFieldMap.keySet(), myFields);
@@ -178,12 +178,12 @@ public class StructDeclaration extends Declaration {
      * @param input
      *            a bitbuffer to read from
      * @return a reference to the definition
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error in reading
      * @since 1.0
      */
     public StructDefinition createDefinition(IDefinitionScope definitionScope,
-            ILexicalScope fieldScope, @NonNull BitBuffer input) throws CTFReaderException {
+            ILexicalScope fieldScope, @NonNull BitBuffer input) throws CTFException {
         alignRead(input);
         final Definition[] myFields = new Definition[fFieldMap.size()];
 
@@ -206,7 +206,7 @@ public class StructDeclaration extends Declaration {
         fMaxAlign = Math.max(fMaxAlign, declaration.getAlignment());
     }
 
-    private void fillStruct(@NonNull BitBuffer input, final Definition[] myFields, StructDefinition structDefinition) throws CTFReaderException {
+    private void fillStruct(@NonNull BitBuffer input, final Definition[] myFields, StructDefinition structDefinition) throws CTFException {
         Iterator<Map.Entry<String, IDeclaration>> iter = fFieldMap.entrySet().iterator();
         for (int i = 0; i < fFieldMap.size(); i++) {
             Map.Entry<String, IDeclaration> entry = iter.next();
index f4907068c38e34e0881af4f3a390d94f8887d232..2127c2fc0ca3c63ee305db1a2fcd097c3c14b5b0 100644 (file)
@@ -20,7 +20,7 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 
@@ -117,17 +117,17 @@ public class VariantDeclaration extends Declaration {
 
     @Override
     public VariantDefinition createDefinition(IDefinitionScope definitionScope,
-            String fieldName, BitBuffer input) throws CTFReaderException {
+            String fieldName, BitBuffer input) throws CTFException {
         alignRead(input);
         Definition def = definitionScope.lookupDefinition(fTag);
         EnumDefinition tagDef = (EnumDefinition) ((def instanceof EnumDefinition) ? def : null);
         if (tagDef == null) {
-            throw new CTFReaderException("Tag is not defined " + fTag); //$NON-NLS-1$
+            throw new CTFException("Tag is not defined " + fTag); //$NON-NLS-1$
         }
         String varFieldName = tagDef.getStringValue();
         fDeclarationToPopulate = fFields.get(varFieldName);
         if (fDeclarationToPopulate == null) {
-            throw new CTFReaderException("Unknown enum selector for variant " + //$NON-NLS-1$
+            throw new CTFException("Unknown enum selector for variant " + //$NON-NLS-1$
                     definitionScope.getScopePath().getPath());
         }
         Definition fieldValue = fDeclarationToPopulate.createDefinition(definitionScope, fieldName, input);
diff --git a/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/trace/CTFIOException.java b/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/trace/CTFIOException.java
new file mode 100644 (file)
index 0000000..996c53b
--- /dev/null
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tracecompass.ctf.core.trace;
+
+import org.eclipse.tracecompass.ctf.core.CTFException;
+
+/**
+ * An exception just for trace readers and writers
+ *
+ * @since 1.0
+ */
+public class CTFIOException extends CTFException {
+
+    /**
+     * Unique ID
+     */
+    private static final long serialVersionUID = -2216400542574921838L;
+
+    /**
+     * Constructor with an attached message.
+     *
+     * @param message
+     *            The message attached to this exception
+     */
+    public CTFIOException(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructor with an attached message.
+     *
+     * @param e
+     *            The exception attached to this exception
+     */
+    public CTFIOException(Exception e) {
+        super(e);
+    }
+
+    /**
+     * Constructor with an attached message and exception.
+     *
+     * @param message
+     *            The message attached to this exception
+     * @param e
+     *            The encapsulated exception
+     * @since 1.0
+     */
+    public CTFIOException(String message, Exception e) {
+        super(message, e);
+    }
+
+}
index 64b876f2d42e3d078f93b1f8248bab8f39c59193..b687d7a2696e3ffe38cee4b3a1c4b82328b4011c 100644 (file)
@@ -21,7 +21,7 @@ import java.util.Set;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
 import org.eclipse.tracecompass.ctf.core.event.types.IDeclaration;
 import org.eclipse.tracecompass.ctf.core.event.types.IEventHeaderDeclaration;
@@ -306,12 +306,12 @@ public class CTFStream {
      *
      * @param events
      *            list of the events to add
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if the list already contains data
      */
-    public void addEvents(Collection<IEventDeclaration> events) throws CTFReaderException {
+    public void addEvents(Collection<IEventDeclaration> events) throws CTFException {
         if (fEventUnsetId) {
-            throw new CTFReaderException("Cannot add to a stream with an unidentified event"); //$NON-NLS-1$
+            throw new CTFException("Cannot add to a stream with an unidentified event"); //$NON-NLS-1$
         }
         if (fEvents.isEmpty()) {
             fEvents.addAll(events);
@@ -322,7 +322,7 @@ public class CTFStream {
                 int index = event.getId().intValue();
                 ensureSize(fEvents, index);
                 if (fEvents.get(index) != null) {
-                    throw new CTFReaderException("Both lists have an event defined at position " + index); //$NON-NLS-1$
+                    throw new CTFException("Both lists have an event defined at position " + index); //$NON-NLS-1$
                 }
                 fEvents.set(index, event);
             }
index 0c8c6cbc1af8bcdf289a05ac09b691f38fd05811..8698b72e821852bb94b0452cc6bfa617731021f7 100644 (file)
@@ -22,7 +22,7 @@ import java.util.UUID;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.scope.ILexicalScope;
@@ -209,10 +209,10 @@ public class CTFStreamInput implements IDefinitionScope {
      * properly</strong>
      *
      * @return true if there are more packets to add
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If there was a problem reading the packed header
      */
-    public boolean addPacketHeaderIndex() throws CTFReaderException {
+    public boolean addPacketHeaderIndex() throws CTFException {
         long currentPosBits = 0L;
         if (!fIndex.isEmpty()) {
             StreamInputPacketIndexEntry pos = fIndex.lastElement();
@@ -233,7 +233,7 @@ public class CTFStreamInput implements IDefinitionScope {
     }
 
     private StreamInputPacketIndexEntry createPacketIndexEntry(long dataOffsetbits)
-            throws CTFReaderException {
+            throws CTFException {
 
         try (FileChannel fc = FileChannel.open(fFile.toPath(), StandardOpenOption.READ)) {
             if (fc == null) {
@@ -253,19 +253,19 @@ public class CTFStreamInput implements IDefinitionScope {
 
             /* Basic validation */
             if (packetIndex.getContentSizeBits() > packetIndex.getPacketSizeBits()) {
-                throw new CTFReaderException("Content size > packet size"); //$NON-NLS-1$
+                throw new CTFException("Content size > packet size"); //$NON-NLS-1$
             }
 
             if (packetIndex.getPacketSizeBits() > ((size * Byte.SIZE - packetIndex.getOffsetBits()))) {
-                throw new CTFReaderException("Not enough data remaining in the file for the size of this packet"); //$NON-NLS-1$
+                throw new CTFException("Not enough data remaining in the file for the size of this packet"); //$NON-NLS-1$
             }
             return packetIndex;
         } catch (IOException e) {
-            throw new CTFReaderException("Failed to create packet index entry", e); //$NON-NLS-1$
+            throw new CTFException("Failed to create packet index entry", e); //$NON-NLS-1$
         }
     }
 
-    private BitBuffer createBitBufferForPacketHeader(FileChannel fc, long dataOffsetbits) throws CTFReaderException, IOException {
+    private BitBuffer createBitBufferForPacketHeader(FileChannel fc, long dataOffsetbits) throws CTFException, IOException {
         /*
          * create a packet bit buffer to read the packet header
          */
@@ -275,16 +275,16 @@ public class CTFStreamInput implements IDefinitionScope {
         return bitBuffer;
     }
 
-    private static ByteBuffer getByteBufferAt(FileChannel fc, long position, long size) throws CTFReaderException, IOException {
+    private static ByteBuffer getByteBufferAt(FileChannel fc, long position, long size) throws CTFException, IOException {
         ByteBuffer map = SafeMappedByteBuffer.map(fc, MapMode.READ_ONLY, position, size);
         if (map == null) {
-            throw new CTFReaderException("Failed to allocate mapped byte buffer"); //$NON-NLS-1$
+            throw new CTFException("Failed to allocate mapped byte buffer"); //$NON-NLS-1$
         }
         return map;
     }
 
     private static ByteBuffer createPacketBitBuffer(FileChannel fc,
-            long packetOffsetBytes, long maxSize) throws CTFReaderException, IOException {
+            long packetOffsetBytes, long maxSize) throws CTFException, IOException {
         /*
          * If there is less data remaining than what we want to map, reduce the
          * map size.
@@ -305,12 +305,12 @@ public class CTFStreamInput implements IDefinitionScope {
         try {
             return getByteBufferAt(fc, packetOffsetBytes, mapSize);
         } catch (IllegalArgumentException | IOException e) {
-            throw new CTFReaderException(e);
+            throw new CTFException(e);
         }
     }
 
     private StructDefinition parseTracePacketHeader(
-            BitBuffer bitBuffer) throws CTFReaderException {
+            BitBuffer bitBuffer) throws CTFException {
 
         StructDefinition tracePacketHeaderDef = fTracePacketHeaderDecl.createDefinition(fStream.getTrace(), ILexicalScope.TRACE_PACKET_HEADER, bitBuffer);
 
@@ -322,7 +322,7 @@ public class CTFStreamInput implements IDefinitionScope {
         if (magicDef != null) {
             int magic = (int) magicDef.getValue();
             if (magic != Utils.CTF_MAGIC) {
-                throw new CTFReaderException(
+                throw new CTFException(
                         "CTF magic mismatch " + Integer.toHexString(magic) + " vs " + Integer.toHexString(Utils.CTF_MAGIC)); //$NON-NLS-1$//$NON-NLS-2$
             }
         }
@@ -336,7 +336,7 @@ public class CTFStreamInput implements IDefinitionScope {
             UUID uuid = Utils.getUUIDfromDefinition(uuidDef);
 
             if (!getStream().getTrace().getUUID().equals(uuid)) {
-                throw new CTFReaderException("UUID mismatch"); //$NON-NLS-1$
+                throw new CTFException("UUID mismatch"); //$NON-NLS-1$
             }
         }
 
@@ -349,14 +349,14 @@ public class CTFStreamInput implements IDefinitionScope {
             long streamID = streamIDDef.getValue();
 
             if (streamID != getStream().getId()) {
-                throw new CTFReaderException("Stream ID changing within a StreamInput"); //$NON-NLS-1$
+                throw new CTFException("Stream ID changing within a StreamInput"); //$NON-NLS-1$
             }
         }
         return tracePacketHeaderDef;
     }
 
     private StreamInputPacketIndexEntry parsePacketContext(long dataOffsetBits, long fileSizeBytes,
-            BitBuffer bitBuffer) throws CTFReaderException {
+            BitBuffer bitBuffer) throws CTFException {
         StreamInputPacketIndexEntry packetIndex;
         StructDefinition streamPacketContextDef = fStreamPacketContextDecl.createDefinition(this, ILexicalScope.STREAM_PACKET_CONTEXT, bitBuffer);
         packetIndex = new StreamInputPacketIndexEntry(dataOffsetBits, streamPacketContextDef, fileSizeBytes, fLostSoFar);
index 483cae8b402f7655c1a448d8ec517e77ee5a5523..d9e5da24992d220d3919b098a871d86ffd92d7a2 100644 (file)
@@ -17,7 +17,7 @@ import java.nio.channels.FileChannel.MapMode;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.CTFStrings;
 import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
 import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
@@ -132,10 +132,10 @@ public class CTFStreamInputPacketReader implements IDefinitionScope, AutoCloseab
      * @param input
      *            the bitbuffer to read from
      * @return an context definition, can be null
-     * @throws CTFReaderException
+     * @throws CTFException
      *             out of bounds exception or such
      */
-    public StructDefinition getEventContextDefinition(@NonNull BitBuffer input) throws CTFReaderException {
+    public StructDefinition getEventContextDefinition(@NonNull BitBuffer input) throws CTFException {
         return fStreamEventContextDecl.createDefinition(fStreamInputReader.getStreamInput(), ILexicalScope.STREAM_EVENT_CONTEXT, input);
     }
 
@@ -145,10 +145,10 @@ public class CTFStreamInputPacketReader implements IDefinitionScope, AutoCloseab
      * @param input
      *            the bitbuffer to read from
      * @return an context definition, can be null
-     * @throws CTFReaderException
+     * @throws CTFException
      *             out of bounds exception or such
      */
-    public StructDefinition getStreamPacketContextDefinition(@NonNull BitBuffer input) throws CTFReaderException {
+    public StructDefinition getStreamPacketContextDefinition(@NonNull BitBuffer input) throws CTFException {
         return fStreamPacketContextDecl.createDefinition(fStreamInputReader.getStreamInput(), ILexicalScope.STREAM_PACKET_CONTEXT, input);
     }
 
@@ -158,10 +158,10 @@ public class CTFStreamInputPacketReader implements IDefinitionScope, AutoCloseab
      * @param input
      *            the bitbuffer to read from
      * @return an header definition, can be null
-     * @throws CTFReaderException
+     * @throws CTFException
      *             out of bounds exception or such
      */
-    public StructDefinition getTracePacketHeaderDefinition(@NonNull BitBuffer input) throws CTFReaderException {
+    public StructDefinition getTracePacketHeaderDefinition(@NonNull BitBuffer input) throws CTFException {
         return fTracePacketHeaderDecl.createDefinition(fStreamInputReader.getStreamInput().getStream().getTrace(), ILexicalScope.TRACE_PACKET_HEADER, input);
     }
 
@@ -205,10 +205,10 @@ public class CTFStreamInputPacketReader implements IDefinitionScope, AutoCloseab
     // ------------------------------------------------------------------------
 
     @NonNull
-    private ByteBuffer getByteBufferAt(long position, long size) throws CTFReaderException, IOException {
+    private ByteBuffer getByteBufferAt(long position, long size) throws CTFException, IOException {
         ByteBuffer map = SafeMappedByteBuffer.map(fStreamInputReader.getFc(), MapMode.READ_ONLY, position, size);
         if (map == null) {
-            throw new CTFReaderException("Failed to allocate mapped byte buffer"); //$NON-NLS-1$
+            throw new CTFIOException("Failed to allocate mapped byte buffer"); //$NON-NLS-1$
         }
         return map;
     }
@@ -218,10 +218,10 @@ public class CTFStreamInputPacketReader implements IDefinitionScope, AutoCloseab
      *
      * @param currentPacket
      *            The index entry of the packet to switch to.
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If we get an error reading the packet
      */
-    void setCurrentPacket(StreamInputPacketIndexEntry currentPacket) throws CTFReaderException {
+    void setCurrentPacket(StreamInputPacketIndexEntry currentPacket) throws CTFException {
         StreamInputPacketIndexEntry prevPacket = null;
         fCurrentPacket = currentPacket;
 
@@ -233,7 +233,7 @@ public class CTFStreamInputPacketReader implements IDefinitionScope, AutoCloseab
             try {
                 bb = getByteBufferAt(fCurrentPacket.getOffsetBytes(), (fCurrentPacket.getPacketSizeBits() + BITS_PER_BYTE - 1) / BITS_PER_BYTE);
             } catch (IOException e) {
-                throw new CTFReaderException(e.getMessage(), e);
+                throw new CTFIOException(e.getMessage(), e);
             }
 
             BitBuffer bitBuffer = new BitBuffer(bb);
@@ -307,10 +307,10 @@ public class CTFStreamInputPacketReader implements IDefinitionScope, AutoCloseab
      *
      * @return The event definition containing the event data that was just
      *         read.
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If there was a problem reading the trace
      */
-    public EventDefinition readNextEvent() throws CTFReaderException {
+    public EventDefinition readNextEvent() throws CTFException {
         /* Default values for those fields */
         // compromise since we cannot have 64 bit addressing of arrays yet.
         int eventID = (int) EventDeclaration.UNSET_EVENT_ID;
@@ -371,7 +371,7 @@ public class CTFStreamInputPacketReader implements IDefinitionScope, AutoCloseab
                 if (idDef instanceof SimpleDatatypeDefinition) {
                     simpleIdDef = ((SimpleDatatypeDefinition) idDef);
                 } else if (idDef != null) {
-                    throw new CTFReaderException("Id defintion not an integer, enum or float definiton in event header."); //$NON-NLS-1$
+                    throw new CTFIOException("Id defintion not an integer, enum or float definiton in event header."); //$NON-NLS-1$
                 }
 
                 /*
@@ -414,7 +414,7 @@ public class CTFStreamInputPacketReader implements IDefinitionScope, AutoCloseab
         /* Get the right event definition using the event id. */
         IEventDeclaration eventDeclaration = fStreamInputReader.getStreamInput().getStream().getEventDeclaration(eventID);
         if (eventDeclaration == null) {
-            throw new CTFReaderException("Incorrect event id : " + eventID); //$NON-NLS-1$
+            throw new CTFIOException("Incorrect event id : " + eventID); //$NON-NLS-1$
         }
         EventDefinition eventDef = eventDeclaration.createDefinition(fStreamInputReader, currentBitBuffer, timestamp);
 
@@ -424,7 +424,7 @@ public class CTFStreamInputPacketReader implements IDefinitionScope, AutoCloseab
          */
 
         if (posStart == currentBitBuffer.position()) {
-            throw new CTFReaderException("Empty event not allowed, event: " + eventDef.getDeclaration().getName()); //$NON-NLS-1$
+            throw new CTFIOException("Empty event not allowed, event: " + eventDef.getDeclaration().getName()); //$NON-NLS-1$
         }
 
         return eventDef;
index 7d43ca9eb4242303a7745657b384930985d90a47..bbcd64f99910b19e361daab2ca99ec49a4a05aa4 100644 (file)
@@ -19,7 +19,7 @@ import java.nio.channels.FileChannel;
 import java.nio.file.StandardOpenOption;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
 import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
 import org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration;
@@ -82,10 +82,10 @@ public class CTFStreamInputReader implements AutoCloseable {
      *
      * @param streamInput
      *            The StreamInput to read.
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If the file cannot be opened
      */
-    public CTFStreamInputReader(CTFStreamInput streamInput) throws CTFReaderException {
+    public CTFStreamInputReader(CTFStreamInput streamInput) throws CTFException {
         if (streamInput == null) {
             throw new IllegalArgumentException("stream cannot be null"); //$NON-NLS-1$
         }
@@ -94,7 +94,7 @@ public class CTFStreamInputReader implements AutoCloseable {
         try {
             fFileChannel = FileChannel.open(fFile.toPath(), StandardOpenOption.READ);
         } catch (IOException e) {
-            throw new CTFReaderException(e);
+            throw new CTFIOException(e);
         }
         fPacketReader = new CTFStreamInputPacketReader(this);
         /*
@@ -232,10 +232,10 @@ public class CTFStreamInputReader implements AutoCloseable {
      * Reads the next event in the current event variable.
      *
      * @return If an event has been successfully read.
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    public CTFResponse readNextEvent() throws CTFReaderException {
+    public CTFResponse readNextEvent() throws CTFException {
 
         /*
          * Change packet if needed
@@ -263,10 +263,10 @@ public class CTFStreamInputReader implements AutoCloseable {
     /**
      * Change the current packet of the packet reader to the next one.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    private void goToNextPacket() throws CTFReaderException {
+    private void goToNextPacket() throws CTFException {
         fPacketIndex++;
         // did we already index the packet?
         if (getPacketSize() >= (fPacketIndex + 1)) {
@@ -297,10 +297,10 @@ public class CTFStreamInputReader implements AutoCloseable {
      * @param timestamp
      *            The timestamp to seek to.
      * @return The offset compared to the current position
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    public long seek(long timestamp) throws CTFReaderException {
+    public long seek(long timestamp) throws CTFException {
         long offset = 0;
 
         gotoPacket(timestamp);
@@ -313,7 +313,7 @@ public class CTFStreamInputReader implements AutoCloseable {
             try {
                 fStreamInput.addPacketHeaderIndex();
                 goToNextPacket();
-            } catch (CTFReaderException e) {
+            } catch (CTFException e) {
                 // do nothing here
                 Activator.log(e.getMessage());
             }
@@ -344,10 +344,10 @@ public class CTFStreamInputReader implements AutoCloseable {
     /**
      * @param timestamp
      *            the time to seek
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    private void gotoPacket(long timestamp) throws CTFReaderException {
+    private void gotoPacket(long timestamp) throws CTFException {
         fPacketIndex = fStreamInput.getIndex().search(timestamp)
                 .previousIndex();
         /*
@@ -359,10 +359,10 @@ public class CTFStreamInputReader implements AutoCloseable {
     /**
      * Seeks the last event of a stream and returns it.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    public void goToLastEvent() throws CTFReaderException {
+    public void goToLastEvent() throws CTFException {
         /*
          * Search in the index for the packet to search in.
          */
index 235618d7cdc9d79f6d19e96b2a9f8d0ccb41346c..dab79d1ad7f72230d1aa89e32bc79c1df755c685 100644 (file)
@@ -33,7 +33,7 @@ import java.util.Set;
 import java.util.TreeSet;
 import java.util.UUID;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.CTFCallsite;
 import org.eclipse.tracecompass.ctf.core.event.CTFClock;
 import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
@@ -149,10 +149,10 @@ public class CTFTrace implements IDefinitionScope {
      *
      * @param path
      *            Filesystem path of the trace directory
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If no CTF trace was found at the path
      */
-    public CTFTrace(String path) throws CTFReaderException {
+    public CTFTrace(String path) throws CTFException {
         this(new File(path));
     }
 
@@ -161,20 +161,20 @@ public class CTFTrace implements IDefinitionScope {
      *
      * @param path
      *            Filesystem path of the trace directory.
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If no CTF trace was found at the path
      */
-    public CTFTrace(File path) throws CTFReaderException {
+    public CTFTrace(File path) throws CTFException {
         fPath = path;
         final Metadata metadata = new Metadata(this);
 
         /* Set up the internal containers for this trace */
         if (!fPath.exists()) {
-            throw new CTFReaderException("Trace (" + path.getPath() + ") doesn't exist. Deleted or moved?"); //$NON-NLS-1$ //$NON-NLS-2$
+            throw new CTFException("Trace (" + path.getPath() + ") doesn't exist. Deleted or moved?"); //$NON-NLS-1$ //$NON-NLS-2$
         }
 
         if (!fPath.isDirectory()) {
-            throw new CTFReaderException("Path must be a valid directory"); //$NON-NLS-1$
+            throw new CTFException("Path must be a valid directory"); //$NON-NLS-1$
         }
 
         /* Open and parse the metadata file */
@@ -190,7 +190,7 @@ public class CTFTrace implements IDefinitionScope {
         fPath = null;
     }
 
-    private void init(File path) throws CTFReaderException {
+    private void init(File path) throws CTFException {
 
         /* Open all the trace files */
 
@@ -442,16 +442,16 @@ public class CTFTrace implements IDefinitionScope {
      * @param index
      *            Which index in the class' streamFileChannel array this file
      *            must use
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if there is a file error
      */
-    private CTFStream openStreamInput(File streamFile) throws CTFReaderException {
+    private CTFStream openStreamInput(File streamFile) throws CTFException {
         ByteBuffer byteBuffer;
         BitBuffer streamBitBuffer;
         CTFStream stream;
 
         if (!streamFile.canRead()) {
-            throw new CTFReaderException("Unreadable file : " //$NON-NLS-1$
+            throw new CTFException("Unreadable file : " //$NON-NLS-1$
                     + streamFile.getPath());
         }
 
@@ -470,7 +470,7 @@ public class CTFTrace implements IDefinitionScope {
             }
         } catch (IOException e) {
             /* Shouldn't happen at this stage if every other check passed */
-            throw new CTFReaderException(e);
+            throw new CTFException(e);
         }
         if (fPacketHeaderDef != null) {
             validateMagicNumber(fPacketHeaderDef);
@@ -495,7 +495,7 @@ public class CTFTrace implements IDefinitionScope {
         }
 
         if (stream == null) {
-            throw new CTFReaderException("Unexpected end of stream"); //$NON-NLS-1$
+            throw new CTFException("Unexpected end of stream"); //$NON-NLS-1$
         }
 
         /*
@@ -507,22 +507,22 @@ public class CTFTrace implements IDefinitionScope {
         return stream;
     }
 
-    private void validateUUID(StructDefinition packetHeaderDef) throws CTFReaderException {
+    private void validateUUID(StructDefinition packetHeaderDef) throws CTFException {
         IDefinition lookupDefinition = packetHeaderDef.lookupDefinition("uuid"); //$NON-NLS-1$
         ArrayDefinition uuidDef = (ArrayDefinition) lookupDefinition;
         if (uuidDef != null) {
             UUID otheruuid = Utils.getUUIDfromDefinition(uuidDef);
             if (!fUuid.equals(otheruuid)) {
-                throw new CTFReaderException("UUID mismatch"); //$NON-NLS-1$
+                throw new CTFException("UUID mismatch"); //$NON-NLS-1$
             }
         }
     }
 
-    private static void validateMagicNumber(StructDefinition packetHeaderDef) throws CTFReaderException {
+    private static void validateMagicNumber(StructDefinition packetHeaderDef) throws CTFException {
         IntegerDefinition magicDef = (IntegerDefinition) packetHeaderDef.lookupDefinition("magic"); //$NON-NLS-1$
         int magic = (int) magicDef.getValue();
         if (magic != Utils.CTF_MAGIC) {
-            throw new CTFReaderException("CTF magic mismatch"); //$NON-NLS-1$
+            throw new CTFException("CTF magic mismatch"); //$NON-NLS-1$
         }
     }
 
@@ -564,10 +564,10 @@ public class CTFTrace implements IDefinitionScope {
      *
      * @param streamFile
      *            the file of the stream
-     * @throws CTFReaderException
+     * @throws CTFException
      *             A stream had an issue being read
      */
-    public void addStreamFile(File streamFile) throws CTFReaderException {
+    public void addStreamFile(File streamFile) throws CTFException {
         openStreamInput(streamFile);
     }
 
@@ -885,14 +885,14 @@ public class CTFTrace implements IDefinitionScope {
      *            the ID of the stream
      * @param streamFile
      *            new file in the stream
-     * @throws CTFReaderException
+     * @throws CTFException
      *             The file must exist
      */
-    public void addStream(long id, File streamFile) throws CTFReaderException {
+    public void addStream(long id, File streamFile) throws CTFException {
         CTFStream stream = null;
         final File file = streamFile;
         if (file == null) {
-            throw new CTFReaderException("cannot create a stream with no file"); //$NON-NLS-1$
+            throw new CTFException("cannot create a stream with no file"); //$NON-NLS-1$
         }
         if (fStreams.containsKey(id)) {
             stream = fStreams.get(id);
index 1c4f9403442a99d6e76bddb2b386247e7f3d08ea..6286da118b69e625abf3b2495d9c783d2c77eff7 100644 (file)
@@ -21,7 +21,7 @@ import java.util.List;
 import java.util.PriorityQueue;
 import java.util.Set;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
 import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
 import org.eclipse.tracecompass.internal.ctf.core.Activator;
@@ -87,10 +87,10 @@ public class CTFTraceReader implements AutoCloseable {
      *
      * @param trace
      *            The trace to read from.
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    public CTFTraceReader(CTFTrace trace) throws CTFReaderException {
+    public CTFTraceReader(CTFTrace trace) throws CTFException {
         fTrace = trace;
         fStreamInputReaders.clear();
 
@@ -119,10 +119,10 @@ public class CTFTraceReader implements AutoCloseable {
      * Copy constructor
      *
      * @return The new CTFTraceReader
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    public CTFTraceReader copyFrom() throws CTFReaderException {
+    public CTFTraceReader copyFrom() throws CTFException {
         CTFTraceReader newReader = null;
 
         newReader = new CTFTraceReader(fTrace);
@@ -189,10 +189,10 @@ public class CTFTraceReader implements AutoCloseable {
     /**
      * Creates one trace file reader per trace file contained in the trace.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    private void createStreamInputReaders() throws CTFReaderException {
+    private void createStreamInputReaders() throws CTFException {
         /*
          * For each stream.
          */
@@ -220,10 +220,10 @@ public class CTFTraceReader implements AutoCloseable {
     /**
      * Update the priority queue to make it match the parent trace
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             An error occured
      */
-    public void update() throws CTFReaderException {
+    public void update() throws CTFException {
         Set<CTFStreamInputReader> readers = new HashSet<>();
         for (CTFStream stream : fTrace.getStreams()) {
             Set<CTFStreamInput> streamInputs = stream.getStreamInputs();
@@ -271,10 +271,10 @@ public class CTFTraceReader implements AutoCloseable {
      * Initializes the priority queue used to choose the trace file with the
      * lower next event timestamp.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    private void populateStreamInputReaderHeap() throws CTFReaderException {
+    private void populateStreamInputReaderHeap() throws CTFException {
         if (fStreamInputReaders.isEmpty()) {
             fPrio = new PriorityQueue<>(MIN_PRIO_SIZE,
                     new StreamInputReaderTimestampComparator());
@@ -325,10 +325,10 @@ public class CTFTraceReader implements AutoCloseable {
      * Go to the next event.
      *
      * @return True if an event was read.
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    public boolean advance() throws CTFReaderException {
+    public boolean advance() throws CTFException {
         /*
          * Remove the reader from the top of the priority queue.
          */
@@ -379,10 +379,10 @@ public class CTFTraceReader implements AutoCloseable {
     /**
      * Go to the last event in the trace.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    public void goToLastEvent() throws CTFReaderException {
+    public void goToLastEvent() throws CTFException {
         seek(getEndTime());
         while (fPrio.size() > 1) {
             advance();
@@ -400,10 +400,10 @@ public class CTFTraceReader implements AutoCloseable {
      *            the timestamp to seek to
      * @return true if there are events above or equal the seek timestamp, false
      *         if seek at the end of the trace (no valid event).
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if an error occurs
      */
-    public boolean seek(long timestamp) throws CTFReaderException {
+    public boolean seek(long timestamp) throws CTFException {
         /*
          * Remove all the trace readers from the priority queue
          */
index 5f132081a377657a5618ab7dc452bf2148b9792f..060fb5e5d1607683435a90e63f7e73441c8214f8 100644 (file)
@@ -30,7 +30,7 @@ import org.antlr.runtime.CommonTokenStream;
 import org.antlr.runtime.RecognitionException;
 import org.antlr.runtime.tree.CommonTree;
 import org.antlr.runtime.tree.RewriteCardinalityException;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.parser.CTFLexer;
 import org.eclipse.tracecompass.ctf.parser.CTFParser;
 import org.eclipse.tracecompass.ctf.parser.CTFParser.parse_return;
@@ -129,10 +129,10 @@ public class Metadata {
     /**
      * Parse the metadata file.
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If there was a problem parsing the metadata
      */
-    public void parseFile() throws CTFReaderException {
+    public void parseFile() throws CTFException {
 
         /*
          * Reader. It will contain a StringReader if we are using packet-based
@@ -151,15 +151,15 @@ public class Metadata {
             readMetaDataText(metadataTextInput);
 
         } catch (FileNotFoundException e) {
-            throw new CTFReaderException("Cannot find metadata file!", e); //$NON-NLS-1$
+            throw new CTFException("Cannot find metadata file!", e); //$NON-NLS-1$
         } catch (IOException | ParseException e) {
-            throw new CTFReaderException(e);
+            throw new CTFException(e);
         } catch (RecognitionException | RewriteCardinalityException e) {
             throw new CtfAntlrException(e);
         }
     }
 
-    private Reader readBinaryMetaData(FileChannel metadataFileChannel) throws CTFReaderException {
+    private Reader readBinaryMetaData(FileChannel metadataFileChannel) throws CTFException {
         /* Create StringBuffer to receive metadata text */
         StringBuffer metadataText = new StringBuffer();
 
@@ -183,17 +183,17 @@ public class Metadata {
      *
      * @param data
      *            the data to read
-     * @throws CTFReaderException
+     * @throws CTFException
      *             this exception wraps a ParseException, IOException or
      *             CtfAntlrException, three exceptions that can be obtained from
      *             parsing a TSDL file
      */
-    public void parseText(String data) throws CTFReaderException {
+    public void parseText(String data) throws CTFException {
         Reader metadataTextInput = new StringReader(data);
         try {
             readMetaDataText(metadataTextInput);
         } catch (IOException | ParseException e) {
-            throw new CTFReaderException(e);
+            throw new CTFException(e);
         } catch (RecognitionException | RewriteCardinalityException e) {
             throw new CtfAntlrException(e);
         }
@@ -213,17 +213,17 @@ public class Metadata {
      *
      * @param dataFragment
      *            the data to read
-     * @throws CTFReaderException
+     * @throws CTFException
      *             this exception wraps a ParseException, IOException or
      *             CtfAntlrException, three exceptions that can be obtained from
      *             parsing a TSDL file
      */
-    public void parseTextFragment(String dataFragment) throws CTFReaderException {
+    public void parseTextFragment(String dataFragment) throws CTFException {
         Reader metadataTextInput = new StringReader(dataFragment);
         try {
             readMetaDataTextFragment(metadataTextInput);
         } catch (IOException | ParseException e) {
-            throw new CTFReaderException(e);
+            throw new CTFException(e);
         } catch (RecognitionException | RewriteCardinalityException e) {
             throw new CtfAntlrException(e);
         }
@@ -258,10 +258,10 @@ public class Metadata {
      * @param metadataFileChannel
      *            FileChannel of the metadata file.
      * @return True if the metadata is packet-based.
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     private boolean isPacketBased(FileChannel metadataFileChannel)
-            throws CTFReaderException {
+            throws CTFException {
         /*
          * Create a ByteBuffer to read the TSDL magic number (default is
          * big-endian)
@@ -272,7 +272,7 @@ public class Metadata {
         try {
             metadataFileChannel.read(magicByteBuffer, 0);
         } catch (IOException e) {
-            throw new CTFReaderException("Unable to read metadata file channel.", e); //$NON-NLS-1$
+            throw new CTFException("Unable to read metadata file channel.", e); //$NON-NLS-1$
         }
 
         /* Get the first int from the file */
@@ -315,11 +315,11 @@ public class Metadata {
      *            StringBuffer to which the metadata text will be appended.
      * @return A structure describing the header of the metadata packet, or null
      *         if the end of the file is reached.
-     * @throws CTFReaderException
+     * @throws CTFException
      */
     private MetadataPacketHeader readMetadataPacket(
             FileChannel metadataFileChannel, StringBuffer metadataText)
-            throws CTFReaderException {
+            throws CTFException {
         /* Allocate a ByteBuffer for the header */
         ByteBuffer headerByteBuffer = ByteBuffer.allocate(METADATA_PACKET_HEADER_SIZE);
 
@@ -333,11 +333,11 @@ public class Metadata {
             }
 
             if (nbBytesRead != METADATA_PACKET_HEADER_SIZE) {
-                throw new CTFReaderException("Error reading the metadata header."); //$NON-NLS-1$
+                throw new CTFException("Error reading the metadata header."); //$NON-NLS-1$
             }
 
         } catch (IOException e) {
-            throw new CTFReaderException("Error reading the metadata header.", e); //$NON-NLS-1$
+            throw new CTFException("Error reading the metadata header.", e); //$NON-NLS-1$
         }
 
         /* Set ByteBuffer's position to 0 */
@@ -350,20 +350,20 @@ public class Metadata {
 
         /* Check TSDL magic number */
         if (!header.isMagicValid()) {
-            throw new CTFReaderException("TSDL magic number does not match"); //$NON-NLS-1$
+            throw new CTFException("TSDL magic number does not match"); //$NON-NLS-1$
         }
 
         /* Check UUID */
         if (!trace.uuidIsSet()) {
             trace.setUUID(header.getUuid());
         } else if (!trace.getUUID().equals(header.getUuid())) {
-            throw new CTFReaderException("UUID mismatch"); //$NON-NLS-1$
+            throw new CTFException("UUID mismatch"); //$NON-NLS-1$
         }
 
         /* Extract the text from the packet */
         int payloadSize = ((header.getContentSize() / BITS_PER_BYTE) - METADATA_PACKET_HEADER_SIZE);
         if (payloadSize < 0) {
-            throw new CTFReaderException("Invalid metadata packet payload size."); //$NON-NLS-1$
+            throw new CTFException("Invalid metadata packet payload size."); //$NON-NLS-1$
         }
         int skipSize = (header.getPacketSize() - header.getContentSize()) / BITS_PER_BYTE;
 
@@ -373,7 +373,7 @@ public class Metadata {
         try {
             metadataFileChannel.read(payloadByteBuffer);
         } catch (IOException e) {
-            throw new CTFReaderException("Error reading metadata packet payload.", e); //$NON-NLS-1$
+            throw new CTFException("Error reading metadata packet payload.", e); //$NON-NLS-1$
         }
         payloadByteBuffer.rewind();
 
index 9de9bd91376962ac65cfe0b74c1a623bf046ba9c..a51f45e8dc4454b278f161e4612518489a64c042 100644 (file)
@@ -14,7 +14,7 @@ package org.eclipse.tracecompass.ctf.core.trace;
 
 import java.util.UUID;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.types.AbstractArrayDefinition;
 import org.eclipse.tracecompass.ctf.core.event.types.CompoundDeclaration;
 import org.eclipse.tracecompass.ctf.core.event.types.IDeclaration;
@@ -104,33 +104,33 @@ public final class Utils {
      * @param uuidDef
      *            the array defintions, must contain integer bytes
      * @return the UUID
-     * @throws CTFReaderException
+     * @throws CTFException
      *             if the definition contains less than 16 elements
      */
-    public static UUID getUUIDfromDefinition(AbstractArrayDefinition uuidDef) throws CTFReaderException {
+    public static UUID getUUIDfromDefinition(AbstractArrayDefinition uuidDef) throws CTFException {
         byte[] uuidArray = new byte[UUID_LEN];
         IDeclaration declaration = uuidDef.getDeclaration();
         if (!(declaration instanceof CompoundDeclaration)) {
-            throw new CTFReaderException("UUID must be a sequence of unsigned bytes"); //$NON-NLS-1$
+            throw new CTFException("UUID must be a sequence of unsigned bytes"); //$NON-NLS-1$
         }
         CompoundDeclaration uuidDec = (CompoundDeclaration) declaration;
 
         IDeclaration uuidElem = uuidDec.getElementType();
         if (!(uuidElem instanceof IntegerDeclaration)) {
-            throw new CTFReaderException("UUID must be a sequence of unsigned bytes"); //$NON-NLS-1$
+            throw new CTFException("UUID must be a sequence of unsigned bytes"); //$NON-NLS-1$
         }
         IntegerDeclaration intUuidElem = (IntegerDeclaration) uuidElem;
         if (!intUuidElem.isUnsignedByte()) {
-            throw new CTFReaderException("UUID must be a sequence of unsigned bytes"); //$NON-NLS-1$
+            throw new CTFException("UUID must be a sequence of unsigned bytes"); //$NON-NLS-1$
         }
         return getUUID(uuidDef, uuidArray);
     }
 
-    private static UUID getUUID(AbstractArrayDefinition uuidDef, byte[] uuidArray) throws CTFReaderException {
+    private static UUID getUUID(AbstractArrayDefinition uuidDef, byte[] uuidArray) throws CTFException {
         for (int i = 0; i < uuidArray.length; i++) {
             IntegerDefinition uuidByteDef = (IntegerDefinition) uuidDef.getDefinitions().get(i);
             if (uuidByteDef == null) {
-                throw new CTFReaderException("UUID incomplete, only " + i + " bytes available"); //$NON-NLS-1$ //$NON-NLS-2$
+                throw new CTFException("UUID incomplete, only " + i + " bytes available"); //$NON-NLS-1$ //$NON-NLS-2$
             }
             uuidArray[i] = (byte) uuidByteDef.getValue();
         }
index 9fbb31cae36b972b5f5cddbcd6b477ac87619333..f0f0801a7963ba9681f2db1a918435e81a9c8a65 100644 (file)
@@ -17,7 +17,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.CTFStrings;
 import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
 import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
@@ -88,7 +88,7 @@ public class EventDeclaration implements IEventDeclaration {
     }
 
     @Override
-    public EventDefinition createDefinition(CTFStreamInputReader streamInputReader, @NonNull BitBuffer input, long timestamp) throws CTFReaderException {
+    public EventDefinition createDefinition(CTFStreamInputReader streamInputReader, @NonNull BitBuffer input, long timestamp) throws CTFException {
         StructDeclaration streamEventContextDecl = streamInputReader.getStreamEventContextDecl();
         StructDefinition streamEventContext = streamEventContextDecl != null ? streamEventContextDecl.createDefinition(fStream.getTrace(), ILexicalScope.STREAM_EVENT_CONTEXT, input) : null;
         StructDefinition packetContext = streamInputReader.getPacketReader().getCurrentPacketEventHeader();
index bdcaeaceb724fab17cdd5136fb27c64e4f65364f..d23fdc509a1c3f54d224be6d9bb3358fabd4d90d 100644 (file)
@@ -17,19 +17,19 @@ import java.lang.reflect.Field;
 
 import org.antlr.runtime.MismatchedTokenException;
 import org.antlr.runtime.RecognitionException;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.parser.CTFLexer;
 
 /**
  * CTF Reader exception but dealing with Antlr-specific parsing problems.
  *
- * It is separated from the main {@link CTFReaderException} - and is not part of
+ * It is separated from the main {@link CTFException} - and is not part of
  * the API - to isolate the Antlr-specific classes and avoid pushing that
  * dependency to the users of this plugin.
  *
  * @author Matthew Khouzam
  */
-public class CtfAntlrException extends CTFReaderException {
+public class CtfAntlrException extends CTFException {
 
     private static final long serialVersionUID = -7078624493350073777L;
 
index c871a47e51d2b5a929c78e5a18da09dda3cf7f95..b498aa7901f3297f699f716841861d6df8d7b986 100644 (file)
@@ -18,7 +18,7 @@ import java.util.List;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.AbstractArrayDefinition;
@@ -102,7 +102,7 @@ public final class ArrayDeclaration extends CompoundDeclaration {
 
     @Override
     public AbstractArrayDefinition createDefinition(@Nullable IDefinitionScope definitionScope,
-            @NonNull String fieldName, BitBuffer input) throws CTFReaderException {
+            @NonNull String fieldName, BitBuffer input) throws CTFException {
         alignRead(input);
         if (isString()) {
             byte[] data = new byte[fLength];
@@ -119,7 +119,7 @@ public final class ArrayDeclaration extends CompoundDeclaration {
         return "[declaration] array[" + Integer.toHexString(hashCode()) + ']'; //$NON-NLS-1$
     }
 
-    private @NonNull List<Definition> read(@NonNull BitBuffer input, @Nullable IDefinitionScope definitionScope, String fieldName) throws CTFReaderException {
+    private @NonNull List<Definition> read(@NonNull BitBuffer input, @Nullable IDefinitionScope definitionScope, String fieldName) throws CTFException {
         Builder<Definition> definitions = new ImmutableList.Builder<>();
         if (!fChildrenNames.containsKey(fieldName)) {
             for (int i = 0; i < fLength; i++) {
index bf4e6b9195635404a7f67543421bb39c1de15166..64796b40057e84693673ceafa21fa478745e596e 100644 (file)
@@ -17,7 +17,7 @@ import java.util.Collection;
 import java.util.List;
 
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.AbstractArrayDefinition;
@@ -91,7 +91,7 @@ public class SequenceDeclaration extends CompoundDeclaration {
 
     @Override
     public AbstractArrayDefinition createDefinition(
-            @Nullable IDefinitionScope definitionScope, String fieldName, BitBuffer input) throws CTFReaderException {
+            @Nullable IDefinitionScope definitionScope, String fieldName, BitBuffer input) throws CTFException {
         IDefinition lenDef = null;
 
         if (definitionScope != null) {
@@ -99,22 +99,22 @@ public class SequenceDeclaration extends CompoundDeclaration {
         }
 
         if (lenDef == null) {
-            throw new CTFReaderException("Sequence length field not found"); //$NON-NLS-1$
+            throw new CTFException("Sequence length field not found"); //$NON-NLS-1$
         }
 
         if (!(lenDef instanceof IntegerDefinition)) {
-            throw new CTFReaderException("Sequence length field not integer"); //$NON-NLS-1$
+            throw new CTFException("Sequence length field not integer"); //$NON-NLS-1$
         }
 
         IntegerDefinition lengthDefinition = (IntegerDefinition) lenDef;
 
         if (lengthDefinition.getDeclaration().isSigned()) {
-            throw new CTFReaderException("Sequence length must not be signed"); //$NON-NLS-1$
+            throw new CTFException("Sequence length must not be signed"); //$NON-NLS-1$
         }
 
         long length = lengthDefinition.getValue();
         if ((length > Integer.MAX_VALUE) || (!input.canRead((int) length * fElemType.getMaximumSize()))) {
-            throw new CTFReaderException("Sequence length too long " + length); //$NON-NLS-1$
+            throw new CTFException("Sequence length too long " + length); //$NON-NLS-1$
         }
 
         if (isString()) {
index 86a7d8e3f704f4ff54d9389abb36053b9247a49f..4fb632479c6b6c19a4b31da5260556b0abb776ac 100644 (file)
@@ -18,7 +18,7 @@ import java.util.List;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.Declaration;
@@ -149,7 +149,7 @@ public final class EventHeaderCompactDeclaration extends Declaration implements
     }
 
     @Override
-    public EventHeaderDefinition createDefinition(@Nullable IDefinitionScope definitionScope, String fieldName, BitBuffer input) throws CTFReaderException {
+    public EventHeaderDefinition createDefinition(@Nullable IDefinitionScope definitionScope, String fieldName, BitBuffer input) throws CTFException {
         alignRead(input);
         ByteOrder bo = input.getByteOrder();
         input.setByteOrder(fByteOrder);
@@ -163,7 +163,7 @@ public final class EventHeaderCompactDeclaration extends Declaration implements
         input.position(input.position() + 3);
         long id = input.get(ID_SIZE, false);
         if (id > Integer.MAX_VALUE) {
-            throw new CTFReaderException("ID " + id + " larger than " + Integer.MAX_VALUE + " is currently unsupported by the parser"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+            throw new CTFException("ID " + id + " larger than " + Integer.MAX_VALUE + " is currently unsupported by the parser"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
         }
         long timestampLong = input.get(FULL_TS, false);
         input.setByteOrder(bo);
index facd9dff73969495732461a0db46ed20713a7a6c..f1b722b2e598701c5fef2e198f4fea430db7ef27 100644 (file)
@@ -18,7 +18,7 @@ import java.util.List;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.Declaration;
@@ -176,7 +176,7 @@ public final class EventHeaderLargeDeclaration extends Declaration implements IE
     }
 
     @Override
-    public EventHeaderDefinition createDefinition(@Nullable IDefinitionScope definitionScope, String fieldName, BitBuffer input) throws CTFReaderException {
+    public EventHeaderDefinition createDefinition(@Nullable IDefinitionScope definitionScope, String fieldName, BitBuffer input) throws CTFException {
         alignRead(input);
         ByteOrder bo = input.getByteOrder();
         input.setByteOrder(fByteOrder);
@@ -189,7 +189,7 @@ public final class EventHeaderLargeDeclaration extends Declaration implements IE
         long timestampLong = input.get(FULL_TS, false);
         input.setByteOrder(bo);
         if (second > Integer.MAX_VALUE) {
-            throw new CTFReaderException("ID " + second + " larger than " + Integer.MAX_VALUE + " is currently unsupported by the parser"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+            throw new CTFException("ID " + second + " larger than " + Integer.MAX_VALUE + " is currently unsupported by the parser"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
         }
         return new EventHeaderDefinition(this, (int) second, timestampLong, FULL_TS);
     }
index a05bb79fa917a51140994a9a1c8b522437511071..3237ffb73248a212724d71cbae7d4ee0800f14a7 100644 (file)
@@ -26,7 +26,7 @@ import java.util.ListIterator;
 import java.util.TreeSet;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 
 /**
  * <b><u>StreamInputPacketIndex</u></b>
@@ -76,11 +76,11 @@ public class StreamInputPacketIndex {
      * @param preParsedIndex
      *            the pre-parsed index file
      *
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If there was a problem reading the entry
      */
     public void appendAll(Collection<StreamInputPacketIndexEntry> preParsedIndex)
-            throws CTFReaderException {
+            throws CTFException {
         for (StreamInputPacketIndexEntry sipie : preParsedIndex) {
             append(checkNotNull(sipie));
         }
@@ -92,15 +92,15 @@ public class StreamInputPacketIndex {
      * @param entry
      *            element to be appended to this index, cannot be null
      * @return {@code true} (as specified by {@link Collection#add})
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If there was a problem reading the entry
      */
     public boolean append(@NonNull StreamInputPacketIndexEntry entry)
-            throws CTFReaderException {
+            throws CTFException {
 
         /* Validate consistent entry. */
         if (entry.getTimestampBegin() > entry.getTimestampEnd()) {
-            throw new CTFReaderException("Packet begin timestamp is after end timestamp"); //$NON-NLS-1$
+            throw new CTFException("Packet begin timestamp is after end timestamp"); //$NON-NLS-1$
         }
 
         /*
@@ -108,7 +108,7 @@ public class StreamInputPacketIndex {
          * order.
          */
         if (!fEntries.isEmpty() && (entry.getTimestampBegin() < lastElement().getTimestampBegin())) {
-            throw new CTFReaderException("Packets begin timestamp decreasing"); //$NON-NLS-1$
+            throw new CTFException("Packets begin timestamp decreasing"); //$NON-NLS-1$
         }
 
         fEntries.add(entry);
index a1fd36de09823027801b46dd6fd2c78b718626f5..0a5100bccb2ce2e13bded07c491845f778650a73 100644 (file)
@@ -21,7 +21,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
 import org.eclipse.tracecompass.ctf.core.event.types.EnumDeclaration;
@@ -77,11 +77,11 @@ public class CtfTmfEventFieldTest {
      *
      * @throws UnsupportedEncodingException
      *             Thrown when UTF-8 encoding is not available.
-     * @throws CTFReaderException
+     * @throws CTFException
      *             error
      */
     @Before
-    public void setUp() throws UnsupportedEncodingException, CTFReaderException {
+    public void setUp() throws UnsupportedEncodingException, CTFException {
         final byte[] testStringBytes = TEST_STRING.getBytes("UTF-8");
 
         int capacity = 2048;
index c4f71e4e66fd29eb199e3c47dd699a069f34a053..7e3e213a59a4cb12de0f53182da9a1267546421d 100644 (file)
@@ -15,7 +15,7 @@ package org.eclipse.tracecompass.internal.tmf.ctf.core.trace.iterator;
 
 import static org.eclipse.tracecompass.common.core.NonNullUtils.equalsNullable;
 
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.trace.CTFStreamInputReader;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
 import org.eclipse.tracecompass.ctf.core.trace.CTFTraceReader;
@@ -64,11 +64,11 @@ public class CtfIterator extends CTFTraceReader
      *
      * @param ctfTmfTrace
      *            The {@link CtfTmfTrace} to iterate over
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If the iterator couldn't not be instantiated, probably due to
      *             a read error.
      */
-    public CtfIterator(CTFTrace ctfTrace, CtfTmfTrace ctfTmfTrace) throws CTFReaderException {
+    public CtfIterator(CTFTrace ctfTrace, CtfTmfTrace ctfTmfTrace) throws CTFException {
         super(ctfTrace);
         fTrace = ctfTmfTrace;
         if (hasMoreEvents()) {
@@ -92,12 +92,12 @@ public class CtfIterator extends CTFTraceReader
      *            The initial timestamp the iterator will be pointing to
      * @param rank
      *            The initial rank
-     * @throws CTFReaderException
+     * @throws CTFException
      *             If the iterator couldn't not be instantiated, probably due to
      *             a read error.
      */
     public CtfIterator(CTFTrace ctfTrace, CtfTmfTrace ctfTmfTrace, CtfLocationInfo ctfLocationData, long rank)
-            throws CTFReaderException {
+            throws CTFException {
         super(ctfTrace);
 
         this.fTrace = ctfTmfTrace;
@@ -193,7 +193,7 @@ public class CtfIterator extends CTFTraceReader
             } else {
                 ret = super.seek(offsetTimestamp);
             }
-        } catch (CTFReaderException e) {
+        } catch (CTFException e) {
             Activator.getDefault().logError(e.getMessage(), e);
             return false;
         }
@@ -241,7 +241,7 @@ public class CtfIterator extends CTFTraceReader
         boolean ret = false;
         try {
             ret = super.advance();
-        } catch (CTFReaderException e) {
+        } catch (CTFException e) {
             Activator.getDefault().logError(e.getMessage(), e);
         }
 
index 558192460365561d94311fea42a99573334156b6..2329e007e7bccf81f0b724330d954084d41d0cc2 100644 (file)
@@ -33,7 +33,7 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.CTFCallsite;
 import org.eclipse.tracecompass.ctf.core.event.CTFClock;
 import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
@@ -188,7 +188,7 @@ public class CtfTmfTrace extends TmfTrace
                     }
                 }
             }
-        } catch (final CTFReaderException e) {
+        } catch (final CTFException e) {
             /*
              * If it failed at the init(), we can assume it's because the file
              * was not found or was not recognized as a CTF trace. Throw into
@@ -234,7 +234,7 @@ public class CtfTmfTrace extends TmfTrace
                 }
             }
             return new CtfTraceValidationStatus(CONFIDENCE, Activator.PLUGIN_ID, trace.getEnvironment());
-        } catch (final CTFReaderException e) {
+        } catch (final CTFException e) {
             return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_ReadingError + ": " + e.toString()); //$NON-NLS-1$
         } catch (final BufferOverflowException e) {
             return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_ReadingError + ": " + Messages.CtfTmfTrace_BufferOverflowErrorMessage); //$NON-NLS-1$
@@ -525,7 +525,7 @@ public class CtfTmfTrace extends TmfTrace
     public ITmfContext createIterator() {
         try {
             return new CtfIterator(fTrace, this);
-        } catch (CTFReaderException e) {
+        } catch (CTFException e) {
             Activator.getDefault().logError(e.getMessage(), e);
         }
         return null;
@@ -544,7 +544,7 @@ public class CtfTmfTrace extends TmfTrace
     public ITmfContext createIterator(CtfLocationInfo ctfLocationData, long rank) {
         try {
             return new CtfIterator(fTrace, this, ctfLocationData, rank);
-        } catch (CTFReaderException e) {
+        } catch (CTFException e) {
             Activator.getDefault().logError(e.getMessage(), e);
         }
         return null;
This page took 0.115742 seconds and 5 git commands to generate.