-
Notifications
You must be signed in to change notification settings - Fork 467
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
try (AbstractExtensionParsingContext context = this.enables(extension) ? new ExtensionParsingContextImpl(moduleName, xmlMapper) : new UnstableExtensionParsingContext(moduleName, xmlMapper)) { | ||
extension.initializeParsers(context); | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
… of unsupported stability.
…evel of the process.
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.