You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Andrey-Khobnya <gi...@git.apache.org> on 2014/04/13 16:07:01 UTC

[GitHub] commons-lang pull request: Fix LANG-948

GitHub user Andrey-Khobnya opened a pull request:

    https://github.com/apache/commons-lang/pull/19

    Fix LANG-948

    Hi all!
    This is fix for bug LANG-948.
    
    Changes with explanations:
    1) Method ```ExtendedMessageFormat.appendQuotedString()``` returned when finds first quote character. This is obviously wrong because quoted string start with quote character and method must consume whole quoted string. I added handling of first quote character at the beginning of method. Also, it doesn't make sense to handle escaped quotes because ```super.applyPattern(stripCustom.toString())``` will called below in ```applyPattern()```. Thus, last argument should be ```false``` when calling ```appendQuotedString()```.
    
    2) Quoted string must start with quote character in ```appendQuotedString()```. And at this moment method is used this way. I added assertion to check and document this.
    
    3) Thus, method ```appendQuotedString()``` is called with last argument always ```false```. It doesn't make sense to handle escaped quotes in ```appendQuotedString()``` because they will be handled in ```super.applyPattern()```. Thus, I deleted this parameter and code for handling escaped quotes.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Andrey-Khobnya/commons-lang fix-948

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/19.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #19
    
----
commit 86e64df6ce7e879c5f608aa7276c251377574f56
Author: Andrey Khobnya <an...@khobnya.me>
Date:   2014-04-13T12:36:07Z

    Fix LANG-948

commit 0f9222d5cccbe27fbda5ab9b97b231162e4b089b
Author: Andrey Khobnya <an...@khobnya.me>
Date:   2014-04-13T12:42:02Z

    Add assertion in ExtendedMessageFormat.appendQuotedString() to check and
    document proper usage

commit 4d372f3ce65087c8863332c74c2563a165d7aa12
Author: Andrey Khobnya <an...@khobnya.me>
Date:   2014-04-13T12:49:28Z

    It doesn't make sense to handle escaped quotes in
    ExtendedMessageFormat.appendQuotedString() because they will be handled
    in super.applyPattern()

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-lang pull request: Fix LANG-948

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/commons-lang/pull/19


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org