You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2020/11/24 20:09:38 UTC

[GitHub] [jena] afs commented on a change in pull request #870: Add public getters to SHACL constraint implementations

afs commented on a change in pull request #870:
URL: https://github.com/apache/jena/pull/870#discussion_r529848215



##########
File path: jena-shacl/src/main/java/org/apache/jena/shacl/engine/constraint/ConstraintComponentSPARQL.java
##########
@@ -59,6 +59,18 @@ public ConstraintComponentSPARQL(SparqlComponent sparqlConstraintComponent,
         }
     }
 
+    public SparqlComponent getSparqlConstraintComponent() {
+        return sparqlConstraintComponent;
+    }
+
+    public Multimap<Parameter, Node> getParameterMap() {
+        return parameterMap;

Review comment:
       Yes, it does matter. `.equals` relies on all parts of the shape and shapes go into datastructures so `hashCode` and `equals` must be stable. A `Collections.unmodifiable` (on "get" or in the constructor, not sure which is better) or a structure copy is needed. The current code probably isn't perfect.
   
   Or documentation!
   
   Another to look at is whether internal calculated members should be made public.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org