[ https://issues.apache.org/jira/browse/JENA-1389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16152969#comment-16152969 ]
Bruno P. Kinoshita commented on JENA-1389: ------------------------------------------ +1 as well. Seems to fit well with Dataset to provide a fluent API. >Can someone confirm whether this is binary compatible? I don't think it is binary compatible. >From http://docs.oracle.com/javase/specs/jls/se8/html/jls-13.html#jls-13.4.15: {quote} Changing the result type of a method, or replacing a result type with void, or replacing void with a result type, has the combined effect of deleting the old method and adding a new method with the new result type or newly void result (see ยง13.4.12). {quote} And from http://docs.oracle.com/javase/specs/jls/se8/html/jls-13.html#jls-13.4.12: {quote} Deleting a method or constructor from a class may break compatibility with any pre-existing binary that referenced this method or constructor; a NoSuchMethodError may be thrown when such a reference from a pre-existing binary is linked. Such an error will occur only if no method with a matching signature and return type is declared in a superclass. {quote} > Return `this` rather than `void` from Dataset > --------------------------------------------- > > Key: JENA-1389 > URL: https://issues.apache.org/jira/browse/JENA-1389 > Project: Apache Jena > Issue Type: Improvement > Components: ARQ > Affects Versions: Jena 3.4.0 > Reporter: Adam Jacobs > Priority: Trivial > Labels: easytask > > Allow method chaining from the org.apache.jena.query.Dataset interface by > returning `this` rather than `void` from the following methods. > # setDefaultModel > # addNamedModel > # removeNamedModel > # replaceNamedModel > Allowing method chaining would align with the behavior of the add and remove > methods in org.apache.jena.rdf.model.Model. -- This message was sent by Atlassian JIRA (v6.4.14#64029)