Skip to content

Commit

Permalink
fix cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
dufoli committed Aug 26, 2021
1 parent fb6efb7 commit cf41df5
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.util.Set;
import java.util.stream.Stream;

import javax.inject.Inject;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.annotation.XmlAccessOrder;
import javax.xml.bind.annotation.XmlAccessorType;
Expand Down Expand Up @@ -121,9 +120,6 @@ class JaxbProcessor {
private static final List<DotName> IGNORE_TYPES = Collections
.singletonList(DotName.createSimple("javax.xml.datatype.XMLGregorianCalendar"));

@Inject
ApplicationArchivesBuildItem applicationArchivesBuildItem;

@BuildStep
void processAnnotationsAndIndexFiles(
BuildProducer<NativeImageSystemPropertyBuildItem> nativeImageProps,
Expand All @@ -134,7 +130,8 @@ void processAnnotationsAndIndexFiles(
BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
BuildProducer<NativeImageResourceBuildItem> resource,
BuildProducer<NativeImageResourceBundleBuildItem> resourceBundle,
BuildProducer<RuntimeInitializedClassBuildItem> runtimeClasses) {
BuildProducer<RuntimeInitializedClassBuildItem> runtimeClasses,
ApplicationArchivesBuildItem applicationArchivesBuildItem) {

IndexView index = combinedIndexBuildItem.getIndex();

Expand Down Expand Up @@ -194,7 +191,7 @@ void processAnnotationsAndIndexFiles(
produceRecursiveProxies(index, typedXmlWriterDN, proxyDefinitions, proxiesCreated);

for (JaxbFileRootBuildItem i : fileRoots) {
try (Stream<Path> stream = iterateResources(i.getFileRoot())) {
try (Stream<Path> stream = iterateResources(applicationArchivesBuildItem, i.getFileRoot())) {
stream.filter(p -> p.getFileName().toString().equals("jaxb.index"))
.forEach(p1 -> handleJaxbFile(p1, resource, reflectiveClass));
}
Expand Down Expand Up @@ -298,7 +295,7 @@ private void handleJaxbFile(Path p, BuildProducer<NativeImageResourceBuildItem>
}
}

private Stream<Path> iterateResources(String path) {
private Stream<Path> iterateResources(ApplicationArchivesBuildItem applicationArchivesBuildItem, String path) {
return applicationArchivesBuildItem.getAllApplicationArchives().stream()
.map(arch -> arch.getChildPath(path))
.filter(p -> p != null && Files.isDirectory(p))
Expand Down

0 comments on commit cf41df5

Please sign in to comment.