diff --git a/NOTICE b/NOTICE index 9efd0b727..9157e8ab9 100644 --- a/NOTICE +++ b/NOTICE @@ -13,10 +13,6 @@ Validation framework developed by JBoss https://github.com/hibernate/hibernate-validator Copyright (c) 2009 Red Hat, Inc. and/or its affiliates, and individual contributors -Alternative collection types provided by Google Guava from -http://code.google.com/p/guava-libraries/ -Copyright (C) 2007 Google Inc. - Google Guice https://code.google.com/p/google-guice/ Copyright (C) 2006 Google Inc. diff --git a/archaius2-archaius1-bridge/src/main/java/com/netflix/archaius/bridge/AbstractConfigurationBridge.java b/archaius2-archaius1-bridge/src/main/java/com/netflix/archaius/bridge/AbstractConfigurationBridge.java index fddcacb31..c6a7ea1e5 100644 --- a/archaius2-archaius1-bridge/src/main/java/com/netflix/archaius/bridge/AbstractConfigurationBridge.java +++ b/archaius2-archaius1-bridge/src/main/java/com/netflix/archaius/bridge/AbstractConfigurationBridge.java @@ -1,11 +1,11 @@ package com.netflix.archaius.bridge; +import java.util.ArrayList; +import java.util.HashSet; import org.apache.commons.configuration.AbstractConfiguration; import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.HierarchicalConfiguration; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; import com.netflix.archaius.api.Config; import com.netflix.archaius.api.ConfigListener; import com.netflix.archaius.api.config.CompositeConfig; @@ -129,12 +129,12 @@ public void addConfiguration(AbstractConfiguration config, String name) { @Override public Set getConfigurationNames() { - return Sets.newHashSet(libraries.getConfigNames()); + return new HashSet<>(libraries.getConfigNames()); } @Override public List getConfigurationNameList() { - return Lists.newArrayList(libraries.getConfigNames()); + return new ArrayList<>(libraries.getConfigNames()); } @Override diff --git a/archaius2-core/src/test/java/com/netflix/archaius/config/CompositeConfigTest.java b/archaius2-core/src/test/java/com/netflix/archaius/config/CompositeConfigTest.java index 1665d009d..5c032e394 100644 --- a/archaius2-core/src/test/java/com/netflix/archaius/config/CompositeConfigTest.java +++ b/archaius2-core/src/test/java/com/netflix/archaius/config/CompositeConfigTest.java @@ -15,13 +15,16 @@ */ package com.netflix.archaius.config; +import java.util.Arrays; +import java.util.Collections; import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.Properties; +import java.util.Set; import org.junit.Assert; import org.junit.Test; -import com.google.common.collect.Sets; import com.netflix.archaius.DefaultConfigLoader; import com.netflix.archaius.cascade.ConcatCascadeStrategy; import com.netflix.archaius.api.exceptions.ConfigException; @@ -129,19 +132,27 @@ public void getKeysTest() throws ConfigException { composite.addConfig("b", MapConfig.builder().put("b1", "A").put("b2", "B").build()); iter = composite.getKeys(); - Assert.assertEquals(Sets.newHashSet("b1", "b2"), Sets.newHashSet(iter)); + Assert.assertEquals(set("b1", "b2"), set(iter)); composite.addConfig("c", EmptyConfig.INSTANCE); iter = composite.getKeys(); - Assert.assertEquals(Sets.newHashSet("b1", "b2"), Sets.newHashSet(iter)); + Assert.assertEquals(set("b1", "b2"), set(iter)); composite.addConfig("d", MapConfig.builder().put("d1", "A").put("d2", "B").build()); composite.addConfig("e", MapConfig.builder().put("e1", "A").put("e2", "B").build()); iter = composite.getKeys(); - Assert.assertEquals(Sets.newHashSet("b1", "b2", "d1", "d2", "e1", "e2"), Sets.newHashSet(iter)); - - + Assert.assertEquals(set("b1", "b2", "d1", "d2", "e1", "e2"), set(iter)); + } + + private static Set set(String ... values) { + return Collections.unmodifiableSet(new LinkedHashSet<>(Arrays.asList(values))); + } + + private static Set set(Iterator values) { + Set vals = new LinkedHashSet<>(); + values.forEachRemaining(e -> vals.add(e)); + return Collections.unmodifiableSet(vals); } } diff --git a/build.gradle b/build.gradle index 0a08f9574..b68effc10 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,6 @@ subprojects { testCompile 'junit:junit:4.11' testCompile 'org.hamcrest:hamcrest-all:1.3' testCompile 'org.mockito:mockito-core:1.+' - testCompile 'com.google.guava:guava:18.0' } group = "com.netflix.${githubProjectName}"