aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorn.christian@seime.no>2018-04-25 17:49:38 +0200
committerGitHub <noreply@github.com>2018-04-25 17:49:38 +0200
commit442204b36914ec9314eeb8b018f539d120d371c9 (patch)
tree460fafe92fa0eb1f094bb18cde9b198267856cfc
parentadd9063f792957502be3905d58a139d824835ed7 (diff)
parent4656265d867a2bdcb0967789fdcf5bfea5b5af38 (diff)
Merge pull request #5710 from vespa-engine/gjoranv/java9-prep-01
Gjoranv/java9 prep 01
-rw-r--r--application-model/pom.xml10
-rw-r--r--bundle-plugin/pom.xml17
-rw-r--r--clustercontroller-apps/pom.xml10
-rw-r--r--clustercontroller-apputil/pom.xml4
-rw-r--r--clustercontroller-core/pom.xml9
-rw-r--r--clustercontroller-utils/pom.xml2
-rw-r--r--config-model/pom.xml2
-rwxr-xr-xconfig/pom.xml8
-rw-r--r--docker-api/pom.xml8
-rw-r--r--node-admin/pom.xml9
-rw-r--r--node-maintainer/pom.xml9
-rw-r--r--parent/pom.xml2
-rw-r--r--vespa-application-maven-plugin/pom.xml9
-rw-r--r--vespa-documentgen-plugin/pom.xml9
-rw-r--r--vespajlib/src/main/java/com/yahoo/collections/ListMap.java6
-rw-r--r--vespajlib/src/main/java/com/yahoo/io/ReadLine.java9
-rw-r--r--yolean/pom.xml10
17 files changed, 17 insertions, 116 deletions
diff --git a/application-model/pom.xml b/application-model/pom.xml
index 801c72e9194..b4a3949fdb4 100644
--- a/application-model/pom.xml
+++ b/application-model/pom.xml
@@ -38,16 +38,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <compilerArgs>
- <arg>-Xlint:rawtypes</arg>
- <arg>-Xlint:unchecked</arg>
- <arg>-Xlint:deprecation</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
</plugin>
</plugins>
</build>
diff --git a/bundle-plugin/pom.xml b/bundle-plugin/pom.xml
index 47a06a1ee76..b68ffa811b2 100644
--- a/bundle-plugin/pom.xml
+++ b/bundle-plugin/pom.xml
@@ -91,6 +91,10 @@
</resources>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<executions>
@@ -109,19 +113,6 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <compilerArgs>
- <arg>-Xlint:all</arg>
- <arg>-Xlint:-processing</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>once</forkMode>
diff --git a/clustercontroller-apps/pom.xml b/clustercontroller-apps/pom.xml
index bdc6059a816..ece2d66c8b7 100644
--- a/clustercontroller-apps/pom.xml
+++ b/clustercontroller-apps/pom.xml
@@ -69,16 +69,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <compilerArgs>
- <arg>-Xlint:rawtypes</arg>
- <arg>-Xlint:unchecked</arg>
- <arg>-Xlint:deprecation</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
</plugin>
</plugins>
</build>
diff --git a/clustercontroller-apputil/pom.xml b/clustercontroller-apputil/pom.xml
index 42c7690eab6..f1dbd57a275 100644
--- a/clustercontroller-apputil/pom.xml
+++ b/clustercontroller-apputil/pom.xml
@@ -56,12 +56,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.8</source>
- <target>1.8</target>
<compilerArgs>
<arg>-Xlint:all</arg>
- <arg>-Xlint:-serial</arg>
<arg>-Xlint:-deprecation</arg>
+ <arg>-Xlint:-serial</arg>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
diff --git a/clustercontroller-core/pom.xml b/clustercontroller-core/pom.xml
index 99cf4df643b..d10c8c8739b 100644
--- a/clustercontroller-core/pom.xml
+++ b/clustercontroller-core/pom.xml
@@ -86,15 +86,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <compilerArgs>
- <arg>-Xlint:all</arg>
- <arg>-Xlint:-serial</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
</plugin>
</plugins>
</build>
diff --git a/clustercontroller-utils/pom.xml b/clustercontroller-utils/pom.xml
index 287a85089ca..ecfc6df3bd0 100644
--- a/clustercontroller-utils/pom.xml
+++ b/clustercontroller-utils/pom.xml
@@ -52,8 +52,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.8</source>
- <target>1.8</target>
<compilerArgs>
<arg>-Xlint:unchecked</arg>
<arg>-Xlint:deprecation</arg>
diff --git a/config-model/pom.xml b/config-model/pom.xml
index 68a2e5041ca..9388608fdcb 100644
--- a/config-model/pom.xml
+++ b/config-model/pom.xml
@@ -331,8 +331,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.8</source>
- <target>1.8</target>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>-Xlint:-rawtypes</arg>
diff --git a/config/pom.xml b/config/pom.xml
index cfa3a692181..291c96514d1 100755
--- a/config/pom.xml
+++ b/config/pom.xml
@@ -183,14 +183,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <compilerArgs>
- <arg>-Xlint:all</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/docker-api/pom.xml b/docker-api/pom.xml
index e82bc86d349..df77b9c04db 100644
--- a/docker-api/pom.xml
+++ b/docker-api/pom.xml
@@ -161,14 +161,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <compilerArgs>
- <arg>-Xlint:all</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
</plugin>
</plugins>
</build>
diff --git a/node-admin/pom.xml b/node-admin/pom.xml
index b5e21ce7385..ea708407365 100644
--- a/node-admin/pom.xml
+++ b/node-admin/pom.xml
@@ -143,15 +143,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
-
- <source>1.8</source>
- <target>1.8</target>
- <compilerArgs>
- <arg>-Xlint:all</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
</plugin>
</plugins>
</build>
diff --git a/node-maintainer/pom.xml b/node-maintainer/pom.xml
index 9e4bedeef3d..2c105a55b40 100644
--- a/node-maintainer/pom.xml
+++ b/node-maintainer/pom.xml
@@ -80,15 +80,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
-
- <source>1.8</source>
- <target>1.8</target>
- <compilerArgs>
- <arg>-Xlint:all</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/parent/pom.xml b/parent/pom.xml
index ae15ae40c35..0340884f86e 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -704,7 +704,7 @@
<test.hide>true</test.hide>
<doclint>all</doclint>
<scala.major-version>2.11</scala.major-version> <!-- TODO: factorylib magic for maven cache bootstrapping prevents moving this to container-dep-versions. -->
- <surefire.version>2.19.1</surefire.version> <!-- NOTE bjorncs 15.06.2017: Version 2.20 has OoM issues -->
+ <surefire.version>2.21.0</surefire.version>
</properties>
</project>
diff --git a/vespa-application-maven-plugin/pom.xml b/vespa-application-maven-plugin/pom.xml
index 980c8eee60f..6468a24e5a9 100644
--- a/vespa-application-maven-plugin/pom.xml
+++ b/vespa-application-maven-plugin/pom.xml
@@ -52,15 +52,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <compilerArgs>
- <arg>-Xlint:all</arg>
- <arg>-Xlint:-processing</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/vespa-documentgen-plugin/pom.xml b/vespa-documentgen-plugin/pom.xml
index 718b19ae994..33f2bd9904b 100644
--- a/vespa-documentgen-plugin/pom.xml
+++ b/vespa-documentgen-plugin/pom.xml
@@ -68,15 +68,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <compilerArgs>
- <arg>-Xlint:all</arg>
- <arg>-Xlint:-processing</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
</plugin>
</plugins>
</build>
diff --git a/vespajlib/src/main/java/com/yahoo/collections/ListMap.java b/vespajlib/src/main/java/com/yahoo/collections/ListMap.java
index b601545b43b..e851362a99d 100644
--- a/vespajlib/src/main/java/com/yahoo/collections/ListMap.java
+++ b/vespajlib/src/main/java/com/yahoo/collections/ListMap.java
@@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang.builder.ToStringBuilder;
+import java.lang.reflect.InvocationTargetException;
import java.util.*;
/**
@@ -25,7 +26,10 @@ public class ListMap<K, V> {
@SuppressWarnings("unchecked")
public ListMap(@SuppressWarnings("rawtypes") Class<? extends Map> implementation) {
try {
- this.map = implementation.newInstance();
+ this.map = implementation.getDeclaredConstructor().newInstance();
+ } catch (InvocationTargetException e) {
+ // For backwards compatibility from when this method used implementation.newInstance()
+ throw new IllegalArgumentException(e.getCause());
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
diff --git a/vespajlib/src/main/java/com/yahoo/io/ReadLine.java b/vespajlib/src/main/java/com/yahoo/io/ReadLine.java
index 48c86cf0017..6e7f9f5e50e 100644
--- a/vespajlib/src/main/java/com/yahoo/io/ReadLine.java
+++ b/vespajlib/src/main/java/com/yahoo/io/ReadLine.java
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.io;
+import java.nio.Buffer;
import java.nio.charset.Charset;
import java.nio.ByteBuffer;
@@ -44,9 +45,11 @@ public class ReadLine {
continue;
}
- // extract string between start and i. limit() returns
- // a buffer so we have to up-cast again
- String line = charset.decode((ByteBuffer) buffer.slice().limit(i - start)).toString();
+ // limit() returns a buffer (before Java 9) so we have to up-cast.
+ // The downcast to Buffer is done to avoid "redundant cast" warning on Java 9.
+ // TODO: when Java 8 is gone, remove the casts and above comments.
+ // extract string between start and i.
+ String line = charset.decode((ByteBuffer) ((Buffer)buffer.slice()).limit(i - start)).toString();
// skip remaining
for (; (i < buffer.limit()) && isEolChar(buffer.get(i)); i++) {
diff --git a/yolean/pom.xml b/yolean/pom.xml
index a59121cb1f6..a55ab923fcc 100644
--- a/yolean/pom.xml
+++ b/yolean/pom.xml
@@ -50,16 +50,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- <compilerArgs>
- <arg>-Xlint:all</arg>
- <arg>-Xlint:-serial</arg>
- <arg>-Xlint:-varargs</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
</plugin>
</plugins>
</build>