[jira] [Commented] (JENA-1495) Covariant return type for Model's PrefixMapping methods.
[ https://issues.apache.org/jira/browse/JENA-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16393536#comment-16393536 ] ASF GitHub Bot commented on JENA-1495: -- Github user afs commented on the issue: https://github.com/apache/jena/pull/368 Closing this PR. I see these commits in the codebase under different SHA1 ids (b8b482ecaa and 036ebce8ed). @jaco0646 - thanks! > Covariant return type for Model's PrefixMapping methods. > > > Key: JENA-1495 > URL: https://issues.apache.org/jira/browse/JENA-1495 > Project: Apache Jena > Issue Type: Improvement > Components: Core >Affects Versions: Jena 3.6.0 >Reporter: Adam Jacobs >Assignee: A. Soroka >Priority: Trivial > Labels: easyfix > Fix For: Jena 3.7.0 > > > The {{Model}} interface inherits several methods from {{PrefixMapping}} which > return {{this}}. > The return type of these methods can be refined to allow call chaining with > the {{Model}} object. > There appear to be two concrete implementations of {{Model}} which override > the {{PrefixMapping}} methods: {{ModelCom}} and {{SecuredModelImpl}}. Steps > to add covariant return types for prefix mapping are as follows. > Add these six methods to the Model interface. > # Model setNsPrefix( String prefix, String uri ); > # Model removeNsPrefix( String prefix ); > # Model clearNsPrefixMap(); > # Model setNsPrefixes( PrefixMapping other ); > # Model setNsPrefixes( Mapmap ); > # Model withDefaultMappings( PrefixMapping map ); > ...and update ModelCom accordingly. > Add these six methods to the SecuredModel interface. > # SecuredModel setNsPrefix( String prefix, String uri ); > # SecuredModel removeNsPrefix( String prefix ); // This method is already > defined. > # SecuredModel clearNsPrefixMap(); > # SecuredModel setNsPrefixes( PrefixMapping other ); > # SecuredModel setNsPrefixes( Map map ); > # SecuredModel withDefaultMappings( PrefixMapping map ); > ...and update SecuredModelImpl accordingly. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (JENA-1495) Covariant return type for Model's PrefixMapping methods.
[ https://issues.apache.org/jira/browse/JENA-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16393533#comment-16393533 ] ASF GitHub Bot commented on JENA-1495: -- Github user asfgit closed the pull request at: https://github.com/apache/jena/pull/368 > Covariant return type for Model's PrefixMapping methods. > > > Key: JENA-1495 > URL: https://issues.apache.org/jira/browse/JENA-1495 > Project: Apache Jena > Issue Type: Improvement > Components: Core >Affects Versions: Jena 3.6.0 >Reporter: Adam Jacobs >Assignee: A. Soroka >Priority: Trivial > Labels: easyfix > Fix For: Jena 3.7.0 > > > The {{Model}} interface inherits several methods from {{PrefixMapping}} which > return {{this}}. > The return type of these methods can be refined to allow call chaining with > the {{Model}} object. > There appear to be two concrete implementations of {{Model}} which override > the {{PrefixMapping}} methods: {{ModelCom}} and {{SecuredModelImpl}}. Steps > to add covariant return types for prefix mapping are as follows. > Add these six methods to the Model interface. > # Model setNsPrefix( String prefix, String uri ); > # Model removeNsPrefix( String prefix ); > # Model clearNsPrefixMap(); > # Model setNsPrefixes( PrefixMapping other ); > # Model setNsPrefixes( Mapmap ); > # Model withDefaultMappings( PrefixMapping map ); > ...and update ModelCom accordingly. > Add these six methods to the SecuredModel interface. > # SecuredModel setNsPrefix( String prefix, String uri ); > # SecuredModel removeNsPrefix( String prefix ); // This method is already > defined. > # SecuredModel clearNsPrefixMap(); > # SecuredModel setNsPrefixes( PrefixMapping other ); > # SecuredModel setNsPrefixes( Map map ); > # SecuredModel withDefaultMappings( PrefixMapping map ); > ...and update SecuredModelImpl accordingly. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (JENA-1495) Covariant return type for Model's PrefixMapping methods.
[ https://issues.apache.org/jira/browse/JENA-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16386949#comment-16386949 ] ASF GitHub Bot commented on JENA-1495: -- Github user jaco0646 commented on a diff in the pull request: https://github.com/apache/jena/pull/368#discussion_r172364101 --- Diff: jena-core/src/main/java/org/apache/jena/rdf/model/Model.java --- @@ -1051,4 +1051,12 @@ Remove all the statements matching (s, p, o) from this model. Answer true iff .close() has been called on this Model. */ public boolean isClosed(); + +// Override return type for methods inherited from PrefixMapping --- End diff -- Done. > Covariant return type for Model's PrefixMapping methods. > > > Key: JENA-1495 > URL: https://issues.apache.org/jira/browse/JENA-1495 > Project: Apache Jena > Issue Type: Improvement > Components: Core >Affects Versions: Jena 3.6.0 >Reporter: Adam Jacobs >Priority: Trivial > Labels: easyfix > > The {{Model}} interface inherits several methods from {{PrefixMapping}} which > return {{this}}. > The return type of these methods can be refined to allow call chaining with > the {{Model}} object. > There appear to be two concrete implementations of {{Model}} which override > the {{PrefixMapping}} methods: {{ModelCom}} and {{SecuredModelImpl}}. Steps > to add covariant return types for prefix mapping are as follows. > Add these six methods to the Model interface. > # Model setNsPrefix( String prefix, String uri ); > # Model removeNsPrefix( String prefix ); > # Model clearNsPrefixMap(); > # Model setNsPrefixes( PrefixMapping other ); > # Model setNsPrefixes( Mapmap ); > # Model withDefaultMappings( PrefixMapping map ); > ...and update ModelCom accordingly. > Add these six methods to the SecuredModel interface. > # SecuredModel setNsPrefix( String prefix, String uri ); > # SecuredModel removeNsPrefix( String prefix ); // This method is already > defined. > # SecuredModel clearNsPrefixMap(); > # SecuredModel setNsPrefixes( PrefixMapping other ); > # SecuredModel setNsPrefixes( Map map ); > # SecuredModel withDefaultMappings( PrefixMapping map ); > ...and update SecuredModelImpl accordingly. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (JENA-1495) Covariant return type for Model's PrefixMapping methods.
[ https://issues.apache.org/jira/browse/JENA-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16386290#comment-16386290 ] ASF GitHub Bot commented on JENA-1495: -- Github user ajs6f commented on the issue: https://github.com/apache/jena/pull/368 This looks basically good to me: with an additional commit addressing https://github.com/apache/jena/pull/368#pullrequestreview-101006841, I'll be happy to merge this. > Covariant return type for Model's PrefixMapping methods. > > > Key: JENA-1495 > URL: https://issues.apache.org/jira/browse/JENA-1495 > Project: Apache Jena > Issue Type: Improvement > Components: Core >Affects Versions: Jena 3.6.0 >Reporter: Adam Jacobs >Priority: Trivial > Labels: easyfix > > The {{Model}} interface inherits several methods from {{PrefixMapping}} which > return {{this}}. > The return type of these methods can be refined to allow call chaining with > the {{Model}} object. > There appear to be two concrete implementations of {{Model}} which override > the {{PrefixMapping}} methods: {{ModelCom}} and {{SecuredModelImpl}}. Steps > to add covariant return types for prefix mapping are as follows. > Add these six methods to the Model interface. > # Model setNsPrefix( String prefix, String uri ); > # Model removeNsPrefix( String prefix ); > # Model clearNsPrefixMap(); > # Model setNsPrefixes( PrefixMapping other ); > # Model setNsPrefixes( Mapmap ); > # Model withDefaultMappings( PrefixMapping map ); > ...and update ModelCom accordingly. > Add these six methods to the SecuredModel interface. > # SecuredModel setNsPrefix( String prefix, String uri ); > # SecuredModel removeNsPrefix( String prefix ); // This method is already > defined. > # SecuredModel clearNsPrefixMap(); > # SecuredModel setNsPrefixes( PrefixMapping other ); > # SecuredModel setNsPrefixes( Map map ); > # SecuredModel withDefaultMappings( PrefixMapping map ); > ...and update SecuredModelImpl accordingly. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (JENA-1495) Covariant return type for Model's PrefixMapping methods.
[ https://issues.apache.org/jira/browse/JENA-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16385159#comment-16385159 ] ASF GitHub Bot commented on JENA-1495: -- Github user ajs6f commented on the issue: https://github.com/apache/jena/pull/368 Urp, just realized that `Model extends PrefixMapping`, so this is fine wrt compatibility. Sorry for the confusion! > Covariant return type for Model's PrefixMapping methods. > > > Key: JENA-1495 > URL: https://issues.apache.org/jira/browse/JENA-1495 > Project: Apache Jena > Issue Type: Improvement > Components: Core >Affects Versions: Jena 3.6.0 >Reporter: Adam Jacobs >Priority: Trivial > Labels: easyfix > > The {{Model}} interface inherits several methods from {{PrefixMapping}} which > return {{this}}. > The return type of these methods can be refined to allow call chaining with > the {{Model}} object. > There appear to be two concrete implementations of {{Model}} which override > the {{PrefixMapping}} methods: {{ModelCom}} and {{SecuredModelImpl}}. Steps > to add covariant return types for prefix mapping are as follows. > Add these six methods to the Model interface. > # Model setNsPrefix( String prefix, String uri ); > # Model removeNsPrefix( String prefix ); > # Model clearNsPrefixMap(); > # Model setNsPrefixes( PrefixMapping other ); > # Model setNsPrefixes( Mapmap ); > # Model withDefaultMappings( PrefixMapping map ); > ...and update ModelCom accordingly. > Add these six methods to the SecuredModel interface. > # SecuredModel setNsPrefix( String prefix, String uri ); > # SecuredModel removeNsPrefix( String prefix ); // This method is already > defined. > # SecuredModel clearNsPrefixMap(); > # SecuredModel setNsPrefixes( PrefixMapping other ); > # SecuredModel setNsPrefixes( Map map ); > # SecuredModel withDefaultMappings( PrefixMapping map ); > ...and update SecuredModelImpl accordingly. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (JENA-1495) Covariant return type for Model's PrefixMapping methods.
[ https://issues.apache.org/jira/browse/JENA-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16385151#comment-16385151 ] A. Soroka commented on JENA-1495: - Thanks, [~jaco0646]! We should be able to incorporate this without too much difficulty. > Covariant return type for Model's PrefixMapping methods. > > > Key: JENA-1495 > URL: https://issues.apache.org/jira/browse/JENA-1495 > Project: Apache Jena > Issue Type: Improvement > Components: Core >Affects Versions: Jena 3.6.0 >Reporter: Adam Jacobs >Priority: Trivial > Labels: easyfix > > The {{Model}} interface inherits several methods from {{PrefixMapping}} which > return {{this}}. > The return type of these methods can be refined to allow call chaining with > the {{Model}} object. > There appear to be two concrete implementations of {{Model}} which override > the {{PrefixMapping}} methods: {{ModelCom}} and {{SecuredModelImpl}}. Steps > to add covariant return types for prefix mapping are as follows. > Add these six methods to the Model interface. > # Model setNsPrefix( String prefix, String uri ); > # Model removeNsPrefix( String prefix ); > # Model clearNsPrefixMap(); > # Model setNsPrefixes( PrefixMapping other ); > # Model setNsPrefixes( Mapmap ); > # Model withDefaultMappings( PrefixMapping map ); > ...and update ModelCom accordingly. > Add these six methods to the SecuredModel interface. > # SecuredModel setNsPrefix( String prefix, String uri ); > # SecuredModel removeNsPrefix( String prefix ); // This method is already > defined. > # SecuredModel clearNsPrefixMap(); > # SecuredModel setNsPrefixes( PrefixMapping other ); > # SecuredModel setNsPrefixes( Map map ); > # SecuredModel withDefaultMappings( PrefixMapping map ); > ...and update SecuredModelImpl accordingly. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (JENA-1495) Covariant return type for Model's PrefixMapping methods.
[ https://issues.apache.org/jira/browse/JENA-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16385150#comment-16385150 ] ASF GitHub Bot commented on JENA-1495: -- Github user ajs6f commented on the issue: https://github.com/apache/jena/pull/368 This seems like a useful change, but it is not back-compatible, so in theory we should hold it for a major version release. > Covariant return type for Model's PrefixMapping methods. > > > Key: JENA-1495 > URL: https://issues.apache.org/jira/browse/JENA-1495 > Project: Apache Jena > Issue Type: Improvement > Components: Core >Affects Versions: Jena 3.6.0 >Reporter: Adam Jacobs >Priority: Trivial > Labels: easyfix > > The {{Model}} interface inherits several methods from {{PrefixMapping}} which > return {{this}}. > The return type of these methods can be refined to allow call chaining with > the {{Model}} object. > There appear to be two concrete implementations of {{Model}} which override > the {{PrefixMapping}} methods: {{ModelCom}} and {{SecuredModelImpl}}. Steps > to add covariant return types for prefix mapping are as follows. > Add these six methods to the Model interface. > # Model setNsPrefix( String prefix, String uri ); > # Model removeNsPrefix( String prefix ); > # Model clearNsPrefixMap(); > # Model setNsPrefixes( PrefixMapping other ); > # Model setNsPrefixes( Mapmap ); > # Model withDefaultMappings( PrefixMapping map ); > ...and update ModelCom accordingly. > Add these six methods to the SecuredModel interface. > # SecuredModel setNsPrefix( String prefix, String uri ); > # SecuredModel removeNsPrefix( String prefix ); // This method is already > defined. > # SecuredModel clearNsPrefixMap(); > # SecuredModel setNsPrefixes( PrefixMapping other ); > # SecuredModel setNsPrefixes( Map map ); > # SecuredModel withDefaultMappings( PrefixMapping map ); > ...and update SecuredModelImpl accordingly. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (JENA-1495) Covariant return type for Model's PrefixMapping methods.
[ https://issues.apache.org/jira/browse/JENA-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16385149#comment-16385149 ] ASF GitHub Bot commented on JENA-1495: -- Github user ajs6f commented on a diff in the pull request: https://github.com/apache/jena/pull/368#discussion_r172049845 --- Diff: jena-core/src/main/java/org/apache/jena/rdf/model/Model.java --- @@ -1051,4 +1051,12 @@ Remove all the statements matching (s, p, o) from this model. Answer true iff .close() has been called on this Model. */ public boolean isClosed(); + +// Override return type for methods inherited from PrefixMapping --- End diff -- We should use `@Override` for explicitness on these changes. > Covariant return type for Model's PrefixMapping methods. > > > Key: JENA-1495 > URL: https://issues.apache.org/jira/browse/JENA-1495 > Project: Apache Jena > Issue Type: Improvement > Components: Core >Affects Versions: Jena 3.6.0 >Reporter: Adam Jacobs >Priority: Trivial > Labels: easyfix > > The {{Model}} interface inherits several methods from {{PrefixMapping}} which > return {{this}}. > The return type of these methods can be refined to allow call chaining with > the {{Model}} object. > There appear to be two concrete implementations of {{Model}} which override > the {{PrefixMapping}} methods: {{ModelCom}} and {{SecuredModelImpl}}. Steps > to add covariant return types for prefix mapping are as follows. > Add these six methods to the Model interface. > # Model setNsPrefix( String prefix, String uri ); > # Model removeNsPrefix( String prefix ); > # Model clearNsPrefixMap(); > # Model setNsPrefixes( PrefixMapping other ); > # Model setNsPrefixes( Mapmap ); > # Model withDefaultMappings( PrefixMapping map ); > ...and update ModelCom accordingly. > Add these six methods to the SecuredModel interface. > # SecuredModel setNsPrefix( String prefix, String uri ); > # SecuredModel removeNsPrefix( String prefix ); // This method is already > defined. > # SecuredModel clearNsPrefixMap(); > # SecuredModel setNsPrefixes( PrefixMapping other ); > # SecuredModel setNsPrefixes( Map map ); > # SecuredModel withDefaultMappings( PrefixMapping map ); > ...and update SecuredModelImpl accordingly. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (JENA-1495) Covariant return type for Model's PrefixMapping methods.
[ https://issues.apache.org/jira/browse/JENA-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16384396#comment-16384396 ] ASF GitHub Bot commented on JENA-1495: -- GitHub user jaco0646 opened a pull request: https://github.com/apache/jena/pull/368 JENA-1495 Return Model from PrefixMapping methods. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jaco0646/jena Covariant-Model-Methods Alternatively you can review and apply these changes as the patch at: https://github.com/apache/jena/pull/368.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #368 commit db778544bf71099447b4126daebf5e0df79c3e3c Author: jaco0646Date: 2018-03-03T01:06:51Z Return Model from PrefixMapping methods. > Covariant return type for Model's PrefixMapping methods. > > > Key: JENA-1495 > URL: https://issues.apache.org/jira/browse/JENA-1495 > Project: Apache Jena > Issue Type: Improvement > Components: Core >Affects Versions: Jena 3.6.0 >Reporter: Adam Jacobs >Priority: Trivial > Labels: easyfix > > The {{Model}} interface inherits several methods from {{PrefixMapping}} which > return {{this}}. > The return type of these methods can be refined to allow call chaining with > the {{Model}} object. > There appear to be two concrete implementations of {{Model}} which override > the {{PrefixMapping}} methods: {{ModelCom}} and {{SecuredModelImpl}}. Steps > to add covariant return types for prefix mapping are as follows. > Add these six methods to the Model interface. > # Model setNsPrefix( String prefix, String uri ); > # Model removeNsPrefix( String prefix ); > # Model clearNsPrefixMap(); > # Model setNsPrefixes( PrefixMapping other ); > # Model setNsPrefixes( Map map ); > # Model withDefaultMappings( PrefixMapping map ); > ...and update ModelCom accordingly. > Add these six methods to the SecuredModel interface. > # SecuredModel setNsPrefix( String prefix, String uri ); > # SecuredModel removeNsPrefix( String prefix ); // This method is already > defined. > # SecuredModel clearNsPrefixMap(); > # SecuredModel setNsPrefixes( PrefixMapping other ); > # SecuredModel setNsPrefixes( Map map ); > # SecuredModel withDefaultMappings( PrefixMapping map ); > ...and update SecuredModelImpl accordingly. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (JENA-1495) Covariant return type for Model's PrefixMapping methods.
[ https://issues.apache.org/jira/browse/JENA-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16380215#comment-16380215 ] A. Soroka commented on JENA-1495: - This seems reasonable-- it would be easier to spot any potential problems looking at code. Can you possibly create a PR for this? > Covariant return type for Model's PrefixMapping methods. > > > Key: JENA-1495 > URL: https://issues.apache.org/jira/browse/JENA-1495 > Project: Apache Jena > Issue Type: Improvement > Components: Core >Affects Versions: Jena 3.6.0 >Reporter: Adam Jacobs >Priority: Trivial > Labels: easyfix > > The {{Model}} interface inherits several methods from {{PrefixMapping}} which > return {{this}}. > The return type of these methods can be refined to allow call chaining with > the {{Model}} object. > There appear to be two concrete implementations of {{Model}} which override > the {{PrefixMapping}} methods: {{ModelCom}} and {{SecuredModelImpl}}. Steps > to add covariant return types for prefix mapping are as follows. > Add these six methods to the Model interface. > # Model setNsPrefix( String prefix, String uri ); > # Model removeNsPrefix( String prefix ); > # Model clearNsPrefixMap(); > # Model setNsPrefixes( PrefixMapping other ); > # Model setNsPrefixes( Mapmap ); > # Model withDefaultMappings( PrefixMapping map ); > ...and update ModelCom accordingly. > Add these six methods to the SecuredModel interface. > # SecuredModel setNsPrefix( String prefix, String uri ); > # SecuredModel removeNsPrefix( String prefix ); // This method is already > defined. > # SecuredModel clearNsPrefixMap(); > # SecuredModel setNsPrefixes( PrefixMapping other ); > # SecuredModel setNsPrefixes( Map map ); > # SecuredModel withDefaultMappings( PrefixMapping map ); > ...and update SecuredModelImpl accordingly. -- This message was sent by Atlassian JIRA (v7.6.3#76005)