From 13a75c42cac708af260135b526d606e4dad49d33 Mon Sep 17 00:00:00 2001 From: Christian Wulf <chw@informatik.uni-kiel.de> Date: Wed, 6 Aug 2014 07:25:45 +0200 Subject: [PATCH] added some missing type arguments --- .../fileToRecord/ZipFile2RecordFilter.java | 27 +++++++++++-------- .../methodcall/framework/core/Pipeline.java | 2 ++ .../MethodCallThroughputAnalysis3.java | 8 +++--- .../MethodCallThroughputAnalysis8.java | 8 +++--- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/ZipFile2RecordFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/ZipFile2RecordFilter.java index ef5bcd71..7c88e034 100644 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/ZipFile2RecordFilter.java +++ b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/ZipFile2RecordFilter.java @@ -16,15 +16,12 @@ package teetime.variant.explicitScheduling.stage.kieker.fileToRecord; import java.io.BufferedInputStream; -import java.io.BufferedReader; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -40,7 +37,7 @@ import kieker.common.util.filesystem.FSUtil; /** * @author Christian Wulf - * + * * @since 1.10 */ public class ZipFile2RecordFilter extends AbstractFilter<ZipFile2RecordFilter> { @@ -84,13 +81,21 @@ public class ZipFile2RecordFilter extends AbstractFilter<ZipFile2RecordFilter> { private void createAndSendRecordsFromZipFile(final Context<ZipFile2RecordFilter> context, final File zipFile, final ClassNameRegistry classNameRegistry) throws FileNotFoundException { final ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFile)); - final BufferedReader reader; - try { - reader = new BufferedReader(new InputStreamReader(zipInputStream, FSUtil.ENCODING)); - } catch (final UnsupportedEncodingException e) { - this.logger.error("This exception should never occur.", e); - return; - } + // BufferedReader reader; + // try { + // reader = new BufferedReader(new InputStreamReader(zipInputStream, FSUtil.ENCODING)); + // } catch (final UnsupportedEncodingException e) { + // this.logger.error("This exception should never occur.", e); + // return; + // } finally { + // if (null != reader) { + // try { + // reader.close(); + // } catch (IOException e) { + // throw new IllegalStateException(e); + // } + // } + // } final DataInputStream input = new DataInputStream(new BufferedInputStream(zipInputStream, 1024 * 1024)); ZipEntry zipEntry; diff --git a/src/main/java/teetime/variant/methodcall/framework/core/Pipeline.java b/src/main/java/teetime/variant/methodcall/framework/core/Pipeline.java index 71ae10fc..6934bf29 100644 --- a/src/main/java/teetime/variant/methodcall/framework/core/Pipeline.java +++ b/src/main/java/teetime/variant/methodcall/framework/core/Pipeline.java @@ -35,6 +35,7 @@ public class Pipeline<I, O> implements Stage<I, O> { this.lastStage = stage; } + @SuppressWarnings("unchecked") @Override public CommittableQueue<O> execute2(final CommittableQueue<I> elements) { // CommittableQueue queue = this.firstStage.execute2(elements); @@ -44,6 +45,7 @@ public class Pipeline<I, O> implements Stage<I, O> { // return this.lastStage.execute2(queue); // below is faster than above (probably because of the instantiation of a list iterator in each (!) execution) + @SuppressWarnings("rawtypes") CommittableQueue queue = elements; for (int i = 0; i < this.stages.length; i++) { diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThroughputAnalysis3.java b/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThroughputAnalysis3.java index 8611d466..1f905d12 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThroughputAnalysis3.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThroughputAnalysis3.java @@ -31,7 +31,7 @@ import teetime.variant.methodcall.stage.StopTimestampFilter; /** * @author Christian Wulf - * + * * @since 1.10 */ public class MethodCallThroughputAnalysis3 extends Analysis { @@ -70,7 +70,7 @@ public class MethodCallThroughputAnalysis3 extends Analysis { final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - final List<Stage> stageList = new ArrayList<Stage>(); + final List<Stage<?, ?>> stageList = new ArrayList<Stage<?, ?>>(); stageList.add(objectProducer); stageList.add(startTimestampFilter); stageList.addAll(Arrays.asList(noopFilters)); @@ -78,7 +78,7 @@ public class MethodCallThroughputAnalysis3 extends Analysis { stageList.add(collectorSink); // using an array decreases the performance from 60ms to 200ms (by 3x) - final Stage[] stages = stageList.toArray(new Stage[0]); + final Stage<?, ?>[] stages = stageList.toArray(new Stage[0]); final WrappingPipeline pipeline = new WrappingPipeline() { @Override @@ -93,7 +93,7 @@ public class MethodCallThroughputAnalysis3 extends Analysis { Object element = null; for (int i = 0; i < stages.length; i++) { - Stage stage = stages[i]; + Stage<?, ?> stage = stages[i]; element = stage.execute(element); if (element == null) { return false; diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThroughputAnalysis8.java b/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThroughputAnalysis8.java index 7045b348..90c034eb 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThroughputAnalysis8.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThroughputAnalysis8.java @@ -32,7 +32,7 @@ import teetime.variant.methodcall.stage.StopTimestampFilter; /** * @author Christian Wulf - * + * * @since 1.10 */ public class MethodCallThroughputAnalysis8 extends Analysis { @@ -71,7 +71,7 @@ public class MethodCallThroughputAnalysis8 extends Analysis { final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - final List<AbstractStage> stageList = new ArrayList<AbstractStage>(); + final List<AbstractStage<?, ?>> stageList = new ArrayList<AbstractStage<?, ?>>(); stageList.add(objectProducer); stageList.add(startTimestampFilter); stageList.addAll(Arrays.asList(noopFilters)); @@ -79,7 +79,7 @@ public class MethodCallThroughputAnalysis8 extends Analysis { stageList.add(collectorSink); // using an array decreases the performance from 60ms to 200ms (by 3x) - final AbstractStage[] stages = stageList.toArray(new AbstractStage[0]); + final AbstractStage<?, ?>[] stages = stageList.toArray(new AbstractStage[0]); final WrappingPipeline pipeline = new WrappingPipeline() { private int startIndex; @@ -89,7 +89,7 @@ public class MethodCallThroughputAnalysis8 extends Analysis { // using the foreach for arrays (i.e., w/o using an iterator variable) increases the performance from 200ms to 130ms Object element = null; for (int i = this.startIndex; i < stages.length; i++) { - Stage stage = stages[i]; + Stage<?, ?> stage = stages[i]; element = stage.execute(element); if (element == null) { return false; -- GitLab