Github user rvesse commented on a diff in the pull request:

    https://github.com/apache/jena/pull/237#discussion_r111201417
  
    --- Diff: jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java 
---
    @@ -784,10 +786,15 @@ private static int compare(NodeValue nv1, NodeValue 
nv2, boolean sortOrderingCom
                         return x ;
                     }
     
    -                // same lang tag (case insensitive)
    -                x = StrUtils.strCompare(node1.getLiteralLexicalForm(), 
node2.getLiteralLexicalForm()) ;
    +                // same lang tag, handle collation
    +                // TBD: cache locales? cache collators? pre define 
both/any? a simple in-memory lru-map-cache?
    +                Locale desiredLocale = 
Locale.forLanguageTag(node1.getLiteralLanguage());
    +                Collator collator = Collator.getInstance(desiredLocale);
    --- End diff --
    
    This needs to be much more defensively coded. Language tags are not 
constrained to be valid languages so they could be no locale or collation 
associated with a given tag to make sure that we fall back to the existing 
behaviour for unknown languages


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to