You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2009/10/19 04:26:31 UTC

[jira] Created: (LANG-540) Make NumericEntityEscaper immutable

Make NumericEntityEscaper immutable
-----------------------------------

                 Key: LANG-540
                 URL: https://issues.apache.org/jira/browse/LANG-540
             Project: Commons Lang
          Issue Type: Improvement
            Reporter: Sebb
             Fix For: 3.0
         Attachments: NumericEntityEscaper.patch

NumericEntityEscaper is currently mutable and not thread-safe.

It can easily be made immutable (and thus thread-safe) by using a private constructor to set the instance fields.

See patch to follow.

A similar approach can be used for some of the other classes in the translate package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-540) Make NumericEntityEscaper immutable

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated LANG-540:
----------------------

    Attachment: LookupTranslator.patch
                NumericEntityEscaper.patch

Can also make private fields in LookupTranslator class final; see attached patch

> Make NumericEntityEscaper immutable
> -----------------------------------
>
>                 Key: LANG-540
>                 URL: https://issues.apache.org/jira/browse/LANG-540
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 3.0
>
>         Attachments: LookupTranslator.patch, NumericEntityEscaper.patch, NumericEntityEscaper.patch
>
>
> NumericEntityEscaper is currently mutable and not thread-safe.
> It can easily be made immutable (and thus thread-safe) by using a private constructor to set the instance fields.
> See patch to follow.
> A similar approach can be used for some of the other classes in the translate package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (LANG-540) Make NumericEntityEscaper immutable

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-540.
------------------------------

    Resolution: Fixed

svn ci -m "Applying Sebb's patch from LANG-540 making the NumericEntityEscaper class immutable"
Sending        src/java/org/apache/commons/lang/text/translate/NumericEntityEscaper.java
Transmitting file data .
Committed revision 826947.

> Make NumericEntityEscaper immutable
> -----------------------------------
>
>                 Key: LANG-540
>                 URL: https://issues.apache.org/jira/browse/LANG-540
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 3.0
>
>         Attachments: NumericEntityEscaper.patch
>
>
> NumericEntityEscaper is currently mutable and not thread-safe.
> It can easily be made immutable (and thus thread-safe) by using a private constructor to set the instance fields.
> See patch to follow.
> A similar approach can be used for some of the other classes in the translate package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-540) Make NumericEntityEscaper immutable

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated LANG-540:
----------------------

    Attachment: NumericEntityEscaper.patch

> Make NumericEntityEscaper immutable
> -----------------------------------
>
>                 Key: LANG-540
>                 URL: https://issues.apache.org/jira/browse/LANG-540
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 3.0
>
>         Attachments: NumericEntityEscaper.patch
>
>
> NumericEntityEscaper is currently mutable and not thread-safe.
> It can easily be made immutable (and thus thread-safe) by using a private constructor to set the instance fields.
> See patch to follow.
> A similar approach can be used for some of the other classes in the translate package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (LANG-540) Make NumericEntityEscaper immutable

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-540.
------------------------------

    Resolution: Fixed

Two patches and line to NumericEntityEscaper added:

------------------------------------------------------------------------
r828944 | bayard | 2009-10-22 23:46:02 -0700 (Thu, 22 Oct 2009) | 1 line
Changed paths:
   M /commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/UnicodeEscaper.java

Making the private fields final via Sebb's patch from LANG-540
------------------------------------------------------------------------
r828943 | bayard | 2009-10-22 23:44:45 -0700 (Thu, 22 Oct 2009) | 1 line
Changed paths:
   M /commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/LookupTranslator.java

Making private fields final per Sebb's patch to LANG-540
------------------------------------------------------------------------
r828942 | bayard | 2009-10-22 23:43:26 -0700 (Thu, 22 Oct 2009) | 1 line
Changed paths:
   M /commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/NumericEntityEscaper.java

Adding back the empty constructor per Sebb's comment on LANG-540

> Make NumericEntityEscaper immutable
> -----------------------------------
>
>                 Key: LANG-540
>                 URL: https://issues.apache.org/jira/browse/LANG-540
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 3.0
>
>         Attachments: LookupTranslator.patch, NumericEntityEscaper.patch, UnicodeEscaper.patch
>
>
> NumericEntityEscaper is currently mutable and not thread-safe.
> It can easily be made immutable (and thus thread-safe) by using a private constructor to set the instance fields.
> See patch to follow.
> A similar approach can be used for some of the other classes in the translate package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (LANG-540) Make NumericEntityEscaper immutable

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb reopened LANG-540:
-----------------------


I've just realised that my patch removed the default public constructor.
This can be remedied by adding:

    public NumericEntityEscaper(){
        this(0, Integer.MAX_VALUE, true);
    }


Also, a similar patch can be applied to UnicodeEscaper, patch to follow.


> Make NumericEntityEscaper immutable
> -----------------------------------
>
>                 Key: LANG-540
>                 URL: https://issues.apache.org/jira/browse/LANG-540
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 3.0
>
>         Attachments: NumericEntityEscaper.patch
>
>
> NumericEntityEscaper is currently mutable and not thread-safe.
> It can easily be made immutable (and thus thread-safe) by using a private constructor to set the instance fields.
> See patch to follow.
> A similar approach can be used for some of the other classes in the translate package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-540) Make NumericEntityEscaper immutable

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated LANG-540:
----------------------

    Attachment: LookupTranslator.patch
                UnicodeEscaper.patch

Wrong files uploaded

> Make NumericEntityEscaper immutable
> -----------------------------------
>
>                 Key: LANG-540
>                 URL: https://issues.apache.org/jira/browse/LANG-540
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 3.0
>
>         Attachments: LookupTranslator.patch, NumericEntityEscaper.patch, UnicodeEscaper.patch
>
>
> NumericEntityEscaper is currently mutable and not thread-safe.
> It can easily be made immutable (and thus thread-safe) by using a private constructor to set the instance fields.
> See patch to follow.
> A similar approach can be used for some of the other classes in the translate package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-540) Make NumericEntityEscaper immutable

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated LANG-540:
----------------------

    Attachment:     (was: NumericEntityEscaper.patch)

> Make NumericEntityEscaper immutable
> -----------------------------------
>
>                 Key: LANG-540
>                 URL: https://issues.apache.org/jira/browse/LANG-540
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 3.0
>
>         Attachments: NumericEntityEscaper.patch
>
>
> NumericEntityEscaper is currently mutable and not thread-safe.
> It can easily be made immutable (and thus thread-safe) by using a private constructor to set the instance fields.
> See patch to follow.
> A similar approach can be used for some of the other classes in the translate package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-540) Make NumericEntityEscaper immutable

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated LANG-540:
----------------------

    Attachment:     (was: NumericEntityEscaper.patch)

> Make NumericEntityEscaper immutable
> -----------------------------------
>
>                 Key: LANG-540
>                 URL: https://issues.apache.org/jira/browse/LANG-540
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 3.0
>
>         Attachments: NumericEntityEscaper.patch
>
>
> NumericEntityEscaper is currently mutable and not thread-safe.
> It can easily be made immutable (and thus thread-safe) by using a private constructor to set the instance fields.
> See patch to follow.
> A similar approach can be used for some of the other classes in the translate package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-540) Make NumericEntityEscaper immutable

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated LANG-540:
----------------------

    Attachment: NumericEntityEscaper.patch

> Make NumericEntityEscaper immutable
> -----------------------------------
>
>                 Key: LANG-540
>                 URL: https://issues.apache.org/jira/browse/LANG-540
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 3.0
>
>         Attachments: NumericEntityEscaper.patch
>
>
> NumericEntityEscaper is currently mutable and not thread-safe.
> It can easily be made immutable (and thus thread-safe) by using a private constructor to set the instance fields.
> See patch to follow.
> A similar approach can be used for some of the other classes in the translate package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-540) Make NumericEntityEscaper immutable

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated LANG-540:
----------------------

    Attachment:     (was: LookupTranslator.patch)

> Make NumericEntityEscaper immutable
> -----------------------------------
>
>                 Key: LANG-540
>                 URL: https://issues.apache.org/jira/browse/LANG-540
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 3.0
>
>         Attachments: NumericEntityEscaper.patch
>
>
> NumericEntityEscaper is currently mutable and not thread-safe.
> It can easily be made immutable (and thus thread-safe) by using a private constructor to set the instance fields.
> See patch to follow.
> A similar approach can be used for some of the other classes in the translate package.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.