This is an automated email from the ASF dual-hosted git repository.

apupier pushed a commit to branch 
test-fix-CAMEL-24812-with-CAMEL-22996-dropJava17
in repository https://gitbox.apache.org/repos/asf/camel.git

commit b0954318543b44484fa023b04bdcda75003a8942
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Fri Oct 16 13:59:50 2026 +0200

    CAMEL-22996: replace deprecated new Locale() with
    Locale.forLanguageTag() or Locale.of()
    
    Co-authored-by: IBM Bob 2.2.1
    Signed-off-by: AurĂ©lien Pupier <[email protected]>
---
 .../java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java  | 2 +-
 .../java/org/apache/camel/impl/engine/IntrospectionSupportTest.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
 
b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
index 39043bd8aad8..296d548ba070 100644
--- 
a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
+++ 
b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java
@@ -273,7 +273,7 @@ public class DefaultCxfRsBinding implements CxfRsBinding, 
HeaderFilterStrategyAw
             if (contentLanguage != null) {
                 return Entity.entity(body, new Variant(
                         MediaType.valueOf(contentType),
-                        new Locale(contentLanguage),
+                        Locale.forLanguageTag(contentLanguage),
                         contentEncoding));
             }
         }
diff --git 
a/core/camel-core/src/test/java/org/apache/camel/impl/engine/IntrospectionSupportTest.java
 
b/core/camel-core/src/test/java/org/apache/camel/impl/engine/IntrospectionSupportTest.java
index 86a529f1a7f8..3b22d6785f78 100644
--- 
a/core/camel-core/src/test/java/org/apache/camel/impl/engine/IntrospectionSupportTest.java
+++ 
b/core/camel-core/src/test/java/org/apache/camel/impl/engine/IntrospectionSupportTest.java
@@ -394,7 +394,7 @@ public class IntrospectionSupportTest extends 
ContextTestSupport {
     @Test
     public void testGetPropertyLocaleIndependent() throws Exception {
         Locale oldLocale = Locale.getDefault();
-        Locale.setDefault(new Locale("tr", "TR"));
+        Locale.setDefault(Locale.of("tr", "TR"));
 
         try {
             ExampleBean bean = new ExampleBean();

Reply via email to