diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-01-09 16:17:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-09 16:17:53 +0100 |
commit | 011a262844a16db4524a1879cd9f893c78509ff1 (patch) | |
tree | 645d236c4115a6e189c643fbe359999fd2bdb9e3 | |
parent | 921b86f4346e9c865ed2f803948afac719cb4852 (diff) | |
parent | 4c07cb7c5b877d98f2232b124215c10e0f2f0dce (diff) |
Merge pull request #11720 from vespa-engine/bjorncs/java-deps-cleanup
Bjorncs/java deps cleanup
16 files changed, 31 insertions, 66 deletions
diff --git a/container-dependency-versions/pom.xml b/container-dependency-versions/pom.xml index c743c6c2b2e..e0f2c1f0a0c 100644 --- a/container-dependency-versions/pom.xml +++ b/container-dependency-versions/pom.xml @@ -313,7 +313,7 @@ <artifactId>javassist</artifactId> <version>${javassist.version}</version> </dependency> - <dependency> + <dependency> <!-- TODO Vespa 8: upgrade to newest version. Consider removing as provided dependency --> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>${org.json.version}</version> diff --git a/container-dev/pom.xml b/container-dev/pom.xml index 7297b21f68d..a7217d05315 100644 --- a/container-dev/pom.xml +++ b/container-dev/pom.xml @@ -153,10 +153,6 @@ <artifactId>icu4j</artifactId> </exclusion> <exclusion> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - </exclusion> - <exclusion> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> </exclusion> @@ -193,10 +189,6 @@ <version>${project.version}</version> <exclusions> <exclusion> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - </exclusion> - <exclusion> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> </exclusion> diff --git a/container-test/pom.xml b/container-test/pom.xml index d1021202a24..4b5008c8a6f 100644 --- a/container-test/pom.xml +++ b/container-test/pom.xml @@ -35,10 +35,6 @@ <artifactId>jackson-dataformat-xml</artifactId> </dependency> <dependency> - <groupId>commons-collections</groupId> - <artifactId>commons-collections</artifactId> - </dependency> - <dependency> <groupId>io.airlift</groupId> <artifactId>airline</artifactId> <exclusions> @@ -89,10 +85,6 @@ <version>1.8.0</version> </dependency> <dependency> - <groupId>commons-configuration</groupId> - <artifactId>commons-configuration</artifactId> - </dependency> - <dependency> <groupId>commons-digester</groupId> <artifactId>commons-digester</artifactId> <version>1.8</version> diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java index dd43195f67d..95867b3786c 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/proxy/ConfigServerRestExecutorImpl.java @@ -213,7 +213,7 @@ public class ConfigServerRestExecutorImpl extends AbstractComponent implements C HostnameVerifier hostnameVerifier) { return HttpClientBuilder.create() .setUserAgent("config-server-proxy-client") - .setSslcontext(sslContextProvider.getIdentitySslContext()) + .setSSLContext(sslContextProvider.getIdentitySslContext()) .setSSLHostnameVerifier(hostnameVerifier) .setDefaultRequestConfig(config) .setMaxConnPerRoute(10) diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/FlagsClient.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/FlagsClient.java index b22c9e44a2b..5cd6b32d572 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/FlagsClient.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/systemflags/FlagsClient.java @@ -87,7 +87,7 @@ class FlagsClient { return HttpClientBuilder.create() .setUserAgent("controller-flags-v1-client") .setRetryHandler(new DefaultHttpRequestRetryHandler(5, /*retry on non-idempotent requests*/true)) - .setSslcontext(identityProvider.getIdentitySslContext()) + .setSSLContext(identityProvider.getIdentitySslContext()) .setSSLHostnameVerifier(new FlagTargetsHostnameVerifier(targets)) .setDefaultRequestConfig(RequestConfig.custom() .setConnectTimeout((int) Duration.ofSeconds(10).toMillis()) diff --git a/docker-api/pom.xml b/docker-api/pom.xml index 1cb03f1819d..2257437adfa 100644 --- a/docker-api/pom.xml +++ b/docker-api/pom.xml @@ -94,12 +94,6 @@ </exclusions> </dependency> <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.10</version> - <scope>compile</scope> - </dependency> - <dependency> <groupId>net.jpountz.lz4</groupId> <artifactId>lz4</artifactId> <scope>compile</scope> diff --git a/docprocs/pom.xml b/docprocs/pom.xml index b7272de2253..2d222431d8f 100644 --- a/docprocs/pom.xml +++ b/docprocs/pom.xml @@ -52,10 +52,6 @@ <artifactId>annotations</artifactId> </exclusion> <exclusion> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - </exclusion> - <exclusion> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> </exclusion> diff --git a/document/pom.xml b/document/pom.xml index 1696d525f6f..f5c5dec5b7c 100644 --- a/document/pom.xml +++ b/document/pom.xml @@ -27,10 +27,6 @@ <scope>provided</scope> </dependency> <dependency> - <groupId>commons-collections</groupId> - <artifactId>commons-collections</artifactId> - </dependency> - <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> diff --git a/document/src/main/java/com/yahoo/document/annotation/AnnotationType2AnnotationContainer.java b/document/src/main/java/com/yahoo/document/annotation/AnnotationType2AnnotationContainer.java index 121ccfb2cda..b0079759b21 100644 --- a/document/src/main/java/com/yahoo/document/annotation/AnnotationType2AnnotationContainer.java +++ b/document/src/main/java/com/yahoo/document/annotation/AnnotationType2AnnotationContainer.java @@ -1,8 +1,10 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.document.annotation; -import org.apache.commons.collections.map.MultiValueMap; +import com.google.common.collect.Multimap; +import com.google.common.collect.Multimaps; +import java.util.ArrayList; import java.util.Collection; import java.util.IdentityHashMap; import java.util.Iterator; @@ -10,11 +12,11 @@ import java.util.NoSuchElementException; /** * - * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a> + * @author Einar M R Rosenvinge */ // TODO: Should this be removed? public class AnnotationType2AnnotationContainer extends IteratingAnnotationContainer { - private final MultiValueMap annotationType2Annotation = MultiValueMap.decorate(new IdentityHashMap()); + private final Multimap<AnnotationType, Annotation> annotationType2Annotation = Multimaps.newMultimap(new IdentityHashMap<>(), ArrayList::new); @Override void annotateAll(Collection<Annotation> annotations) { diff --git a/document/src/main/java/com/yahoo/document/annotation/SpanNode2AnnotationContainer.java b/document/src/main/java/com/yahoo/document/annotation/SpanNode2AnnotationContainer.java index b65b6b7b4d6..c19f02f5c0b 100644 --- a/document/src/main/java/com/yahoo/document/annotation/SpanNode2AnnotationContainer.java +++ b/document/src/main/java/com/yahoo/document/annotation/SpanNode2AnnotationContainer.java @@ -1,7 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.document.annotation; -import org.apache.commons.collections.map.MultiValueMap; + +import com.google.common.collect.Multimap; +import com.google.common.collect.Multimaps; import java.util.ArrayList; import java.util.Collection; @@ -13,10 +15,10 @@ import java.util.List; /** * TODO: Should this be removed? * - * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a> + * @author Einar M R Rosenvinge */ class SpanNode2AnnotationContainer extends AnnotationContainer { - private final MultiValueMap spanNode2Annotation = MultiValueMap.decorate(new IdentityHashMap()); + private final Multimap<SpanNode, Annotation> spanNode2Annotation = Multimaps.newMultimap(new IdentityHashMap<>(), ArrayList::new); @Override void annotateAll(Collection<Annotation> annotations) { @@ -43,7 +45,7 @@ class SpanNode2AnnotationContainer extends AnnotationContainer { @Override @SuppressWarnings("unchecked") Iterator<Annotation> iterator(SpanNode node) { - Collection<Annotation> annotationsForNode = spanNode2Annotation.getCollection(node); + Collection<Annotation> annotationsForNode = spanNode2Annotation.get(node); if (annotationsForNode == null) { return Collections.<Annotation>emptyList().iterator(); } @@ -63,7 +65,7 @@ class SpanNode2AnnotationContainer extends AnnotationContainer { } List<Collection<Annotation>> annotationLists = new ArrayList<Collection<Annotation>>(nodes.size()); for (SpanNode includedNode : nodes.keySet()) { - Collection<Annotation> includedAnnotations = spanNode2Annotation.getCollection(includedNode); + Collection<Annotation> includedAnnotations = spanNode2Annotation.get(includedNode); if (includedAnnotations != null) { annotationLists.add(includedAnnotations); } diff --git a/document/src/main/java/com/yahoo/document/annotation/SpanTree.java b/document/src/main/java/com/yahoo/document/annotation/SpanTree.java index 2206d95aa38..05e5ff41cf1 100644 --- a/document/src/main/java/com/yahoo/document/annotation/SpanTree.java +++ b/document/src/main/java/com/yahoo/document/annotation/SpanTree.java @@ -2,6 +2,7 @@ package com.yahoo.document.annotation; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMultiset; import com.yahoo.document.CollectionDataType; import com.yahoo.document.Field; import com.yahoo.document.MapDataType; @@ -11,9 +12,14 @@ import com.yahoo.document.datatypes.FieldValue; import com.yahoo.document.datatypes.MapFieldValue; import com.yahoo.document.datatypes.StringFieldValue; import com.yahoo.document.datatypes.StructuredFieldValue; -import org.apache.commons.collections.CollectionUtils; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.IdentityHashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; /** * A SpanTree holds a root node of a tree of SpanNodes, and a List of Annotations pointing to these nodes @@ -672,7 +678,8 @@ public class SpanTree implements Iterable<Annotation>, SpanNodeParent, Comparabl List<Annotation> annotationCollection = new LinkedList<Annotation>(getAnnotations()); List<Annotation> otherAnnotations = new LinkedList<Annotation>(tree.getAnnotations()); - return annotationCollection.size() == otherAnnotations.size() && CollectionUtils.isEqualCollection(annotationCollection, otherAnnotations); + return annotationCollection.size() == otherAnnotations.size() && + ImmutableMultiset.copyOf(annotationCollection).equals(ImmutableMultiset.copyOf(otherAnnotations)); } @Override diff --git a/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/HealthCheckProxyHandler.java b/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/HealthCheckProxyHandler.java index e206cb3215d..ffff63a424e 100644 --- a/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/HealthCheckProxyHandler.java +++ b/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/HealthCheckProxyHandler.java @@ -133,7 +133,7 @@ class HealthCheckProxyHandler extends HandlerWrapper { client = HttpClientBuilder.create() .disableAutomaticRetries() .setConnectionReuseStrategy(NoConnectionReuseStrategy.INSTANCE) - .setSslcontext(sslContextFactory.getSslContext()) + .setSSLContext(sslContextFactory.getSslContext()) .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) .setUserTokenHandler(context -> null) // https://stackoverflow.com/a/42112034/1615280 .setUserAgent("health-check-proxy-client") diff --git a/parent/pom.xml b/parent/pom.xml index 52b8737f422..ca6e361899c 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -475,24 +475,9 @@ <dependency> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId> - <version>1.3.1</version> - </dependency> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> <version>1.4</version> </dependency> <dependency> - <groupId>commons-collections</groupId> - <artifactId>commons-collections</artifactId> - <version>3.2.1</version> - </dependency> - <dependency> - <groupId>commons-configuration</groupId> - <artifactId>commons-configuration</artifactId> - <version>1.6</version> - </dependency> - <dependency> <groupId>commons-net</groupId> <artifactId>commons-net</artifactId> <version>2.0</version> @@ -750,8 +735,8 @@ <properties> <antlr.version>3.5.2</antlr.version> <antlr4.version>4.5</antlr4.version> - <apache.httpclient.version>4.4.1</apache.httpclient.version> - <apache.httpcore.version>4.4.1</apache.httpcore.version> + <apache.httpclient.version>4.5.10</apache.httpclient.version> + <apache.httpcore.version>4.4.12</apache.httpcore.version> <asm.version>7.0</asm.version> <!-- Athenz dependencies. Make sure these dependencies match those in Vespa's internal repositories --> <athenz.version>1.8.29</athenz.version> diff --git a/security-tools/pom.xml b/security-tools/pom.xml index 76882927059..38b14ce957f 100644 --- a/security-tools/pom.xml +++ b/security-tools/pom.xml @@ -22,7 +22,6 @@ <dependency> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId> - <version>1.4</version> <scope>compile</scope> </dependency> diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/client/DefaultIdentityDocumentClient.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/client/DefaultIdentityDocumentClient.java index dba29841952..c99e40732bb 100644 --- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/client/DefaultIdentityDocumentClient.java +++ b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/client/DefaultIdentityDocumentClient.java @@ -101,7 +101,7 @@ public class DefaultIdentityDocumentClient implements IdentityDocumentClient { HostnameVerifier hostnameVerifier) { return HttpClientBuilder.create() .setRetryHandler(new DefaultHttpRequestRetryHandler(3, /*requestSentRetryEnabled*/true)) - .setSslcontext(sslContext) + .setSSLContext(sslContext) .setSSLHostnameVerifier(hostnameVerifier) .setUserAgent("default-identity-document-client") .setDefaultRequestConfig(RequestConfig.custom() 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 0e7488c8927..ac6a1d7cd22 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 @@ -413,7 +413,7 @@ class ApacheGatewayConnection implements GatewayConnection { } else { clientBuilder = HttpClientBuilder.create(); if (connectionParams.getSslContext() != null) { - clientBuilder.setSslcontext(connectionParams.getSslContext()); + clientBuilder.setSSLContext(connectionParams.getSslContext()); } else { SslContextBuilder builder = new SslContextBuilder(); if (connectionParams.getPrivateKey() != null && connectionParams.getCertificate() != null) { @@ -422,7 +422,7 @@ class ApacheGatewayConnection implements GatewayConnection { if (connectionParams.getCaCertificates() != null) { builder.withTrustStore(connectionParams.getCaCertificates()); } - clientBuilder.setSslcontext(builder.build()); + clientBuilder.setSSLContext(builder.build()); } if (connectionParams.getHostnameVerifier() != null) { clientBuilder.setSSLHostnameVerifier(connectionParams.getHostnameVerifier()); |