diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 07a37d1e4f41642a3c4e99774cf03afcdb7d3670..fd90099190270595bea522d835b26a00bea3f6ca 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -5,31 +5,43 @@ <title>Release Notes</title> </properties> <body> + <release version="2.1-SNAPSHOT" description="Nightly builds"> + <action dev="ntd" type="add" issue="163"> + Introduced error codes. + </action> + </release> <release version="2.0" date="30.09.2015" description="Camellia Release"> <action dev="ntd" type="add" issue="93"> - New concept: composite stages. + New concept: composite + stages. </action> <action dev="ntd" type="add" issue="33"> - New concept: TeeTime automatically + New concept: TeeTime + automatically chooses the correct type of pipe for all connections. </action> <action dev="chw" type="add" issue="207"> Added capacity to IPipe. </action> <action dev="chw" type="add" issue="197"> - Added the ability to add ports to a merger at runtime. + Added the ability to add + ports to a merger at runtime. </action> <action dev="chw" type="add" issue="172"> - Added the ability to add ports to a distributor at runtime. + Added the ability to add + ports to a distributor at runtime. </action> <action dev="chw" type="add" issue="183"> - Threads can be added at runtime. + Threads can be added at + runtime. </action> <action dev="ntd" type="add" issue="195"> - Configurations can only be executed once. + Configurations can only be + executed once. </action> <action dev="ntd" type="add" issue="165"> - Ports can be named for better debugging. + Ports can be named for + better debugging. </action> <action dev="ntd" type="add"> Stages without any input port are @@ -38,42 +50,51 @@ <action dev="ntd" type="add" issue="171"> Configurations are now built within the Configuration class. - This removes any constraints on CompositeStages and - enables therefore multiple connections and multithreading in such stages. + This removes any constraints on + CompositeStages and + enables therefore multiple connections and + multithreading in such stages. </action> <action dev="ntd" type="add" issue="154"> All stages will be initialized before starting the analysis. </action> <action dev="ntd" type="add" issue="122"> - Threads can be named for better debugging. + Threads can be named for + better debugging. </action> <action dev="ntd" type="add" issue="170"> - Exceptions within the initialization will now terminate the execution. + Exceptions within the + initialization will now terminate the execution. </action> <action dev="ntd" type="add" issue="211"> Added Services. - Any Execution can now be aborted. + Any + Execution can now be aborted. </action> - + <action dev="ntd" type="update" issue="224"> - Merged Stage into AbstractStage. + Merged Stage into + AbstractStage. </action> <action dev="chw" type="update" issue="189"> - Merger and Distributor strategies are moved to a separate package. + Merger and Distributor + strategies are moved to a separate package. </action> <action dev="ntd" type="update" issue="185"> TerminatingExceptionListener is now the default listener. </action> <action dev="ntd" type="update" issue="174"> - Removed addThreadableStage and replaced it by AbstractStage.declareActive(). + Removed + addThreadableStage and replaced it by AbstractStage.declareActive(). </action> <action dev="ntd" type="update"> Renamed Analysis to Execution. </action> - + <action dev="ntd" type="remove" issue="217"> - Removed InitializingSignal. + Removed + InitializingSignal. </action> <action dev="ntd" type="remove"> Removed pair class. diff --git a/src/main/java/teetime/framework/A2InvalidThreadAssignmentCheck.java b/src/main/java/teetime/framework/A2InvalidThreadAssignmentCheck.java index b49832c43d13f2aabf553820237b4fb8cc15c1e4..60e33dae10ab10252bc290054ff44827fd3cbff2 100644 --- a/src/main/java/teetime/framework/A2InvalidThreadAssignmentCheck.java +++ b/src/main/java/teetime/framework/A2InvalidThreadAssignmentCheck.java @@ -82,7 +82,8 @@ public class A2InvalidThreadAssignmentCheck { } else { if (colors.containsKey(targetStage)) { if (colors.get(targetStage) != color) { - throw new IllegalStateException("Crossing threads"); // One stage is connected to a stage of another thread (but not its "headstage") + throw new IllegalStateException("1001 - Crossing threads in " + targetStage.getId()); // One stage is connected to a stage of another thread + // (but not its "headstage") } } colors.put(targetStage, color); diff --git a/src/main/java/teetime/framework/AbstractCompositeStage.java b/src/main/java/teetime/framework/AbstractCompositeStage.java index 5fbae9736fe52d507e4dd025d0177ed6ab68cbd8..db4fa8f5fa9debdaca4340aafae472cd00a2e4ce 100644 --- a/src/main/java/teetime/framework/AbstractCompositeStage.java +++ b/src/main/java/teetime/framework/AbstractCompositeStage.java @@ -59,6 +59,13 @@ public abstract class AbstractCompositeStage { * the type of elements to be sent */ protected <T> void connectPorts(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort, final int capacity) { + if (sourcePort == null) { + throw new IllegalArgumentException("1002 - sourcePort may not be null"); + } + if (targetPort == null) { + throw new IllegalArgumentException("1003 - targetPort may not be null"); + } + if (sourcePort.getOwningStage().getInputPorts().size() == 0) { if (sourcePort.getOwningStage().getOwningThread() == null) { sourcePort.getOwningStage().declareActive(); diff --git a/src/main/java/teetime/framework/AbstractInterThreadPipe.java b/src/main/java/teetime/framework/AbstractInterThreadPipe.java index f723c2fe989a64aaee2be80dafb7e801730328cc..0592066dce80ec2e1651cbf10d3f15a5f065083b 100644 --- a/src/main/java/teetime/framework/AbstractInterThreadPipe.java +++ b/src/main/java/teetime/framework/AbstractInterThreadPipe.java @@ -68,7 +68,8 @@ public abstract class AbstractInterThreadPipe<T> extends AbstractPipe<T> { public final void waitForStartSignal() throws InterruptedException { final ISignal signal = signalQueue.take(); if (!(signal instanceof StartingSignal)) { - throw new IllegalStateException("Expected StartingSignal, but was " + signal.getClass().getSimpleName()); + throw new IllegalStateException( + "2001 - Expected StartingSignal, but was " + signal.getClass().getSimpleName() + " in " + getTargetPort().getOwningStage().getId()); } cachedTargetStage.onSignal(signal, getTargetPort()); } diff --git a/src/main/java/teetime/framework/Execution.java b/src/main/java/teetime/framework/Execution.java index 669fd83460b2295362a391e4422f926a51dfe289..6a746f261fce9f89c42992a32737f594299ab991 100644 --- a/src/main/java/teetime/framework/Execution.java +++ b/src/main/java/teetime/framework/Execution.java @@ -67,7 +67,7 @@ public final class Execution<T extends Configuration> { this.configuration = configuration; this.configurationContext = configuration.getContext(); if (configuration.isInitialized()) { - throw new IllegalStateException("Configuration was already executed"); + throw new IllegalStateException("3001 - Configuration has already been used."); } configuration.setInitialized(true); if (validationEnabled) { @@ -151,7 +151,7 @@ public final class Execution<T extends Configuration> { */ public void executeNonBlocking() { if (configuration.isExecuted()) { - throw new IllegalStateException("Any configuration instance may only be executed once."); + throw new IllegalStateException("3002 - Any configuration instance may only be executed once."); } configuration.setExecuted(true); configurationContext.executeConfiguration(); diff --git a/src/main/java/teetime/framework/ExecutionException.java b/src/main/java/teetime/framework/ExecutionException.java index 946ba6cd10707d120a76befae29e1912c04fc818..71dd418c48be808adca5d9055869eefc1b389c3e 100644 --- a/src/main/java/teetime/framework/ExecutionException.java +++ b/src/main/java/teetime/framework/ExecutionException.java @@ -31,7 +31,7 @@ public class ExecutionException extends RuntimeException { private final Map<Thread, List<Exception>> exceptions; public ExecutionException(final Map<Thread, List<Exception>> exceptions) { - super((exceptions.size() == 1) ? exceptions.toString() : exceptions.size() + " error(s) while execution. Check thrown exception(s)."); + super("3003 - " + ((exceptions.size() == 1) ? exceptions.toString() : exceptions.size()) + " error(s) occurred while execution. Check thrown exception(s)."); this.exceptions = exceptions; } diff --git a/src/main/java/teetime/framework/ExecutionInstantiation.java b/src/main/java/teetime/framework/ExecutionInstantiation.java index d9bf4fa485727e922b8d539abc3851ee2538caef..e30c1ee0daa01776269e6554ac6401c0e8e174b3 100644 --- a/src/main/java/teetime/framework/ExecutionInstantiation.java +++ b/src/main/java/teetime/framework/ExecutionInstantiation.java @@ -95,7 +95,8 @@ class ExecutionInstantiation { } else { if (colors.containsKey(targetStage)) { if (!colors.get(targetStage).equals(color)) { - throw new IllegalStateException("Crossing threads"); // One stage is connected to a stage of another thread (but not its "headstage") + throw new IllegalStateException("1001 - Crossing threads in " + targetStage.getId()); // One stage is connected to a stage of another thread + // (but not its "headstage") } } intraThreadPipeFactory.create(outputPort, pipe.getTargetPort()); diff --git a/src/main/java/teetime/framework/NotEnoughInputException.java b/src/main/java/teetime/framework/NotEnoughInputException.java index 883aa43b956d8cad6f13f84fe69d1f196865170a..a46d4b308751fe1aa510bab07c63e4fad90655ac 100644 --- a/src/main/java/teetime/framework/NotEnoughInputException.java +++ b/src/main/java/teetime/framework/NotEnoughInputException.java @@ -15,7 +15,7 @@ */ package teetime.framework; -public final class NotEnoughInputException extends RuntimeException { +final class NotEnoughInputException extends RuntimeException { private static final long serialVersionUID = -2517233596919204396L; diff --git a/src/main/java/teetime/framework/ThreadService.java b/src/main/java/teetime/framework/ThreadService.java index cf9ac715a3c306bfa5100e71fa2191534f29ba80..2df4b165836378ddb227a82b57bc5cfa62447357 100644 --- a/src/main/java/teetime/framework/ThreadService.java +++ b/src/main/java/teetime/framework/ThreadService.java @@ -85,7 +85,7 @@ class ThreadService extends AbstractService<ThreadService> { threadableStages.addAll(newThreadableStages); if (threadableStages.isEmpty()) { - throw new IllegalStateException("No stage was added using the addThreadableStage(..) method. Add at least one stage."); + throw new IllegalStateException("1004 - No threadable stages in this configuration."); } A2InvalidThreadAssignmentCheck checker = new A2InvalidThreadAssignmentCheck(newThreadableStages);