Author: mir
Date: Tue Oct 19 12:10:32 2010
New Revision: 1024213

URL: http://svn.apache.org/viewvc?rev=1024213&view=rev
Log:
CLEREZZA-337: GraphNode.hasProperty() improved so it's possible to check if the 
GraphNode has a certain property at all regardless of its value

Modified:
    
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/GraphNode.java

Modified: 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/GraphNode.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/GraphNode.java?rev=1024213&r1=1024212&r2=1024213&view=diff
==============================================================================
--- 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/GraphNode.java
 (original)
+++ 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/GraphNode.java
 Tue Oct 19 12:10:32 2010
@@ -324,7 +324,9 @@ public class GraphNode {
        }
 
        /**
-        * Checks wether this node has the given property with the given value
+        * Checks wether this node has the given property with the given value.
+        * If the given value is null, then it is checked if this node has the
+        * specified property regardless of its value.
         *
         * @param property
         * @param object
@@ -336,6 +338,9 @@ public class GraphNode {
                l.lock();
                try {
                        Iterator<Resource> objects = getObjects(property);
+                       if (object == null) {
+                               return objects.hasNext();
+                       }
                        while (objects.hasNext()) {
                                if (objects.next().equals(object)) {
                                        return true;


Reply via email to