Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fixed few sonar warnings.
[controller.git]
/
opendaylight
/
config
/
config-manager
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
config
/
manager
/
impl
/
DeadlockMonitor.java
diff --git
a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java
b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java
index 9882b4662cce2b75519b509135fd17c961e12e9d..20e5fe658411f2b694885496b948217a4e59ef48 100644
(file)
--- a/
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java
+++ b/
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java
@@
-27,7
+27,7
@@
public class DeadlockMonitor implements AutoCloseable {
@GuardedBy("this")
private final Deque<ModuleIdentifierWithNanos> moduleIdentifierWithNanosStack = new LinkedList<>();
@GuardedBy("this")
@GuardedBy("this")
private final Deque<ModuleIdentifierWithNanos> moduleIdentifierWithNanosStack = new LinkedList<>();
@GuardedBy("this")
- private ModuleIdentifierWithNanos top = ModuleIdentifierWithNanos.
EMPTY
;
+ private ModuleIdentifierWithNanos top = ModuleIdentifierWithNanos.
empty
;
public DeadlockMonitor(TransactionIdentifier transactionIdentifier) {
this.transactionIdentifier = transactionIdentifier;
public DeadlockMonitor(TransactionIdentifier transactionIdentifier) {
this.transactionIdentifier = transactionIdentifier;
@@
-41,7
+41,7
@@
public class DeadlockMonitor implements AutoCloseable {
if (popping) {
moduleIdentifierWithNanosStack.pop();
if (moduleIdentifierWithNanosStack.isEmpty()) {
if (popping) {
moduleIdentifierWithNanosStack.pop();
if (moduleIdentifierWithNanosStack.isEmpty()) {
- top = ModuleIdentifierWithNanos.
EMPTY
;
+ top = ModuleIdentifierWithNanos.
empty
;
} else {
top = moduleIdentifierWithNanosStack.peekLast();
}
} else {
top = moduleIdentifierWithNanosStack.peekLast();
}
@@
-75,14
+75,15
@@
public class DeadlockMonitor implements AutoCloseable {
@Override
public void run() {
@Override
public void run() {
- ModuleIdentifierWithNanos old = new ModuleIdentifierWithNanos(); // null moduleId
- while (this.isInterrupted() == false) {
+ // null moduleId
+ ModuleIdentifierWithNanos old = new ModuleIdentifierWithNanos();
+ while (!this.isInterrupted()) {
ModuleIdentifierWithNanos copy;
synchronized(this) {
copy = new ModuleIdentifierWithNanos(DeadlockMonitor.this.top);
}
ModuleIdentifierWithNanos copy;
synchronized(this) {
copy = new ModuleIdentifierWithNanos(DeadlockMonitor.this.top);
}
- if (old.moduleIdentifier == null ||
old.equals(copy) == false
) {
+ if (old.moduleIdentifier == null ||
!old.equals(copy)
) {
// started
old = copy;
} else {
// started
old = copy;
} else {
@@
-107,11
+108,8
@@
public class DeadlockMonitor implements AutoCloseable {
}
}
}
}
-
-
-
private static class ModuleIdentifierWithNanos {
private static class ModuleIdentifierWithNanos {
- private static ModuleIdentifierWithNanos
EMPTY
= new ModuleIdentifierWithNanos();
+ private static ModuleIdentifierWithNanos
empty
= new ModuleIdentifierWithNanos();
@Nullable
private final ModuleIdentifier moduleIdentifier;
@Nullable
private final ModuleIdentifier moduleIdentifier;