rest
rest copied to clipboard
Clarification: Reconfiguration of Client
A JAX-RS Client
can be configured like this (example taken from JavaDocs):
Client client = ClientBuilder.newClient();
client.property("MyProperty", "MyValue")
.register(MyProvider.class)
.register(MyFeature.class);
After these lines, client
references to an instance that has the property MyProperty
set to MyValue
and that has MyProvider
and MyFeature
registered.
What neither the Jakarta REST Specification not the Client
JavaDocs tell is, what happens to client
if we extend the example like this:
Client c2 = client.register(Foo.class).property("MyProperty", "Bar");
I assume it is undisputed that c2
refers to a Client
additionally having Foo
registered and property MyProperty
changed to Bar
.
But what about client
? Does client
(like c2
) also have Foo
registered and property Bar
set to MayValue
now, or is client
still holding the value MyValue
and does not have Foo
registered?
We should discuss this question, find a concensus, and adapt the JavaDocs.
Opinions?