Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit ebc6348

Browse files
authored
Merge pull request #107 from B3Partners/geotools-upgrade
Bump GeoTools 20.5 -> 23.1 en bouwen met java 11
2 parents 0b99141 + 037eac8 commit ebc6348

File tree

21 files changed

+456
-95
lines changed

21 files changed

+456
-95
lines changed

.mvn/jvm.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-Xss9g -Xms4g -Xmx12g -Djava.awt.headless=true -XX:+IgnoreUnrecognizedVMOptions -Djava.security.egd=file:/dev/./urandom
1+
-Djava.awt.headless=true -XX:+IgnoreUnrecognizedVMOptions -Djava.security.egd=file:/dev/./urandom

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ language: java
22

33
jdk:
44
- openjdk8
5+
- openjdk11
56

67
matrix:
78
fast_finish: true

Jenkinsfile

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,35 @@ timestamps {
88
numToKeepStr: '5']
99
]]);
1010

11+
final def jdks = ['OpenJDK11', 'JDK8']
12+
1113
node {
12-
withEnv(["JAVA_HOME=${ tool 'JDK8' }", "PATH+MAVEN=${tool 'Maven CURRENT'}/bin:${env.JAVA_HOME}/bin"]) {
14+
jdks.eachWithIndex { jdk, indexOfJdk ->
15+
final String jdkTestName = jdk.toString()
16+
withEnv(["JAVA_HOME=${ tool jdkTestName }", "PATH+MAVEN=${tool 'Maven CURRENT'}/bin:${env.JAVA_HOME}/bin"]) {
1317

14-
stage('Prepare') {
15-
checkout scm
16-
}
18+
stage('Prepare') {
19+
checkout scm
20+
}
1721

18-
stage('Build') {
19-
echo "Building branch: ${env.BRANCH_NAME}"
20-
sh "mvn install -B -V -e -fae -q"
21-
}
22+
stage('Build') {
23+
echo "Building branch: ${env.BRANCH_NAME}"
24+
sh "mvn install -B -V -e -fae -q"
25+
}
2226

23-
stage('Test') {
24-
echo "Running unit tests"
25-
sh "mvn -e test -B"
27+
stage('Test') {
28+
echo "Running unit tests"
29+
sh "mvn -e test -B"
30+
}
31+
32+
stage('Integration Test') {
33+
echo "Running unit tests"
34+
sh "mvn -e verify -B"
35+
}
2636
}
37+
}
38+
39+
withEnv(["JAVA_HOME=${ tool 'JDK8' }", "PATH+MAVEN=${tool 'Maven CURRENT'}/bin:${env.JAVA_HOME}/bin"]) {
2740

2841
stage('Publish Test Results') {
2942
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/TEST-*.xml, **/target/failsafe-reports/TEST-*.xml'

appveyor.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,24 @@ max_jobs: 1
77
build:
88
verbosity: minimal
99

10-
matrix:
11-
fast_finish: false
10+
environment:
11+
fast_finish: true
12+
13+
matrix:
14+
- JDK: JDK8
15+
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
16+
- JDK: JDK11
17+
JAVA_HOME: C:\Program Files\Java\jdk11
1218

1319
install:
1420

1521
- ps: |
1622
Add-Type -AssemblyName System.IO.Compression.FileSystem
1723
if (!(Test-Path("C:\Users\appveyor\downloads\maven-bin.zip"))) {
18-
(new-object System.Net.WebClient).DownloadFile('https://archive.apache.org/dist/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.zip', 'C:\Users\appveyor\downloads\maven-bin.zip')
24+
(new-object System.Net.WebClient).DownloadFile('https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip', 'C:\Users\appveyor\downloads\maven-bin.zip')
1925
}
2026
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\Users\appveyor\downloads\maven-bin.zip", "C:\maven")
21-
- cmd: SET PATH=C:\maven\apache-maven-3.6.0\bin;%PATH%
27+
- cmd: SET PATH=C:\maven\apache-maven-3.6.3\bin;%PATH%
2228
- cmd: echo %PATH%
2329
- cmd: java -version
2430
- cmd: mvn -v

b3p-datastorelinker/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
<parent>
66
<groupId>nl.b3p</groupId>
77
<artifactId>datastorelinker-parent</artifactId>
8-
<version>5.2.2-SNAPSHOT</version>
8+
<version>6.0.0-SNAPSHOT</version>
99
</parent>
1010

1111
<groupId>nl.b3p</groupId>
1212
<artifactId>b3p-datastorelinker</artifactId>
13-
<version>5.2.2-SNAPSHOT</version>
1413
<packaging>jar</packaging>
1514

1615
<dependencies>

b3p-datastorelinker/src/main/java/nl/b3p/geotools/data/linker/ActionFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ public static int toInteger(String value) {
950950
}
951951

952952
public static Long toLong(String value) {
953-
return new Long(value);
953+
return Long.valueOf(value);
954954
}
955955

956956
public static Double toDouble(String value) {

b3p-datastorelinker/src/main/java/nl/b3p/geotools/data/linker/Client.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public static void main(String[] args) throws Exception {
168168
}
169169

170170
} else {
171-
throw new Exception("File \"" + file.toURL().toString() + " could not be found");
171+
throw new Exception("File \"" + file.toURI().toString() + " could not be found");
172172
}
173173
}
174174
}
@@ -235,7 +235,7 @@ public static void saveAsXML(File propertiesFile) throws FileNotFoundException,
235235
properties.storeToXML(output, "XML Generated with DataStoreLinker v" + version);
236236

237237
} else {
238-
throw new IOException("File \"" + propertiesFile.toURL().toString() + "\" is not a propertiesFile");
238+
throw new IOException("File \"" + propertiesFile.toURI().toString() + "\" is not a propertiesFile");
239239
}
240240
}
241241

b3p-datastorelinker/src/main/java/nl/b3p/geotools/data/linker/DataStoreLinker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ public static DataStore openDataStore(Map params, boolean createNew) throws Exce
510510
ShapefileDataStoreFactory factory = new ShapefileDataStoreFactory();
511511
// FileDataStoreFactorySpi factory = new IndexedShapefileDataStoreFactory();
512512

513-
params.put("url", new File(url).toURL());
513+
params.put("url", new File(url).toURI());
514514
dataStore = factory.createNewDataStore(params);
515515
} else {
516516
log.warn("Can not create a new datastore, filetype unknown.");
@@ -619,7 +619,7 @@ public static Map<String, Object> propertiesToMaps(Properties batch, String filt
619619
} else if (keypart.toLowerCase().equals("url")) {
620620
File file = new File(value);
621621
if (file.exists()) {
622-
stepIn.put(keypart, file.toURL());
622+
stepIn.put(keypart, file.toURI());
623623
} else {
624624
stepIn.put(keypart, value);
625625
}

b3p-datastorelinker/src/main/java/nl/b3p/geotools/data/linker/blocks/ActionDataStore_Writer.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package nl.b3p.geotools.data.linker.blocks;
22

3+
import org.geotools.util.factory.Hints;
34
import org.locationtech.jts.geom.LineString;
45
import org.locationtech.jts.geom.MultiLineString;
56
import java.io.IOException;
@@ -17,18 +18,15 @@
1718
import nl.b3p.geotools.data.linker.DataStoreLinker;
1819
import nl.b3p.geotools.data.linker.FeatureException;
1920
import nl.b3p.geotools.data.linker.Status;
20-
import static nl.b3p.geotools.data.linker.blocks.Action.log;
2121
import nl.b3p.geotools.data.linker.feature.EasyFeature;
2222
import org.apache.commons.lang.exception.ExceptionUtils;
2323
import org.geotools.data.DataStore;
2424
import org.geotools.data.DefaultTransaction;
2525
import org.geotools.data.FeatureSource;
2626
import org.geotools.data.FeatureStore;
2727
import org.geotools.data.Transaction;
28-
import org.geotools.data.oracle.OracleDialect;
2928
import org.geotools.data.postgis.PostGISDialect;
3029
import org.geotools.data.wfs.WFSDataStore;
31-
import org.geotools.factory.Hints;
3230
import org.geotools.feature.DefaultFeatureCollection;
3331
import org.geotools.feature.FeatureCollection;
3432
import org.geotools.feature.FeatureIterator;
@@ -431,26 +429,26 @@ private void initPostCollectionActions(Map properties) {
431429
}
432430

433431
if (ActionFactory.propertyCheck(properties, ActionFactory.POLYGONIZE)) {
434-
polygonize = new Boolean(properties.get(ActionFactory.POLYGONIZE).toString());
432+
polygonize = Boolean.valueOf(properties.get(ActionFactory.POLYGONIZE).toString());
435433
postCollectionActionsInitDone = true;
436434
} else {
437435
polygonize = false;
438436
}
439437
if (ActionFactory.propertyCheck(properties, ActionFactory.POLYGONIZEWITHATTR)) {
440-
polygonizeWithAttr = new Boolean(properties.get(ActionFactory.POLYGONIZEWITHATTR).toString());
438+
polygonizeWithAttr = Boolean.valueOf(properties.get(ActionFactory.POLYGONIZEWITHATTR).toString());
441439
postCollectionActionsInitDone = true;
442440
} else {
443441
polygonizeWithAttr = false;
444442
}
445443
if (ActionFactory.propertyCheck(properties, ActionFactory.POLYGONIZESUFLKI)) {
446-
polygonizeSufLki = new Boolean(properties.get(ActionFactory.POLYGONIZESUFLKI).toString());
444+
polygonizeSufLki = Boolean.valueOf(properties.get(ActionFactory.POLYGONIZESUFLKI).toString());
447445
postCollectionActionsInitDone = true;
448446
} else {
449447
polygonizeSufLki = false;
450448
}
451449

452450
if (ActionFactory.propertyCheck(properties, ActionFactory.POSTPOINTWITHINPOLYGON)) {
453-
postPointWithinPolygon = new Boolean(properties.get(ActionFactory.POSTPOINTWITHINPOLYGON).toString());
451+
postPointWithinPolygon = Boolean.valueOf(properties.get(ActionFactory.POSTPOINTWITHINPOLYGON).toString());
454452
postCollectionActionsInitDone = true;
455453
} else {
456454
postPointWithinPolygon = false;

b3p-datastorelinker/src/main/java/nl/b3p/geotools/data/linker/blocks/CollectionAction_PolygonizeWithAttr.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public ArrayList<SimpleFeature> filterInvalidLines(FeatureIterator lineFeatures)
303303
else if (lineGeom.buffer(0.0005).contains(featureGeom)) {
304304
addLine = false;
305305
} else if (featureGeom.buffer(0.0005).contains(lineGeom)) {
306-
removeIndex.add(new Integer(i));
306+
removeIndex.add(i);
307307
}
308308
}
309309
}else{

0 commit comments

Comments
 (0)