Skip to content

Commit

Permalink
Replace usage of shaded Guava Supplier with java.util.function.Suppli…
Browse files Browse the repository at this point in the history
…er (apache#9693)

- it is a bad practice to reference shaded classes in other modules.
- in this case, it is possible to replace the usage of the shaded
  Guava Supplier with java.util.function.Supplier
  • Loading branch information
lhotari authored Feb 25, 2021
1 parent 666af1a commit f42f625
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public ProviderMetadata getProviderMetadata() {

if (config.getProviderCredentials() != null) {
return contextBuilder
.credentialsSupplier(config.getCredentials())
.credentialsSupplier(config.getCredentials()::get)
.buildView(BlobStoreContext.class)
.getBlobStore();
} else {
Expand Down Expand Up @@ -358,7 +358,7 @@ public ProviderMetadata getProviderMetadata() {

if (config.getProviderCredentials() != null) {
return contextBuilder
.credentialsSupplier(config.getCredentials())
.credentialsSupplier(config.getCredentials()::get)
.buildView(BlobStoreContext.class)
.getBlobStore();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.pulsar.jcloud.shade.com.google.common.base.Supplier;
import org.jclouds.Constants;
import org.jclouds.aws.s3.AWSS3ProviderMetadata;
import org.jclouds.blobstore.BlobStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
import org.apache.bookkeeper.client.BookKeeper;
import org.apache.bookkeeper.client.LedgerHandle;
import org.apache.bookkeeper.client.PulsarMockBookKeeper;
Expand All @@ -34,7 +35,6 @@
import org.apache.bookkeeper.mledger.offload.jcloud.provider.TieredStorageConfiguration;
import org.apache.bookkeeper.util.ZkUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.pulsar.jcloud.shade.com.google.common.base.Supplier;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.MockZooKeeper;
import org.apache.zookeeper.data.ACL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@
package org.apache.bookkeeper.mledger.offload.jcloud.provider;

import static org.testng.Assert.assertEquals;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.pulsar.jcloud.shade.com.google.common.base.Supplier;

import org.jclouds.domain.Credentials;
import org.testng.annotations.Test;

public class TieredStorageConfigurationTests {

/*
* Previous property names, for backwards-compatibility.
*/
Expand Down

0 comments on commit f42f625

Please sign in to comment.