afs commented on code in PR #2134:
URL: https://github.com/apache/jena/pull/2134#discussion_r1436562081


##########
jena-arq/src/test/java/org/apache/jena/sparql/expr/TestExpressions.java:
##########
@@ -346,9 +346,29 @@ public class TestExpressions
     @Test public void boolean_126() { testBoolean("datatype('fred') = 
<"+XSD.xstring.getURI()+">", true) ; }
     @Test public void boolean_127() { 
testBoolean("datatype('fred'^^<urn:test:foo>) = <urn:test:foo>", true) ; }
     @Test public void boolean_128() { testBoolean("datatype('fred'^^<foo>) = 
<Foo>", false) ; }
-    @Test public void string_15() { testString("lang('fred'@en)", "en") ; }
-    @Test public void string_16() { testString("lang('fred'@en-uk)", "en-uk") 
; }
-    @Test public void string_17() { testString("lang('fred')", "") ; }
+
+    @Test public void lang_01() { testString("LANG('tea time'@en)", "en") ; }
+    // Aside For some strange reason, the language code is GB not UK.
+    // The state is UK! "The United Kingdom of Great Britain and Norther 
Ireland."
+    // The four countries England, Scotland, Wales and Northern Ireland (since 
1922).
+    // It's complicated: https://en.wikipedia.org/wiki/United_Kingdom

Review Comment:
   Yes, it's `en-GB`. 
   
   Digression: London's special economy is not a legal structure but reflects 
the way investment funding flows in the UK.
   



##########
jena-base/src/main/java/org/apache/jena/atlas/lib/Lib.java:
##########
@@ -112,25 +113,42 @@ static public UnsupportedOperationException 
unsupportedMethod(Object object, Str
     /** Do two lists have the same elements without considering the order of 
the lists nor duplicates? */
     public static <T> boolean equalsListAsSet(List<T> list1, List<T> list2) {
         if ( list1 == null && list2 == null )
-            return true ;
-        if ( list1 == null ) return false ;
-        if ( list2 == null ) return false ;
-        return list1.containsAll(list2) && list2.containsAll(list1) ;
+            return true;
+        if ( list1 == null ) return false;
+        if ( list2 == null ) return false;
+        return list1.containsAll(list2) && list2.containsAll(list1);
     }
 
     /** HashCode - allow nulls */
-    public static final int hashCodeObject(Object obj) { return 
hashCodeObject(obj, -4) ; }
+    public static final int hashCodeObject(Object obj) { return 
hashCodeObject(obj, -4); }
 
     /** HashCode - allow nulls */
     public static final int hashCodeObject(Object obj, int nullHashCode) {
         if ( obj == null )
-            return nullHashCode ;
-        return obj.hashCode() ;
+            return nullHashCode;
+        return obj.hashCode();
+    }
+
+    public static boolean isEmpty(CharSequence cs) {
+        // Hide implementation
+        return StringUtils.isEmpty(cs);
+    }
+
+    /** Non-locale lowercase {@link Locale#ROOT} */
+    public static String lowercase(String string) {
+        // Hide implementation
+        return string.toLowerCase(Locale.ROOT);
+    }
+
+    /** Non-locale uppercase {@link Locale#ROOT} */
+    public static String uppercase(String string) {
+        // Hide implementation
+        return string.toUpperCase(Locale.ROOT);

Review Comment:
   This is a specific form of uppercase for "system" use - there points in the 
system where lower/uppercase apply to 
   (e.g. language tags and URI schema name which are `a-zA-Z`). There are some 
locales where lower/upper case in the locale do not map ASCII to ASCII 
(lowercase dotted `i` - some languages have uppercase dotted `I`).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to