[ 
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.

Reply via email to