From 7eaf410eeb32bd8e4a0d74f3ca733e09bef290ee Mon Sep 17 00:00:00 2001 From: melloware Date: Tue, 17 Sep 2024 08:55:20 -0400 Subject: [PATCH] Fix #3: @Param is now Quarkified! --- .../omnifaces/deployment/OmnifacesProcessor.java | 6 +++++- .../io/quarkiverse/omnifaces/it/CdiParamBean.java | 14 +++----------- .../main/resources/META-INF/resources/params.xhtml | 2 -- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/deployment/src/main/java/io/quarkiverse/omnifaces/deployment/OmnifacesProcessor.java b/deployment/src/main/java/io/quarkiverse/omnifaces/deployment/OmnifacesProcessor.java index de74b11..2850126 100644 --- a/deployment/src/main/java/io/quarkiverse/omnifaces/deployment/OmnifacesProcessor.java +++ b/deployment/src/main/java/io/quarkiverse/omnifaces/deployment/OmnifacesProcessor.java @@ -174,8 +174,12 @@ void registerForReflection(BuildProducer reflectiveCla // All utilities classNames.addAll(collectClassesInPackage(combinedIndex, "org.omnifaces.util")); + classNames.addAll(collectSubclasses(combinedIndex, java.lang.Number.class.getName())); + classNames.add(java.lang.Integer.class.getName()); + classNames.add(java.lang.String.class.getName()); + reflectiveClass.produce( - ReflectiveClassBuildItem.builder(classNames.toArray(new String[0])).methods(true).build()); + ReflectiveClassBuildItem.builder(classNames.toArray(new String[0])).methods(true).serialization(true).build()); } @Record(ExecutionTime.STATIC_INIT) diff --git a/integration-tests/src/main/java/io/quarkiverse/omnifaces/it/CdiParamBean.java b/integration-tests/src/main/java/io/quarkiverse/omnifaces/it/CdiParamBean.java index 3482fb3..4a7d077 100644 --- a/integration-tests/src/main/java/io/quarkiverse/omnifaces/it/CdiParamBean.java +++ b/integration-tests/src/main/java/io/quarkiverse/omnifaces/it/CdiParamBean.java @@ -7,13 +7,11 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import java.util.Date; import java.util.List; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.RequestScoped; import jakarta.faces.FacesException; -import jakarta.faces.convert.DateTimeConverter; import jakarta.faces.validator.LengthValidator; import jakarta.inject.Inject; import jakarta.inject.Named; @@ -47,12 +45,6 @@ public class CdiParamBean { @Param Integer number; - // Like - @Inject - @Param(converterClass = DateTimeConverter.class, converterAttributes = { - @Attribute(name = "pattern", value = "yyyyMMdd") }, converterMessage = "{1}: \"{0}\" is not the date format we had in mind! Please use the format yyyyMMdd.") - Date date; - private String result; @PostConstruct @@ -62,8 +54,8 @@ public void init() { return; } - result = String.format("You entered text1 '%s', text2 '%s', text3 '%s', number '%d', date '%5$tY%5$tm%5$td'", text1, - text2, text3, number, date); + result = String.format("You entered text1 '%s', text2 '%s', text3 '%s', number '%d'", text1, + text2, text3, number); Messages.addGlobalInfo("Yes, no validation errors!"); } @@ -92,4 +84,4 @@ public static T copy(T source) { return copy; } -} \ No newline at end of file +} diff --git a/integration-tests/src/main/resources/META-INF/resources/params.xhtml b/integration-tests/src/main/resources/META-INF/resources/params.xhtml index 87ce938..c52764d 100644 --- a/integration-tests/src/main/resources/META-INF/resources/params.xhtml +++ b/integration-tests/src/main/resources/META-INF/resources/params.xhtml @@ -80,14 +80,12 @@ -
  • -