T3: bugfixes and avoid override of finalize
Change-Id: I7e0ddcec59ae75dae30d083b7d873255ad5991f1
(cherry picked from commit 3577bae12a5b395e2113c6035edca08a6339c1a0)
diff --git a/apps/t3/src/main/java/org/onosproject/t3/impl/Generator.java b/apps/t3/src/main/java/org/onosproject/t3/impl/Generator.java
index 95e4d4e..82ad628 100644
--- a/apps/t3/src/main/java/org/onosproject/t3/impl/Generator.java
+++ b/apps/t3/src/main/java/org/onosproject/t3/impl/Generator.java
@@ -97,6 +97,14 @@
itemAvailableOrHasFinished.await();
} catch (InterruptedException e) {
hasFinished = true;
+ producer.interrupt();
+ try {
+ producer.join();
+ } catch (InterruptedException e1) {
+ // Interrupting the broken thread
+ Thread.currentThread().interrupt();
+ throw new IllegalStateException(e1);
+ }
}
if (exceptionRaisedByProducer != null) {
throw exceptionRaisedByProducer;
@@ -137,11 +145,4 @@
producer.setDaemon(true);
producer.start();
}
-
- @Override
- protected void finalize() throws Throwable {
- producer.interrupt();
- producer.join();
- super.finalize();
- }
}
\ No newline at end of file
diff --git a/apps/t3/src/main/java/org/onosproject/t3/impl/TroubleshootManager.java b/apps/t3/src/main/java/org/onosproject/t3/impl/TroubleshootManager.java
index 74933f6..3564750 100644
--- a/apps/t3/src/main/java/org/onosproject/t3/impl/TroubleshootManager.java
+++ b/apps/t3/src/main/java/org/onosproject/t3/impl/TroubleshootManager.java
@@ -424,8 +424,9 @@
&& ((VlanIdCriterion) trace.getInitialPacket().getCriterion(Criterion.Type.VLAN_VID)).vlanId()
.equals(((VlanIdCriterion) outputPath.getFinalPacket().getCriterion(Criterion.Type.VLAN_VID))
.vlanId())) {
- trace.addResultMessage("Connect point out " + cp + " is same as initial input " +
- trace.getInitialConnectPoint());
+ if (computePath(completePath, trace, outputPath.getOutput())) {
+ trace.addResultMessage("Connect point out " + cp + " is same as initial input " + in);
+ }
break;
}