From 83f51287c7a1416e00acc9dc41d9a8b0b6fd898b Mon Sep 17 00:00:00 2001 From: blakeli Date: Fri, 18 Apr 2025 15:06:28 -0400 Subject: [PATCH 1/2] Move classes only used by lite gen code to package private. --- .../src/main/java/com/google/protobuf/GeneratedMessageLite.java | 2 +- .../src/main/java/com/google/protobuf/LazyFieldLite.java | 2 +- .../src/main/java/com/google/protobuf/MapEntryLite.java | 2 +- .../src/main/java/com/google/protobuf/MapFieldLite.java | 2 +- .../src/main/java/com/google/protobuf/UnknownFieldSetLite.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/protobuf-api/src/main/java/com/google/protobuf/GeneratedMessageLite.java b/protobuf-api/src/main/java/com/google/protobuf/GeneratedMessageLite.java index c153960..76fbcaa 100644 --- a/protobuf-api/src/main/java/com/google/protobuf/GeneratedMessageLite.java +++ b/protobuf-api/src/main/java/com/google/protobuf/GeneratedMessageLite.java @@ -34,7 +34,7 @@ * * @author kenton@google.com Kenton Varda */ -public abstract class GeneratedMessageLite< +abstract class GeneratedMessageLite< MessageType extends GeneratedMessageLite, BuilderType extends GeneratedMessageLite.Builder> extends AbstractMessageLite { diff --git a/protobuf-api/src/main/java/com/google/protobuf/LazyFieldLite.java b/protobuf-api/src/main/java/com/google/protobuf/LazyFieldLite.java index d5579fe..0ff6398 100644 --- a/protobuf-api/src/main/java/com/google/protobuf/LazyFieldLite.java +++ b/protobuf-api/src/main/java/com/google/protobuf/LazyFieldLite.java @@ -30,7 +30,7 @@ * * @author xiangl@google.com (Xiang Li) */ -public class LazyFieldLite { +class LazyFieldLite { private static final ExtensionRegistryLite EMPTY_REGISTRY = ExtensionRegistryLite.getEmptyRegistry(); diff --git a/protobuf-api/src/main/java/com/google/protobuf/MapEntryLite.java b/protobuf-api/src/main/java/com/google/protobuf/MapEntryLite.java index 99f3460..61b1f65 100644 --- a/protobuf-api/src/main/java/com/google/protobuf/MapEntryLite.java +++ b/protobuf-api/src/main/java/com/google/protobuf/MapEntryLite.java @@ -19,7 +19,7 @@ * *

Protobuf internal. Users shouldn't use. */ -public class MapEntryLite { +class MapEntryLite { static class Metadata { public final WireFormat.FieldType keyType; diff --git a/protobuf-api/src/main/java/com/google/protobuf/MapFieldLite.java b/protobuf-api/src/main/java/com/google/protobuf/MapFieldLite.java index bc5704b..a94825c 100644 --- a/protobuf-api/src/main/java/com/google/protobuf/MapFieldLite.java +++ b/protobuf-api/src/main/java/com/google/protobuf/MapFieldLite.java @@ -21,7 +21,7 @@ * *

This class is a protobuf implementation detail. Users shouldn't use this class directly. */ -public final class MapFieldLite extends LinkedHashMap { +final class MapFieldLite extends LinkedHashMap { private boolean isMutable; diff --git a/protobuf-api/src/main/java/com/google/protobuf/UnknownFieldSetLite.java b/protobuf-api/src/main/java/com/google/protobuf/UnknownFieldSetLite.java index 36c9481..809ac95 100644 --- a/protobuf-api/src/main/java/com/google/protobuf/UnknownFieldSetLite.java +++ b/protobuf-api/src/main/java/com/google/protobuf/UnknownFieldSetLite.java @@ -20,7 +20,7 @@ * * @author dweis@google.com (Daniel Weis) */ -public final class UnknownFieldSetLite { +final class UnknownFieldSetLite { // Arbitrarily chosen. // TODO: Tune this number? From 333878cd0035f9b28629f4efe5eff150f271f71b Mon Sep 17 00:00:00 2001 From: blakeli Date: Fri, 18 Apr 2025 18:29:34 -0400 Subject: [PATCH 2/2] Make LazyFieldLite public again because it is on the surface of CodedOutputStream. --- .../src/main/java/com/google/protobuf/LazyFieldLite.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protobuf-api/src/main/java/com/google/protobuf/LazyFieldLite.java b/protobuf-api/src/main/java/com/google/protobuf/LazyFieldLite.java index 0ff6398..d5579fe 100644 --- a/protobuf-api/src/main/java/com/google/protobuf/LazyFieldLite.java +++ b/protobuf-api/src/main/java/com/google/protobuf/LazyFieldLite.java @@ -30,7 +30,7 @@ * * @author xiangl@google.com (Xiang Li) */ -class LazyFieldLite { +public class LazyFieldLite { private static final ExtensionRegistryLite EMPTY_REGISTRY = ExtensionRegistryLite.getEmptyRegistry();