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

[WFCORE-6741] [WFCORE-6652] Improve user experience when using extension or namespace of unsupported stability. #5899

Merged
merged 3 commits into from
Mar 18, 2024

Conversation

pferraro
Copy link
Contributor

@pferraro pferraro commented Mar 11, 2024

https://issues.redhat.com/browse/WFCORE-6652
https://issues.redhat.com/browse/WFCORE-6741

Rather than skip parser registration of unsupported extensions (or unsupported schemas of a supported extension) entirely, register its namespaces using a placeholder parser throwing an informative message.

@github-actions github-actions bot added the deps-ok Dependencies have been checked, and there are no significant changes label Mar 11, 2024
@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

Comment on lines +351 to +353
try (AbstractExtensionParsingContext context = this.enables(extension) ? new ExtensionParsingContextImpl(moduleName, xmlMapper) : new UnstableExtensionParsingContext(moduleName, xmlMapper)) {
extension.initializeParsers(context);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Autocloseable interface is used to mark objects that could hold resources, here it is used to invoke the ExtensionParsingContext#attemptCurrentParserInitialization(), since the abstract class does nothing on its close() method.

Is that usage correct? It looks inappropriate. I don't see where ExtensionParsingContext#attemptCurrentParserInitialization() was trying to release resources that can justify the movement to an Autocloseable.close() implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • An extension parsing context could hold resources.
  • The JDK itself implements AutoCloseable for objects that do not "hold resources" in the traditional sense, but that have a defined lifecycle, e.g. DoubleStream, IntStream, LongStream, Stream, etc.
  • The usage here is an internal implementation detail of the private class and is not publicly exposed.

@yersan yersan added the ready-for-merge This PR is ready to be merged and fulfills all requirements label Mar 18, 2024
@yersan yersan changed the title WFCORE-6652 Improve user experience when using extension or namespace of unsupported stability. [WFCORE-6741] [WFCORE-6652] Improve user experience when using extension or namespace of unsupported stability. Mar 18, 2024
@yersan yersan merged commit 9e50fa6 into wildfly:main Mar 18, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps-ok Dependencies have been checked, and there are no significant changes ready-for-merge This PR is ready to be merged and fulfills all requirements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants