Skip to content

Commit

Permalink
OAK-10164: oak-commons: prepare for switch to shaded guava
Browse files Browse the repository at this point in the history
  • Loading branch information
reschke committed Mar 28, 2023
1 parent 5359461 commit ca578ca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

import com.google.common.base.Charsets;
import com.google.common.base.Strings;
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.Iterators;
import com.google.common.collect.PeekingIterator;
import org.apache.commons.io.FileUtils;
Expand Down Expand Up @@ -395,7 +394,7 @@ public int compare(String s1, String s2) {
* @deprecated use {@link org.apache.jackrabbit.oak.commons.io.FileLineDifferenceIterator} instead
*/
@Deprecated(since = "1.20.0", forRemoval = true)
public static class FileLineDifferenceIterator extends AbstractIterator<String> implements Closeable {
public static class FileLineDifferenceIterator extends com.google.common.collect.AbstractIterator<String> implements Closeable {
private final PeekingIterator<String> peekMarked;
private final LineIterator marked;
private final LineIterator all;
Expand Down Expand Up @@ -494,7 +493,7 @@ private String computeNextDiff() {
* @deprecated use {@link org.apache.jackrabbit.oak.commons.io.BurnOnCloseFileIterator} instead
*/
@Deprecated(since = "1.20.0", forRemoval = true)
public static class BurnOnCloseFileIterator<T> extends AbstractIterator<T> implements Closeable {
public static class BurnOnCloseFileIterator<T> extends com.google.common.collect.AbstractIterator<T> implements Closeable {
private final Logger log = LoggerFactory.getLogger(getClass());

private final LineIterator iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.AbstractIterator;

/**
* Implements a {@link java.io.Closeable} wrapper over a {@link LineIterator}.
* Also has a transformer to transform the output. If the underlying file is
Expand Down Expand Up @@ -95,7 +93,7 @@ public String apply(String s) {
});
}

private static class Impl<T> extends AbstractIterator<T> implements Closeable {
private static class Impl<T> extends com.google.common.collect.AbstractIterator<T> implements Closeable {
private final Iterator<String> iterator;
private final Function<String, T> transformer;
private final File backingFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.io.InputStream;
import java.util.function.Supplier;

import com.google.common.io.ByteSource;
import org.apache.commons.io.input.ClosedInputStream;
import org.apache.jackrabbit.oak.commons.GuavaDeprecation;

Expand All @@ -33,7 +32,7 @@
*/
public class LazyInputStream extends FilterInputStream {

private final ByteSource byteSource;
private final com.google.common.io.ByteSource byteSource;
private final Supplier<InputStream> inputStreamSupplier;

private boolean opened;
Expand All @@ -48,7 +47,7 @@ public LazyInputStream(Supplier<InputStream> inputStreamSupplier) {
* @deprecated Use {@link #LazyInputStream(Supplier)} instead
*/
@Deprecated(since = "1.20.0", forRemoval = true)
public LazyInputStream(ByteSource byteSource) {
public LazyInputStream(com.google.common.io.ByteSource byteSource) {
super(null);
this.byteSource = byteSource;
this.inputStreamSupplier = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.util.Random;
import java.util.Set;

import com.google.common.base.Function;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterators;
import com.google.common.collect.Sets;
Expand Down Expand Up @@ -116,7 +115,7 @@ public void writeCustomReadOrgStringsDeprecated() throws Exception {
Set<String> actual = newHashSet("a", "z", "e", "b");

File f = folder.newFile();
int count = writeStrings(added.iterator(), f, false, new Function<String, String>() {
int count = writeStrings(added.iterator(), f, false, new com.google.common.base.Function<String, String>() {
@Nullable @Override public String apply(@Nullable String input) {
return Splitter.on("-").trimResults().omitEmptyStrings().splitToList(input).get(0);
}
Expand Down Expand Up @@ -211,7 +210,7 @@ public void sortLargeFileWithCustomComparatorTest() throws IOException {
}

Iterator<Long> boxedEntries = Longs.asList(entries).iterator();
Iterator<String> hexEntries = Iterators.transform(boxedEntries, new Function<Long, String>() {
Iterator<String> hexEntries = Iterators.transform(boxedEntries, new com.google.common.base.Function<Long, String>() {
@Nullable @Override public String apply(@Nullable Long input) {
return Long.toHexString(input);
}
Expand Down

0 comments on commit ca578ca

Please sign in to comment.