[jboss-jira] [JBoss JIRA] (WFLY-9597) UndertowSubsystemParser_5_0 could be instantiated twice: once as a reader and once as a writer
Paul Ferraro (JIRA)
issues at jboss.org
Tue Dec 5 18:15:00 EST 2017
[ https://issues.jboss.org/browse/WFLY-9597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497648#comment-13497648 ]
Paul Ferraro commented on WFLY-9597:
------------------------------------
If we're concerned about metaspace costs, we should consider eliminating the need for each consumer of PersistentResourceDefinition to create subclasses of PersistentResourceXmlParser per version (since these classes are loaded regardless of whether they are instantiated). Additionally, the PersistentResourceXmlParser subclasses for non-current versions unnecessarily implement XMLElementWriter<ModelNode>, the implementations of which are never used.
Instead, we could create 2 concrete classes, let's call them PersistentResourceXmlReader and PersistentResourceXMLWriter, each constructed with a version specific PersistentResourceXMLDescription (or Supplier<PersistentResourceXMLDescription>). This way the PersistentResourceXMLDescription is still shared across writer and current reader, and we don't need all those extra subclasses per version per subsystem.
> UndertowSubsystemParser_5_0 could be instantiated twice: once as a reader and once as a writer
> ----------------------------------------------------------------------------------------------
>
> Key: WFLY-9597
> URL: https://issues.jboss.org/browse/WFLY-9597
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Reporter: Radoslav Husar
> Assignee: Tomaz Cerar
>
> The org.wildfly.extension.undertow.UndertowSubsystemParser_5_0#xmlDescription could be created twice, the first and last line in the diff should return the same instance or use different approach: https://github.com/rhusar/wildfly/blob/7dbc8bd0c8bcdae5db61ecdff1484a422cf4b92c/undertow/src/main/java/org/wildfly/extension/undertow/UndertowExtension.java#L100-L113
> Most likely the same issue is in multiple places.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list