This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit bf3b7698a06fd4722e95ce282bcbdef02d7a2984 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Sat Mar 2 08:08:25 2024 +0100 camel-cloudevents - Fix name with plus sign is a valid name. Fix metadata generator to allow that. --- ...lication-cloudevents-json.json => application-cloudevents+json.json} | 0 .../cloudevents/transformer/CloudEventJsonDataTypeTransformerTest.java | 2 +- .../src/main/java/org/apache/camel/spi/TransformerResolver.java | 1 - .../apache/camel/maven/packaging/GenerateDataTypeTransformerMojo.java | 2 +- .../main/java/org/apache/camel/maven/packaging/SpiGeneratorMojo.java | 2 +- 5 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/camel-cloudevents/src/generated/resources/META-INF/services/org/apache/camel/transformer/application-cloudevents-json.json b/components/camel-cloudevents/src/generated/resources/META-INF/services/org/apache/camel/transformer/application-cloudevents+json.json similarity index 100% rename from components/camel-cloudevents/src/generated/resources/META-INF/services/org/apache/camel/transformer/application-cloudevents-json.json rename to components/camel-cloudevents/src/generated/resources/META-INF/services/org/apache/camel/transformer/application-cloudevents+json.json diff --git a/components/camel-cloudevents/src/test/java/org/apache/camel/component/cloudevents/transformer/CloudEventJsonDataTypeTransformerTest.java b/components/camel-cloudevents/src/test/java/org/apache/camel/component/cloudevents/transformer/CloudEventJsonDataTypeTransformerTest.java index 6f3376fe061..02b223e10a1 100644 --- a/components/camel-cloudevents/src/test/java/org/apache/camel/component/cloudevents/transformer/CloudEventJsonDataTypeTransformerTest.java +++ b/components/camel-cloudevents/src/test/java/org/apache/camel/component/cloudevents/transformer/CloudEventJsonDataTypeTransformerTest.java @@ -96,7 +96,7 @@ class CloudEventJsonDataTypeTransformerTest { @Test public void shouldLookupTransformer() throws Exception { Transformer transformer - = camelContext.getTransformerRegistry().resolveTransformer(new TransformerKey("application-cloudevents/json")); + = camelContext.getTransformerRegistry().resolveTransformer(new TransformerKey("application-cloudevents+json")); Assertions.assertNotNull(transformer); Assertions.assertEquals(CloudEventJsonDataTypeTransformer.class, transformer.getClass()); } diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/TransformerResolver.java b/core/camel-api/src/main/java/org/apache/camel/spi/TransformerResolver.java index af75c26051b..23817d1affb 100644 --- a/core/camel-api/src/main/java/org/apache/camel/spi/TransformerResolver.java +++ b/core/camel-api/src/main/java/org/apache/camel/spi/TransformerResolver.java @@ -52,7 +52,6 @@ public interface TransformerResolver<K> { default String normalize(K key) { String keyString = key.toString(); keyString = StringHelper.after(keyString, DataType.DEFAULT_SCHEME + ":", keyString); - return StringHelper.sanitize(keyString).toLowerCase(Locale.US); } diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/GenerateDataTypeTransformerMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/GenerateDataTypeTransformerMojo.java index c395fd581ba..bf93e9984c2 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/GenerateDataTypeTransformerMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/GenerateDataTypeTransformerMojo.java @@ -220,7 +220,7 @@ public class GenerateDataTypeTransformerMojo extends AbstractGeneratorMojo { } private String sanitizeFileName(String fileName) { - return fileName.replaceAll("[^A-Za-z0-9-/]", "-"); + return fileName.replaceAll("[^A-Za-z0-9+-/]", "-"); } private String asTitle(String name) { diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpiGeneratorMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpiGeneratorMojo.java index 841d2217a84..c33a083c880 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpiGeneratorMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpiGeneratorMojo.java @@ -163,7 +163,7 @@ public class SpiGeneratorMojo extends AbstractGeneratorMojo { } private String sanitizeFileName(String fileName) { - return fileName.replaceAll("[^A-Za-z0-9-/+]", "-"); + return fileName.replaceAll("[^A-Za-z0-9+-/]", "-"); } private boolean isLocal(String className) {