jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [4/7] jena git commit: Add check for non-literals.
Date Tue, 27 Jun 2017 14:53:15 GMT
Add check for non-literals.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/675b44df
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/675b44df
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/675b44df

Branch: refs/heads/master
Commit: 675b44df6a1b4088cbb61ed2b6744b9a48203f5d
Parents: 11234c0
Author: Andy Seaborne <andy@apache.org>
Authored: Tue Jun 27 14:56:00 2017 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Tue Jun 27 14:56:00 2017 +0100

----------------------------------------------------------------------
 jena-core/src/main/java/org/apache/jena/rdf/model/impl/Util.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/675b44df/jena-core/src/main/java/org/apache/jena/rdf/model/impl/Util.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/rdf/model/impl/Util.java b/jena-core/src/main/java/org/apache/jena/rdf/model/impl/Util.java
index 8a93b73..ba7c969 100644
--- a/jena-core/src/main/java/org/apache/jena/rdf/model/impl/Util.java
+++ b/jena-core/src/main/java/org/apache/jena/rdf/model/impl/Util.java
@@ -203,6 +203,8 @@ public class Util extends Object {
      */
     public static boolean isSimpleString(Node n) {
         Objects.requireNonNull(n) ;
+        if ( ! n.isLiteral() )
+            return false ;
         RDFDatatype dt = n.getLiteralDatatype() ;
         if ( dt == null )
             return !isLangString(n) ;
@@ -217,6 +219,8 @@ public class Util extends Object {
      */
     public static boolean isLangString(Node n) {
         Objects.requireNonNull(n) ;
+        if ( ! n.isLiteral() )
+            return false ;
         String lang = n.getLiteralLanguage() ;
         if ( lang == null )
             return false ;


Mime
View raw message