Internal change

PiperOrigin-RevId: 710331011
pull/19817/head
Protobuf Team Bot 2 months ago committed by Copybara-Service
parent dbacaf53cc
commit 058336342d
  1. 11
      java/core/src/main/java/com/google/protobuf/ProtobufToStringOutput.java

@ -17,13 +17,6 @@ public final class ProtobufToStringOutput {
private static final ThreadLocal<OutputMode> outputMode =
ThreadLocal.withInitial(() -> OutputMode.TEXT_FORMAT);
// Many tests are bound to the traditional Message.toString() output format (the text format). To
// accelerate the debug format adoption while avoiding breaking such tests, we introduce this
// test-only flag to disable the debug format in tests for certain libraries in which the output
// of Message.toString() is unlikely to be deserialized.
private static final ThreadLocal<Boolean> disableDebugFormatForTests =
ThreadLocal.withInitial(() -> false);
private ProtobufToStringOutput() {}
@CanIgnoreReturnValue
@ -53,8 +46,4 @@ public final class ProtobufToStringOutput {
public static boolean shouldOutputDebugFormat() {
return outputMode.get() == OutputMode.DEBUG_FORMAT;
}
static void setDisableDebugFormatForTests(boolean disable) {
disableDebugFormatForTests.set(disable);
}
}

Loading…
Cancel
Save