[geogebra] 02/02: Use libcommons-collections3-java instead of libcollections15-java.

Giovanni Mascellani gio at moszumanska.debian.org
Tue Aug 5 20:21:09 UTC 2014


This is an automated email from the git hooks/post-receive script.

gio pushed a commit to branch patch/use_apache_commons_collections
in repository geogebra.

commit ba44cb6ffccf979cc45a0c32a92c074e602bb3a1
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Tue Aug 5 22:08:47 2014 +0200

    Use libcommons-collections3-java instead of libcollections15-java.
---
 .../ics/jung/algorithms/shortestpath/DijkstraDistance.java   | 12 ++++++------
 .../jung/algorithms/shortestpath/DijkstraShortestPath.java   |  6 +++---
 edu/uci/ics/jung/algorithms/util/MapBinaryHeap.java          |  4 ++--
 edu/uci/ics/jung/graph/SparseMultigraph.java                 |  6 +++---
 geogebra/kernel/discrete/AlgoShortestDistance.java           |  8 ++++----
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/edu/uci/ics/jung/algorithms/shortestpath/DijkstraDistance.java b/edu/uci/ics/jung/algorithms/shortestpath/DijkstraDistance.java
index a91ed89..7a44e96 100644
--- a/edu/uci/ics/jung/algorithms/shortestpath/DijkstraDistance.java
+++ b/edu/uci/ics/jung/algorithms/shortestpath/DijkstraDistance.java
@@ -19,8 +19,8 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.functors.ConstantTransformer;
+import org.apache.commons.collections.Transformer;
+import org.apache.commons.collections.functors.ConstantTransformer;
 
 import edu.uci.ics.jung.algorithms.util.BasicMapEntry;
 import edu.uci.ics.jung.algorithms.util.MapBinaryHeap;
@@ -65,7 +65,7 @@ import edu.uci.ics.jung.graph.Hypergraph;
 public class DijkstraDistance<V,E> implements Distance<V>
 {
     protected Hypergraph<V,E> g;
-    protected Transformer<E,? extends Number> nev;
+    protected Transformer/*<E,? extends Number>*/ nev;
     protected Map<V,SourceData> sourceMap;   // a map of source vertices to an instance of SourceData
     protected boolean cached;
     protected double max_distance;
@@ -81,7 +81,7 @@ public class DijkstraDistance<V,E> implements Distance<V>
      * @param nev   the class responsible for returning weights for edges
      * @param cached    specifies whether the results are to be cached
      */
-    public DijkstraDistance(Hypergraph<V,E> g, Transformer<E,? extends Number> nev, boolean cached) {
+    public DijkstraDistance(Hypergraph<V,E> g, Transformer/*<E,? extends Number>*/ nev, boolean cached) {
         this.g = g;
         this.nev = nev;
         this.sourceMap = new HashMap<V,SourceData>();
@@ -98,7 +98,7 @@ public class DijkstraDistance<V,E> implements Distance<V>
      * @param g     the graph on which distances will be calculated
      * @param nev   the class responsible for returning weights for edges
      */
-    public DijkstraDistance(Hypergraph<V,E> g, Transformer<E,? extends Number> nev) {
+    public DijkstraDistance(Hypergraph<V,E> g, Transformer/*<E,? extends Number>*/ nev) {
         this(g, nev, true);
     }
     
@@ -198,7 +198,7 @@ public class DijkstraDistance<V,E> implements Distance<V>
                 {
                     if (!sd.distances.containsKey(w))
                     {
-                        double edge_weight = nev.transform(e).doubleValue();
+                        double edge_weight = ((Number) nev.transform(e)).doubleValue();
                         if (edge_weight < 0)
                             throw new IllegalArgumentException("Edges weights must be non-negative");
                         double new_dist = v_dist + edge_weight;
diff --git a/edu/uci/ics/jung/algorithms/shortestpath/DijkstraShortestPath.java b/edu/uci/ics/jung/algorithms/shortestpath/DijkstraShortestPath.java
index 749cf0b..b224843 100644
--- a/edu/uci/ics/jung/algorithms/shortestpath/DijkstraShortestPath.java
+++ b/edu/uci/ics/jung/algorithms/shortestpath/DijkstraShortestPath.java
@@ -17,7 +17,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.collections15.Transformer;
+import org.apache.commons.collections.Transformer;
 
 import edu.uci.ics.jung.graph.Graph;
 
@@ -47,7 +47,7 @@ public class DijkstraShortestPath<V,E> extends DijkstraDistance<V,E> implements
      * @param nev   the class responsible for returning weights for edges
      * @param cached    specifies whether the results are to be cached
      */
-    public DijkstraShortestPath(Graph<V,E> g, Transformer<E, ? extends Number> nev, boolean cached)
+    public DijkstraShortestPath(Graph<V,E> g, Transformer/*<E, ? extends Number>*/ nev, boolean cached)
     {
         super(g, nev, cached);
     }
@@ -60,7 +60,7 @@ public class DijkstraShortestPath<V,E> extends DijkstraDistance<V,E> implements
      * @param g     the graph on which distances will be calculated
      * @param nev   the class responsible for returning weights for edges
      */
-    public DijkstraShortestPath(Graph<V,E> g, Transformer<E, ? extends Number> nev)
+    public DijkstraShortestPath(Graph<V,E> g, Transformer/*<E, ? extends Number>*/ nev)
     {
         super(g, nev);
     }
diff --git a/edu/uci/ics/jung/algorithms/util/MapBinaryHeap.java b/edu/uci/ics/jung/algorithms/util/MapBinaryHeap.java
index bd00a82..cac619e 100644
--- a/edu/uci/ics/jung/algorithms/util/MapBinaryHeap.java
+++ b/edu/uci/ics/jung/algorithms/util/MapBinaryHeap.java
@@ -23,7 +23,7 @@ import java.util.NoSuchElementException;
 import java.util.Queue;
 import java.util.Vector;
 
-import org.apache.commons.collections15.IteratorUtils;
+import org.apache.commons.collections.IteratorUtils;
 
 /**
  * An array-based binary heap implementation of a priority queue, 
@@ -317,7 +317,7 @@ public class MapBinaryHeap<T>
     @Override
     public Iterator<T> iterator()
     {
-        return IteratorUtils.<T>unmodifiableIterator(heap.iterator());
+        return (Iterator<T>) IteratorUtils.unmodifiableIterator(heap.iterator());
     }
 
     /**
diff --git a/edu/uci/ics/jung/graph/SparseMultigraph.java b/edu/uci/ics/jung/graph/SparseMultigraph.java
index f2d2b63..2527366 100644
--- a/edu/uci/ics/jung/graph/SparseMultigraph.java
+++ b/edu/uci/ics/jung/graph/SparseMultigraph.java
@@ -18,7 +18,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.collections15.Factory;
+import org.apache.commons.collections.Factory;
 
 import edu.uci.ics.jung.graph.util.EdgeType;
 import edu.uci.ics.jung.graph.util.Pair;
@@ -37,8 +37,8 @@ public class SparseMultigraph<V,E>
      * @param <V> the vertex type for the graph factory
      * @param <E> the edge type for the graph factory
      */
-	public static <V,E> Factory<Graph<V,E>> getFactory() { 
-		return new Factory<Graph<V,E>> () {
+	public static <V,E> Factory/*<Graph<V,E>>*/ getFactory() { 
+		return new Factory/*<Graph<V,E>>*/ () {
 			public Graph<V,E> create() {
 				return new SparseMultigraph<V,E>();
 			}
diff --git a/geogebra/kernel/discrete/AlgoShortestDistance.java b/geogebra/kernel/discrete/AlgoShortestDistance.java
index f25582d..afccb65 100644
--- a/geogebra/kernel/discrete/AlgoShortestDistance.java
+++ b/geogebra/kernel/discrete/AlgoShortestDistance.java
@@ -17,7 +17,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.commons.collections15.Transformer;
+import org.apache.commons.collections.Transformer;
 
 public class AlgoShortestDistance extends AlgoElement {
 	
@@ -122,9 +122,9 @@ public class AlgoShortestDistance extends AlgoElement {
         if (weighted.getBoolean() == true) {
         	//weighted Shortest Path
         	// use length of segments to weight
-	        Transformer<MyLink, Double> wtTransformer = new Transformer<MyLink,Double>() {
-	        	public Double transform(MyLink link) {
-	        	return link.weight;
+	        Transformer/*<MyLink, Double>*/ wtTransformer = new Transformer/*<MyLink,Double>*/() {
+	        	public Double transform(Object link) {
+	        	return ((MyLink) link).weight;
 	        	}
 	        	};
         	alg = new DijkstraShortestPath<MyNode, MyLink>(g, wtTransformer);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/geogebra.git



More information about the pkg-java-commits mailing list