[WEBSOCKET_SPEC-85] Some DefaultClientConfiguration methods return ClientEndpointConfiguration Created: 03/Jan/13  Updated: 01/Feb/13  Due: 01/Feb/13  Resolved: 01/Feb/13

Status: Resolved
Project: websocket-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jitu Assignee: dannycoward
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: v012


public ClientEndpointConfiguration setDecoders(List<Decoder> decoders) {

that should be

public DefaultClientConfiguration setDecoders(List<Decoder> decoders) {

Similarly, other methods setEncoders, setExtensions, setPreferredSubProtocols needs to be changed

Comment by Justin Lee [ 03/Jan/13 ]

My first question was, "why would you want to return a concrete class rather than the interface" but then noticed that those methods aren't on the interface at all. Why is that? Seems like an oversight.

Comment by jitu [ 03/Jan/13 ]

IMO, we shouldn't be adding the setter methods on the ClientEndpointConfiguration interface or its super interfaces. Container doesn't use these setter methods. Also, all the concrete impl will be forced to be mutable.

DefaultClientConfiguration is just one concrete impl that is using these setter methods to configure that information. Instead, it can use constructors, or a builder (if there are many parameters) to configure that information.

Comment by dannycoward [ 01/Feb/13 ]

This is an oversight. Its trying to use the builder pattern to set up the information. So the returns should be DefaultClientConfiguration.

Comment by dannycoward [ 01/Feb/13 ]

fixed as suggested.

Generated at Fri Oct 09 15:02:56 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.