Skip to content

Commit 692b009

Browse files
l46kokcopybara-github
authored andcommitted
Remove deprecated CelAbstractSyntaxTree#getProtoResultType
PiperOrigin-RevId: 705921867
1 parent 30dca50 commit 692b009

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

common/src/main/java/dev/cel/common/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ java_library(
5858
"//common/internal",
5959
"//common/internal:file_descriptor_converter",
6060
"//common/types",
61-
"//common/types:cel_proto_types",
6261
"//common/types:cel_types",
6362
"//common/types:type_providers",
64-
"@cel_spec//proto/cel/expr:expr_java_proto",
6563
"@maven//:com_google_errorprone_error_prone_annotations",
6664
"@maven//:com_google_guava_guava",
6765
"@maven//:com_google_protobuf_protobuf_java",

common/src/main/java/dev/cel/common/CelAbstractSyntaxTree.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package dev.cel.common;
1616

17-
import dev.cel.expr.Type;
1817
import com.google.auto.value.AutoValue;
1918
import com.google.common.collect.ImmutableList;
2019
import com.google.common.collect.ImmutableMap;
@@ -23,7 +22,6 @@
2322
import dev.cel.common.ast.CelConstant;
2423
import dev.cel.common.ast.CelExpr;
2524
import dev.cel.common.ast.CelReference;
26-
import dev.cel.common.types.CelProtoTypes;
2725
import dev.cel.common.types.CelType;
2826
import dev.cel.common.types.SimpleType;
2927
import java.util.Map;
@@ -94,18 +92,6 @@ public CelType getResultType() {
9492
return isChecked() ? getType(getExpr().id()).get() : SimpleType.DYN;
9593
}
9694

97-
/**
98-
* For a type checked abstract syntax tree the resulting type is returned in proto format
99-
* described in checked.proto. Otherwise, the dynamic type is returned.
100-
*
101-
* @deprecated Use {@link #getResultType} instead. Convert the resulting {@link CelType} into
102-
* canonical CEL expr proto format via {@link CelProtoTypes#celTypeToType} if necessary.
103-
*/
104-
@Deprecated
105-
public Type getProtoResultType() {
106-
return CelProtoTypes.celTypeToType(getResultType());
107-
}
108-
10995
/**
11096
* Returns the {@link CelSource} that was used during construction of the abstract syntax tree.
11197
*/

common/src/test/java/dev/cel/common/CelAbstractSyntaxTreeTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package dev.cel.common;
1616

1717
import static com.google.common.truth.Truth.assertThat;
18-
import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat;
1918

2019
import dev.cel.expr.CheckedExpr;
2120
import dev.cel.expr.Constant;
@@ -95,15 +94,13 @@ public final class CelAbstractSyntaxTreeTest {
9594
public void getResultType_isDynWhenParsedExpr() {
9695
CelAbstractSyntaxTree ast = PARSED_AST;
9796

98-
assertThat(ast.getProtoResultType()).isEqualTo(CelProtoTypes.DYN);
9997
assertThat(ast.getResultType()).isEqualTo(SimpleType.DYN);
10098
}
10199

102100
@Test
103101
public void getResultType_isStaticWhenCheckedExpr() {
104102
CelAbstractSyntaxTree ast = CHECKED_AST;
105103

106-
assertThat(ast.getProtoResultType()).isEqualTo(CelProtoTypes.BOOL);
107104
assertThat(ast.getResultType()).isEqualTo(SimpleType.BOOL);
108105
}
109106

0 commit comments

Comments
 (0)