commonsrdf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COMMONSRDF-47) RDFSyntax should be interface, not enum
Date Thu, 17 Nov 2016 22:55:58 GMT

    [ https://issues.apache.org/jira/browse/COMMONSRDF-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15675058#comment-15675058
] 

ASF GitHub Bot commented on COMMONSRDF-47:
------------------------------------------

Github user ansell commented on a diff in the pull request:

    https://github.com/apache/incubator-commonsrdf/pull/27#discussion_r88565106
  
    --- Diff: simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java
---
    @@ -240,7 +240,7 @@ public T rdfTermFactory(RDF rdfTermFactory) {
         public T contentType(RDFSyntax rdfSyntax) throws IllegalArgumentException {
             AbstractRDFParser<T> c = clone();
             c.contentTypeSyntax = Optional.ofNullable(rdfSyntax);
    -        c.contentType = c.contentTypeSyntax.map(syntax -> syntax.mediaType);
    +        c.contentType = c.contentTypeSyntax.map(syntax -> syntax.mediaType());
             return c.asT();
    --- End diff --
    
    It hurts my head thinking about this, but what is the signature for the generic type "T"
designed to do. It seems like a circular definition, which doesn't really make sense but I
can't think why T could have been introduced so I am stuck at seeing it as circular.
    
    ```
    AbstractRDFParser<T extends AbstractRDFParser<T>>
    ```


> RDFSyntax should be interface, not enum
> ---------------------------------------
>
>                 Key: COMMONSRDF-47
>                 URL: https://issues.apache.org/jira/browse/COMMONSRDF-47
>             Project: Apache Commons RDF
>          Issue Type: Bug
>          Components: api
>    Affects Versions: 0.2.0
>            Reporter: Stian Soiland-Reyes
>            Assignee: Stian Soiland-Reyes
>
> [~p_ansell] raises in [pull request 25|https://github.com/apache/incubator-commonsrdf/pull/25#discussion_r85231845]
> {quote}
> Using enum for RDFSyntax is a bad idea unless it overrides an interface and the interface
is used in method signatures instead of the enum. There are many other RDFSyntaxes, and enum
(without implementing an interface) is only suited to cases where the full set are known a
priori.
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message