[Mulgara-svn] r1843 - branches/distinct_queries/src/jar/store-stringpool/java/org/mulgara/store/stringpool/xa

pag at mulgara.org pag at mulgara.org
Fri Nov 13 19:29:47 UTC 2009


Author: pag
Date: 2009-11-13 11:29:46 -0800 (Fri, 13 Nov 2009)
New Revision: 1843

Modified:
   branches/distinct_queries/src/jar/store-stringpool/java/org/mulgara/store/stringpool/xa/SPDecimalImpl.java
Log:
Removing + character when parsing integers. Also, correctly comparing to unknown literals that claim to be decimal

Modified: branches/distinct_queries/src/jar/store-stringpool/java/org/mulgara/store/stringpool/xa/SPDecimalImpl.java
===================================================================
--- branches/distinct_queries/src/jar/store-stringpool/java/org/mulgara/store/stringpool/xa/SPDecimalImpl.java	2009-11-13 19:28:16 UTC (rev 1842)
+++ branches/distinct_queries/src/jar/store-stringpool/java/org/mulgara/store/stringpool/xa/SPDecimalImpl.java	2009-11-13 19:29:46 UTC (rev 1843)
@@ -359,6 +359,7 @@
    */
   SPDecimalExtImpl(int subtypeId, URI typeURI, String lexicalForm) {
     super(subtypeId, typeURI);
+    if (lexicalForm.startsWith("+")) lexicalForm = lexicalForm.substring(1);
     l = Long.valueOf(lexicalForm);
   }
 
@@ -395,6 +396,9 @@
     if (o instanceof SPDecimalBaseImpl) {
       return BigDecimal.valueOf(l).compareTo(((SPDecimalBaseImpl)o).val);
     }
+    // if this is an unparseable value, then hard code it to the bottom of the type ordering
+    if (o instanceof UnknownSPTypedLiteralImpl) return -1;
+
     // Compare the longs.
     SPDecimalExtImpl di = (SPDecimalExtImpl)o;
     return compare(l, di.l);




More information about the Mulgara-svn mailing list