tom

Fixed some sonar-reported issues.

......@@ -45,7 +45,7 @@ public class AbstractListenerRegistry<E extends Event, L extends EventListener<E
for (L listener : listeners) {
try {
listener.event(event);
} catch (Throwable error) {
} catch (Exception error) {
reportProblem(event, error);
}
}
......
......@@ -82,7 +82,7 @@ public class SimpleEventDispatcher extends DefaultEventSinkRegistry
log.warn("No sink registered for event class {}",
event.getClass());
}
} catch (Throwable e) {
} catch (Exception e) {
log.warn("Error encountered while dispatching event:", e);
}
}
......
......@@ -141,7 +141,6 @@ public class SimpleDeviceManager
public void updatePorts(DeviceId deviceId, List<PortDescription> portDescriptions) {
checkNotNull(deviceId, DEVICE_ID_NULL);
checkNotNull(portDescriptions, "Port descriptions list cannot be null");
// FIXME: fix the interface to accept DeviceId separately
log.info("Device {} ports updated: {}", portDescriptions);
List<DeviceEvent> events = store.updatePorts(deviceId, portDescriptions);
for (DeviceEvent event : events) {
......
......@@ -22,8 +22,6 @@ public class AdjacencyListsGraph<V extends Vertex, E extends Edge<V>> implements
private final ImmutableSetMultimap<V, E> sources;
private final ImmutableSetMultimap<V, E> destinations;
private final Set<E> noEdges = ImmutableSet.of();
/**
* Creates a graph comprising of the specified vertexes and edges.
*
......
......@@ -21,8 +21,8 @@ public class BreadthFirstSearch<V extends Vertex, E extends Edge<V>>
result.costs.put(src, 0.0);
frontier.add(src);
search:
while (!frontier.isEmpty()) {
boolean reachedEnd = false;
while (!reachedEnd && !frontier.isEmpty()) {
// Prepare the next frontier.
Set<V> next = new HashSet<>();
......@@ -40,10 +40,15 @@ public class BreadthFirstSearch<V extends Vertex, E extends Edge<V>>
true);
// If we have reached our intended destination, bail.
if (nextVertex.equals(dst)) {
break search;
reachedEnd = true;
break;
}
next.add(nextVertex);
}
if (reachedEnd) {
break;
}
}
}
......
......@@ -25,9 +25,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
*/
public class Heap<T> {
private static final String E_HEAP_READONLY = "Heap iterator is read-only";
private static final String E_HEAP_END = "Heap iterator reached end of heap";
private final List<T> data;
private final Comparator<T> comparator;
......