Skip to content

Conversation

@reschke
Copy link
Contributor

@reschke reschke commented Oct 2, 2025

Bikeshedding of class and method names expected :-)

EDIT: unfortunately, we indeed have cases where entity resolution currently is needed; *ConfigurationParser and SearchIndex.

@reschke reschke self-assigned this Oct 2, 2025
@reschke reschke requested review from kwin and mbaedke October 2, 2025 15:11
@reschke reschke marked this pull request as draft October 2, 2025 15:20
/**
* @return a "safe" {@link DocumentBuilderFactory}
*/
public static DocumentBuilderFactory documentBuilderFactory() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public static DocumentBuilderFactory documentBuilderFactory() {
public static DocumentBuilderFactory safeDocumentBuilderFactory() {

@reschke reschke requested a review from kwin October 6, 2025 13:40
@reschke reschke marked this pull request as ready for review October 6, 2025 13:40
/**
* Factory for "safe" instances of XML parsers (wrt XXE etc.).
*/
public class Factories {
Copy link
Member

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

Copy link
Contributor Author

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...

@reschke reschke requested a review from kwin October 7, 2025 06:00
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 7, 2025

@reschke reschke merged commit 2a28fcc into trunk Oct 7, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants