You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Dirk Moebius (JIRA)" <ji...@apache.org> on 2010/04/29 13:41:54 UTC

[jira] Created: (PIVOT-486) TableView.setSort(String) doesn't work

TableView.setSort(String) doesn't work
--------------------------------------

                 Key: PIVOT-486
                 URL: https://issues.apache.org/jira/browse/PIVOT-486
             Project: Pivot
          Issue Type: Bug
          Components: wtk
    Affects Versions: 1.5
            Reporter: Dirk Moebius


private method TableView.parseSort(String json) has this line:

            Dictionary.Pair<String, SortDirection> pair =
                new Dictionary.Pair<String, SortDirection>((String)map.get(COLUMN_NAME_KEY),
                    SortDirection.valueOf(((String)map.get(SORT_DIRECTION_KEY)).toLowerCase()));

The enum value for SortDirection cannot be found. Must be changed to toUpperCase().


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


[jira] Updated: (PIVOT-486) TableView.setSort(String) doesn't work

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

Dirk Moebius updated PIVOT-486:
-------------------------------

    Attachment: pivot-486-TableView-setSort.patch

The attached file fixes this issue.

You might wonder why I used "toUpperCase(Locale.US)" instead of "toUpperCase()". This is because in some locales the upperCase of a Unicode glyph is not the same as you might expect by uppercasing an ASCII character. E.g. in the turkish locale, the Unicode uppercase of 'i' is 'İ' (an 'I' with a dot above!), so uppercasing the word "ascending" would lead to "ASCENDİNG", not "ASCENDING", and the enum value would still not be found.

Using toUpperCase(Locale.US) ensures that as long as all chars are below 256, the correct ASCII uppercase value will be used.

Come to think about it, you'd better check all usages of toUpperCase() and toLowerCase() in Pivot, otherwise Pivot won't work in Turkey, Iceland etc. at all.

> TableView.setSort(String) doesn't work
> --------------------------------------
>
>                 Key: PIVOT-486
>                 URL: https://issues.apache.org/jira/browse/PIVOT-486
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 1.5
>            Reporter: Dirk Moebius
>         Attachments: pivot-486-TableView-setSort.patch
>
>
> private method TableView.parseSort(String json) has this line:
>             Dictionary.Pair<String, SortDirection> pair =
>                 new Dictionary.Pair<String, SortDirection>((String)map.get(COLUMN_NAME_KEY),
>                     SortDirection.valueOf(((String)map.get(SORT_DIRECTION_KEY)).toLowerCase()));
> The enum value for SortDirection cannot be found. Must be changed to toUpperCase().

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


[jira] Resolved: (PIVOT-486) TableView.setSort(String) doesn't work

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

Greg Brown resolved PIVOT-486.
------------------------------

    Fix Version/s: 1.5
       Resolution: Fixed

I resolved the specific issue with TableView. I think we should create a new ticket to track the locale issue, since it will be a much bigger change (and is technically a different issue).


> TableView.setSort(String) doesn't work
> --------------------------------------
>
>                 Key: PIVOT-486
>                 URL: https://issues.apache.org/jira/browse/PIVOT-486
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 1.5
>            Reporter: Dirk Moebius
>             Fix For: 1.5
>
>         Attachments: pivot-486-TableView-setSort.patch
>
>
> private method TableView.parseSort(String json) has this line:
>             Dictionary.Pair<String, SortDirection> pair =
>                 new Dictionary.Pair<String, SortDirection>((String)map.get(COLUMN_NAME_KEY),
>                     SortDirection.valueOf(((String)map.get(SORT_DIRECTION_KEY)).toLowerCase()));
> The enum value for SortDirection cannot be found. Must be changed to toUpperCase().

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


[jira] Commented: (PIVOT-486) TableView.setSort(String) doesn't work

Posted by "Dirk Moebius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862195#action_12862195 ] 

Dirk Moebius commented on PIVOT-486:
------------------------------------

Thanks for fixing. For the locale issue I opened PIVOT-487.

> TableView.setSort(String) doesn't work
> --------------------------------------
>
>                 Key: PIVOT-486
>                 URL: https://issues.apache.org/jira/browse/PIVOT-486
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 1.5
>            Reporter: Dirk Moebius
>             Fix For: 1.5
>
>         Attachments: pivot-486-TableView-setSort.patch
>
>
> private method TableView.parseSort(String json) has this line:
>             Dictionary.Pair<String, SortDirection> pair =
>                 new Dictionary.Pair<String, SortDirection>((String)map.get(COLUMN_NAME_KEY),
>                     SortDirection.valueOf(((String)map.get(SORT_DIRECTION_KEY)).toLowerCase()));
> The enum value for SortDirection cannot be found. Must be changed to toUpperCase().

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