Merge pull request #926 from andrewgaul/to-string-and-close-exception-handling

Propagate exceptions from toStringAndClose
This commit is contained in:
Adrian Cole 2012-10-29 16:50:37 -07:00
commit 3a2905ee1e
1 changed files with 0 additions and 12 deletions

View File

@ -41,10 +41,6 @@ import java.util.concurrent.ExecutionException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
import org.jclouds.logging.Logger;
import com.google.common.base.Charsets;
import com.google.common.io.CharStreams;
import com.google.common.io.InputSupplier;
@ -135,11 +131,6 @@ public class Strings2 {
checkNotNull(input, "input");
try {
return new String(toByteArray(input), Charsets.UTF_8);
} catch (IOException e) {
logger.warn(e, "Failed to read from stream");
return null;
} catch (NullPointerException e) {
return null;
} finally {
closeQuietly(input);
}
@ -149,9 +140,6 @@ public class Strings2 {
return new ByteArrayInputStream(in.getBytes(Charsets.UTF_8));
}
@Resource
private static Logger logger = Logger.NULL;
/**
* replaces tokens that are expressed as <code>{token}</code>
*