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

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_r88564593
  
    --- Diff: api/src/main/java/org/apache/commons/rdf/api/RDFSyntax.java ---
    @@ -34,7 +152,7 @@
      *      1.1 Primer</a>
      * @see org.apache.commons.rdf.experimental.RDFParser
      */
    -public enum RDFSyntax {
    +  public enum OfficialRDFSyntax implements RDFSyntax {
    --- End diff --
    
    There is no particular reason that "enum" needs to be used given the 
interface design is done for flexibility, and given the difficulties with 
equals and hashCode. I would suggest reimplementing the "values()" method, 
along with equals and hashCode, and changing this to a "public final class".


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

Reply via email to