Skip to content

Commit 7e158f3

Browse files
committed
Upgrade Groovy to 2.5.4
1 parent 71d10c8 commit 7e158f3

14 files changed

Lines changed: 95 additions & 68 deletions

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Versions
135135
+-----------+----------+-----------+--------+----------+
136136
| GeoScript | GeoTools | GeoServer | JTS | Groovy |
137137
+-----------+----------+-----------+--------+----------+
138-
| 1.13 | 21 | 2.15 | 1.16.0 | 2.4.15 |
138+
| 1.13 | 21 | 2.15 | 1.16.0 | 2.5.4 |
139139
+-----------+----------+-----------+--------+----------+
140140
| 1.12 | 20 | 2.14 | 1.16.0 | 2.4.15 |
141141
+-----------+----------+-----------+--------+----------+

pom.xml

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,28 @@
289289
</dependency>
290290
<dependency>
291291
<groupId>org.codehaus.groovy</groupId>
292-
<artifactId>groovy-all</artifactId>
293-
<version>2.4.15</version>
292+
<artifactId>groovy</artifactId>
293+
<version>2.5.4</version>
294+
</dependency>
295+
<dependency>
296+
<groupId>org.codehaus.groovy</groupId>
297+
<artifactId>groovy-sql</artifactId>
298+
<version>2.5.4</version>
299+
</dependency>
300+
<dependency>
301+
<groupId>org.codehaus.groovy</groupId>
302+
<artifactId>groovy-xml</artifactId>
303+
<version>2.5.4</version>
304+
</dependency>
305+
<dependency>
306+
<groupId>org.codehaus.groovy</groupId>
307+
<artifactId>groovy-json</artifactId>
308+
<version>2.5.4</version>
309+
</dependency>
310+
<dependency>
311+
<groupId>org.codehaus.groovy</groupId>
312+
<artifactId>groovy-swing</artifactId>
313+
<version>2.5.4</version>
294314
</dependency>
295315
<dependency>
296316
<groupId>com.opencsv</groupId>
@@ -349,7 +369,7 @@
349369
<plugin>
350370
<groupId>org.codehaus.groovy</groupId>
351371
<artifactId>groovy-eclipse-compiler</artifactId>
352-
<version>2.9.2-04</version>
372+
<version>3.0.0-01</version>
353373
<extensions>true</extensions>
354374
</plugin>
355375
<plugin>
@@ -364,12 +384,12 @@
364384
<dependency>
365385
<groupId>org.codehaus.groovy</groupId>
366386
<artifactId>groovy-eclipse-compiler</artifactId>
367-
<version>2.9.2-04</version>
387+
<version>3.0.0-01</version>
368388
</dependency>
369389
<dependency>
370390
<groupId>org.codehaus.groovy</groupId>
371391
<artifactId>groovy-eclipse-batch</artifactId>
372-
<version>2.4.13-02</version>
392+
<version>2.5.4-01</version>
373393
</dependency>
374394
</dependencies>
375395
</plugin>
@@ -412,6 +432,18 @@
412432
</goals>
413433
</execution>
414434
</executions>
435+
<dependencies>
436+
<dependency>
437+
<groupId>org.codehaus.groovy</groupId>
438+
<artifactId>groovy-ant</artifactId>
439+
<version>2.5.4</version>
440+
</dependency>
441+
<dependency>
442+
<groupId>org.codehaus.groovy</groupId>
443+
<artifactId>groovy-groovydoc</artifactId>
444+
<version>2.5.4</version>
445+
</dependency>
446+
</dependencies>
415447
</plugin>
416448
<plugin>
417449
<groupId>org.apache.maven.plugins</groupId>

src/main/groovy/geoscript/index/GeoHash.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ class GeoHash {
507507
List<String> hashList = []
508508
for (int lat = 0; lat <= latStep; lat++) {
509509
for (int lon = 0; lon <= lonStep; lon++) {
510-
hashList.push(neighbor(hashSouthWest, lon, lat, numberOfChars))
510+
hashList.add(hashList.size(), neighbor(hashSouthWest, lon, lat, numberOfChars))
511511
}
512512
}
513513
hashList
@@ -546,7 +546,7 @@ class GeoHash {
546546
List<String> hashList = []
547547
for (int lat = 0; lat <= latStep; lat++) {
548548
for (int lon = 0; lon <= lonStep; lon++) {
549-
hashList.push(neighbor(hashSouthWest, lon, lat, bitDepth))
549+
hashList.add(hashList.size(), neighbor(hashSouthWest, lon, lat, bitDepth))
550550
}
551551
}
552552
hashList

src/main/groovy/geoscript/layer/Layer.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ class Layer implements Renderable {
636636
else {
637637
List values = s.toString().split(" ") as List
638638
if (values.last().toUpperCase() in ["ASC","DESC"]) {
639-
sortDirection = values.pop().toUpperCase()
639+
sortDirection = values.removeLast().toUpperCase()
640640
sortName = values.join(" ")
641641
} else {
642642
sortName = values.join(" ")

src/main/groovy/geoscript/layer/Tile.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.apache.commons.codec.binary.Base64
99
* @author Jared Erickson
1010
*/
1111
@EqualsAndHashCode
12-
@ToString(includePackage = false, includeNames = true, excludes = "data")
12+
@ToString(includePackage = false, includeNames = true, excludes = ["data","base64String"])
1313
class Tile {
1414

1515
/**

src/main/groovy/geoscript/style/UniqueValues.groovy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package geoscript.style
22

33
import geoscript.feature.Feature
4-
import geoscript.filter.Color
4+
import geoscript.filter.Color as FColor
55
import geoscript.filter.Filter
66
import geoscript.layer.Cursor
77
import geoscript.layer.Layer
@@ -24,7 +24,7 @@ class UniqueValues extends Composite {
2424
* @param field The Field or the Field's name
2525
* @param colors A Closure (which takes index based on 0 and a value), a Palette name, or a List of Colors
2626
*/
27-
UniqueValues(Layer layer, def field, def colors = {index, value -> Color.getRandomPastel()}) {
27+
UniqueValues(Layer layer, def field, def colors = {index, value -> FColor.getRandomPastel()}) {
2828
super(createSymbolizers(layer, field instanceof Field ? field.name : field as String, colors))
2929
}
3030

@@ -35,7 +35,7 @@ class UniqueValues extends Composite {
3535
* @param colors A Closure (which takes index based on 0 and a value), a Palette name, or a List of Colors
3636
* @return A Symbolizer
3737
*/
38-
private static List createSymbolizers(Layer layer, String field, def colors = {index, value -> Color.getRandomPastel()}) {
38+
private static List createSymbolizers(Layer layer, String field, def colors = {index, value -> FColor.getRandomPastel()}) {
3939

4040
// Collect the unique values
4141
Set uniqueValueSet = new HashSet()
@@ -53,7 +53,7 @@ class UniqueValues extends Composite {
5353
// If the colors argument is a String treat it
5454
// like a Palette
5555
if (colors instanceof String) {
56-
colors = Color.getPaletteColors(colors)
56+
colors = FColor.getPaletteColors(colors)
5757
}
5858

5959
// Create the list of Rules
@@ -77,7 +77,7 @@ class UniqueValues extends Composite {
7777

7878
// Make sure color is a java.awt.Color
7979
if (color instanceof String) {
80-
color = new Color(color)
80+
color = new FColor(color)
8181
}
8282

8383
// Increment our counter

src/main/groovy/geoscript/style/io/ColorTableReader.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package geoscript.style.io
22

3-
import geoscript.filter.Color
3+
import geoscript.filter.Color as FilterColor
44
import geoscript.style.ColorMap
55
import geoscript.style.Style
66

@@ -38,11 +38,11 @@ class ColorTableReader implements Reader {
3838
str.eachLine {line ->
3939
def parts = line.replaceAll("\\s+"," ").split(" ") as List
4040
String value = parts[0]
41-
Color color
41+
FilterColor color
4242
if (parts.size() == 2) {
43-
color = new Color(parts[1])
43+
color = new FilterColor(parts[1])
4444
} else {
45-
color = new Color(parts.subList(1,parts.size()).join(",") )
45+
color = new FilterColor(parts.subList(1,parts.size()).join(",") )
4646
}
4747
if (value.isNumber() && color?.value) {
4848
values.add([quantity: value, color: color])

src/main/groovy/geoscript/style/io/ColorTableWriter.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package geoscript.style.io
22

3-
import geoscript.filter.Color
3+
import geoscript.filter.Color as FilterColor
44
import geoscript.style.ColorMap
55
import geoscript.style.Style
66

@@ -48,7 +48,7 @@ class ColorTableWriter implements Writer {
4848
StringWriter writer = new StringWriter()
4949
colorMap.values.eachWithIndex{value,i ->
5050
if (i > 0) writer.write(NEW_LINE)
51-
writer.write("${value.quantity} ${new Color(value.color).rgb.join(' ')}")
51+
writer.write("${value.quantity} ${new FilterColor(value.color).rgb.join(' ')}")
5252
}
5353
writer.toString()
5454
}

src/main/groovy/geoscript/style/io/UniqueValuesReader.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package geoscript.style.io
22

33
import geoscript.filter.Filter
4-
import geoscript.filter.Color
4+
import geoscript.filter.Color as FColor
55
import geoscript.style.Composite
66
import geoscript.style.Style
77
import geoscript.style.Symbolizer
@@ -106,7 +106,7 @@ class UniqueValuesReader implements Reader {
106106
if (line.contains("=")) {
107107
List parts = line.split("=")
108108
String value = parts[0]
109-
String color = Color.toHex(parts[1])
109+
String color = FColor.toHex(parts[1])
110110
if (color) {
111111
Filter filter = Filter.equals(this.field, value)
112112
styles.add(Symbolizer.getDefault(this.geometryType, color).where(filter))
@@ -116,7 +116,7 @@ class UniqueValuesReader implements Reader {
116116
List parts = line.split(",")
117117
if (parts.size() >= 2) {
118118
String value = parts[0]
119-
String color = Color.toHex(parts.tail().join(","))
119+
String color = FColor.toHex(parts.tail().join(","))
120120
if (color) {
121121
Filter filter = Filter.equals(this.field, value)
122122
styles.add(Symbolizer.getDefault(this.geometryType, color).where(filter))

src/test/groovy/geoscript/feature/FeatureTestCase.groovy

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ class FeatureTestCase {
197197
@Test void getGeoRSS() {
198198
Schema s1 = new Schema("houses", [new Field("geom","Point"), new Field("name","string"), new Field("price","float")])
199199
Feature f1 = new Feature([new Point(111,-47), "House", 12.5], "house1", s1)
200-
AssertUtil.assertStringsEqual "<entry xmlns:georss='http://www.georss.org/georss' xmlns='http://www.w3.org/2005/Atom'>" +
200+
AssertUtil.assertStringsEqual "<entry >" +
201201
"<title>house1</title>" +
202-
"<summary>[geom:POINT (111 -47), name:House, price:12.5]</summary>" +
202+
"<summary >[geom:POINT (111 -47), name:House, price:12.5]</summary>" +
203203
"<updated>12/7/2013</updated>" +
204-
"<georss:point>-47.0 111.0</georss:point>" +
204+
"<georss:point >-47.0 111.0</georss:point>" +
205205
"</entry>", f1.getGeoRSS(feedType: "atom", geometryType: "simple", itemDate: "12/7/2013"), removeXmlNS: true
206206
}
207207

@@ -283,7 +283,9 @@ class FeatureTestCase {
283283
Schema s1 = new Schema("houses", [new Field("geom","Point"), new Field("name","string"), new Field("price","float")])
284284
Feature f1 = new Feature([new Point(111,-47), "House", 12.5], "house1", s1)
285285
AssertUtil.assertStringsEqual "<wpt lat='-47.0' lon='111.0' xmlns='http://www.topografix.com/GPX/1/1'>" +
286-
"<name>House</name><desc>House costs \$12.5</desc></wpt>",
286+
"<name>House</name>" +
287+
"<desc xmlns='http://www.topografix.com/GPX/1/1'>House costs \$12.5</desc>" +
288+
"</wpt>",
287289
f1.getGpx(name: new Property("name"), description: {Feature f -> "${f['name']} costs \$${f['price']}"})
288290
}
289291

0 commit comments

Comments
 (0)