Thomas Vachuska

Fixed some javadoc warning/errors.

Fixed NPE error in objective tracker.
Preparing for upgrade to Java 8 and Karaf 3.0.2.
...@@ -135,6 +135,11 @@ public class ObjectiveTracker implements ObjectiveTrackerService { ...@@ -135,6 +135,11 @@ public class ObjectiveTracker implements ObjectiveTrackerService {
135 135
136 @Override 136 @Override
137 public void run() { 137 public void run() {
138 + // If there is no delegate, why bother? Just bail.
139 + if (delegate == null) {
140 + return;
141 + }
142 +
138 if (event.reasons() == null) { 143 if (event.reasons() == null) {
139 delegate.triggerCompile(new HashSet<IntentId>(), true); 144 delegate.triggerCompile(new HashSet<IntentId>(), true);
140 145
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
48 <artifactId>maven-javadoc-plugin</artifactId> 48 <artifactId>maven-javadoc-plugin</artifactId>
49 <version>2.10.1</version> 49 <version>2.10.1</version>
50 <configuration> 50 <configuration>
51 + <additionalparam>-Xdoclint:none</additionalparam>
51 <show>package</show> 52 <show>package</show>
52 <excludePackageNames>org.onlab.thirdparty:*.impl:*.impl.*:org.onlab.onos.provider.*:org.onlab.onos.gui:org.onlab.onos.rest:org.onlab.onos.cli*:org.onlab.onos.tvue:org.onlab.onos.foo:org.onlab.onos.mobility:org.onlab.onos.proxyarp:org.onlab.onos.fwd:org.onlab.onos.ifwd:org.onlab.onos.optical:org.onlab.onos.config:org.onlab.onos.calendar:org.onlab.onos.sdnip*:org.onlab.onos.metrics:org.onlab.onos.store.*:org.onlab.onos.openflow.*</excludePackageNames> 53 <excludePackageNames>org.onlab.thirdparty:*.impl:*.impl.*:org.onlab.onos.provider.*:org.onlab.onos.gui:org.onlab.onos.rest:org.onlab.onos.cli*:org.onlab.onos.tvue:org.onlab.onos.foo:org.onlab.onos.mobility:org.onlab.onos.proxyarp:org.onlab.onos.fwd:org.onlab.onos.ifwd:org.onlab.onos.optical:org.onlab.onos.config:org.onlab.onos.calendar:org.onlab.onos.sdnip*:org.onlab.onos.metrics:org.onlab.onos.store.*:org.onlab.onos.openflow.*</excludePackageNames>
53 <docfilessubdirs>true</docfilessubdirs> 54 <docfilessubdirs>true</docfilessubdirs>
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
48 <artifactId>maven-javadoc-plugin</artifactId> 48 <artifactId>maven-javadoc-plugin</artifactId>
49 <version>2.10.1</version> 49 <version>2.10.1</version>
50 <configuration> 50 <configuration>
51 + <additionalparam>-Xdoclint:none</additionalparam>
51 <show>package</show> 52 <show>package</show>
52 <docfilessubdirs>true</docfilessubdirs> 53 <docfilessubdirs>true</docfilessubdirs>
53 <doctitle>ONOS Java API</doctitle> 54 <doctitle>ONOS Java API</doctitle>
......
...@@ -13,8 +13,11 @@ if [ -z "${JAVA_HOME}" ]; then ...@@ -13,8 +13,11 @@ if [ -z "${JAVA_HOME}" ]; then
13 export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64" 13 export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
14 fi 14 fi
15 fi 15 fi
16 +
16 export MAVEN=${MAVEN:-~/Applications/apache-maven-3.2.2} 17 export MAVEN=${MAVEN:-~/Applications/apache-maven-3.2.2}
17 -export KARAF=${KARAF:-~/Applications/apache-karaf-3.0.1} 18 +
19 +export KARAF_VERSION=${KARAF_VERSION:-3.0.1}
20 +export KARAF=${KARAF:-~/Applications/apache-karaf-$KARAF_VERSION}
18 export KARAF_LOG=$KARAF/data/log/karaf.log 21 export KARAF_LOG=$KARAF/data/log/karaf.log
19 22
20 # Setup a path 23 # Setup a path
......
...@@ -135,7 +135,7 @@ public final class TestUtils { ...@@ -135,7 +135,7 @@ public final class TestUtils {
135 } 135 }
136 136
137 /** 137 /**
138 - * Triggers an allocation of an object of type <T> and forces a call to 138 + * Triggers an allocation of an object of type T and forces a call to
139 * the private constructor. 139 * the private constructor.
140 * 140 *
141 * @param constructor Constructor to call 141 * @param constructor Constructor to call
......
...@@ -116,6 +116,7 @@ public abstract class AbstractGraphPathSearch<V extends Vertex, E extends Edge<V ...@@ -116,6 +116,7 @@ public abstract class AbstractGraphPathSearch<V extends Vertex, E extends Edge<V
116 /** 116 /**
117 * Returns the current cost to reach the specified vertex. 117 * Returns the current cost to reach the specified vertex.
118 * 118 *
119 + * @param v vertex to reach
119 * @return cost to reach the vertex 120 * @return cost to reach the vertex
120 */ 121 */
121 double cost(V v) { 122 double cost(V v) {
...@@ -127,7 +128,7 @@ public abstract class AbstractGraphPathSearch<V extends Vertex, E extends Edge<V ...@@ -127,7 +128,7 @@ public abstract class AbstractGraphPathSearch<V extends Vertex, E extends Edge<V
127 * Updates the cost of the vertex using its existing cost plus the 128 * Updates the cost of the vertex using its existing cost plus the
128 * cost to traverse the specified edge. 129 * cost to traverse the specified edge.
129 * 130 *
130 - * @param v vertex 131 + * @param vertex vertex to update
131 * @param edge edge through which vertex is reached 132 * @param edge edge through which vertex is reached
132 * @param cost current cost to reach the vertex from the source 133 * @param cost current cost to reach the vertex from the source
133 * @param replace true to indicate that any accrued edges are to be 134 * @param replace true to indicate that any accrued edges are to be
...@@ -135,13 +136,13 @@ public abstract class AbstractGraphPathSearch<V extends Vertex, E extends Edge<V ...@@ -135,13 +136,13 @@ public abstract class AbstractGraphPathSearch<V extends Vertex, E extends Edge<V
135 * added to the previously accrued edges as they yield 136 * added to the previously accrued edges as they yield
136 * the same cost 137 * the same cost
137 */ 138 */
138 - void updateVertex(V v, E edge, double cost, boolean replace) { 139 + void updateVertex(V vertex, E edge, double cost, boolean replace) {
139 - costs.put(v, cost); 140 + costs.put(vertex, cost);
140 if (edge != null) { 141 if (edge != null) {
141 - Set<E> edges = parents.get(v); 142 + Set<E> edges = parents.get(vertex);
142 if (edges == null) { 143 if (edges == null) {
143 edges = new HashSet<>(); 144 edges = new HashSet<>();
144 - parents.put(v, edges); 145 + parents.put(vertex, edges);
145 } 146 }
146 if (replace) { 147 if (replace) {
147 edges.clear(); 148 edges.clear();
...@@ -163,17 +164,17 @@ public abstract class AbstractGraphPathSearch<V extends Vertex, E extends Edge<V ...@@ -163,17 +164,17 @@ public abstract class AbstractGraphPathSearch<V extends Vertex, E extends Edge<V
163 * If possible, relax the specified edge using the supplied base cost 164 * If possible, relax the specified edge using the supplied base cost
164 * and edge-weight function. 165 * and edge-weight function.
165 * 166 *
166 - * @param e edge to be relaxed 167 + * @param edge edge to be relaxed
167 * @param cost base cost to reach the edge destination vertex 168 * @param cost base cost to reach the edge destination vertex
168 * @param ew optional edge weight function 169 * @param ew optional edge weight function
169 * @param forbidNegatives if true negative values will forbid the link 170 * @param forbidNegatives if true negative values will forbid the link
170 * @return true if the edge was relaxed; false otherwise 171 * @return true if the edge was relaxed; false otherwise
171 */ 172 */
172 - boolean relaxEdge(E e, double cost, EdgeWeight<V, E> ew, 173 + boolean relaxEdge(E edge, double cost, EdgeWeight<V, E> ew,
173 boolean... forbidNegatives) { 174 boolean... forbidNegatives) {
174 - V v = e.dst(); 175 + V v = edge.dst();
175 double oldCost = cost(v); 176 double oldCost = cost(v);
176 - double hopCost = ew == null ? 1.0 : ew.weight(e); 177 + double hopCost = ew == null ? 1.0 : ew.weight(edge);
177 if (hopCost < 0 && forbidNegatives.length == 1 && forbidNegatives[0]) { 178 if (hopCost < 0 && forbidNegatives.length == 1 && forbidNegatives[0]) {
178 return false; 179 return false;
179 } 180 }
...@@ -182,7 +183,7 @@ public abstract class AbstractGraphPathSearch<V extends Vertex, E extends Edge<V ...@@ -182,7 +183,7 @@ public abstract class AbstractGraphPathSearch<V extends Vertex, E extends Edge<V
182 boolean relaxed = newCost < oldCost; 183 boolean relaxed = newCost < oldCost;
183 boolean same = Math.abs(newCost - oldCost) <= samenessThreshold; 184 boolean same = Math.abs(newCost - oldCost) <= samenessThreshold;
184 if (same || relaxed) { 185 if (same || relaxed) {
185 - updateVertex(v, e, newCost, !same); 186 + updateVertex(v, edge, newCost, !same);
186 } 187 }
187 return relaxed; 188 return relaxed;
188 } 189 }
......
...@@ -28,14 +28,16 @@ import static com.google.common.base.Preconditions.checkNotNull; ...@@ -28,14 +28,16 @@ import static com.google.common.base.Preconditions.checkNotNull;
28 /** 28 /**
29 * Implementation of an array-backed heap structure whose sense of order is 29 * Implementation of an array-backed heap structure whose sense of order is
30 * imposed by the provided comparator. 30 * imposed by the provided comparator.
31 - * <p/> 31 + * <p>
32 * While this provides similar functionality to {@link java.util.PriorityQueue} 32 * While this provides similar functionality to {@link java.util.PriorityQueue}
33 * data structure, one key difference is that external entities can control 33 * data structure, one key difference is that external entities can control
34 * when to restore the heap property, which is done through invocation of the 34 * when to restore the heap property, which is done through invocation of the
35 * {@link #heapify} method. 35 * {@link #heapify} method.
36 - * <p/> 36 + * </p>
37 + * <p>
37 * This class is not thread-safe and care must be taken to prevent concurrent 38 * This class is not thread-safe and care must be taken to prevent concurrent
38 * modifications. 39 * modifications.
40 + * </p>
39 * 41 *
40 * @param <T> type of the items on the heap 42 * @param <T> type of the items on the heap
41 */ 43 */
......
...@@ -32,12 +32,14 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>> ...@@ -32,12 +32,14 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>>
32 32
33 /** 33 /**
34 * {@inheritDoc} 34 * {@inheritDoc}
35 - * <p/> 35 + * <p>
36 * This implementation produces results augmented with information on 36 * This implementation produces results augmented with information on
37 * SCCs within the graph. 37 * SCCs within the graph.
38 - * <p/> 38 + * </p>
39 + * <p>
39 * To prevent traversal of an edge, the {@link EdgeWeight#weight} should 40 * To prevent traversal of an edge, the {@link EdgeWeight#weight} should
40 * return a negative value as an edge weight. 41 * return a negative value as an edge weight.
42 + * </p>
41 */ 43 */
42 @Override 44 @Override
43 public SCCResult<V, E> search(Graph<V, E> graph, EdgeWeight<V, E> weight) { 45 public SCCResult<V, E> search(Graph<V, E> graph, EdgeWeight<V, E> weight) {
......
...@@ -49,8 +49,8 @@ import com.codahale.metrics.Timer; ...@@ -49,8 +49,8 @@ import com.codahale.metrics.Timer;
49 * this class, but are allocated by the caller and passed in for registration: 49 * this class, but are allocated by the caller and passed in for registration:
50 * <pre> 50 * <pre>
51 * <code> 51 * <code>
52 - * private final Gauge<Long> gauge = 52 + * private final Gauge&lt;Long&gt; gauge =
53 - * new {@literal Gauge<Long>}() { 53 + * new {@literal Gauge&lt;Long&gt}() {
54 * {@literal @}Override 54 * {@literal @}Override
55 * public Long getValue() { 55 * public Long getValue() {
56 * return gaugeValue; 56 * return gaugeValue;
......