Skip to content

Commit

Permalink
Fix #115: MyFaces AbstractAttributeMap
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Sep 15, 2023
1 parent 850d9c9 commit 1aa4d49
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ jobs:
- name: Build with Maven
run: mvn -B clean install -Dno-format

# - name: Build with Maven (Native)
# run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
- name: Build with Maven (Native)
run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveCla
classNames.addAll(collectClassesInPackage(combinedIndex, "org.omnifaces.el.functions"));
// All utilities
classNames.addAll(collectClassesInPackage(combinedIndex, "org.omnifaces.util"));
// MyFaces
classNames.addAll(collectImplementors(combinedIndex, Map.Entry.class.getName()));

reflectiveClass.produce(ReflectiveClassBuildItem.builder(classNames.toArray(new String[0])).methods(true).build());
reflectiveClass.produce(
ReflectiveClassBuildItem.builder(classNames.toArray(new String[0])).methods(true).fields(true).build());
}

@Record(ExecutionTime.STATIC_INIT)
Expand Down Expand Up @@ -247,7 +250,17 @@ private List<String> collectSubclasses(CombinedIndexBuildItem combinedIndex, Str
.stream()
.map(ClassInfo::toString)
.collect(Collectors.toList());
classes.add(className);
return classes;
}

}
public List<String> collectImplementors(CombinedIndexBuildItem combinedIndex, String className) {
List<String> classes = combinedIndex.getIndex()
.getAllKnownImplementors(DotName.createSimple(className))
.stream()
.map(ClassInfo::toString)
.collect(Collectors.toList());
classes.add(className);
return classes;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ public class OmniFacesFeature implements Feature {
public void afterRegistration(AfterRegistrationAccess access) {
final RuntimeClassInitializationSupport runtimeInit = ImageSingletons.lookup(RuntimeClassInitializationSupport.class);

runtimeInit.initializeAtRunTime("org.apache.myfaces.util.lang.ThreadsafeXorShiftRandom", REASON);
runtimeInit.initializeAtRunTime("org.omnifaces.config.WebXmlSingleton", REASON);
}

@Override
public String getDescription() {
return REASON;
}
}
}

0 comments on commit 1aa4d49

Please sign in to comment.