Skip to content

Commit c30f417

Browse files
l46kokcopybara-github
authored andcommitted
Remove deprecated create methods
PiperOrigin-RevId: 631198940
1 parent 20a0420 commit c30f417

3 files changed

Lines changed: 10 additions & 65 deletions

File tree

common/src/main/java/dev/cel/common/ast/CelExpr.java

Lines changed: 6 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.google.errorprone.annotations.CanIgnoreReturnValue;
2424
import com.google.errorprone.annotations.CheckReturnValue;
2525
import com.google.errorprone.annotations.Immutable;
26-
import com.google.errorprone.annotations.InlineMe;
2726
import dev.cel.common.ast.CelExpr.ExprKind.Kind;
2827
import java.util.ArrayList;
2928
import java.util.Arrays;
@@ -90,32 +89,14 @@ public CelCall call() {
9089
return exprKind().call();
9190
}
9291

93-
/**
94-
* @deprecated Use {@link #list()} instead.
95-
*/
96-
@Deprecated
97-
@InlineMe(replacement = "this.list()")
98-
public final CelList createList() {
99-
return list();
100-
}
101-
10292
/**
10393
* {@inheritDoc}
10494
*
10595
* @throws UnsupportedOperationException if expression is not {@link Kind#LIST}.
10696
*/
10797
@Override
10898
public CelList list() {
109-
return exprKind().createList();
110-
}
111-
112-
/**
113-
* @deprecated Use {@link #list()} instead.
114-
*/
115-
@Deprecated
116-
@InlineMe(replacement = "this.struct()")
117-
public final CelStruct createStruct() {
118-
return struct();
99+
return exprKind().list();
119100
}
120101

121102
/**
@@ -125,16 +106,7 @@ public final CelStruct createStruct() {
125106
*/
126107
@Override
127108
public CelStruct struct() {
128-
return exprKind().createStruct();
129-
}
130-
131-
/**
132-
* @deprecated Use {@link #list()} instead.
133-
*/
134-
@Deprecated
135-
@InlineMe(replacement = "this.map()")
136-
public final CelMap createMap() {
137-
return map();
109+
return exprKind().struct();
138110
}
139111

140112
/**
@@ -144,7 +116,7 @@ public final CelMap createMap() {
144116
*/
145117
@Override
146118
public CelMap map() {
147-
return exprKind().createMap();
119+
return exprKind().map();
148120
}
149121

150122
/**
@@ -203,7 +175,7 @@ public CelCall callOrDefault() {
203175
*/
204176
public CelList listOrDefault() {
205177
return exprKind().getKind().equals(ExprKind.Kind.LIST)
206-
? exprKind().createList()
178+
? exprKind().list()
207179
: CelList.newBuilder().build();
208180
}
209181

@@ -213,7 +185,7 @@ public CelList listOrDefault() {
213185
*/
214186
public CelStruct structOrDefault() {
215187
return exprKind().getKind().equals(ExprKind.Kind.STRUCT)
216-
? exprKind().createStruct()
188+
? exprKind().struct()
217189
: CelStruct.newBuilder().build();
218190
}
219191

@@ -223,7 +195,7 @@ public CelStruct structOrDefault() {
223195
*/
224196
public CelMap mapOrDefault() {
225197
return exprKind().getKind().equals(ExprKind.Kind.MAP)
226-
? exprKind().createMap()
198+
? exprKind().map()
227199
: CelMap.newBuilder().build();
228200
}
229201

@@ -405,37 +377,10 @@ public enum Kind {
405377

406378
public abstract CelList list();
407379

408-
/**
409-
* @deprecated Use {@link #list()} instead.
410-
*/
411-
@Deprecated
412-
@InlineMe(replacement = "this.list()")
413-
public final CelList createList() {
414-
return list();
415-
}
416-
417380
public abstract CelStruct struct();
418381

419-
/**
420-
* @deprecated Use {@link #struct()} instead.
421-
*/
422-
@Deprecated
423-
@InlineMe(replacement = "this.struct()")
424-
public final CelStruct createStruct() {
425-
return struct();
426-
}
427-
428382
public abstract CelMap map();
429383

430-
/**
431-
* @deprecated Use {@link #map()} instead.
432-
*/
433-
@Deprecated
434-
@InlineMe(replacement = "this.map()")
435-
public final CelMap createMap() {
436-
return map();
437-
}
438-
439384
public abstract CelComprehension comprehension();
440385
}
441386

common/src/main/java/dev/cel/common/ast/CelExprConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ public static Expr fromCelExpr(CelExpr celExpr) {
7676
.addAllOptionalIndices(celCreateList.optionalIndices()))
7777
.build();
7878
case STRUCT:
79-
return expr.setStructExpr(celStructToExprStruct(celExprKind.createStruct())).build();
79+
return expr.setStructExpr(celStructToExprStruct(celExprKind.struct())).build();
8080
case MAP:
81-
return expr.setStructExpr(celMapToExprStruct(celExprKind.createMap())).build();
81+
return expr.setStructExpr(celMapToExprStruct(celExprKind.map())).build();
8282
case COMPREHENSION:
8383
CelExpr.CelComprehension celComprehension = celExprKind.comprehension();
8484
return expr.setComprehensionExpr(

common/src/main/java/dev/cel/common/ast/CelExprV1Alpha1Converter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ public static Expr fromCelExpr(CelExpr celExpr) {
7676
.addAllOptionalIndices(celCreateList.optionalIndices()))
7777
.build();
7878
case STRUCT:
79-
return expr.setStructExpr(celStructToExprStruct(celExprKind.createStruct())).build();
79+
return expr.setStructExpr(celStructToExprStruct(celExprKind.struct())).build();
8080
case MAP:
81-
return expr.setStructExpr(celMapToExprStruct(celExprKind.createMap())).build();
81+
return expr.setStructExpr(celMapToExprStruct(celExprKind.map())).build();
8282
case COMPREHENSION:
8383
CelExpr.CelComprehension celComprehension = celExprKind.comprehension();
8484
return expr.setComprehensionExpr(

0 commit comments

Comments
 (0)