Package: geogebra / 4.0.34.0+dfsg1-7

use_apache_commons_collections.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
From: Emmanuel Bourg <ebourg@apache.org>
Date: Wed, 18 Apr 2018 10:09:17 +0200
Subject: Replaces collections15 with commons-collections.

---
 .../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);