Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WFLY-8656: External bean archives - support all bean discovery modes. #10649

Merged
merged 2 commits into from Nov 16, 2017

Conversation

mkouba
Copy link
Contributor

@mkouba mkouba commented Nov 9, 2017

@jmesnil
Copy link
Member

jmesnil commented Nov 13, 2017

retest this please

@stuartwdouglas
Copy link
Contributor

Retest this please

}
};
} else {
// Build ClassInfo on the fly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may have already built this and placed it under the org.jboss.as.server.deployment.Attachments#ADDITIONAL_ANNOTATION_INDEXES_BY_MODULE key if annotations are imported, it would be better to re-use this rather than building it again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, but we only build the index if no META-INF/jandex.idx is found in exported resources for a specific beans.xml. Also it seems Attachments.ADDITIONAL_ANNOTATION_INDEXES_BY_MODULE only contains indexes for modules where META-INF/jandex.idx exists and annotations are imported.

Attachments.COMPOSITE_ANNOTATION_INDEX probably contains indexes from all deployment module dependencies (loaded or calculated on the fly). Shouldn't we use this instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it will build an index if it does not exist (previous versions this was not the case, but we changed this a while ago to remove the need to manually index external modules, although this does only happen when annotations are imported).

Looking at the current implementation a bit closed I can see this actually won't work though, as it indexes the module as a whole while you are just looking at each jar individually, so the current implementation is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it will build...

I think it's built but not added to Attachments.ADDITIONAL_ANNOTATION_INDEXES_BY_MODULE, only to Attachments.COMPOSITE_ANNOTATION_INDEX:
https://github.com/wildfly/wildfly-core/blob/master/server/src/main/java/org/jboss/as/server/deployment/annotation/CompositeIndexProcessor.java#L101

...so the current implementation is fine

OK

Indexer indexer = new Indexer();
consumer = (name, classFile) -> {
try {
ClassInfo classInfo = indexer.index(classFile.openStream());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not look like this stream is closed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I'll fix it right away. Thanks!

@stuartwdouglas stuartwdouglas added the ready-for-merge Only for use by those with merge permissions! label Nov 15, 2017
@stuartwdouglas stuartwdouglas merged commit 820f572 into wildfly:master Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Only for use by those with merge permissions!
Projects
None yet
4 participants