elharo opened a new pull request, #137:
URL: https://github.com/apache/xerces-j/pull/137

   ## Summary
   
   Fixes [XERCESJ-1453](https://issues.apache.org/jira/browse/XERCESJ-1453).
   
   Removes extraneous `String.intern()` calls on string literals and other 
compile-time constant expressions. The Java Language Specification (section 
3.10.5) guarantees that string literals are already interned, so these calls 
have no semantic effect, clutter the code, and can prevent the fields from 
being treated as compile-time constants.
   
   Affected files:
   
   * `Constants.java`
   * `XMLEntityManager.java`
   * `XMLScanner.java`
   * `XMLVersionDetector.java`
   * `DFAContentModel.java`
   * `QNameDV.java`
   * `XPath.java`
   * `SchemaGrammar.java`
   * `SchemaSymbols.java`
   * `XMLSymbols.java`
   * `XIncludeHandler.java`
   * `NamespaceContext.java`
   
   In `DFAContentModel`, the two special strings are now `static final` 
compile-time constants and the static initializer that only called `intern()` 
was removed. In `XIncludeHandler`, the `intern()` calls on concatenations of 
now-constant literals were also removed.
   
   The remaining `.intern()` calls operate on non-constant values (variables, 
`new String(...)`, `StringBuilder.toString()`) and are intentionally left in 
place.
   
   ## Testing
   
   `ant test` passes.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to