diff --git a/extensions/quarkus/deployment/src/main/java/org/apache/myfaces/core/extensions/quarkus/deployment/MyFacesProcessor.java b/extensions/quarkus/deployment/src/main/java/org/apache/myfaces/core/extensions/quarkus/deployment/MyFacesProcessor.java index 327d6d27b..cfd10831d 100644 --- a/extensions/quarkus/deployment/src/main/java/org/apache/myfaces/core/extensions/quarkus/deployment/MyFacesProcessor.java +++ b/extensions/quarkus/deployment/src/main/java/org/apache/myfaces/core/extensions/quarkus/deployment/MyFacesProcessor.java @@ -337,9 +337,8 @@ void buildRecommendedInitParams(BuildProducer initPar { // user config Config config = ConfigProvider.getConfig(); - - Optional projectStage = resolveProjectStage(config); - initParam.produce(new ServletInitParamBuildItem(ProjectStage.PROJECT_STAGE_PARAM_NAME, projectStage.get())); + String projectStage = resolveProjectStage(config); + initParam.produce(new ServletInitParamBuildItem(ProjectStage.PROJECT_STAGE_PARAM_NAME, projectStage)); } @BuildStep @@ -361,7 +360,7 @@ void buildAnnotationProviderIntegration(MyFacesRecorder recorder, CombinedIndexB } } - private Optional resolveProjectStage(Config config) + private String resolveProjectStage(Config config) { Optional projectStage = config.getOptionalValue(ProjectStage.PROJECT_STAGE_PARAM_NAME, String.class); @@ -377,7 +376,7 @@ else if (ConfigUtils.getProfiles().contains(LaunchMode.TEST.getDefaultProfile()) projectStage = Optional.of(ProjectStage.SystemTest.name()); } } - return projectStage; + return projectStage.orElse(ProjectStage.Production.name()); } @BuildStep @@ -495,12 +494,6 @@ void registerForLimitedReflection(MyFacesRecorder recorder, classNames.addAll(collectSubclasses(combinedIndex, factory)); } - classNames.addAll(Arrays.asList( - "jakarta.faces.component._DeltaStateHelper", - "jakarta.faces.component._DeltaStateHelper$InternalMap", - "jakarta.validation.groups.Default", - "jakarta.validation.Validation")); - List> classes = new ArrayList<>(Arrays.asList(ApplicationImplEventManager.class, DefaultWebConfigProviderFactory.class, ErrorPageWriter.class, @@ -534,11 +527,12 @@ void registerForMethodReflection(MyFacesRecorder recorder, BuildProducer reflectiveClass) { + List classNames = new ArrayList<>(); + classNames.add("jakarta.faces.component._AttachedStateWrapper"); + classNames.add("jakarta.faces.component._DeltaStateHelper"); + classNames.add("jakarta.faces.component._DeltaStateHelper$InternalMap"); + classNames.add("jakarta.faces.component._DeltaStateHelper$InternalMap"); + classNames.add("jakarta.faces.component._DeltaStateHelper$InternalMap"); + classNames.add("jakarta.faces.context._MyFacesExternalContextHelper"); + classNames.add("jakarta.validation.Validation"); + classNames.add("jakarta.validation.groups.Default"); + + classNames.add(org.apache.myfaces.view.facelets.tag.faces.FaceletState.class.getName()); reflectiveClass.produce( - ReflectiveClassBuildItem.builder("jakarta.faces.context._MyFacesExternalContextHelper") - .methods(true).fields(true).build()); + ReflectiveClassBuildItem.builder( + classNames.toArray(new String[0])).methods().fields().serialization().build()); } @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) @@ -787,7 +792,7 @@ else if (ai.target().asMethod().returnType().kind() == Type.Kind.PARAMETERIZED_T types.removeIf(Objects::isNull); // collect all public types from getters and fields - List temp = new ArrayList(); + List temp = new ArrayList<>(); types.forEach(ci -> collectPublicTypes(ci, temp, combinedIndex)); types.addAll(temp);