|
17 | 17 | import static com.google.common.base.Preconditions.checkNotNull; |
18 | 18 | import static com.google.common.collect.ImmutableMap.toImmutableMap; |
19 | 19 |
|
20 | | -import dev.cel.expr.ExprValue; |
21 | 20 | import com.google.common.collect.ImmutableList; |
22 | 21 | import com.google.common.collect.ImmutableMap; |
23 | 22 | import com.google.common.primitives.Ints; |
@@ -205,9 +204,6 @@ public Object adaptProtoToValue(MessageOrBuilder proto) { |
205 | 204 |
|
206 | 205 | @SuppressWarnings({"unchecked", "rawtypes"}) |
207 | 206 | public Optional<Object> adaptFieldToValue(FieldDescriptor fieldDescriptor, Object fieldValue) { |
208 | | - if (isUnknown(fieldValue)) { |
209 | | - return Optional.of(fieldValue); |
210 | | - } |
211 | 207 | if (fieldDescriptor.isMapField()) { |
212 | 208 | Descriptor entryDescriptor = fieldDescriptor.getMessageType(); |
213 | 209 | FieldDescriptor keyFieldDescriptor = entryDescriptor.findFieldByNumber(1); |
@@ -255,9 +251,6 @@ public Optional<Object> adaptValueToFieldType( |
255 | 251 | if (isWrapperType(fieldDescriptor) && fieldValue.equals(NullValue.NULL_VALUE)) { |
256 | 252 | return Optional.empty(); |
257 | 253 | } |
258 | | - if (isUnknown(fieldValue)) { |
259 | | - return Optional.of(fieldValue); |
260 | | - } |
261 | 254 | if (fieldDescriptor.isMapField()) { |
262 | 255 | Descriptor entryDescriptor = fieldDescriptor.getMessageType(); |
263 | 256 | FieldDescriptor keyDescriptor = entryDescriptor.findFieldByNumber(1); |
@@ -590,11 +583,6 @@ private static boolean isWrapperType(FieldDescriptor fieldDescriptor) { |
590 | 583 | return wellKnownProto != null && wellKnownProto.isWrapperType(); |
591 | 584 | } |
592 | 585 |
|
593 | | - private static boolean isUnknown(Object object) { |
594 | | - return object instanceof ExprValue |
595 | | - && ((ExprValue) object).getKindCase() == ExprValue.KindCase.UNKNOWN; |
596 | | - } |
597 | | - |
598 | 586 | private static int intCheckedCast(long value) { |
599 | 587 | try { |
600 | 588 | return Ints.checkedCast(value); |
|
0 commit comments