jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: Resetting parameters after LinkBuilder#uri

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Mon, 25 Mar 2013 16:50:06 +0300

On 25/03/13 16:46, Bill Burke wrote:
>
>
> On 3/25/2013 9:34 AM, Sergey Beryozkin wrote:
>> Hi
>>
>> Should be LinkBuilder#uri documented to clarify that the parameters have
>> to be reset ?
>>
>> CXF user reported a different issue but it highlighted that when a link
>> builder is reused, the new Link will have the parameters inherited from
>> the previous link, for example,
>>
>> linkBuilder.uri("/next").rel("next").param("a", "a1");
>> Link next = linkBuilder.build();
>>
>> linkBuilder.uri("/prev").rel("prev").param("b", "b1");
>> Link prev = linkBuilder.build();
>>
>> Here, the prev Link will have the "a" parameter used to build the next
>> Link inherited, unless the parameters are reset when LinkBuilder#uri
>> method is called.
>>
>> Do you agree ?
>>
>
> No, i don't.
>
Is that it, you simply don't agree without even justifying why ?

Let me give another try:

>> linkBuilder.uri("/next").rel("next").param("a", "a1");
>> Link next = linkBuilder.build();
>>
>> linkBuilder.uri("/prev");
>> Link prev = linkBuilder.build();

Would it really be what user meant, having "/prev" link having a rel=next ?

Sergey