Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 710331011
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Dec 28, 2024
1 parent dbacaf5 commit 0583363
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ private enum OutputMode {
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
Expand Down Expand Up @@ -53,8 +46,4 @@ public static void callWithTextFormat(Runnable impl) {
public static boolean shouldOutputDebugFormat() {
return outputMode.get() == OutputMode.DEBUG_FORMAT;
}

static void setDisableDebugFormatForTests(boolean disable) {
disableDebugFormatForTests.set(disable);
}
}

0 comments on commit 0583363

Please sign in to comment.