This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/dev/pr-11894-99e53aad863b7991daf3aafffaf2e1b69882346d in repository https://gitbox.apache.org/repos/asf/seatunnel.git
commit d57a0f685860363468afda9d4db89236e2c354b9 Author: 陈家名 <[email protected]> AuthorDate: Sun Aug 30 16:22:52 2026 +0000 [Fix][Zeta] Make job status parsing locale independent (#11894) --- .../seatunnel/engine/common/job/JobStatus.java | 4 ++- .../seatunnel/engine/common/job/JobStatusTest.java | 40 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/seatunnel-engine/seatunnel-engine-common/src/main/java/org/apache/seatunnel/engine/common/job/JobStatus.java b/seatunnel-engine/seatunnel-engine-common/src/main/java/org/apache/seatunnel/engine/common/job/JobStatus.java index bd7d266a21..925fb33ce3 100644 --- a/seatunnel-engine/seatunnel-engine-common/src/main/java/org/apache/seatunnel/engine/common/job/JobStatus.java +++ b/seatunnel-engine/seatunnel-engine-common/src/main/java/org/apache/seatunnel/engine/common/job/JobStatus.java @@ -18,6 +18,8 @@ package org.apache.seatunnel.engine.common.job; +import java.util.Locale; + /** Possible states of a job once it has been accepted by the dispatcher. */ public enum JobStatus { /** @@ -84,6 +86,6 @@ public enum JobStatus { } public static JobStatus fromString(String status) { - return JobStatus.valueOf(status.toUpperCase()); + return JobStatus.valueOf(status.toUpperCase(Locale.ROOT)); } } diff --git a/seatunnel-engine/seatunnel-engine-common/src/test/java/org/apache/seatunnel/engine/common/job/JobStatusTest.java b/seatunnel-engine/seatunnel-engine-common/src/test/java/org/apache/seatunnel/engine/common/job/JobStatusTest.java new file mode 100644 index 0000000000..d1a0916b8b --- /dev/null +++ b/seatunnel-engine/seatunnel-engine-common/src/test/java/org/apache/seatunnel/engine/common/job/JobStatusTest.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.engine.common.job; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; + +import java.util.Locale; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class JobStatusTest { + + @Test + @ResourceLock("default-locale") + void testFromStringUsesLocaleIndependentCaseConversion() { + Locale originalLocale = Locale.getDefault(); + try { + Locale.setDefault(Locale.forLanguageTag("tr-TR")); + assertEquals(JobStatus.FINISHED, JobStatus.fromString("finished")); + } finally { + Locale.setDefault(originalLocale); + } + } +}
