Skip to content
This repository was archived by the owner on Dec 23, 2023. It is now read-only.

Commit 4ddf824

Browse files
author
Bogdan Drutu
authored
Make LowerCaseBase16Encoding package protected. (#1427)
1 parent d3fa0e5 commit 4ddf824

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

api/src/main/java/io/opencensus/trace/internal/LowerCaseBase16Encoding.java renamed to api/src/main/java/io/opencensus/trace/LowerCaseBase16Encoding.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
package io.opencensus.trace.internal;
17+
package io.opencensus.trace;
1818

19-
import io.opencensus.common.Internal;
2019
import io.opencensus.internal.Utils;
2120
import java.util.Arrays;
2221

2322
/** Internal copy of the Guava implementation of the {@code BaseEncoding.base16().lowerCase()}. */
24-
@Internal
25-
public final class LowerCaseBase16Encoding {
23+
final class LowerCaseBase16Encoding {
2624
private static final String ALPHABET = "0123456789abcdef";
2725
private static final int ASCII_CHARACTERS = 128;
2826
private static final char[] ENCODING = buildEncodingArray();
@@ -53,7 +51,7 @@ private static byte[] buildDecodingArray() {
5351
* @param bytes byte array to be encoded.
5452
* @return the encoded {@code String}.
5553
*/
56-
public static String encodeToString(byte[] bytes) {
54+
static String encodeToString(byte[] bytes) {
5755
StringBuilder stringBuilder = new StringBuilder(bytes.length * 2);
5856
for (byte byteVal : bytes) {
5957
int b = byteVal & 0xFF;
@@ -71,7 +69,7 @@ public static String encodeToString(byte[] bytes) {
7169
* @throws IllegalArgumentException if the input is not a valid encoded string according to this
7270
* encoding.
7371
*/
74-
public static byte[] decodeToBytes(CharSequence chars) {
72+
static byte[] decodeToBytes(CharSequence chars) {
7573
Utils.checkArgument(chars.length() % 2 == 0, "Invalid input length " + chars.length());
7674
int bytesWritten = 0;
7775
byte[] bytes = new byte[chars.length() / 2];

api/src/main/java/io/opencensus/trace/SpanId.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package io.opencensus.trace;
1818

1919
import io.opencensus.internal.Utils;
20-
import io.opencensus.trace.internal.LowerCaseBase16Encoding;
2120
import java.util.Arrays;
2221
import java.util.Random;
2322
import javax.annotation.Nullable;

api/src/main/java/io/opencensus/trace/TraceId.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import io.opencensus.common.Internal;
2020
import io.opencensus.internal.Utils;
21-
import io.opencensus.trace.internal.LowerCaseBase16Encoding;
2221
import java.util.Arrays;
2322
import java.util.Random;
2423
import javax.annotation.Nullable;

api/src/test/java/io/opencensus/trace/internal/LowerCaseBase16EncodingTest.java renamed to api/src/test/java/io/opencensus/trace/LowerCaseBase16EncodingTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package io.opencensus.trace.internal;
17+
package io.opencensus.trace;
1818

1919
import static com.google.common.truth.Truth.assertThat;
2020

@@ -25,7 +25,7 @@
2525
import org.junit.runner.RunWith;
2626
import org.junit.runners.JUnit4;
2727

28-
/** Unit tests for {@link LowerCaseBase16Encoding}. */
28+
/** Unit tests for {@link io.opencensus.trace.LowerCaseBase16Encoding}. */
2929
@RunWith(JUnit4.class)
3030
public class LowerCaseBase16EncodingTest {
3131
private static final Charset CHARSET = Charset.forName("UTF-8");

0 commit comments

Comments
 (0)