-
Notifications
You must be signed in to change notification settings - Fork 234
JCR-5195: Utilities for 'safe' creation of XML document builders #298
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
Conversation
…do changes in classes not ready
| /** | ||
| * @return a "safe" {@link DocumentBuilderFactory} | ||
| */ | ||
| public static DocumentBuilderFactory documentBuilderFactory() { |
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.
| public static DocumentBuilderFactory documentBuilderFactory() { | |
| public static DocumentBuilderFactory safeDocumentBuilderFactory() { | |
jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/xml/Factory.java
Outdated
Show resolved
Hide resolved
| /** | ||
| * Factory for "safe" instances of XML parsers (wrt XXE etc.). | ||
| */ | ||
| public class Factories { |
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.
I would still go for a more specific classname. Otherwise things like "Organize Imports" might easily return a clashing class with same generic name. Same reason why XMLConstants in javax.xml is not just named Constants
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.
What's (to me) is more convincing is:
$ find . -name *XML*.java
./jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java
./jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DefaultXMLExcerpt.java
./jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WeightedXMLExcerpt.java
./jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/XMLChar.java
./jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/XMLUtil.java
./jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/XMLChar.java
But the result is the same...
…name Factory class again
|



Bikeshedding of class and method names expected :-)
EDIT: unfortunately, we indeed have cases where entity resolution currently is needed; *ConfigurationParser and SearchIndex.