From 736c775bfc2cde38a53e4d43f858d3a3b6728c34 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 10 Oct 2014 00:01:22 +0200 Subject: Add missing @Override annotations --- sonar-graph/src/main/java/org/sonar/graph/DirectedGraph.java | 5 +++++ sonar-graph/src/main/java/org/sonar/graph/FeedbackCycle.java | 2 ++ sonar-graph/src/main/java/org/sonar/graph/FeedbackEdge.java | 1 + sonar-graph/src/main/java/org/sonar/graph/StringEdge.java | 3 +++ sonar-graph/src/main/java/org/sonar/graph/StringEdgeFactory.java | 2 ++ 5 files changed, 13 insertions(+) (limited to 'sonar-graph/src/main/java/org') diff --git a/sonar-graph/src/main/java/org/sonar/graph/DirectedGraph.java b/sonar-graph/src/main/java/org/sonar/graph/DirectedGraph.java index 6372ba01095..ecbb0fb6d72 100644 --- a/sonar-graph/src/main/java/org/sonar/graph/DirectedGraph.java +++ b/sonar-graph/src/main/java/org/sonar/graph/DirectedGraph.java @@ -84,6 +84,7 @@ public class DirectedGraph> implements DirectedGraphAccesso edges.put(vertexKey2, edge); } + @Override public E getEdge(V from, V to) { Map outgoingEdgesFrom = outgoingEdgesByVertex.get(from); if (outgoingEdgesFrom == null) { @@ -93,6 +94,7 @@ public class DirectedGraph> implements DirectedGraphAccesso } } + @Override public boolean hasEdge(V from, V to) { Map outgoingEdges = outgoingEdgesByVertex.get(from); if (outgoingEdges == null) { @@ -111,6 +113,7 @@ public class DirectedGraph> implements DirectedGraphAccesso } } + @Override public Set getVertices() { return vertices; } @@ -126,6 +129,7 @@ public class DirectedGraph> implements DirectedGraphAccesso return result; } + @Override public Collection getOutgoingEdges(V from) { Map outgoingEdges = outgoingEdgesByVertex.get(from); if (outgoingEdges == null) { @@ -134,6 +138,7 @@ public class DirectedGraph> implements DirectedGraphAccesso return outgoingEdges.values(); } + @Override public Collection getIncomingEdges(V to) { Map incomingEdges = incomingEdgesByVertex.get(to); if (incomingEdges == null) { diff --git a/sonar-graph/src/main/java/org/sonar/graph/FeedbackCycle.java b/sonar-graph/src/main/java/org/sonar/graph/FeedbackCycle.java index 43125a0e932..81de9669e43 100644 --- a/sonar-graph/src/main/java/org/sonar/graph/FeedbackCycle.java +++ b/sonar-graph/src/main/java/org/sonar/graph/FeedbackCycle.java @@ -87,10 +87,12 @@ public final class FeedbackCycle implements Iterable, Comparable iterator() { return orderedFeedbackEdges.iterator(); } + @Override public int compareTo(FeedbackCycle feedbackCycle) { if (getTotalOccurrencesOfEdgesInCycle() < feedbackCycle.getTotalOccurrencesOfEdgesInCycle()) {//NOSONAR this class has a natural ordering that is inconsistent with equals return -1; diff --git a/sonar-graph/src/main/java/org/sonar/graph/FeedbackEdge.java b/sonar-graph/src/main/java/org/sonar/graph/FeedbackEdge.java index 529efe8bda2..6e24a466058 100644 --- a/sonar-graph/src/main/java/org/sonar/graph/FeedbackEdge.java +++ b/sonar-graph/src/main/java/org/sonar/graph/FeedbackEdge.java @@ -51,6 +51,7 @@ public class FeedbackEdge implements Comparable { return occurences; } + @Override public int compareTo(FeedbackEdge feedbackEdge) { if (this.getRelativeWeight() < feedbackEdge.getRelativeWeight()) { return -1; diff --git a/sonar-graph/src/main/java/org/sonar/graph/StringEdge.java b/sonar-graph/src/main/java/org/sonar/graph/StringEdge.java index 11168ca8663..c5aa7bb1844 100644 --- a/sonar-graph/src/main/java/org/sonar/graph/StringEdge.java +++ b/sonar-graph/src/main/java/org/sonar/graph/StringEdge.java @@ -38,14 +38,17 @@ public class StringEdge implements Edge { this.weight = weight; } + @Override public String getFrom() { return from; } + @Override public String getTo() { return to; } + @Override public int getWeight() { return weight; } diff --git a/sonar-graph/src/main/java/org/sonar/graph/StringEdgeFactory.java b/sonar-graph/src/main/java/org/sonar/graph/StringEdgeFactory.java index 7d77959d996..a7dd4dee50c 100644 --- a/sonar-graph/src/main/java/org/sonar/graph/StringEdgeFactory.java +++ b/sonar-graph/src/main/java/org/sonar/graph/StringEdgeFactory.java @@ -21,10 +21,12 @@ package org.sonar.graph; public class StringEdgeFactory implements EdgeFactory { + @Override public StringEdge createEdge(String from, String to) { return new StringEdge(from, to); } + @Override public StringEdge createEdge(String from, String to, int weight) { return new StringEdge(from, to, weight); } -- cgit v1.2.3