Skip to content
Permalink
Browse files
JCLOUDS-534 Avoid runtime incompatibility introduced by Guava's close…
…Quietly.
  • Loading branch information
Adrian Cole committed Oct 30, 2014
1 parent 63e2d9b commit 77cb0a51f1c7365aa1b2d5cb590120da669d7f2c
Showing 2 changed files with 4 additions and 4 deletions.
@@ -18,6 +18,7 @@

import static com.google.common.base.Charsets.UTF_8;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.util.Closeables2.closeQuietly;

import java.io.IOException;
import java.util.Locale;
@@ -42,7 +43,6 @@
import com.google.common.io.BaseEncoding;
import com.google.common.io.ByteSource;
import com.google.common.io.ByteStreams;
import com.google.common.io.Closeables;
import com.google.common.net.HttpHeaders;

// TODO: Query parameters, not necessary for Glacier
@@ -144,7 +144,7 @@ private static HashCode buildHashedPayload(HttpRequest request) {
} catch (IOException e) {
throw new HttpException("Error signing request", e);
} finally {
Closeables.closeQuietly(his);
closeQuietly(his);
}
}

@@ -18,6 +18,7 @@

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.util.Closeables2.closeQuietly;

import java.io.IOException;
import java.io.InputStream;
@@ -35,7 +36,6 @@
import com.google.common.hash.Hashing;
import com.google.common.hash.HashingInputStream;
import com.google.common.io.ByteStreams;
import com.google.common.io.Closeables;

public final class TreeHash {
private static final int CHUNK_SIZE = 1024 * 1024;
@@ -122,7 +122,7 @@ public static TreeHash buildTreeHashFromPayload(Payload payload) throws IOExcept
//The result list contains exactly one element now.
return new TreeHash(hashList(list.build()), linearHis.hash());
} finally {
Closeables.closeQuietly(is);
closeQuietly(is);
}
}

0 comments on commit 77cb0a5

Please sign in to comment.