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 2022/12/16 11:04:53 UTC

[GitHub] [jena] namedgraph opened a new pull request, #1682: GH-1676: Use Set::copyOf instead of Collections::unmodifiableSet

namedgraph opened a new pull request, #1682:
URL: https://github.com/apache/jena/pull/1682

   Added `Collection<Lang>` accessors to `Writer` registries as well.
   My NetBeans is struggling with Jena's codebase, so I hope it's correct 🤞 .
   
   GitHub issue resolved #GH-1676
   
   Added `RDFWriterRegistry::registeredFormats` which defaults to `RDFWriterRegistry::registered`, because I think in a future release `RDFWriterRegistry::registered` should be changed to return `Collection<Lang>` for consistency.
   
   ----
   
    - [ ] Tests are included.
    - [ ] Documentation change and updates are provided for the [Apache Jena website](https://github.com/apache/jena-site/)
    - [ ] Commits have been squashed to remove intermediate development commit messages.
    - [ ] Key commit messages start with the issue number (GH-xxxx or JENA-xxxx)
   
   By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the [Contributor's Agreement](https://www.apache.org/licenses/contributor-agreements.html).
   
   ----
   
   See the [Apache Jena "Contributing" guide](https://github.com/apache/jena/blob/main/CONTRIBUTING.md).
   


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


[GitHub] [jena] namedgraph commented on a diff in pull request #1682: GH-1676: Use Set::copyOf instead of Collections::unmodifiableSet

Posted by GitBox <gi...@apache.org>.
namedgraph commented on code in PR #1682:
URL: https://github.com/apache/jena/pull/1682#discussion_r1050671531


##########
jena-arq/src/main/java/org/apache/jena/riot/RDFWriterRegistry.java:
##########
@@ -301,22 +301,32 @@ public static boolean contains(RDFFormat format)
 
     /** All registered graph formats */
     public static Collection<RDFFormat> registeredGraphFormats() {
-        return Collections.unmodifiableSet(registryGraph.keySet()) ;
+        return Set.copyOf(registryGraph.keySet()) ;
     }
 
     /** All registered dataset formats */
     public static Collection<RDFFormat> registeredDatasetFormats() {
-        return Collections.unmodifiableSet(registryDataset.keySet()) ;
+        return Set.copyOf(registryDataset.keySet()) ;
+    }
+
+    /** All registered formats */
+    public static Collection<RDFFormat> registeredFormats() {
+        return registered();
     }
 
     /** All registered formats */
     public static Collection<RDFFormat> registered() {
         Set<RDFFormat> x = new HashSet<>() ;
         x.addAll(registryGraph.keySet()) ;
         x.addAll(registryDataset.keySet()) ;
-        return Collections.unmodifiableSet(x) ;
+        return Set.copyOf(x) ;
     }

Review Comment:
   Done



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


[GitHub] [jena] afs commented on pull request #1682: GH-1676: Use Set::copyOf instead of Collections::unmodifiableSet

Posted by GitBox <gi...@apache.org>.
afs commented on PR #1682:
URL: https://github.com/apache/jena/pull/1682#issuecomment-1354867405

   There is a compile error - `RDFParserRegistry` needs to `import java.util.Collection`.
   
   There is a deprecation warning from `ModLangOutput` (I can clear that up later).
   


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


[GitHub] [jena] namedgraph commented on pull request #1682: GH-1676: Use Set::copyOf instead of Collections::unmodifiableSet

Posted by GitBox <gi...@apache.org>.
namedgraph commented on PR #1682:
URL: https://github.com/apache/jena/pull/1682#issuecomment-1354883418

   Added the import


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


[GitHub] [jena] afs commented on a diff in pull request #1682: GH-1676: Use Set::copyOf instead of Collections::unmodifiableSet

Posted by GitBox <gi...@apache.org>.
afs commented on code in PR #1682:
URL: https://github.com/apache/jena/pull/1682#discussion_r1050657427


##########
jena-arq/src/main/java/org/apache/jena/riot/RDFWriterRegistry.java:
##########
@@ -301,22 +301,32 @@ public static boolean contains(RDFFormat format)
 
     /** All registered graph formats */
     public static Collection<RDFFormat> registeredGraphFormats() {
-        return Collections.unmodifiableSet(registryGraph.keySet()) ;
+        return Set.copyOf(registryGraph.keySet()) ;
     }
 
     /** All registered dataset formats */
     public static Collection<RDFFormat> registeredDatasetFormats() {
-        return Collections.unmodifiableSet(registryDataset.keySet()) ;
+        return Set.copyOf(registryDataset.keySet()) ;
+    }
+
+    /** All registered formats */
+    public static Collection<RDFFormat> registeredFormats() {
+        return registered();
     }
 
     /** All registered formats */
     public static Collection<RDFFormat> registered() {
         Set<RDFFormat> x = new HashSet<>() ;
         x.addAll(registryGraph.keySet()) ;
         x.addAll(registryDataset.keySet()) ;
-        return Collections.unmodifiableSet(x) ;
+        return Set.copyOf(x) ;
     }

Review Comment:
   Let's deprecate this and remove it in a later release.
   
   `registeredFormats` is the implementation.
   `registered()` calls `registeredFormats`.
   



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


[GitHub] [jena] afs merged pull request #1682: GH-1676: Use Set::copyOf instead of Collections::unmodifiableSet

Posted by GitBox <gi...@apache.org>.
afs merged PR #1682:
URL: https://github.com/apache/jena/pull/1682


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