Sorting changed from version 5

Started by ErikR, October 26, 2023, 09:47:57 AM

Previous topic - Next topic

ErikR

Hi,

I use numbers in folder and views to arrange them in a logical order and trusts the Sorting mechanism to order the correctly.

For example:
10. Business motivation
20. Business view
30. Application view

Sometimes I need to add a second view in an area or a sub view;
10.10. Business motivation from Sales point of view

and expects the order to be:
10. Business motivation
10.10. Business motivation from Sales point of view
20. Business view
30. Application view

This works because space " " has ASCII-value 32 and is before . that in turn is before numbers before characters.


Since version 5 space seems to be sorted differently or perhaps ignored, I don't know.
The above now orders:
10.10. Business motivation from Sales point of view
10. Business motivation
20. Business view
30. Application view

and I have to change 10. to 10.00 in order to make it work.

What has happened and why is space not sorted according to the asci table (which is the same for UTF-8 as I understand it)?

Am I supposed to report a bug or is this intentional?

BR
Erik

Phil Beauvoir

#1
Hi Erik,

since Archi 5.0 all trees, tables and lists use lexical string comparison based on locale. Internally, this means using the Java Collator instance to compare strings. Before this some foreign words were shown at the end of the list. For example, with "état":

every
fence
état

And now is:

état
every
fence

It seems that Collator ignores spaces. See https://stackoverflow.com/questions/16567287/java-collation-ignores-space
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

ErikR

The article also mentions how to add a rule for including space again.....

Phil Beauvoir

Quote from: ErikR on October 26, 2023, 11:49:04 AMThe article also mentions how to add a rule for including space again.....

Yes, but that is an example for Czech language. I'm not sure if it will work for all locales, and there are quite a few instances in Archi where the Collator is used.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.