From dd849cf33d133c93a0d98cd6d4dfb1889ef36182 Mon Sep 17 00:00:00 2001 From: Sean Huh Date: Tue, 13 Oct 2026 18:21:37 -0700 Subject: [PATCH] Keep each lite message's descriptor instead of building its CelType on every hop PiperOrigin-RevId: 999023029 --- .../values/ProtoLiteCelValueConverter.java | 87 +++++------ .../common/values/ProtoMessageLiteValue.java | 93 ++++++------ .../ProtoLiteCelValueConverterTest.java | 42 ++++-- .../values/ProtoMessageLiteValueTest.java | 138 ++++++++---------- 4 files changed, 169 insertions(+), 191 deletions(-) diff --git a/common/src/main/java/dev/cel/common/values/ProtoLiteCelValueConverter.java b/common/src/main/java/dev/cel/common/values/ProtoLiteCelValueConverter.java index 81fae97a4..fd441b0fa 100644 --- a/common/src/main/java/dev/cel/common/values/ProtoLiteCelValueConverter.java +++ b/common/src/main/java/dev/cel/common/values/ProtoLiteCelValueConverter.java @@ -119,7 +119,10 @@ private Object readLengthDelimitedField( return CelByteString.of(inputStream.readByteArray()); case MESSAGE: return mergeOrReadMessageField( - inputStream.readBytes(), fieldDescriptor.getFieldProtoTypeName(), existingValue); + inputStream.readBytes(), + fieldDescriptor.getFieldProtoTypeName(), + existingValue, + /* isView= */ true); case STRING: return inputStream.readStringRequireUtf8(); default: @@ -127,26 +130,28 @@ private Object readLengthDelimitedField( } } + // For bytes that don't alias another message's buffer (empty or freshly serialized). private Object readMessageField(ByteString bytes, String fieldProtoTypeName) { - return mergeOrReadMessageField(bytes, fieldProtoTypeName, /* existingValue= */ null); + return mergeOrReadMessageField( + bytes, fieldProtoTypeName, /* existingValue= */ null, /* isView= */ false); } private Object mergeOrReadMessageField( - ByteString bytes, String fieldProtoTypeName, @Nullable Object existingValue) { + ByteString bytes, String fieldProtoTypeName, @Nullable Object existingValue, boolean isView) { MessageLiteDescriptor descriptor = descriptorPool.findDescriptor(fieldProtoTypeName).orElse(null); if (descriptor == null) { if (existingValue instanceof RawProtoMessageLiteValue) { bytes = ((RawProtoMessageLiteValue) existingValue).toByteString().concat(bytes); } - return RawProtoMessageLiteValue.create(bytes, fieldProtoTypeName, this, /* isView= */ true); + return RawProtoMessageLiteValue.create(bytes, fieldProtoTypeName, this, isView); } WellKnownProto wellKnownProto = WellKnownProto.getByTypeName(fieldProtoTypeName).orElse(null); if (isStructLike(wellKnownProto)) { if (existingValue instanceof ProtoMessageLiteValue) { bytes = ((ProtoMessageLiteValue) existingValue).toByteString().concat(bytes); } - return ProtoMessageLiteValue.create(bytes, fieldProtoTypeName, this); + return ProtoMessageLiteValue.create(bytes, descriptor, this); } if (existingValue instanceof MessageLite) { return mergeMessageLite(((MessageLite) existingValue).toBuilder(), bytes, fieldProtoTypeName); @@ -171,29 +176,7 @@ Object getDefaultCelValue(SelectField field, FieldLiteDescriptor fieldDescriptor : getDefaultCelValue(fieldDescriptor); } - @Nullable FieldLiteDescriptor findFieldDescriptor(String protoTypeName, int fieldNumber) { - MessageLiteDescriptor descriptor = descriptorPool.findDescriptor(protoTypeName).orElse(null); - return descriptor == null ? null : descriptor.findByFieldNumber(fieldNumber); - } - - @Nullable FieldLiteDescriptor findFieldDescriptor(String protoTypeName, String fieldName) { - MessageLiteDescriptor descriptor = descriptorPool.findDescriptor(protoTypeName).orElse(null); - return descriptor == null ? null : descriptor.findByFieldName(fieldName); - } - - @Nullable MessageLiteDescriptor findDescriptorWithGetters(String protoTypeName) { - return descriptorPool - .findDescriptor(protoTypeName) - .filter(MessageLiteDescriptor::hasGetters) - .orElse(null); - } - - MessageLite parseMessageLite(ByteString bytes, String protoTypeName) { - MessageLiteDescriptor descriptor = descriptorPool.getDescriptorOrThrow(protoTypeName); - return parseMessageLite(bytes, descriptor); - } - - private static MessageLite parseMessageLite(ByteString bytes, MessageLiteDescriptor descriptor) { + static MessageLite parseMessageLite(ByteString bytes, MessageLiteDescriptor descriptor) { if (bytes.isEmpty()) { return descriptor.newMessageBuilder().getDefaultInstanceForType(); } @@ -229,7 +212,7 @@ private Object toRuntimeValue(MessageLite msg, MessageLiteDescriptor descriptor) WellKnownProto wellKnownProto = WellKnownProto.getByTypeName(descriptor.getProtoTypeName()).orElse(null); if (isStructLike(wellKnownProto)) { - return ProtoMessageLiteValue.create(msg, descriptor.getProtoTypeName(), this); + return ProtoMessageLiteValue.create(msg, descriptor, this); } return fromWellKnownProto(msg, checkNotNull(wellKnownProto)); @@ -425,12 +408,17 @@ Optional findByFieldNumber(ByteString bytes, String protoTypeName, Selec return Optional.ofNullable(readField(bytes, protoTypeName, field)); } - /** Returns whether {@code field} is present in {@code bytes}. */ + /** Returns whether {@code field}, unknown to its message's descriptor, is in {@code bytes}. */ boolean hasFieldByNumber(ByteString bytes, String protoTypeName, SelectField field) { - FieldLiteDescriptor fieldDescriptor = findFieldDescriptor(protoTypeName, field.fieldNumber()); - if (fieldDescriptor == null) { - fieldDescriptor = newFieldDescriptor(field); - } + return hasFieldByNumber(bytes, protoTypeName, field, newFieldDescriptor(field)); + } + + /** Like the overload above, for a field its message's descriptor has. */ + boolean hasFieldByNumber( + ByteString bytes, + String protoTypeName, + SelectField field, + FieldLiteDescriptor fieldDescriptor) { if (fieldDescriptor.getProtoFieldType().equals(FieldLiteDescriptor.Type.GROUP)) { throw new UnsupportedOperationException("Groups are not supported"); } @@ -469,8 +457,8 @@ boolean hasFieldByNumber(ByteString bytes, String protoTypeName, SelectField fie * wire bytes: its CEL value, or null if it's absent. */ @Nullable Object readFieldByGetter( - MessageLite message, MessageLiteDescriptor descriptor, FieldLiteDescriptor fieldDescriptor) { - Object value = readGetter(message, descriptor, fieldDescriptor.getFieldNumber()); + ProtoMessageLiteValue message, FieldLiteDescriptor fieldDescriptor) { + Object value = readGetter(message, fieldDescriptor.getFieldNumber()); if (value == null) { return null; } @@ -519,14 +507,14 @@ boolean hasFieldByNumber(ByteString bytes, String protoTypeName, SelectField fie } /** Like {@link #hasFieldByNumber}, through the field's generated getter. */ - boolean hasByGetter(MessageLite message, MessageLiteDescriptor descriptor, SelectField field) { - return readGetter(message, descriptor, field.fieldNumber()) != null; + boolean hasByGetter(ProtoMessageLiteValue message, SelectField field) { + return readGetter(message, field.fieldNumber()) != null; } // A field's value as its getter returns it, or null if it's unset or an empty repeated or map. - private static @Nullable Object readGetter( - MessageLite message, MessageLiteDescriptor descriptor, int fieldNumber) { - Object value = descriptor.getFieldValue(message, fieldNumber); + private static @Nullable Object readGetter(ProtoMessageLiteValue message, int fieldNumber) { + Object value = + message.descriptor().getFieldValue(checkNotNull(message.rawValue()), fieldNumber); boolean isEmpty = (value instanceof List && ((List) value).isEmpty()) || (value instanceof Map && ((Map) value).isEmpty()); @@ -549,18 +537,11 @@ private Object fromGetterValue(Object value, FieldLiteDescriptor fieldDescriptor : (long) ((EnumLite) value).getNumber(); case MESSAGE: MessageLite message = (MessageLite) value; - String protoTypeName = fieldDescriptor.getFieldProtoTypeName(); - MessageLiteDescriptor descriptor = - descriptorPool.findDescriptor(protoTypeName).orElse(null); - if (descriptor == null) { - // Without a descriptor, only this submessage is serialized, rather than its whole root. - return RawProtoMessageLiteValue.create(message.toByteString(), protoTypeName, this); - } - if (descriptorPool.findDescriptor(message).orElse(null) != descriptor) { - // The pool decodes this type into another class, such as an older version of it. - return readMessageField(message.toByteString(), protoTypeName); - } - return toRuntimeValue(message, descriptor); + MessageLiteDescriptor descriptor = descriptorPool.findDescriptor(message).orElse(null); + // Not a class the pool knows (e.g. another version of its type): read its own bytes. + return descriptor != null + ? toRuntimeValue(message, descriptor) + : readMessageField(message.toByteString(), fieldDescriptor.getFieldProtoTypeName()); default: return super.toRuntimeValue(value); } diff --git a/common/src/main/java/dev/cel/common/values/ProtoMessageLiteValue.java b/common/src/main/java/dev/cel/common/values/ProtoMessageLiteValue.java index c34fbe250..27129b1fe 100644 --- a/common/src/main/java/dev/cel/common/values/ProtoMessageLiteValue.java +++ b/common/src/main/java/dev/cel/common/values/ProtoMessageLiteValue.java @@ -68,11 +68,16 @@ abstract class ProtoMessageLiteValue extends StructValue // re-serializing intermediate hops; lazily parsed into a MessageLite only if value() is called. abstract @Nullable ByteString wireBytes(); - @Override - public abstract CelType celType(); + abstract MessageLiteDescriptor descriptor(); abstract ProtoLiteCelValueConverter protoLiteCelValueConverter(); + @Override + public CelType celType() { + // Built on demand, since one of these values is created on every hop but rarely asked its type. + return StructTypeReference.create(protoTypeName()); + } + @Memoized @Override public MessageLite value() { @@ -80,8 +85,7 @@ public MessageLite value() { if (msg != null) { return msg; } - return protoLiteCelValueConverter() - .parseMessageLite(checkNotNull(wireBytes()), celType().name()); + return ProtoLiteCelValueConverter.parseMessageLite(checkNotNull(wireBytes()), descriptor()); } @Memoized @@ -112,20 +116,26 @@ public final boolean equals(Object other) { return false; } ProtoMessageLiteValue that = (ProtoMessageLiteValue) other; - return this.celType().equals(that.celType()) && this.value().equals(that.value()); + return this.protoTypeName().equals(that.protoTypeName()) && this.value().equals(that.value()); } @Override public final int hashCode() { - return Objects.hash(value(), celType()); + return Objects.hash(value(), protoTypeName()); + } + + @Override + public final String toString() { + // AutoValue's would print the message's contents, which may be sensitive. + return "ProtoMessageLiteValue{protoTypeName=" + protoTypeName() + "}"; } @Override public Object select(String field) { - FieldLiteDescriptor fd = findFieldDescriptor(field); + FieldLiteDescriptor fd = descriptor().findByFieldName(field); if (fd == null) { throw CelAttributeNotFoundException.of( - String.format("field '%s' is not declared in message '%s'", field, celType().name())); + String.format("field '%s' is not declared in message '%s'", field, protoTypeName())); } Object fieldValue = readField(fd); return fieldValue != null ? fieldValue : protoLiteCelValueConverter().getDefaultCelValue(fd); @@ -134,88 +144,73 @@ public Object select(String field) { @Override public Optional find(String field) { // Per SelectableValue#find, a field that doesn't exist is reported as absent. - return Optional.ofNullable(findFieldDescriptor(field)).map(this::readField); + return Optional.ofNullable(descriptor().findByFieldName(field)).map(this::readField); } @Override public Object selectByFieldNumber(SelectField field) { - FieldLiteDescriptor fd = findFieldDescriptor(field.fieldNumber()); + FieldLiteDescriptor fd = descriptor().findByFieldNumber(field.fieldNumber()); if (fd != null) { Object value = readField(fd); return value != null ? value : protoLiteCelValueConverter().getDefaultCelValue(field, fd); } - return protoLiteCelValueConverter() - .selectByFieldNumber(toByteString(), celType().name(), field); + return protoLiteCelValueConverter().selectByFieldNumber(toByteString(), protoTypeName(), field); } @Override public boolean hasFieldByNumber(SelectField field) { - MessageLite message = rawValue(); - if (message != null && findFieldDescriptor(field.fieldNumber()) != null) { - MessageLiteDescriptor descriptor = findDescriptorWithGetters(); - if (descriptor != null) { - return protoLiteCelValueConverter().hasByGetter(message, descriptor, field); - } + FieldLiteDescriptor fd = descriptor().findByFieldNumber(field.fieldNumber()); + if (fd == null) { + return protoLiteCelValueConverter().hasFieldByNumber(toByteString(), protoTypeName(), field); } - return protoLiteCelValueConverter().hasFieldByNumber(toByteString(), celType().name(), field); + return canReadByGetter() + ? protoLiteCelValueConverter().hasByGetter(this, field) + : protoLiteCelValueConverter().hasFieldByNumber(toByteString(), protoTypeName(), field, fd); } @Override public Optional findByFieldNumber(SelectField field) { - FieldLiteDescriptor fd = findFieldDescriptor(field.fieldNumber()); + FieldLiteDescriptor fd = descriptor().findByFieldNumber(field.fieldNumber()); if (fd != null) { return Optional.ofNullable(readField(fd)); } - return protoLiteCelValueConverter().findByFieldNumber(toByteString(), celType().name(), field); + return protoLiteCelValueConverter().findByFieldNumber(toByteString(), protoTypeName(), field); } private @Nullable Object readField(FieldLiteDescriptor fd) { - MessageLite message = rawValue(); - if (message != null) { - MessageLiteDescriptor descriptor = findDescriptorWithGetters(); - if (descriptor != null) { - return protoLiteCelValueConverter().readFieldByGetter(message, descriptor, fd); - } - } - return protoLiteCelValueConverter().readField(toByteString(), celType().name(), fd); + return canReadByGetter() + ? protoLiteCelValueConverter().readFieldByGetter(this, fd) + : protoLiteCelValueConverter().readField(toByteString(), protoTypeName(), fd); } - private @Nullable FieldLiteDescriptor findFieldDescriptor(String fieldName) { - return protoLiteCelValueConverter().findFieldDescriptor(celType().name(), fieldName); + private boolean canReadByGetter() { + return rawValue() != null && descriptor().hasGetters(); } - private @Nullable FieldLiteDescriptor findFieldDescriptor(int fieldNumber) { - return protoLiteCelValueConverter().findFieldDescriptor(celType().name(), fieldNumber); - } - - private @Nullable MessageLiteDescriptor findDescriptorWithGetters() { - return protoLiteCelValueConverter().findDescriptorWithGetters(celType().name()); + private String protoTypeName() { + return descriptor().getProtoTypeName(); } static ProtoMessageLiteValue create( - MessageLite value, String typeName, ProtoLiteCelValueConverter protoLiteCelValueConverter) { + MessageLite value, + MessageLiteDescriptor descriptor, + ProtoLiteCelValueConverter protoLiteCelValueConverter) { checkNotNull(value); - checkNotNull(typeName); + checkNotNull(descriptor); checkNotNull(protoLiteCelValueConverter); return new AutoValue_ProtoMessageLiteValue( - value, - /* wireBytes= */ null, - StructTypeReference.create(typeName), - protoLiteCelValueConverter); + value, /* wireBytes= */ null, descriptor, protoLiteCelValueConverter); } static ProtoMessageLiteValue create( ByteString wireBytes, - String typeName, + MessageLiteDescriptor descriptor, ProtoLiteCelValueConverter protoLiteCelValueConverter) { checkNotNull(wireBytes); - checkNotNull(typeName); + checkNotNull(descriptor); checkNotNull(protoLiteCelValueConverter); return new AutoValue_ProtoMessageLiteValue( - /* rawValue= */ null, - wireBytes, - StructTypeReference.create(typeName), - protoLiteCelValueConverter); + /* rawValue= */ null, wireBytes, descriptor, protoLiteCelValueConverter); } ProtoMessageLiteValue() {} diff --git a/common/src/test/java/dev/cel/common/values/ProtoLiteCelValueConverterTest.java b/common/src/test/java/dev/cel/common/values/ProtoLiteCelValueConverterTest.java index c7946078d..ed8d68b7c 100644 --- a/common/src/test/java/dev/cel/common/values/ProtoLiteCelValueConverterTest.java +++ b/common/src/test/java/dev/cel/common/values/ProtoLiteCelValueConverterTest.java @@ -386,6 +386,23 @@ public void readField_nestedMessageWithoutDescriptor_returnsRawProtoMessageLiteV .isEqualTo("cel.expr.conformance.proto3.NestedTestAllTypes"); } + @Test + public void select_inMemorySubmessageWithoutDescriptor_isNotCopiedOnUnwrap() { + TestAllTypes msg = + TestAllTypes.newBuilder() + .setOneofType( + NestedTestAllTypes.newBuilder() + .setPayload(TestAllTypes.newBuilder().setSingleInt64(42L))) + .build(); + ProtoMessageLiteValue value = + (ProtoMessageLiteValue) PROTO_LITE_CEL_VALUE_CONVERTER.toRuntimeValue(msg); + + RawProtoMessageLiteValue submessage = (RawProtoMessageLiteValue) value.select("oneof_type"); + + // Serialized on its own rather than sliced from its parent, so unwrapping needn't copy it. + assertThat(submessage.value()).isSameInstanceAs(submessage); + } + @Test public void readField_splitSingularSubmessages_mergesAllOccurrences() throws Exception { ByteArrayOutputStream unknownFieldBaos = new ByteArrayOutputStream(); @@ -437,14 +454,6 @@ public void readField_splitSingularSubmessages_mergesAllOccurrences() throws Exc .build()); } - @Test - public void parseMessageLite_emptyBytes_returnsDefaultInstanceSingleton() { - MessageLite parsed = - PROTO_LITE_CEL_VALUE_CONVERTER.parseMessageLite(ByteString.EMPTY, PROTO3_TEST_ALL_TYPES); - - assertThat(parsed).isSameInstanceAs(TestAllTypes.getDefaultInstance()); - } - @Test public void readField_emptyBytes_returnsNull() { FieldLiteDescriptor fd = @@ -593,7 +602,10 @@ public void hasFieldByNumber_emptyPackedRepeatedField_returnsFalse( boolean result = PROTO_LITE_CEL_VALUE_CONVERTER.hasFieldByNumber( - emptyPackedBytes, messageName, repeatedInt32); + emptyPackedBytes, + messageName, + repeatedInt32, + fieldDescriptor(messageName, TestAllTypes.REPEATED_INT32_FIELD_NUMBER)); assertThat(result).isFalse(); } @@ -612,7 +624,10 @@ public void hasFieldByNumber_emptyPackedFollowedByPopulatedPacked_returnsTrue() boolean result = PROTO_LITE_CEL_VALUE_CONVERTER.hasFieldByNumber( - emptyThenPopulatedBytes, PROTO3_TEST_ALL_TYPES, repeatedInt32); + emptyThenPopulatedBytes, + PROTO3_TEST_ALL_TYPES, + repeatedInt32, + fieldDescriptor(PROTO3_TEST_ALL_TYPES, TestAllTypes.REPEATED_INT32_FIELD_NUMBER)); assertThat(result).isTrue(); } @@ -701,10 +716,9 @@ public void fieldReads_throughGetters_matchWireBytes( (ProtoMessageLiteValue) ALL_TYPES_CONVERTER.toRuntimeValue(testCase.message); ProtoMessageLiteValue fromWire = ProtoMessageLiteValue.create( - testCase.message.toByteString(), throughGetters.celType().name(), ALL_TYPES_CONVERTER); + testCase.message.toByteString(), throughGetters.descriptor(), ALL_TYPES_CONVERTER); - for (FieldLiteDescriptor field : - DESCRIPTOR_POOL.findDescriptor(testCase.message).get().getFieldDescriptors()) { + for (FieldLiteDescriptor field : throughGetters.descriptor().getFieldDescriptors()) { String name = field.getFieldName(); SelectField selectField = SelectField.create(field.getFieldNumber(), name); expect @@ -743,7 +757,7 @@ public void selectByFieldNumber_unknownClosedEnumValueInMemory_readsAsUnset() th (ProtoMessageLiteValue) ALL_TYPES_CONVERTER.toRuntimeValue(message); ProtoMessageLiteValue fromWire = ProtoMessageLiteValue.create( - message.toByteString(), inMemory.celType().name(), ALL_TYPES_CONVERTER); + message.toByteString(), inMemory.descriptor(), ALL_TYPES_CONVERTER); SelectField field = SelectField.create( dev.cel.expr.conformance.proto2.TestAllTypes.STANDALONE_ENUM_FIELD_NUMBER, diff --git a/common/src/test/java/dev/cel/common/values/ProtoMessageLiteValueTest.java b/common/src/test/java/dev/cel/common/values/ProtoMessageLiteValueTest.java index b12be4335..537745bd2 100644 --- a/common/src/test/java/dev/cel/common/values/ProtoMessageLiteValueTest.java +++ b/common/src/test/java/dev/cel/common/values/ProtoMessageLiteValueTest.java @@ -47,6 +47,7 @@ import dev.cel.expr.conformance.proto3.TestAllTypes.NestedEnum; import dev.cel.expr.conformance.proto3.TestAllTypes.NestedMessage; import dev.cel.expr.conformance.proto3.TestAllTypesCelDescriptor; +import dev.cel.protobuf.CelLiteDescriptor.MessageLiteDescriptor; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.time.Duration; @@ -67,12 +68,19 @@ public final class ProtoMessageLiteValueTest { private static final ProtoLiteCelValueConverter PROTO_LITE_CEL_VALUE_CONVERTER = ProtoLiteCelValueConverter.newInstance(DESCRIPTOR_POOL); + private static final MessageLiteDescriptor TEST_ALL_TYPES_DESCRIPTOR = + DESCRIPTOR_POOL.getDescriptorOrThrow("cel.expr.conformance.proto3.TestAllTypes"); + + private static final MessageLiteDescriptor NESTED_MESSAGE_DESCRIPTOR = + DESCRIPTOR_POOL.getDescriptorOrThrow( + "cel.expr.conformance.proto3.TestAllTypes.NestedMessage"); + @Test public void create_withEmptyMessage() { ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( TestAllTypes.getDefaultInstance(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(messageLiteValue.value()).isEqualTo(TestAllTypes.getDefaultInstance()); @@ -84,7 +92,7 @@ public void create_withPopulatedMessage() { ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( TestAllTypes.newBuilder().setSingleInt64(1L).build(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(messageLiteValue.value()) @@ -96,9 +104,7 @@ public void create_withPopulatedMessage() { public void create_withEmptyByteString() { ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( - ByteString.EMPTY, - "cel.expr.conformance.proto3.TestAllTypes", - PROTO_LITE_CEL_VALUE_CONVERTER); + ByteString.EMPTY, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(messageLiteValue.isZeroValue()).isTrue(); assertThat(messageLiteValue.toByteString()).isEqualTo(ByteString.EMPTY); @@ -106,10 +112,13 @@ public void create_withEmptyByteString() { } @Test - public void isZeroValue_emptyWireBytesWithoutDescriptor_returnsTrueWithoutParsing() { + public void isZeroValue_emptyWireBytes_returnsTrueWithoutParsing() { + // The descriptor's null builder makes any parse throw. ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( - ByteString.EMPTY, "unregistered.Message", PROTO_LITE_CEL_VALUE_CONVERTER); + ByteString.EMPTY, + new MessageLiteDescriptor("unregistered.Message", ImmutableList.of(), () -> null), + PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(messageLiteValue.isZeroValue()).isTrue(); } @@ -120,9 +129,7 @@ public void isZeroValue_nonEmptyWireBytesForDefaultMessage_returnsTrue() { ByteString explicitZeroFieldBytes = ByteString.copyFrom(new byte[] {0x08, 0x00}); ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( - explicitZeroFieldBytes, - "cel.expr.conformance.proto3.TestAllTypes", - PROTO_LITE_CEL_VALUE_CONVERTER); + explicitZeroFieldBytes, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(messageLiteValue.isZeroValue()).isTrue(); } @@ -134,9 +141,7 @@ public void create_withPopulatedByteString_selectsAndLazilyMaterializesValue() { ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( - expected.toByteString(), - "cel.expr.conformance.proto3.TestAllTypes", - PROTO_LITE_CEL_VALUE_CONVERTER); + expected.toByteString(), TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(messageLiteValue.select("single_int64")).isEqualTo(42L); assertThat(messageLiteValue.select("single_string")).isEqualTo("hello"); @@ -156,37 +161,30 @@ public void equals_byteStringBackedAndMessageBacked_areEqual() { .addEqualityGroup( ProtoMessageLiteValue.create( TestAllTypes.getDefaultInstance(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER), ProtoMessageLiteValue.create( - ByteString.EMPTY, - "cel.expr.conformance.proto3.TestAllTypes", - PROTO_LITE_CEL_VALUE_CONVERTER)) + ByteString.EMPTY, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER)) .addEqualityGroup( ProtoMessageLiteValue.create( - populated, - "cel.expr.conformance.proto3.TestAllTypes", - PROTO_LITE_CEL_VALUE_CONVERTER), + populated, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER), ProtoMessageLiteValue.create( populated.toByteString(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER), - ProtoMessageLiteValue.create( - populated, "cel.expr.conformance.proto3.TestAllTypes", distinctConverter)) + ProtoMessageLiteValue.create(populated, TEST_ALL_TYPES_DESCRIPTOR, distinctConverter)) .addEqualityGroup( ProtoMessageLiteValue.create( - different, - "cel.expr.conformance.proto3.TestAllTypes", - PROTO_LITE_CEL_VALUE_CONVERTER)) + different, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER)) .addEqualityGroup( ProtoMessageLiteValue.create( TestAllTypes.getDefaultInstance(), - "different.TypeName", + new MessageLiteDescriptor("different.TypeName", ImmutableList.of(), () -> null), PROTO_LITE_CEL_VALUE_CONVERTER)) .addEqualityGroup( ProtoMessageLiteValue.create( NestedMessage.getDefaultInstance(), - "cel.expr.conformance.proto3.TestAllTypes.NestedMessage", + NESTED_MESSAGE_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER)) .testEquals(); } @@ -196,9 +194,7 @@ public void create_withCorruptByteString_throwsOnValueMaterialization() { ByteString corruptBytes = ByteString.copyFrom(new byte[] {(byte) 0xFF, (byte) 0xFF}); ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( - corruptBytes, - "cel.expr.conformance.proto3.TestAllTypes", - PROTO_LITE_CEL_VALUE_CONVERTER); + corruptBytes, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, messageLiteValue::value); @@ -215,9 +211,7 @@ public void create_withCorruptByteString_throwsOnSelect() { ByteString corruptBytes = ByteString.copyFrom(new byte[] {(byte) 0xFF, (byte) 0xFF}); ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( - corruptBytes, - "cel.expr.conformance.proto3.TestAllTypes", - PROTO_LITE_CEL_VALUE_CONVERTER); + corruptBytes, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> messageLiteValue.select("single_int64")); @@ -234,9 +228,7 @@ public void create_withCorruptByteString_throwsOnSelectByFieldNumber() { ByteString corruptBytes = ByteString.copyFrom(new byte[] {0x10, (byte) 0x80}); ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( - corruptBytes, - "cel.expr.conformance.proto3.TestAllTypes", - PROTO_LITE_CEL_VALUE_CONVERTER); + corruptBytes, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); SelectField selectField = SelectField.create(2L, "single_int64", 3, 0L); IllegalArgumentException thrown = @@ -256,9 +248,7 @@ public void create_withCorruptByteString_throwsOnHasFieldByNumber() { ByteString corruptBytes = ByteString.copyFrom(new byte[] {0x10, (byte) 0x80}); ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( - corruptBytes, - "cel.expr.conformance.proto3.TestAllTypes", - PROTO_LITE_CEL_VALUE_CONVERTER); + corruptBytes, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); SelectField selectField = SelectField.create(2L, "single_int64"); IllegalArgumentException thrown = @@ -306,7 +296,7 @@ public void create_withMismatchedWireType_throwsOnSelect( ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( ByteString.copyFrom(testCase.bytes), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); IllegalArgumentException thrown = @@ -330,7 +320,7 @@ public void select_otherFieldHasMismatchedWireType_decodesOnlySelectedField() { .concat(TestAllTypes.newBuilder().setSingleInt64(42L).build().toByteString()); ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( - bytes, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + bytes, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object result = messageLiteValue.select("single_int64"); @@ -342,7 +332,7 @@ public void select_undeclaredField_throwsCelAttributeNotFoundException() { ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( TestAllTypes.getDefaultInstance(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); CelAttributeNotFoundException thrown = @@ -376,7 +366,7 @@ public void find_returnsValueOnlyIfFieldIsPresent(@TestParameter FindFieldTestCa ProtoMessageLiteValue messageLiteValue = ProtoMessageLiteValue.create( TestAllTypes.newBuilder().setSingleString("foo").build(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Optional result = messageLiteValue.find(testCase.fieldName); @@ -428,7 +418,7 @@ private enum SelectFieldTestCase { ImmutableList.of( ProtoMessageLiteValue.create( NestedMessage.newBuilder().setBb(10).build(), - "cel.expr.conformance.proto3.TestAllTypes.NestedMessage", + NESTED_MESSAGE_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER))), REPEATED_INT64_WRAPPER("repeated_int64_wrapper", ImmutableList.of(11L, 12L)), @@ -519,9 +509,7 @@ public void selectField_success(@TestParameter SelectFieldTestCase testCase) { .build(); ProtoMessageLiteValue protoMessageValue = ProtoMessageLiteValue.create( - testAllTypes, - "cel.expr.conformance.proto3.TestAllTypes", - PROTO_LITE_CEL_VALUE_CONVERTER); + testAllTypes, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object selectedValue = protoMessageValue.select(testCase.fieldName); @@ -555,7 +543,7 @@ public void selectField_containerField_returnsImmutableContainer( ProtoMessageLiteValue protoMessageValue = ProtoMessageLiteValue.create( TestAllTypes.newBuilder().addRepeatedInt64(1L).putMapInt64Int64(1L, 2L).build(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object selectedValue = protoMessageValue.select(testCase.selectField.fieldName()); @@ -569,7 +557,7 @@ public void selectByFieldNumber_containerField_returnsImmutableContainer( ProtoMessageLiteValue protoMessageValue = ProtoMessageLiteValue.create( TestAllTypes.newBuilder().addRepeatedInt64(1L).putMapInt64Int64(1L, 2L).build(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object selectedValue = protoMessageValue.selectByFieldNumber(testCase.selectField); @@ -611,7 +599,7 @@ private enum DefaultValueTestCase { "single_nested_message", ProtoMessageLiteValue.create( NestedMessage.getDefaultInstance(), - "cel.expr.conformance.proto3.TestAllTypes.NestedMessage", + NESTED_MESSAGE_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER)); private final String fieldName; @@ -628,7 +616,7 @@ public void selectField_defaultValue(@TestParameter DefaultValueTestCase testCas ProtoMessageLiteValue protoMessageValue = ProtoMessageLiteValue.create( TestAllTypes.getDefaultInstance(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object selectedValue = protoMessageValue.select(testCase.fieldName); @@ -641,7 +629,7 @@ public void selectByFieldNumber_knownField_returnsValue() { TestAllTypes proto = TestAllTypes.newBuilder().setSingleString("foo").build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object result = val.selectByFieldNumber(SelectField.create(14L, "single_string", 9, "default")); @@ -653,7 +641,7 @@ public void selectByFieldNumber_absentKnownMessageField_returnsDefaultMessage() ProtoMessageLiteValue val = ProtoMessageLiteValue.create( TestAllTypes.getDefaultInstance(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object result = val.selectByFieldNumber(SelectField.create(21L, "single_nested_message", 11)); @@ -662,7 +650,7 @@ public void selectByFieldNumber_absentKnownMessageField_returnsDefaultMessage() .isEqualTo( ProtoMessageLiteValue.create( NestedMessage.getDefaultInstance(), - "cel.expr.conformance.proto3.TestAllTypes.NestedMessage", + NESTED_MESSAGE_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER)); } @@ -676,7 +664,7 @@ public void selectByFieldNumber_unknownWireField_decoded() throws Exception { TestAllTypes.parseFrom(baos.toByteArray(), ExtensionRegistryLite.getEmptyRegistry()); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object result = val.selectByFieldNumber(SelectField.create(999L, "unknown_field", 3, 0L)); @@ -694,7 +682,7 @@ public void selectByFieldNumber_unknownRepeatedWireField_decoded() throws Except TestAllTypes.parseFrom(baos.toByteArray(), ExtensionRegistryLite.getEmptyRegistry()); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object result = val.selectByFieldNumber( @@ -708,7 +696,7 @@ public void selectByFieldNumber_renamedField_resolvesByFieldNumber() { TestAllTypes proto = TestAllTypes.newBuilder().setSingleString("foo").build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object result = val.selectByFieldNumber(SelectField.create(14L, "renamed_string", 9, "default")); @@ -730,7 +718,7 @@ public void selectByFieldNumber_unknownFieldCollidesWithKnownFieldName_returnsUn .build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object result = val.selectByFieldNumber(SelectField.create(999L, "single_string", 3, 0L)); @@ -742,7 +730,7 @@ public void selectByFieldNumber_renamedMapField_resolvesByFieldNumber() { TestAllTypes proto = TestAllTypes.newBuilder().putMapStringString("k", "v").build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object result = val.selectByFieldNumber( @@ -757,7 +745,7 @@ public void selectByFieldNumber_renamedRepeatedField_resolvesByFieldNumber() { TestAllTypes.newBuilder().addRepeatedInt64(10L).addRepeatedInt64(20L).build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Object result = val.selectByFieldNumber(SelectField.create(32L, "renamed_repeated", 3, ImmutableList.of())); @@ -780,7 +768,7 @@ public void findByFieldNumber_intermediateUnknownSubmessage_returnsRawProtoMessa TestAllTypes.parseFrom(baos.toByteArray(), ExtensionRegistryLite.getEmptyRegistry()); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); Optional nav = val.findByFieldNumber(SelectField.create(998L, "unknown_submessage")); @@ -792,7 +780,7 @@ public void hasFieldByNumber_knownField_returnsTrue() { TestAllTypes proto = TestAllTypes.newBuilder().setSingleString("present").build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(val.hasFieldByNumber(SelectField.create(14L, "single_string"))).isTrue(); } @@ -807,7 +795,7 @@ public void hasFieldByNumber_unknownFieldPresent_returnsTrue() throws Exception TestAllTypes.parseFrom(baos.toByteArray(), ExtensionRegistryLite.getEmptyRegistry()); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(val.hasFieldByNumber(SelectField.create(999L, "unknown_present"))).isTrue(); } @@ -817,7 +805,7 @@ public void hasFieldByNumber_unknownFieldAbsent_returnsFalse() { ProtoMessageLiteValue val = ProtoMessageLiteValue.create( TestAllTypes.getDefaultInstance(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(val.hasFieldByNumber(SelectField.create(888L, "unknown_absent"))).isFalse(); @@ -828,7 +816,7 @@ public void hasFieldByNumber_renamedField_resolvesByFieldNumber() { TestAllTypes proto = TestAllTypes.newBuilder().setSingleString("present").build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(val.hasFieldByNumber(SelectField.create(14L, "renamed_string"))).isTrue(); } @@ -838,7 +826,7 @@ public void hasFieldByNumber_renamedMapField_resolvesByFieldNumber() { TestAllTypes proto = TestAllTypes.newBuilder().putMapStringString("k", "v").build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(val.hasFieldByNumber(SelectField.create(61L, "renamed_map"))).isTrue(); } @@ -848,7 +836,7 @@ public void hasFieldByNumber_renamedRepeatedField_resolvesByFieldNumber() { TestAllTypes proto = TestAllTypes.newBuilder().addRepeatedInt64(10L).build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(val.hasFieldByNumber(SelectField.create(32L, "renamed_repeated"))).isTrue(); } @@ -858,7 +846,7 @@ public void qualify_emptyList_returnsSameInstance() { ProtoMessageLiteValue val = ProtoMessageLiteValue.create( TestAllTypes.getDefaultInstance(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(OptimizedSelectTraversal.qualify(val, ImmutableList.of())).isSameInstanceAs(val); @@ -869,7 +857,7 @@ public void hasField_emptyList_returnsFalse() { ProtoMessageLiteValue val = ProtoMessageLiteValue.create( TestAllTypes.getDefaultInstance(), - "cel.expr.conformance.proto3.TestAllTypes", + TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat(OptimizedSelectTraversal.hasField(val, ImmutableList.of())).isFalse(); @@ -880,7 +868,7 @@ public void qualify_mapField_returnsMap() { TestAllTypes proto = TestAllTypes.newBuilder().putMapStringString("k", "v").build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); ImmutableList fields = ImmutableList.of( SelectField.createMap(61L, "map_string_string", SelectField.MapEntrySpec.create(9, 9))); @@ -898,7 +886,7 @@ public void qualify_nestedMessage_resolvesField() { .build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); ImmutableList fields = ImmutableList.of( SelectField.create(21L, "single_nested_message", 11), @@ -917,7 +905,7 @@ public void hasField_nestedMessage_resolvesPresence() { .build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); assertThat( OptimizedSelectTraversal.hasField( @@ -940,7 +928,7 @@ public void qualify_intermediateScalar_throwsCelAttributeNotFoundWithChildFieldN TestAllTypes proto = TestAllTypes.newBuilder().setSingleInt64(42L).build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); ImmutableList fields = ImmutableList.of( SelectField.create(2L, "single_int64", 3, 0L), @@ -959,7 +947,7 @@ public void hasField_intermediateScalar_throwsCelAttributeNotFoundWithChildField TestAllTypes proto = TestAllTypes.newBuilder().setSingleInt64(42L).build(); ProtoMessageLiteValue val = ProtoMessageLiteValue.create( - proto, "cel.expr.conformance.proto3.TestAllTypes", PROTO_LITE_CEL_VALUE_CONVERTER); + proto, TEST_ALL_TYPES_DESCRIPTOR, PROTO_LITE_CEL_VALUE_CONVERTER); ImmutableList fields = ImmutableList.of( SelectField.create(2L, "single_int64"), SelectField.create(3L, "leaf_field"));