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

    https://github.com/apache/jena/pull/237#discussion_r116373375
  
    --- Diff: jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java 
---
    @@ -774,19 +772,10 @@ private static int compare(NodeValue nv1, NodeValue 
nv2, boolean sortOrderingCom
                 }
                 case VSPACE_SORTKEY :
                 {
    -                int cmp = 0;
    -                String c1 = nv1.getCollation();
    -                String c2 = nv2.getCollation();
    -                if (c1 != null && c2 != null && c1.equals(c2)) {
    -                    // locales are parsed. Here we could think about 
caching if necessary
    -                    Locale desiredLocale = Locale.forLanguageTag(c1);
    -                    // collators are already stored in a concurrent map by 
the JVM, with <locale, softref<collator>>
    -                    Collator collator = 
Collator.getInstance(desiredLocale);
    -                    cmp = collator.compare(nv1.getString(), 
nv2.getString());
    -                } else {
    -                    cmp = XSDFuncOp.compareString(nv1, nv2) ;
    +                if (!(nv1 instanceof NodeValueSortKey) || !(nv2 instanceof 
NodeValueSortKey)) {
    +                    raise(new ExprNotComparableException("Can't compare 
(not node value sort keys) "+nv1+" and "+nv2)) ;
    --- End diff --
    
    Agree, right now there is no way of that happening, as the value space for 
sort keys is returned only when both node values are `NodeSortKey`s. Added more 
to prevent bugs in case anyone ever changed the function returning the value 
space.
    
    Should we remove it?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to