You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by "kinow (via GitHub)" <gi...@apache.org> on 2023/04/01 22:13:14 UTC

[GitHub] [jena] kinow commented on a diff in pull request #1831: GH-1830: Fuseki admin, create dataset - write instantiated template.

kinow commented on code in PR #1831:
URL: https://github.com/apache/jena/pull/1831#discussion_r1155185869


##########
jena-fuseki2/jena-fuseki-webapp/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java:
##########
@@ -151,14 +151,16 @@ else if ( WebContent.isMultiPartForm(ct) )
             else
                 assemblerFromBody(action, dest);
 
+            Model model = ModelFactory.createDefaultModel();
+            model.add(modelData);

Review Comment:
   Looks like there will be two `Model` instances here, but `model` is never used, except for creating a copy of `modelData` to be used in `AssemblerUtils.addRegistered`. The rest of the code uses `modelData`.
   
   If that's correct, maybe that could be `AssemblerUtils.addRegistered(ModelFactory.createDefaultModel().add(modelData));` to avoid risking the `model` instance being used accidentally. Or maybe `Model` could have a `.copy()` method?



-- 
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: pr-unsubscribe@jena.apache.org

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