@@ -27,6 +27,11 @@ public final class ExportJobCreationOptions {
2727 OrchestrationRuntimeStatus .COMPLETED ,
2828 OrchestrationRuntimeStatus .FAILED ,
2929 OrchestrationRuntimeStatus .TERMINATED )));
30+ private static final List <OrchestrationRuntimeStatus > ALL_TERMINAL_STATUSES = Collections .unmodifiableList (
31+ Arrays .asList (
32+ OrchestrationRuntimeStatus .COMPLETED ,
33+ OrchestrationRuntimeStatus .FAILED ,
34+ OrchestrationRuntimeStatus .TERMINATED ));
3035
3136 private String jobId ;
3237 private ExportMode mode ;
@@ -86,7 +91,7 @@ public ExportJobCreationOptions(
8691 "maxInstancesPerBatch must be between " + MIN_INSTANCES_PER_BATCH +
8792 " and " + MAX_INSTANCES_PER_BATCH + "." );
8893 }
89- if (runtimeStatus != null ) {
94+ if (runtimeStatus != null && ! runtimeStatus . isEmpty () ) {
9095 for (OrchestrationRuntimeStatus status : runtimeStatus ) {
9196 if (!TERMINAL_STATUSES .contains (status )) {
9297 throw new IllegalArgumentException (
@@ -101,7 +106,11 @@ public ExportJobCreationOptions(
101106 this .completedTimeTo = completedTimeTo ;
102107 this .destination = destination ;
103108 this .format = format != null ? format : ExportFormat .DEFAULT ;
104- this .runtimeStatus = runtimeStatus ;
109+ // Null or empty means "no explicit filter" — default to all terminal statuses so the
110+ // sidecar request is always unambiguous (matches .NET behavior).
111+ this .runtimeStatus = (runtimeStatus != null && !runtimeStatus .isEmpty ())
112+ ? runtimeStatus
113+ : ALL_TERMINAL_STATUSES ;
105114 this .maxInstancesPerBatch = maxInstancesPerBatch ;
106115 }
107116
0 commit comments