diff options
author | gjoranv <gjoranv@gmail.com> | 2019-03-29 15:16:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-29 15:16:09 +0100 |
commit | db02a6f26cbf5b65219a0766dca5379fea781b04 (patch) | |
tree | 2551facf66eead0762c3e86319523561e686fe35 | |
parent | 21845dd68dc2c3ad5cec5db8be08770b6b2f2507 (diff) | |
parent | 25a30c37fd2a8577ee3a1263d57e6d7f942114e5 (diff) |
Merge pull request #8955 from vespa-engine/bratseth/clients-may-compile-with-jdk-8
Client-side modules should be compilable with jdk8
6 files changed, 69 insertions, 22 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/component/FileStatusHandlerComponent.java b/config-model/src/main/java/com/yahoo/vespa/model/container/component/FileStatusHandlerComponent.java index dc04aa54ba0..ee61b34987a 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/component/FileStatusHandlerComponent.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/component/FileStatusHandlerComponent.java @@ -6,6 +6,7 @@ import com.yahoo.osgi.provider.model.ComponentModel; /** * Sets up VipStatusHandler that answers OK when a certain file is present. + * * @author Tony Vaagenes */ public class FileStatusHandlerComponent extends Handler implements VipStatusConfig.Producer { diff --git a/document/src/main/java/com/yahoo/document/json/DocumentUpdateJsonSerializer.java b/document/src/main/java/com/yahoo/document/json/DocumentUpdateJsonSerializer.java index 8d50f4a14dd..7b78f90bc56 100644 --- a/document/src/main/java/com/yahoo/document/json/DocumentUpdateJsonSerializer.java +++ b/document/src/main/java/com/yahoo/document/json/DocumentUpdateJsonSerializer.java @@ -65,8 +65,8 @@ import static com.yahoo.document.json.JsonSerializationHelper.*; * @see #serialize(com.yahoo.document.DocumentUpdate) * @author Vegard Sjonfjell */ -public class DocumentUpdateJsonSerializer -{ +public class DocumentUpdateJsonSerializer { + private final JsonFactory jsonFactory = new JsonFactory(); private final JsonDocumentUpdateWriter writer = new JsonDocumentUpdateWriter(); private JsonGenerator generator; diff --git a/vespa-hadoop/pom.xml b/vespa-hadoop/pom.xml index 2f8dbb46a78..999bb7bcc01 100644 --- a/vespa-hadoop/pom.xml +++ b/vespa-hadoop/pom.xml @@ -21,6 +21,28 @@ <pig.version>0.14.0</pig.version> </properties> + <!-- This is a client jar and should be compilable with jdk8 --> + <profiles> + <profile> + <id>jdk11</id> + <activation> + <jdk>11</jdk> + </activation> + <properties> + <java.version>11</java.version> + </properties> + </profile> + <profile> + <id>jdk1.8</id> + <activation> + <jdk>1.8</jdk> + </activation> + <properties> + <java.version>8</java.version> + </properties> + </profile> + </profiles> + <dependencies> <!-- Hadoop dependencies --> <dependency> @@ -95,18 +117,6 @@ <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <showDeprecation>true</showDeprecation> - <compilerArgs> - <arg>-Xlint:all</arg> - <arg>-Werror</arg> - </compilerArgs> - </configuration> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> @@ -145,8 +155,16 @@ </plugin> <plugin> - <groupId>com.yahoo.vespa</groupId> - <artifactId>abi-check-plugin</artifactId> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.0</version> + <configuration> + <jdkToolchain> + <version>${java.version}</version> + </jdkToolchain> + <source>${java.version}</source> + <target>${java.version}</target> + </configuration> </plugin> </plugins> diff --git a/vespa-http-client/pom.xml b/vespa-http-client/pom.xml index b42c4c32a08..6ee3d56673d 100644 --- a/vespa-http-client/pom.xml +++ b/vespa-http-client/pom.xml @@ -14,6 +14,29 @@ <name>${project.artifactId}</name> <description>Independent external feeding API towards Vespa.</description> + <!-- This is a client jar and should be compilable with jdk8 --> + <profiles> + <profile> + <id>jdk11</id> + <activation> + <jdk>11</jdk> + </activation> + <properties> + <java.version>11</java.version> + </properties> + </profile> + <profile> + <id>jdk1.8</id> + <activation> + <jdk>1.8</jdk> + </activation> + <properties> + <java.version>8</java.version> + </properties> + </profile> + </profiles> + + <dependencies> <!-- NOTE: Adding dependencies here may break clients because this is used outside an OSGi container with @@ -135,8 +158,16 @@ </executions> </plugin> <plugin> - <groupId>com.yahoo.vespa</groupId> - <artifactId>abi-check-plugin</artifactId> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.0</version> + <configuration> + <jdkToolchain> + <version>${java.version}</version> + </jdkToolchain> + <source>${java.version}</source> + <target>${java.version}</target> + </configuration> </plugin> </plugins> </build> diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java index 4468355698f..f9357ab16d8 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java @@ -412,7 +412,7 @@ class ApacheGatewayConnection implements GatewayConnection { } clientBuilder.setUserAgent(String.format("vespa-http-client (%s)", Vtag.currentVersion)); - clientBuilder.setDefaultHeaders(List.of(new BasicHeader(Headers.CLIENT_VERSION, Vtag.currentVersion))); + clientBuilder.setDefaultHeaders(Collections.singletonList(new BasicHeader(Headers.CLIENT_VERSION, Vtag.currentVersion))); clientBuilder.setMaxConnPerRoute(1); clientBuilder.setMaxConnTotal(1); clientBuilder.disableContentCompression(); diff --git a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/CommandLineArgumentsTest.java b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/CommandLineArgumentsTest.java index ec80dd53a4b..53715259a0c 100644 --- a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/CommandLineArgumentsTest.java +++ b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/CommandLineArgumentsTest.java @@ -7,11 +7,8 @@ import com.yahoo.vespa.http.client.config.SessionParams; import org.junit.Test; import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; import java.util.Comparator; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; |