Skip to content
Permalink
Browse files
fix: deprecate obsolete utility methods (#1231)
* unused logger

* first batch if deprecations fior superseded utility methods

* format
  • Loading branch information
elharo committed Jan 22, 2021
1 parent e1fb4bb commit 8f95371cf5681fbc67bd598d74089f38742a1177
@@ -1012,7 +1012,9 @@ public HttpResponse execute() throws IOException {
LowLevelHttpResponse lowLevelHttpResponse = lowLevelHttpRequest.execute();
if (lowLevelHttpResponse != null) {
OpenCensusUtils.recordReceivedMessageEvent(span, lowLevelHttpResponse.getContentLength());
span.putAttribute(HttpTraceAttributeConstants.HTTP_STATUS_CODE, AttributeValue.longAttributeValue(lowLevelHttpResponse.getStatusCode()));
span.putAttribute(
HttpTraceAttributeConstants.HTTP_STATUS_CODE,
AttributeValue.longAttributeValue(lowLevelHttpResponse.getStatusCode()));
}
// Flag used to indicate if an exception is thrown before the response is constructed.
boolean responseConstructed = false;
@@ -22,7 +22,9 @@
*
* @since 1.8
* @author Yaniv Inbar
* @deprecated use com.google.common.io.BaseEncoding#base64
*/
@Deprecated
public class Base64 {

/**
@@ -41,6 +41,7 @@
*
* @since 1.15
* @author Eyal Peled
* @deprecated use com.google.common.annotations.Beta
*/
@Target(
value = {
@@ -52,4 +53,5 @@
ElementType.PACKAGE
})
@Documented
@Deprecated
public @interface Beta {}
@@ -24,7 +24,9 @@
*
* @since 1.14
* @author Yaniv Inbar
* @deprecated use com.google.common.io.ByteSource
*/
@Deprecated
public class ByteArrayStreamingContent implements StreamingContent {

/** Byte array content. */
@@ -22,12 +22,11 @@
/**
* Provides utility methods for working with byte arrays and I/O streams.
*
* <p>NOTE: this is a copy of a subset of Guava's {@link com.google.common.io.ByteStreams}. The
* implementation must match as closely as possible to Guava's implementation.
*
* @since 1.14
* @author Yaniv Inbar
* @deprecated use Guava's com.google.common.io.ByteStreams
*/
@Deprecated
public final class ByteStreams {

private static final int BUF_SIZE = 0x1000; // 4K
@@ -15,6 +15,7 @@
package com.google.api.client.util;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
* Contains constant definitions for some standard {@link Charset} instances that are guaranteed to
@@ -25,14 +26,16 @@
*
* @since 1.14
* @author Yaniv Inbar
* @deprecated use java.nio.charset.StandardCharsets
*/
@Deprecated
public final class Charsets {

/** UTF-8 charset. */
public static final Charset UTF_8 = Charset.forName("UTF-8");
public static final Charset UTF_8 = StandardCharsets.UTF_8;

/** ISO-8859-1 charset. */
public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
public static final Charset ISO_8859_1 = StandardCharsets.ISO_8859_1;

private Charsets() {}
}
@@ -19,12 +19,11 @@
/**
* Static utility methods pertaining to {@link Collection} instances.
*
* <p>NOTE: this is a copy of a subset of Guava's {@link com.google.common.collect.Collections2}.
* The implementation must match as closely as possible to Guava's implementation.
*
* @since 1.14
* @author Yaniv Inbar
* @deprecated use Guava's {@link com.google.common.collect.Collections2}
*/
@Deprecated
public final class Collections2 {

/** Used to avoid http://bugs.sun.com/view_bug.do?bug_id=6558557. */
@@ -54,7 +54,9 @@ public class IOUtils {
*
* @param inputStream source input stream
* @param outputStream destination output stream
* @deprecated use {@link com.google.common.io.ByteStreams#copy(InputStream, OutputStream)}
*/
@Deprecated
public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException {
copy(inputStream, outputStream, true);
}
@@ -79,7 +81,9 @@ public static void copy(InputStream inputStream, OutputStream outputStream) thro
* @param inputStream source input stream
* @param outputStream destination output stream
* @param closeInputStream whether the input stream should be closed at the end of this method
* @deprecated use {@link com.google.common.io.ByteStreams#copy(InputStream, OutputStream)}
*/
@Deprecated
public static void copy(
InputStream inputStream, OutputStream outputStream, boolean closeInputStream)
throws IOException {
@@ -173,6 +177,7 @@ public static <S extends Serializable> S deserialize(InputStream inputStream) th
* Returns whether the given file is a symbolic link.
*
* @since 1.16
* @deprecated use java.nio.file.Path#isSymbolicLink
*/
public static boolean isSymbolicLink(File file) throws IOException {
// first try using Java 7
@@ -24,7 +24,9 @@
*
* @since 1.14
* @author Yaniv Inbar
* @deprecated use com.google.common.io.ByteSink
*/
@Deprecated
public interface StreamingContent {

/**

0 comments on commit 8f95371

Please sign in to comment.