You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "pavelsalamon (via GitHub)" <gi...@apache.org> on 2024/08/28 16:14:32 UTC
[PR] [WSCOMMONS-578] StackOverflowError occurs in XmlSchema.getAllSchemas() [ws-xmlschema]
pavelsalamon opened a new pull request, #59:
URL: https://github.com/apache/ws-xmlschema/pull/59
Fixes this bug in XmlSchemaSerializer: [WSCOMMONS-578](https://issues.apache.org/jira/browse/WSCOMMONS-578)
We've been using this modification for many years, I'd like to get it upstream.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
Re: [PR] [WSCOMMONS-578] StackOverflowError occurs in XmlSchema.getAllSchemas() [ws-xmlschema]
Posted by "pavelsalamon (via GitHub)" <gi...@apache.org>.
pavelsalamon commented on code in PR #59:
URL: https://github.com/apache/ws-xmlschema/pull/59#discussion_r1759089604
##########
xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java:
##########
@@ -72,6 +74,11 @@ public XmlSchemaSerializerException(String msg) {
public static final String XSD_NAMESPACE = XMLConstants.W3C_XML_SCHEMA_NS_URI;
private static final String XMLNS_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/";
+ /**
+ * Keeps track of already serialized schemas.
+ */
+ private static ThreadLocal<Set<XmlSchema>> serializedSchemaElements = new ThreadLocal<>();
Review Comment:
I believe so.
When imports are used, new instances of `XmlSchemaSerializer` are created for them so we need to share the same `Set<XmlSchema>` between multiple instances of serializer. That's why `static` is used.
But we don't want to share the same `Set<XmlSchema>` globally between all threads that are potentially serializing something in the same JVM. That leads to `ThreadLocal`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
Re: [PR] [WSCOMMONS-578] StackOverflowError occurs in XmlSchema.getAllSchemas() [ws-xmlschema]
Posted by "zhangjunc (via GitHub)" <gi...@apache.org>.
zhangjunc commented on PR #59:
URL: https://github.com/apache/ws-xmlschema/pull/59#issuecomment-3350437225
Is XML Schema still under maintenance, and when will the new version be released?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
Re: [PR] [WSCOMMONS-578] StackOverflowError occurs in XmlSchema.getAllSchemas() [ws-xmlschema]
Posted by "coheigea (via GitHub)" <gi...@apache.org>.
coheigea merged PR #59:
URL: https://github.com/apache/ws-xmlschema/pull/59
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org
Re: [PR] [WSCOMMONS-578] StackOverflowError occurs in XmlSchema.getAllSchemas() [ws-xmlschema]
Posted by "veithen (via GitHub)" <gi...@apache.org>.
veithen commented on code in PR #59:
URL: https://github.com/apache/ws-xmlschema/pull/59#discussion_r1757233056
##########
xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java:
##########
@@ -72,6 +74,11 @@ public XmlSchemaSerializerException(String msg) {
public static final String XSD_NAMESPACE = XMLConstants.W3C_XML_SCHEMA_NS_URI;
private static final String XMLNS_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/";
+ /**
+ * Keeps track of already serialized schemas.
+ */
+ private static ThreadLocal<Set<XmlSchema>> serializedSchemaElements = new ThreadLocal<>();
Review Comment:
Do we really need a `ThreadLocal` for this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org