Java: Deprecate newExtensionWriter.

New usages should use newExtensionSerializer, which can avoid allocations for
empty field sets.

PiperOrigin-RevId: 645044533
pull/17172/head
Mark Hansen 5 months ago committed by Copybara-Service
parent 6b7e814347
commit 7122ba1d0a
  1. 9
      java/core/src/main/java/com/google/protobuf/GeneratedMessage.java

@ -1094,7 +1094,14 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial
}
}
// TODO: Remove, replace with newExtensionSerializer().
/**
* For compatibility with older gencode.
*
* <p> TODO Remove this in the next breaking release.
*
* @deprecated Use {@link newExtensionSerializer()} instead.
*/
@Deprecated
protected ExtensionWriter newExtensionWriter() {
return new ExtensionWriter(false);
}

Loading…
Cancel
Save