Skip to content
Snippets Groups Projects
Commit 5479bd21 authored by Christian Wulf's avatar Christian Wulf
Browse files

fixed some PMD issues;

set log level from warn to info for unconnected ports
parent a71e34a0
No related branches found
No related tags found
No related merge requests found
...@@ -104,6 +104,7 @@ public abstract class AbstractStage extends Stage { ...@@ -104,6 +104,7 @@ public abstract class AbstractStage extends Stage {
currentState = StageState.VALIDATED; currentState = StageState.VALIDATED;
} }
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Override @Override
public void onStarting() throws Exception { public void onStarting() throws Exception {
this.owningThread = Thread.currentThread(); this.owningThread = Thread.currentThread();
...@@ -119,15 +120,17 @@ public abstract class AbstractStage extends Stage { ...@@ -119,15 +120,17 @@ public abstract class AbstractStage extends Stage {
private void connectUnconnectedOutputPorts() { private void connectUnconnectedOutputPorts() {
for (OutputPort<?> outputPort : this.cachedOutputPorts) { for (OutputPort<?> outputPort : this.cachedOutputPorts) {
if (null == outputPort.getPipe()) { // if port is unconnected if (null == outputPort.getPipe()) { // if port is unconnected
this.logger.warn("Unconnected output port: " + outputPort + ". Connecting with a dummy output port."); if (logger.isInfoEnabled()) {
this.logger.info("Unconnected output port: " + outputPort + ". Connecting with a dummy output port.");
}
outputPort.setPipe(DUMMY_PORT); outputPort.setPipe(DUMMY_PORT);
} }
} }
} }
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Override @Override
public void onTerminating() throws Exception { public void onTerminating() throws Exception {
logger.trace("onTerminating: " + this.getId());
currentState = StageState.TERMINATED; currentState = StageState.TERMINATED;
} }
......
...@@ -112,6 +112,7 @@ public abstract class Stage { ...@@ -112,6 +112,7 @@ public abstract class Stage {
return owningThread; return owningThread;
} }
@SuppressWarnings("PMD.DefaultPackage")
void setOwningThread(final Thread owningThread) { void setOwningThread(final Thread owningThread) {
this.owningThread = owningThread; this.owningThread = owningThread;
} }
...@@ -122,8 +123,10 @@ public abstract class Stage { ...@@ -122,8 +123,10 @@ public abstract class Stage {
public abstract void onValidating(List<InvalidPortConnection> invalidPortConnections); public abstract void onValidating(List<InvalidPortConnection> invalidPortConnections);
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public abstract void onStarting() throws Exception; public abstract void onStarting() throws Exception;
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public abstract void onTerminating() throws Exception; public abstract void onTerminating() throws Exception;
} }
...@@ -42,10 +42,10 @@ public final class CountingMap<T> extends HashMap<T, Integer> { ...@@ -42,10 +42,10 @@ public final class CountingMap<T> extends HashMap<T, Integer> {
* The key which sould be incremented * The key which sould be incremented
*/ */
public void increment(final T key) { public void increment(final T key) {
if (super.containsKey(key)) { Integer count = super.get(key);
Integer i = super.get(key); if (null != count) {
i++; count++;
super.put(key, i); super.put(key, count);
} else { } else {
super.put(key, 1); super.put(key, 1);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment