You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org> on 2010/06/21 04:51:24 UTC
[jira] Assigned: (XERCESJ-1453) Remove extraneous intern() calls on
String literals
[ https://issues.apache.org/jira/browse/XERCESJ-1453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Glavassevich reassigned XERCESJ-1453:
---------------------------------------------
Assignee: Michael Glavassevich
> Remove extraneous intern() calls on String literals
> ---------------------------------------------------
>
> Key: XERCESJ-1453
> URL: https://issues.apache.org/jira/browse/XERCESJ-1453
> Project: Xerces2-J
> Issue Type: Improvement
> Components: Other
> Affects Versions: 2.10.0
> Environment: All.
> Reporter: Michael Ernst
> Assignee: Michael Glavassevich
> Priority: Minor
> Attachments: xerces-j-remove-unnecessary-interning.diff
>
> Original Estimate: 0.08h
> Remaining Estimate: 0.08h
>
> Xerces contains 159 unnecessary calls to String.intern(); for
> example,
> private static final String fAndSymbol = "and".intern();
> should be
> private static final String fAndSymbol = "and";
> These calls are unnecessary because the Java Language Specification,
> section 3.10.5, guarantees that every String literal in the program is
> already interned
> (http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.5).
> Therefore, the calls have no semantic effect and serve no positive purpose.
> However, they do have some negative consequences:
> * They clutter the code.
> * They are confusing to anyone who reads them and wonders why the
> extraneous calls are being made.
> * They may disable compiler optimizations (because the fields are not
> initialized to a compile-time constant).
> Therefore, it would be best to remove the extraneous calls to intern().
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org