Date   

Re: Proposed Final Draft

Pavel Bucek
 

It should be used only for tasks which need to be scheduled.

Effectively there is only single task like that in the API right now: delayed reconnect of SseEventSource.

Regards,
Pavel


On 11/07/2017 12:52, Sergey Beryozkin wrote:
Hi Pavel, thanks,

OK, what about the ScheduledExecutorService - how can the client API implementation know when to use this one
if the ExecutorService is also set ?

Cheers, Sergey

On 11/07/17 10:12, Pavel Bucek wrote:

Hi Sergey,

yes, that is correct.

Regards,
Pavel


On 11/07/2017 10:35, Sergey Beryozkin wrote:
Hi Pavel

These executor services, if set in the client builder - should they be used in the rx() flows ?

Thanks, Sergey 
On 11/07/17 00:12, Pavel Bucek wrote:

Hi Andy,

firstly, thanks for your kind words.

Your pull request was merged - good that you brought that up. Thanks!

Best regards,
Pavel


On 07/07/2017 14:38, Andy McCright wrote:
Hi Pavel,
 
Thank you for the clarification, and my apologies for bringing this up so late - a colleague and I ran into some confusion on this point, so I thought I would bring if forward in hopes that other users might avoid a similar confusion.
 
I have opened a pull request [1] with my suggested changes to the javadoc.  I think this may help users better understand the differences in the Java SE vs EE environments.
 
Thanks again - it has been a pleasure working with you in this expert group!
 
Andy
 
[1] https://github.com/jax-rs/api/pull/560

J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: Re: [jaxrs] Proposed Final Draft
Date: Fri, Jul 7, 2017 12:25 AM
 

Hi Andy,

it is very late for changing anything..

We are not saying that on Java EE environment ClientBuilder#executorService and #scheduledExecutorService have no effect - but it might sound that way.

The "default" for Java SE is NOT ForkJoinPool#commonPool, since it is not meant for I/O operations. On Java SE, the default is intentionally left as implementation specific.

And I'm not sure what you mean by "what about Future Objects returned from ..." - if there is any need for starting a thread, it should be done on the executor service provided in the client builder. Note that the javadoc for ClientBuilder#executorService mentions:

* Provided executor service will be used for executing asynchronous tasks.

And Invocation#buildGet() (and others):

* Submit the request for an asynchronous invocation and receive a future
* response back.

Which seem to imply what I wrote..

It might be still possible to tweak the javadoc, I'll wait for your reaction - whether this makes sense or not and then will inquire about possible javadoc adjustment.

Thanks and regards,
Pavel


On 07/07/2017 00:35, Andy McCright wrote:
Hi Pavel,
 
If it is not too late, I'm wondering if we could clarify the uses of ClientBuilder.executorService(...) and scheduledExecutorService(...).
 
Are we saying that in a Java EE environment, these methods have no effect?  If so, can we change this text:
When running in a Java EE container, implementations are required to use the container-managed executor service.
 
to:
When running in a Java EE container, this method will have no effect.  The container will always use the container-managed executor service.
 
and a similar change for the executorService method?
 
 
If instead we are saying that in a Java EE container, the default ES and SES are different than in Java SE, we should clarify it like this:
When running in a Java EE container, the default scheduled executor service will be the container-managed service.  In Java SE, this will be the ForkJoinPool service.
 
 
I think we should also clarify what methods will use these services.  The javadoc currently provides some guidance with:
     * @see Invocation.Builder#async()
     * @see Invocation.Builder#rx()
     * @see RxInvokerProvider#getRxInvoker(SyncInvoker, ExecutorService)
and
     * @see SseEventSource.Builder#reconnectingEvery(long, TimeUnit)
 
but what about Future objects returned from methods like buildGet().submit(...)?
 
Thanks,
 
Andy
 


J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: [jaxrs] Proposed Final Draft
Date: Thu, Jun 22, 2017 6:18 AM
 
Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us
know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370




 
 
 
 







Re: Proposed Final Draft

Sergey Beryozkin
 

Hi Pavel, thanks,

OK, what about the ScheduledExecutorService - how can the client API implementation know when to use this one
if the ExecutorService is also set ?

Cheers, Sergey

On 11/07/17 10:12, Pavel Bucek wrote:

Hi Sergey,

yes, that is correct.

Regards,
Pavel


On 11/07/2017 10:35, Sergey Beryozkin wrote:
Hi Pavel

These executor services, if set in the client builder - should they be used in the rx() flows ?

Thanks, Sergey 
On 11/07/17 00:12, Pavel Bucek wrote:

Hi Andy,

firstly, thanks for your kind words.

Your pull request was merged - good that you brought that up. Thanks!

Best regards,
Pavel


On 07/07/2017 14:38, Andy McCright wrote:
Hi Pavel,
 
Thank you for the clarification, and my apologies for bringing this up so late - a colleague and I ran into some confusion on this point, so I thought I would bring if forward in hopes that other users might avoid a similar confusion.
 
I have opened a pull request [1] with my suggested changes to the javadoc.  I think this may help users better understand the differences in the Java SE vs EE environments.
 
Thanks again - it has been a pleasure working with you in this expert group!
 
Andy
 
[1] https://github.com/jax-rs/api/pull/560

J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: Re: [jaxrs] Proposed Final Draft
Date: Fri, Jul 7, 2017 12:25 AM
 

Hi Andy,

it is very late for changing anything..

We are not saying that on Java EE environment ClientBuilder#executorService and #scheduledExecutorService have no effect - but it might sound that way.

The "default" for Java SE is NOT ForkJoinPool#commonPool, since it is not meant for I/O operations. On Java SE, the default is intentionally left as implementation specific.

And I'm not sure what you mean by "what about Future Objects returned from ..." - if there is any need for starting a thread, it should be done on the executor service provided in the client builder. Note that the javadoc for ClientBuilder#executorService mentions:

* Provided executor service will be used for executing asynchronous tasks.

And Invocation#buildGet() (and others):

* Submit the request for an asynchronous invocation and receive a future
* response back.

Which seem to imply what I wrote..

It might be still possible to tweak the javadoc, I'll wait for your reaction - whether this makes sense or not and then will inquire about possible javadoc adjustment.

Thanks and regards,
Pavel


On 07/07/2017 00:35, Andy McCright wrote:
Hi Pavel,
 
If it is not too late, I'm wondering if we could clarify the uses of ClientBuilder.executorService(...) and scheduledExecutorService(...).
 
Are we saying that in a Java EE environment, these methods have no effect?  If so, can we change this text:
When running in a Java EE container, implementations are required to use the container-managed executor service.
 
to:
When running in a Java EE container, this method will have no effect.  The container will always use the container-managed executor service.
 
and a similar change for the executorService method?
 
 
If instead we are saying that in a Java EE container, the default ES and SES are different than in Java SE, we should clarify it like this:
When running in a Java EE container, the default scheduled executor service will be the container-managed service.  In Java SE, this will be the ForkJoinPool service.
 
 
I think we should also clarify what methods will use these services.  The javadoc currently provides some guidance with:
     * @see Invocation.Builder#async()
     * @see Invocation.Builder#rx()
     * @see RxInvokerProvider#getRxInvoker(SyncInvoker, ExecutorService)
and
     * @see SseEventSource.Builder#reconnectingEvery(long, TimeUnit)
 
but what about Future objects returned from methods like buildGet().submit(...)?
 
Thanks,
 
Andy
 


J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: [jaxrs] Proposed Final Draft
Date: Thu, Jun 22, 2017 6:18 AM
 
Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us
know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370




 
 
 
 






Re: Proposed Final Draft

Pavel Bucek
 

Hi Sergey,

yes, that is correct.

Regards,
Pavel


On 11/07/2017 10:35, Sergey Beryozkin wrote:
Hi Pavel

These executor services, if set in the client builder - should they be used in the rx() flows ?

Thanks, Sergey 
On 11/07/17 00:12, Pavel Bucek wrote:

Hi Andy,

firstly, thanks for your kind words.

Your pull request was merged - good that you brought that up. Thanks!

Best regards,
Pavel


On 07/07/2017 14:38, Andy McCright wrote:
Hi Pavel,
 
Thank you for the clarification, and my apologies for bringing this up so late - a colleague and I ran into some confusion on this point, so I thought I would bring if forward in hopes that other users might avoid a similar confusion.
 
I have opened a pull request [1] with my suggested changes to the javadoc.  I think this may help users better understand the differences in the Java SE vs EE environments.
 
Thanks again - it has been a pleasure working with you in this expert group!
 
Andy
 
[1] https://github.com/jax-rs/api/pull/560

J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: Re: [jaxrs] Proposed Final Draft
Date: Fri, Jul 7, 2017 12:25 AM
 

Hi Andy,

it is very late for changing anything..

We are not saying that on Java EE environment ClientBuilder#executorService and #scheduledExecutorService have no effect - but it might sound that way.

The "default" for Java SE is NOT ForkJoinPool#commonPool, since it is not meant for I/O operations. On Java SE, the default is intentionally left as implementation specific.

And I'm not sure what you mean by "what about Future Objects returned from ..." - if there is any need for starting a thread, it should be done on the executor service provided in the client builder. Note that the javadoc for ClientBuilder#executorService mentions:

* Provided executor service will be used for executing asynchronous tasks.

And Invocation#buildGet() (and others):

* Submit the request for an asynchronous invocation and receive a future
* response back.

Which seem to imply what I wrote..

It might be still possible to tweak the javadoc, I'll wait for your reaction - whether this makes sense or not and then will inquire about possible javadoc adjustment.

Thanks and regards,
Pavel


On 07/07/2017 00:35, Andy McCright wrote:
Hi Pavel,
 
If it is not too late, I'm wondering if we could clarify the uses of ClientBuilder.executorService(...) and scheduledExecutorService(...).
 
Are we saying that in a Java EE environment, these methods have no effect?  If so, can we change this text:
When running in a Java EE container, implementations are required to use the container-managed executor service.
 
to:
When running in a Java EE container, this method will have no effect.  The container will always use the container-managed executor service.
 
and a similar change for the executorService method?
 
 
If instead we are saying that in a Java EE container, the default ES and SES are different than in Java SE, we should clarify it like this:
When running in a Java EE container, the default scheduled executor service will be the container-managed service.  In Java SE, this will be the ForkJoinPool service.
 
 
I think we should also clarify what methods will use these services.  The javadoc currently provides some guidance with:
     * @see Invocation.Builder#async()
     * @see Invocation.Builder#rx()
     * @see RxInvokerProvider#getRxInvoker(SyncInvoker, ExecutorService)
and
     * @see SseEventSource.Builder#reconnectingEvery(long, TimeUnit)
 
but what about Future objects returned from methods like buildGet().submit(...)?
 
Thanks,
 
Andy
 


J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: [jaxrs] Proposed Final Draft
Date: Thu, Jun 22, 2017 6:18 AM
 
Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us
know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370




 
 
 
 





Re: Proposed Final Draft

Sergey Beryozkin
 

Hi Pavel

These executor services, if set in the client builder - should they be used in the rx() flows ?

Thanks, Sergey 

On 11/07/17 00:12, Pavel Bucek wrote:

Hi Andy,

firstly, thanks for your kind words.

Your pull request was merged - good that you brought that up. Thanks!

Best regards,
Pavel


On 07/07/2017 14:38, Andy McCright wrote:
Hi Pavel,
 
Thank you for the clarification, and my apologies for bringing this up so late - a colleague and I ran into some confusion on this point, so I thought I would bring if forward in hopes that other users might avoid a similar confusion.
 
I have opened a pull request [1] with my suggested changes to the javadoc.  I think this may help users better understand the differences in the Java SE vs EE environments.
 
Thanks again - it has been a pleasure working with you in this expert group!
 
Andy
 
[1] https://github.com/jax-rs/api/pull/560

J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: Re: [jaxrs] Proposed Final Draft
Date: Fri, Jul 7, 2017 12:25 AM
 

Hi Andy,

it is very late for changing anything..

We are not saying that on Java EE environment ClientBuilder#executorService and #scheduledExecutorService have no effect - but it might sound that way.

The "default" for Java SE is NOT ForkJoinPool#commonPool, since it is not meant for I/O operations. On Java SE, the default is intentionally left as implementation specific.

And I'm not sure what you mean by "what about Future Objects returned from ..." - if there is any need for starting a thread, it should be done on the executor service provided in the client builder. Note that the javadoc for ClientBuilder#executorService mentions:

* Provided executor service will be used for executing asynchronous tasks.

And Invocation#buildGet() (and others):

* Submit the request for an asynchronous invocation and receive a future
* response back.

Which seem to imply what I wrote..

It might be still possible to tweak the javadoc, I'll wait for your reaction - whether this makes sense or not and then will inquire about possible javadoc adjustment.

Thanks and regards,
Pavel


On 07/07/2017 00:35, Andy McCright wrote:
Hi Pavel,
 
If it is not too late, I'm wondering if we could clarify the uses of ClientBuilder.executorService(...) and scheduledExecutorService(...).
 
Are we saying that in a Java EE environment, these methods have no effect?  If so, can we change this text:
When running in a Java EE container, implementations are required to use the container-managed executor service.
 
to:
When running in a Java EE container, this method will have no effect.  The container will always use the container-managed executor service.
 
and a similar change for the executorService method?
 
 
If instead we are saying that in a Java EE container, the default ES and SES are different than in Java SE, we should clarify it like this:
When running in a Java EE container, the default scheduled executor service will be the container-managed service.  In Java SE, this will be the ForkJoinPool service.
 
 
I think we should also clarify what methods will use these services.  The javadoc currently provides some guidance with:
     * @see Invocation.Builder#async()
     * @see Invocation.Builder#rx()
     * @see RxInvokerProvider#getRxInvoker(SyncInvoker, ExecutorService)
and
     * @see SseEventSource.Builder#reconnectingEvery(long, TimeUnit)
 
but what about Future objects returned from methods like buildGet().submit(...)?
 
Thanks,
 
Andy
 


J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: [jaxrs] Proposed Final Draft
Date: Thu, Jun 22, 2017 6:18 AM
 
Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us
know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370




 
 
 
 




Re: Proposed Final Draft

Pavel Bucek
 

Hi Andy,

firstly, thanks for your kind words.

Your pull request was merged - good that you brought that up. Thanks!

Best regards,
Pavel


On 07/07/2017 14:38, Andy McCright wrote:
Hi Pavel,
 
Thank you for the clarification, and my apologies for bringing this up so late - a colleague and I ran into some confusion on this point, so I thought I would bring if forward in hopes that other users might avoid a similar confusion.
 
I have opened a pull request [1] with my suggested changes to the javadoc.  I think this may help users better understand the differences in the Java SE vs EE environments.
 
Thanks again - it has been a pleasure working with you in this expert group!
 
Andy
 
[1] https://github.com/jax-rs/api/pull/560

J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: Re: [jaxrs] Proposed Final Draft
Date: Fri, Jul 7, 2017 12:25 AM
 

Hi Andy,

it is very late for changing anything..

We are not saying that on Java EE environment ClientBuilder#executorService and #scheduledExecutorService have no effect - but it might sound that way.

The "default" for Java SE is NOT ForkJoinPool#commonPool, since it is not meant for I/O operations. On Java SE, the default is intentionally left as implementation specific.

And I'm not sure what you mean by "what about Future Objects returned from ..." - if there is any need for starting a thread, it should be done on the executor service provided in the client builder. Note that the javadoc for ClientBuilder#executorService mentions:

* Provided executor service will be used for executing asynchronous tasks.

And Invocation#buildGet() (and others):

* Submit the request for an asynchronous invocation and receive a future
* response back.

Which seem to imply what I wrote..

It might be still possible to tweak the javadoc, I'll wait for your reaction - whether this makes sense or not and then will inquire about possible javadoc adjustment.

Thanks and regards,
Pavel


On 07/07/2017 00:35, Andy McCright wrote:
Hi Pavel,
 
If it is not too late, I'm wondering if we could clarify the uses of ClientBuilder.executorService(...) and scheduledExecutorService(...).
 
Are we saying that in a Java EE environment, these methods have no effect?  If so, can we change this text:
When running in a Java EE container, implementations are required to use the container-managed executor service.
 
to:
When running in a Java EE container, this method will have no effect.  The container will always use the container-managed executor service.
 
and a similar change for the executorService method?
 
 
If instead we are saying that in a Java EE container, the default ES and SES are different than in Java SE, we should clarify it like this:
When running in a Java EE container, the default scheduled executor service will be the container-managed service.  In Java SE, this will be the ForkJoinPool service.
 
 
I think we should also clarify what methods will use these services.  The javadoc currently provides some guidance with:
     * @see Invocation.Builder#async()
     * @see Invocation.Builder#rx()
     * @see RxInvokerProvider#getRxInvoker(SyncInvoker, ExecutorService)
and
     * @see SseEventSource.Builder#reconnectingEvery(long, TimeUnit)
 
but what about Future objects returned from methods like buildGet().submit(...)?
 
Thanks,
 
Andy
 


J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: [jaxrs] Proposed Final Draft
Date: Thu, Jun 22, 2017 6:18 AM
 
Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us
know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370




 
 
 
 



Re: Proposed Final Draft -- Java 8 Implementation

Pavel Bucek
 

I have to agree, but we can't do the whole change at this point :-/

I'm adding @throws to Sse, since there is a default implementation in the api, which behaves like that. SseEventSink change could break things and wouldn't be covered in any TCK test.

Feel free to add this as an issue.

(I even noticed that we are NOT consistent, there are some methods which are throwing NPE.. I wish we had this discussion one or two months ago ..)

Regards,
Pavel

On 10/07/2017 18:58, Markus KARG wrote:
Ok I agree that we should not touch old APIs, but we should add @throws to new APIs like Sse and SseEventSink then. Also I am not convinced that IAE is only for application callers: Why should it stay open which exception an implementation will receive in case of wrong parameters? I mean, it will definitively receive SOME exception and it is only good for the implementation provider to know WHICH catch (IAE vs NPE)?

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Montag, 10. Juli 2017 18:57
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Annotating provider method arguments doesn't make much sense, since they are invoked by the implementation - declaring @throws makes more sense on methods which are invoked directly by the application code..

.. but I'm sure you'll find some methods which are not annotated and maybe should be. Unfortunately, we are not going to fix that now, since exposing that information usually requires adding or modifying TCK test suite and we can't do that at this moment.

Regards,
Pavel


On 10/07/2017 18:44, Markus KARG wrote:
Lol ;-D

Pavel, I meant the SSE API, actually, but right, I did not check ALL APIs. So to make your claim a valid argument, we should now add @throws IllegalArgumentExcpetion to the JavaDocs of ALL places where it is currently NOT covered by your grep output to keep consistency (like MessageBodyWriter, Providers, WriterInterceptor, InterceptorContext and so on)...?

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Montag, 10. Juli 2017 07:03
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

:-)

$ grep -r IllegalArgument .
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/client/Client.java: * @throws IllegalArgumentException
in case the supplied string is not a valid URI template.
./javax/ws/rs/client/ClientBuilder.java: * @throws
IllegalArgumentException when the value is negative.
./javax/ws/rs/client/ClientBuilder.java: * @throws
IllegalArgumentException when the value is negative.
./javax/ws/rs/client/Entity.java: * @throws IllegalArgumentException
if the supplied string cannot be parsed
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/core/CacheControl.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: throw new
IllegalArgumentException("name==null");
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if the supplied string cannot be parsed
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if value is {@code null}.
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if value is {@code null}.
./javax/ws/rs/core/EntityTag.java: throw new
IllegalArgumentException("value==null");
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/GenericEntity.java: * @throws
IllegalArgumentException if entity is {@code null}.
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("The entity must not be null");
./javax/ws/rs/core/GenericEntity.java: * @throws
IllegalArgumentException if the entity is not assignable to
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("Arguments must not be null.");
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("The type is incompatible with the class of
the entity.");
./javax/ws/rs/core/GenericType.java: * the following case would throw an {@link IllegalArgumentException}:
./javax/ws/rs/core/GenericType.java: * @throws
IllegalArgumentException in case the generic type parameter value is not
./javax/ws/rs/core/GenericType.java: * @throws
IllegalArgumentException if genericType is {@code null} or not an instance of
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException("Type must not be null");
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException("Type parameter " + type.toString() + " not a class or " +
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException(e);
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException(currentType + " does not specify the type parameter T of GenericType<T>");
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
a syntax error is found.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
uri is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
uri is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
path is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
resource is not annotated with {@link javax.ws.rs.Path}
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
resource or method is {@code null}, or there is more
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the name is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the title is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the type is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if either the name or value are {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if there are any URI template parameters
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if there are any URI template parameters
./javax/ws/rs/core/MediaType.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/MultivaluedHashMap.java: * @throws
IllegalArgumentException if the initial capacity is negative.
./javax/ws/rs/core/MultivaluedHashMap.java: * @throws
IllegalArgumentException if the initial capacity is negative
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is {@code null}.
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is {@code null}.
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if tag is {@code null}.
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/Response.java: throw new
IllegalArgumentException();
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if uri is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if {@code uriTemplate} is not a valid URI template or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if link is {@code null}
./javax/ws/rs/core/UriBuilder.java: throw new
IllegalArgumentException("The provider 'link' parameter value is 'null'.");
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if path is {@code null}.
./javax/ws/rs/core/UriBuilder.java: public static UriBuilder
fromPath(String path) throws IllegalArgumentException {
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource is not annotated with
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource or method is {@code null},
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the {@code uri} parameter is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if {@code uriTemplate} is not a valid URI template or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if scheme is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if ssp cannot be parsed or is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if host is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if port is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if path is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource is {@code null}, or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource or method is {@code null},
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if method is {@code null} or is
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if segments or any element of segments
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if matrix cannot be parsed.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name or values is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if query cannot be parsed.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name or values is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or encoded value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or encoded value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/ParamConverter.java: * @throws
IllegalArgumentException if the supplied string cannot be
./javax/ws/rs/ext/ParamConverter.java: * @throws
IllegalArgumentException if the supplied object cannot be
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/RuntimeDelegate.java: throws
IllegalArgumentException, UnsupportedOperationException;
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/RuntimeDelegate.java: throws
IllegalArgumentException;
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
IllegalArgumentException if the supplied string cannot be
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
IllegalArgumentException if the supplied object cannot be
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the allowed methods varargs are {@code null}.
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the allowed methods varargs are {@code null}.
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: throw new
IllegalArgumentException("Response does not contain required 'Allow'
HTTP header.");
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'data' must not be null.");
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'data' must not be null.");
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'name' must not be null.");
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the provided parameter is {@code null}.
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the any of the provided parameters is {@code null}.
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the any of the provided parameters is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: throws
IllegalArgumentException {
./javax/ws/rs/WebApplicationException.java: throws IllegalArgumentException {
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if the response validation failed.
./javax/ws/rs/WebApplicationException.java: throw new IllegalArgumentException(String.format("Invalid response status code.
Expected [%d], was [%d].",
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if the response validation failed.
./javax/ws/rs/WebApplicationException.java: throw new
IllegalArgumentException(String.format(


On 08/07/2017 12:24, Markus KARG wrote:
Pavel, actually looking at the rest of the *API* (as you suggested) I did not find declaration of IAE, as it is solely part of the *implementation* -- it is rather undocumented that in particular IAE is to be thrown. Hence, as it is undocumented, you could not only replace it by NPE at any time in the RI (and such actually fulfil the expectation of the programmer when reading the JavaDocs), but also any other implementation could never had thrown IAE ever -- but possibly currently throws NPE. So to make your argument valid, we effectively must declare IAE in the JAX-RS JavaDocs -- and I really don't want that...

Due to the scarce time, it is ok to keept the status quo. But I don't
buy your argument. ;-)

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 18:06
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Well, if you look at the rest of the API, the pattern is to use IAE even when parameter is null, so .. being consistent with existing API wins over anything else..


On 07/07/2017 17:15, Markus KARG wrote:
So it is by intention that you still use IllegalArgumentException
instead of NPE. Understood. :-)

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 08:11
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Hi Markus,

I'm sorry I'm responding so late, I must have missed this email.

The main issue with Object.requireNonNull is that it throws a NPE instead of IAE, so we can't really use it on most of places - and I believe checking the value and throwing the exception would be much faster than calling Object.requireNonNull, catching the exception, etc..

Regards,
Pavel


On 24/06/2017 00:01, Markus KARG wrote:
A target of JAX-RS 2.1 is support for Java 8. So I wonder why still idioms of the pre-8 age are used in the API implementation instead of Java 8 idioms. For example:

default OutboundSseEvent newEvent(String data) {
if (data == null) {
throw new IllegalArgumentException("Parameter 'data' must not be null.");
}

return newEventBuilder().data(String.class, data).build();
}

This rather looks like Java 7 style, because since Java 8 this typically would be done with Objects utility:

default OutboundSseEvent newEvent(String data) {
Objects.requireNonNull(data, "Parameter 'data' must not be null.");
return newEventBuilder().data(String.class, data).build();
}

(BTW It is simply a question of style whether one would even inline
the check instead of using two code lines, since requireNonNull
actually is function.)

The result not only is a smaller binary but also faster execution, as less custom byte code will get created, verified and loaded. Hence the shared requireNonNull method is much earlier eligible for native compilation.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Donnerstag, 22. Juni 2017 13:23
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] Proposed Final Draft

Dear experts,

we'd like to announce that Proposed Final Draft was published on
JCP JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370





















Re: Proposed Final Draft -- Java 8 Implementation

 

Ok I agree that we should not touch old APIs, but we should add @throws to new APIs like Sse and SseEventSink then. Also I am not convinced that IAE is only for application callers: Why should it stay open which exception an implementation will receive in case of wrong parameters? I mean, it will definitively receive SOME exception and it is only good for the implementation provider to know WHICH catch (IAE vs NPE)?

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Montag, 10. Juli 2017 18:57
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Annotating provider method arguments doesn't make much sense, since they are invoked by the implementation - declaring @throws makes more sense on methods which are invoked directly by the application code..

.. but I'm sure you'll find some methods which are not annotated and maybe should be. Unfortunately, we are not going to fix that now, since exposing that information usually requires adding or modifying TCK test suite and we can't do that at this moment.

Regards,
Pavel


On 10/07/2017 18:44, Markus KARG wrote:
Lol ;-D

Pavel, I meant the SSE API, actually, but right, I did not check ALL APIs. So to make your claim a valid argument, we should now add @throws IllegalArgumentExcpetion to the JavaDocs of ALL places where it is currently NOT covered by your grep output to keep consistency (like MessageBodyWriter, Providers, WriterInterceptor, InterceptorContext and so on)...?

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Montag, 10. Juli 2017 07:03
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

:-)

$ grep -r IllegalArgument .
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/client/Client.java: * @throws IllegalArgumentException
in case the supplied string is not a valid URI template.
./javax/ws/rs/client/ClientBuilder.java: * @throws
IllegalArgumentException when the value is negative.
./javax/ws/rs/client/ClientBuilder.java: * @throws
IllegalArgumentException when the value is negative.
./javax/ws/rs/client/Entity.java: * @throws IllegalArgumentException
if the supplied string cannot be parsed
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/core/CacheControl.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: throw new
IllegalArgumentException("name==null");
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if the supplied string cannot be parsed
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if value is {@code null}.
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if value is {@code null}.
./javax/ws/rs/core/EntityTag.java: throw new
IllegalArgumentException("value==null");
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/GenericEntity.java: * @throws
IllegalArgumentException if entity is {@code null}.
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("The entity must not be null");
./javax/ws/rs/core/GenericEntity.java: * @throws
IllegalArgumentException if the entity is not assignable to
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("Arguments must not be null.");
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("The type is incompatible with the class of
the entity.");
./javax/ws/rs/core/GenericType.java: * the following case would throw an {@link IllegalArgumentException}:
./javax/ws/rs/core/GenericType.java: * @throws
IllegalArgumentException in case the generic type parameter value is not
./javax/ws/rs/core/GenericType.java: * @throws
IllegalArgumentException if genericType is {@code null} or not an instance of
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException("Type must not be null");
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException("Type parameter " + type.toString() + " not a class or " +
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException(e);
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException(currentType + " does not specify the type parameter T of GenericType<T>");
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
a syntax error is found.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
uri is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
uri is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
path is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
resource is not annotated with {@link javax.ws.rs.Path}
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
resource or method is {@code null}, or there is more
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the name is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the title is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the type is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if either the name or value are {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if there are any URI template parameters
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if there are any URI template parameters
./javax/ws/rs/core/MediaType.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/MultivaluedHashMap.java: * @throws
IllegalArgumentException if the initial capacity is negative.
./javax/ws/rs/core/MultivaluedHashMap.java: * @throws
IllegalArgumentException if the initial capacity is negative
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is {@code null}.
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is {@code null}.
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if tag is {@code null}.
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/Response.java: throw new
IllegalArgumentException();
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if uri is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if {@code uriTemplate} is not a valid URI template or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if link is {@code null}
./javax/ws/rs/core/UriBuilder.java: throw new
IllegalArgumentException("The provider 'link' parameter value is 'null'.");
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if path is {@code null}.
./javax/ws/rs/core/UriBuilder.java: public static UriBuilder
fromPath(String path) throws IllegalArgumentException {
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource is not annotated with
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource or method is {@code null},
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the {@code uri} parameter is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if {@code uriTemplate} is not a valid URI template or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if scheme is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if ssp cannot be parsed or is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if host is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if port is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if path is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource is {@code null}, or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource or method is {@code null},
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if method is {@code null} or is
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if segments or any element of segments
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if matrix cannot be parsed.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name or values is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if query cannot be parsed.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name or values is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or encoded value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or encoded value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/ParamConverter.java: * @throws
IllegalArgumentException if the supplied string cannot be
./javax/ws/rs/ext/ParamConverter.java: * @throws
IllegalArgumentException if the supplied object cannot be
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/RuntimeDelegate.java: throws
IllegalArgumentException, UnsupportedOperationException;
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/RuntimeDelegate.java: throws
IllegalArgumentException;
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
IllegalArgumentException if the supplied string cannot be
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
IllegalArgumentException if the supplied object cannot be
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the allowed methods varargs are {@code null}.
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the allowed methods varargs are {@code null}.
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: throw new
IllegalArgumentException("Response does not contain required 'Allow'
HTTP header.");
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'data' must not be null.");
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'data' must not be null.");
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'name' must not be null.");
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the provided parameter is {@code null}.
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the any of the provided parameters is {@code null}.
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the any of the provided parameters is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: throws
IllegalArgumentException {
./javax/ws/rs/WebApplicationException.java: throws IllegalArgumentException {
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if the response validation failed.
./javax/ws/rs/WebApplicationException.java: throw new IllegalArgumentException(String.format("Invalid response status code.
Expected [%d], was [%d].",
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if the response validation failed.
./javax/ws/rs/WebApplicationException.java: throw new
IllegalArgumentException(String.format(


On 08/07/2017 12:24, Markus KARG wrote:
Pavel, actually looking at the rest of the *API* (as you suggested) I did not find declaration of IAE, as it is solely part of the *implementation* -- it is rather undocumented that in particular IAE is to be thrown. Hence, as it is undocumented, you could not only replace it by NPE at any time in the RI (and such actually fulfil the expectation of the programmer when reading the JavaDocs), but also any other implementation could never had thrown IAE ever -- but possibly currently throws NPE. So to make your argument valid, we effectively must declare IAE in the JAX-RS JavaDocs -- and I really don't want that...

Due to the scarce time, it is ok to keept the status quo. But I don't
buy your argument. ;-)

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 18:06
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Well, if you look at the rest of the API, the pattern is to use IAE even when parameter is null, so .. being consistent with existing API wins over anything else..


On 07/07/2017 17:15, Markus KARG wrote:
So it is by intention that you still use IllegalArgumentException
instead of NPE. Understood. :-)

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 08:11
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Hi Markus,

I'm sorry I'm responding so late, I must have missed this email.

The main issue with Object.requireNonNull is that it throws a NPE instead of IAE, so we can't really use it on most of places - and I believe checking the value and throwing the exception would be much faster than calling Object.requireNonNull, catching the exception, etc..

Regards,
Pavel


On 24/06/2017 00:01, Markus KARG wrote:
A target of JAX-RS 2.1 is support for Java 8. So I wonder why still idioms of the pre-8 age are used in the API implementation instead of Java 8 idioms. For example:

default OutboundSseEvent newEvent(String data) {
if (data == null) {
throw new IllegalArgumentException("Parameter 'data' must not be null.");
}

return newEventBuilder().data(String.class, data).build();
}

This rather looks like Java 7 style, because since Java 8 this typically would be done with Objects utility:

default OutboundSseEvent newEvent(String data) {
Objects.requireNonNull(data, "Parameter 'data' must not be null.");
return newEventBuilder().data(String.class, data).build();
}

(BTW It is simply a question of style whether one would even inline
the check instead of using two code lines, since requireNonNull
actually is function.)

The result not only is a smaller binary but also faster execution, as less custom byte code will get created, verified and loaded. Hence the shared requireNonNull method is much earlier eligible for native compilation.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Donnerstag, 22. Juni 2017 13:23
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] Proposed Final Draft

Dear experts,

we'd like to announce that Proposed Final Draft was published on
JCP JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370




















Re: Proposed Final Draft -- Java 8 Implementation

Pavel Bucek
 

Annotating provider method arguments doesn't make much sense, since they are invoked by the implementation - declaring @throws makes more sense on methods which are invoked directly by the application code..

.. but I'm sure you'll find some methods which are not annotated and maybe should be. Unfortunately, we are not going to fix that now, since exposing that information usually requires adding or modifying TCK test suite and we can't do that at this moment.

Regards,
Pavel

On 10/07/2017 18:44, Markus KARG wrote:
Lol ;-D

Pavel, I meant the SSE API, actually, but right, I did not check ALL APIs. So to make your claim a valid argument, we should now add @throws IllegalArgumentExcpetion to the JavaDocs of ALL places where it is currently NOT covered by your grep output to keep consistency (like MessageBodyWriter, Providers, WriterInterceptor, InterceptorContext and so on)...?

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Montag, 10. Juli 2017 07:03
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

:-)

$ grep -r IllegalArgument .
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/client/Client.java: * @throws IllegalArgumentException
in case the supplied string is not a valid URI template.
./javax/ws/rs/client/ClientBuilder.java: * @throws
IllegalArgumentException when the value is negative.
./javax/ws/rs/client/ClientBuilder.java: * @throws
IllegalArgumentException when the value is negative.
./javax/ws/rs/client/Entity.java: * @throws IllegalArgumentException
if the supplied string cannot be parsed
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/core/CacheControl.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: throw new
IllegalArgumentException("name==null");
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if the supplied string cannot be parsed
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if value is {@code null}.
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if value is {@code null}.
./javax/ws/rs/core/EntityTag.java: throw new
IllegalArgumentException("value==null");
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/GenericEntity.java: * @throws
IllegalArgumentException if entity is {@code null}.
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("The entity must not be null");
./javax/ws/rs/core/GenericEntity.java: * @throws
IllegalArgumentException if the entity is not assignable to
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("Arguments must not be null.");
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("The type is incompatible with the class of the entity.");
./javax/ws/rs/core/GenericType.java: * the following case would throw an {@link IllegalArgumentException}:
./javax/ws/rs/core/GenericType.java: * @throws
IllegalArgumentException in case the generic type parameter value is not
./javax/ws/rs/core/GenericType.java: * @throws
IllegalArgumentException if genericType is {@code null} or not an instance of
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException("Type must not be null");
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException("Type parameter " + type.toString() + " not a class or " +
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException(e);
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException(currentType + " does not specify the type parameter T of GenericType<T>");
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
a syntax error is found.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
uri is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
uri is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
path is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
resource is not annotated with {@link javax.ws.rs.Path}
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
resource or method is {@code null}, or there is more
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the name is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the title is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the type is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if either the name or value are {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if there are any URI template parameters
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if there are any URI template parameters
./javax/ws/rs/core/MediaType.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/MultivaluedHashMap.java: * @throws
IllegalArgumentException if the initial capacity is negative.
./javax/ws/rs/core/MultivaluedHashMap.java: * @throws
IllegalArgumentException if the initial capacity is negative
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is {@code null}.
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is {@code null}.
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if tag is {@code null}.
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/Response.java: throw new
IllegalArgumentException();
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if uri is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if {@code uriTemplate} is not a valid URI template or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if link is {@code null}
./javax/ws/rs/core/UriBuilder.java: throw new
IllegalArgumentException("The provider 'link' parameter value is 'null'.");
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if path is {@code null}.
./javax/ws/rs/core/UriBuilder.java: public static UriBuilder
fromPath(String path) throws IllegalArgumentException {
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource is not annotated with
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource or method is {@code null},
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the {@code uri} parameter is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if {@code uriTemplate} is not a valid URI template or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if scheme is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if ssp cannot be parsed or is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if host is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if port is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if path is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource is {@code null}, or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource or method is {@code null},
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if method is {@code null} or is
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if segments or any element of segments
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if matrix cannot be parsed.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name or values is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if query cannot be parsed.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name or values is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or encoded value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or encoded value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/ParamConverter.java: * @throws
IllegalArgumentException if the supplied string cannot be
./javax/ws/rs/ext/ParamConverter.java: * @throws
IllegalArgumentException if the supplied object cannot be
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/RuntimeDelegate.java: throws
IllegalArgumentException, UnsupportedOperationException;
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/RuntimeDelegate.java: throws
IllegalArgumentException;
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
IllegalArgumentException if the supplied string cannot be
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
IllegalArgumentException if the supplied object cannot be
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the allowed methods varargs are {@code null}.
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the allowed methods varargs are {@code null}.
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: throw new
IllegalArgumentException("Response does not contain required 'Allow'
HTTP header.");
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'data' must not be null.");
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'data' must not be null.");
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'name' must not be null.");
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the provided parameter is {@code null}.
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the any of the provided parameters is {@code null}.
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the any of the provided parameters is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: throws IllegalArgumentException {
./javax/ws/rs/WebApplicationException.java: throws IllegalArgumentException {
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if the response validation failed.
./javax/ws/rs/WebApplicationException.java: throw new IllegalArgumentException(String.format("Invalid response status code.
Expected [%d], was [%d].",
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if the response validation failed.
./javax/ws/rs/WebApplicationException.java: throw new IllegalArgumentException(String.format(


On 08/07/2017 12:24, Markus KARG wrote:
Pavel, actually looking at the rest of the *API* (as you suggested) I did not find declaration of IAE, as it is solely part of the *implementation* -- it is rather undocumented that in particular IAE is to be thrown. Hence, as it is undocumented, you could not only replace it by NPE at any time in the RI (and such actually fulfil the expectation of the programmer when reading the JavaDocs), but also any other implementation could never had thrown IAE ever -- but possibly currently throws NPE. So to make your argument valid, we effectively must declare IAE in the JAX-RS JavaDocs -- and I really don't want that...

Due to the scarce time, it is ok to keept the status quo. But I don't
buy your argument. ;-)

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 18:06
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Well, if you look at the rest of the API, the pattern is to use IAE even when parameter is null, so .. being consistent with existing API wins over anything else..


On 07/07/2017 17:15, Markus KARG wrote:
So it is by intention that you still use IllegalArgumentException
instead of NPE. Understood. :-)

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 08:11
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Hi Markus,

I'm sorry I'm responding so late, I must have missed this email.

The main issue with Object.requireNonNull is that it throws a NPE instead of IAE, so we can't really use it on most of places - and I believe checking the value and throwing the exception would be much faster than calling Object.requireNonNull, catching the exception, etc..

Regards,
Pavel


On 24/06/2017 00:01, Markus KARG wrote:
A target of JAX-RS 2.1 is support for Java 8. So I wonder why still idioms of the pre-8 age are used in the API implementation instead of Java 8 idioms. For example:

default OutboundSseEvent newEvent(String data) {
if (data == null) {
throw new IllegalArgumentException("Parameter 'data' must not be null.");
}

return newEventBuilder().data(String.class, data).build();
}

This rather looks like Java 7 style, because since Java 8 this typically would be done with Objects utility:

default OutboundSseEvent newEvent(String data) {
Objects.requireNonNull(data, "Parameter 'data' must not be null.");
return newEventBuilder().data(String.class, data).build();
}

(BTW It is simply a question of style whether one would even inline
the check instead of using two code lines, since requireNonNull
actually is function.)

The result not only is a smaller binary but also faster execution, as less custom byte code will get created, verified and loaded. Hence the shared requireNonNull method is much earlier eligible for native compilation.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Donnerstag, 22. Juni 2017 13:23
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] Proposed Final Draft

Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP
JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370



















Re: Proposed Final Draft -- Java 8 Implementation

 

Lol ;-D

Pavel, I meant the SSE API, actually, but right, I did not check ALL APIs. So to make your claim a valid argument, we should now add @throws IllegalArgumentExcpetion to the JavaDocs of ALL places where it is currently NOT covered by your grep output to keep consistency (like MessageBodyWriter, Providers, WriterInterceptor, InterceptorContext and so on)...?

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Montag, 10. Juli 2017 07:03
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

:-)

$ grep -r IllegalArgument .
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/client/Client.java: * @throws IllegalArgumentException
in case the supplied string is not a valid URI template.
./javax/ws/rs/client/ClientBuilder.java: * @throws
IllegalArgumentException when the value is negative.
./javax/ws/rs/client/ClientBuilder.java: * @throws
IllegalArgumentException when the value is negative.
./javax/ws/rs/client/Entity.java: * @throws IllegalArgumentException
if the supplied string cannot be parsed
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/core/CacheControl.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: throw new
IllegalArgumentException("name==null");
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException
if the supplied string cannot be parsed
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if value is {@code null}.
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if value is {@code null}.
./javax/ws/rs/core/EntityTag.java: throw new
IllegalArgumentException("value==null");
./javax/ws/rs/core/EntityTag.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/GenericEntity.java: * @throws
IllegalArgumentException if entity is {@code null}.
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("The entity must not be null");
./javax/ws/rs/core/GenericEntity.java: * @throws
IllegalArgumentException if the entity is not assignable to
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("Arguments must not be null.");
./javax/ws/rs/core/GenericEntity.java: throw new
IllegalArgumentException("The type is incompatible with the class of the entity.");
./javax/ws/rs/core/GenericType.java: * the following case would throw an {@link IllegalArgumentException}:
./javax/ws/rs/core/GenericType.java: * @throws
IllegalArgumentException in case the generic type parameter value is not
./javax/ws/rs/core/GenericType.java: * @throws
IllegalArgumentException if genericType is {@code null} or not an instance of
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException("Type must not be null");
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException("Type parameter " + type.toString() + " not a class or " +
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException(e);
./javax/ws/rs/core/GenericType.java: throw new
IllegalArgumentException(currentType + " does not specify the type parameter T of GenericType<T>");
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
a syntax error is found.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
uri is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
uri is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
path is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
resource is not annotated with {@link javax.ws.rs.Path}
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if
resource or method is {@code null}, or there is more
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the name is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the title is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if the type is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if either the name or value are {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if there are any URI template parameters
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException
if there are any URI template parameters
./javax/ws/rs/core/MediaType.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/MultivaluedHashMap.java: * @throws
IllegalArgumentException if the initial capacity is negative.
./javax/ws/rs/core/MultivaluedHashMap.java: * @throws
IllegalArgumentException if the initial capacity is negative
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws
IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is {@code null}.
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is {@code null}.
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException
if tag is {@code null}.
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/Response.java: throw new
IllegalArgumentException();
./javax/ws/rs/core/Response.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if uri is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if {@code uriTemplate} is not a valid URI template or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if link is {@code null}
./javax/ws/rs/core/UriBuilder.java: throw new
IllegalArgumentException("The provider 'link' parameter value is 'null'.");
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if path is {@code null}.
./javax/ws/rs/core/UriBuilder.java: public static UriBuilder
fromPath(String path) throws IllegalArgumentException {
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource is not annotated with
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource or method is {@code null},
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the {@code uri} parameter is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if {@code uriTemplate} is not a valid URI template or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if scheme is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if ssp cannot be parsed or is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if host is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if port is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if path is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource is {@code null}, or
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if resource or method is {@code null},
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if method is {@code null} or is
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if segments or any element of segments
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if matrix cannot be parsed.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name or values is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if query cannot be parsed.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name or values is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null}
template name or encoded value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the resolved template name or encoded value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws
IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws
IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new
IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/ParamConverter.java: * @throws
IllegalArgumentException if the supplied string cannot be
./javax/ws/rs/ext/ParamConverter.java: * @throws
IllegalArgumentException if the supplied object cannot be
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/RuntimeDelegate.java: throws
IllegalArgumentException, UnsupportedOperationException;
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
java.lang.IllegalArgumentException
./javax/ws/rs/ext/RuntimeDelegate.java: throws
IllegalArgumentException;
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
IllegalArgumentException if the supplied string cannot be
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws
IllegalArgumentException if the supplied object cannot be
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the allowed methods varargs are {@code null}.
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the allowed methods varargs are {@code null}.
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: throw new
IllegalArgumentException("Response does not contain required 'Allow'
HTTP header.");
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/RedirectionException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws
IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws
IllegalArgumentException in case the status code set in the response
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'data' must not be null.");
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'data' must not be null.");
./javax/ws/rs/sse/Sse.java: throw new
IllegalArgumentException("Parameter 'name' must not be null.");
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the provided parameter is {@code null}.
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the any of the provided parameters is {@code null}.
./javax/ws/rs/sse/SseEventSource.java: * @throws
IllegalArgumentException when the any of the provided parameters is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: throws IllegalArgumentException {
./javax/ws/rs/WebApplicationException.java: throws IllegalArgumentException {
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if the response validation failed.
./javax/ws/rs/WebApplicationException.java: throw new IllegalArgumentException(String.format("Invalid response status code.
Expected [%d], was [%d].",
./javax/ws/rs/WebApplicationException.java: * @throws
IllegalArgumentException if the response validation failed.
./javax/ws/rs/WebApplicationException.java: throw new IllegalArgumentException(String.format(


On 08/07/2017 12:24, Markus KARG wrote:
Pavel, actually looking at the rest of the *API* (as you suggested) I did not find declaration of IAE, as it is solely part of the *implementation* -- it is rather undocumented that in particular IAE is to be thrown. Hence, as it is undocumented, you could not only replace it by NPE at any time in the RI (and such actually fulfil the expectation of the programmer when reading the JavaDocs), but also any other implementation could never had thrown IAE ever -- but possibly currently throws NPE. So to make your argument valid, we effectively must declare IAE in the JAX-RS JavaDocs -- and I really don't want that...

Due to the scarce time, it is ok to keept the status quo. But I don't
buy your argument. ;-)

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 18:06
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Well, if you look at the rest of the API, the pattern is to use IAE even when parameter is null, so .. being consistent with existing API wins over anything else..


On 07/07/2017 17:15, Markus KARG wrote:
So it is by intention that you still use IllegalArgumentException
instead of NPE. Understood. :-)

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 08:11
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Hi Markus,

I'm sorry I'm responding so late, I must have missed this email.

The main issue with Object.requireNonNull is that it throws a NPE instead of IAE, so we can't really use it on most of places - and I believe checking the value and throwing the exception would be much faster than calling Object.requireNonNull, catching the exception, etc..

Regards,
Pavel


On 24/06/2017 00:01, Markus KARG wrote:
A target of JAX-RS 2.1 is support for Java 8. So I wonder why still idioms of the pre-8 age are used in the API implementation instead of Java 8 idioms. For example:

default OutboundSseEvent newEvent(String data) {
if (data == null) {
throw new IllegalArgumentException("Parameter 'data' must not be null.");
}

return newEventBuilder().data(String.class, data).build();
}

This rather looks like Java 7 style, because since Java 8 this typically would be done with Objects utility:

default OutboundSseEvent newEvent(String data) {
Objects.requireNonNull(data, "Parameter 'data' must not be null.");
return newEventBuilder().data(String.class, data).build();
}

(BTW It is simply a question of style whether one would even inline
the check instead of using two code lines, since requireNonNull
actually is function.)

The result not only is a smaller binary but also faster execution, as less custom byte code will get created, verified and loaded. Hence the shared requireNonNull method is much earlier eligible for native compilation.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Donnerstag, 22. Juni 2017 13:23
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] Proposed Final Draft

Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP
JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370

















Re: Proposed Final Draft -- Java 8 Implementation

Pavel Bucek
 

:-)

$ grep -r IllegalArgument .
./javax/ws/rs/BadRequestException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/BadRequestException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/client/Client.java: * @throws IllegalArgumentException in case the supplied string is not a valid URI template.
./javax/ws/rs/client/ClientBuilder.java: * @throws IllegalArgumentException when the value is negative.
./javax/ws/rs/client/ClientBuilder.java: * @throws IllegalArgumentException when the value is negative.
./javax/ws/rs/client/Entity.java: * @throws IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ClientErrorException.java: * @throws IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/core/CacheControl.java: * @throws IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: throw new IllegalArgumentException("name==null");
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/Cookie.java: throws IllegalArgumentException {
./javax/ws/rs/core/Cookie.java: * @throws IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/EntityTag.java: * @throws IllegalArgumentException if value is {@code null}.
./javax/ws/rs/core/EntityTag.java: * @throws IllegalArgumentException if value is {@code null}.
./javax/ws/rs/core/EntityTag.java: throw new IllegalArgumentException("value==null");
./javax/ws/rs/core/EntityTag.java: * @throws IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/GenericEntity.java: * @throws IllegalArgumentException if entity is {@code null}.
./javax/ws/rs/core/GenericEntity.java: throw new IllegalArgumentException("The entity must not be null");
./javax/ws/rs/core/GenericEntity.java: * @throws IllegalArgumentException if the entity is not assignable to
./javax/ws/rs/core/GenericEntity.java: throw new IllegalArgumentException("Arguments must not be null.");
./javax/ws/rs/core/GenericEntity.java: throw new IllegalArgumentException("The type is incompatible with the class of the entity.");
./javax/ws/rs/core/GenericType.java: * the following case would throw an {@link IllegalArgumentException}:
./javax/ws/rs/core/GenericType.java: * @throws IllegalArgumentException in case the generic type parameter value is not
./javax/ws/rs/core/GenericType.java: * @throws IllegalArgumentException if genericType is {@code null} or not an instance of
./javax/ws/rs/core/GenericType.java: throw new IllegalArgumentException("Type must not be null");
./javax/ws/rs/core/GenericType.java: throw new IllegalArgumentException("Type parameter " + type.toString() + " not a class or " +
./javax/ws/rs/core/GenericType.java: throw new IllegalArgumentException(e);
./javax/ws/rs/core/GenericType.java: throw new IllegalArgumentException(currentType + " does not specify the type parameter T of GenericType<T>");
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if a syntax error is found.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if uri is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if uri is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if path is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if resource is not annotated with {@link javax.ws.rs.Path}
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if resource or method is {@code null}, or there is more
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if string representation of URI is invalid.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if the name is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if the title is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if the type is {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if either the name or value are {@code null}.
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/Link.java: * @throws IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/MediaType.java: * @throws IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/MultivaluedHashMap.java: * @throws IllegalArgumentException if the initial capacity is negative.
./javax/ws/rs/core/MultivaluedHashMap.java: * @throws IllegalArgumentException if the initial capacity is negative
./javax/ws/rs/core/NewCookie.java: * @throws IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws IllegalArgumentException if cookie is {@code null}.
./javax/ws/rs/core/NewCookie.java: * @throws IllegalArgumentException if the supplied string cannot be parsed
./javax/ws/rs/core/Request.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Request.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException if tag is {@code null}.
./javax/ws/rs/core/Response.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException if status is less than {@code 100} or greater
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/Response.java: throw new IllegalArgumentException();
./javax/ws/rs/core/Response.java: * @throws IllegalArgumentException if status is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if uri is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if {@code uriTemplate} is not a valid URI template or
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if link is {@code null}
./javax/ws/rs/core/UriBuilder.java: throw new IllegalArgumentException("The provider 'link' parameter value is 'null'.");
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if path is {@code null}.
./javax/ws/rs/core/UriBuilder.java: public static UriBuilder fromPath(String path) throws IllegalArgumentException {
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if resource is not annotated with
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if resource or method is {@code null},
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if the {@code uri} parameter is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if {@code uriTemplate} is not a valid URI template or
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if scheme is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if ssp cannot be parsed or is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if host is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if port is invalid.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if path is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if resource is {@code null}, or
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if resource or method is {@code null},
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if method is {@code null} or is
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if segments or any element of segments
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if matrix cannot be parsed.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if name or values is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if query cannot be parsed.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if name or values is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if name is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null} template name or value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if the resolved template name or value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null} template name or value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if the resolved template name or value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * In case a {@code null} template name or encoded value is entered a {@link IllegalArgumentException}
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if the resolved template name or encoded value is {@code null}.
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: throws IllegalArgumentException;
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if the name-value map or any of the names or values
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/UriBuilder.java: * @throws IllegalArgumentException if there are any URI template parameters
./javax/ws/rs/core/UriBuilder.java: throws IllegalArgumentException, UriBuilderException;
./javax/ws/rs/core/Variant.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: throw new IllegalArgumentException("mediaType, language, encoding all null");
./javax/ws/rs/core/Variant.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/core/Variant.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/ext/ParamConverter.java: * @throws IllegalArgumentException if the supplied string cannot be
./javax/ws/rs/ext/ParamConverter.java: * @throws IllegalArgumentException if the supplied object cannot be
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/ext/RuntimeDelegate.java: throws IllegalArgumentException, UnsupportedOperationException;
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws java.lang.IllegalArgumentException
./javax/ws/rs/ext/RuntimeDelegate.java: throws IllegalArgumentException;
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws IllegalArgumentException if the supplied string cannot be
./javax/ws/rs/ext/RuntimeDelegate.java: * @throws IllegalArgumentException if the supplied object cannot be
./javax/ws/rs/ForbiddenException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ForbiddenException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/InternalServerErrorException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAcceptableException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws IllegalArgumentException in case the allowed methods varargs are {@code null}.
./javax/ws/rs/NotAllowedException.java: * @throws IllegalArgumentException in case the allowed methods varargs are {@code null}.
./javax/ws/rs/NotAllowedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAllowedException.java: throw new IllegalArgumentException("Response does not contain required 'Allow' HTTP header.");
./javax/ws/rs/NotAuthorizedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotAuthorizedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotFoundException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/NotSupportedException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/RedirectionException.java: * @throws IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/RedirectionException.java: * @throws IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/RedirectionException.java: * @throws IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/RedirectionException.java: * @throws IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/RedirectionException.java: * @throws IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/RedirectionException.java: * @throws IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the status code is {@code null} or is not from
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the status code is not a valid HTTP status code or
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServerErrorException.java: * @throws IllegalArgumentException in case the response status code is not from the
./javax/ws/rs/ServiceUnavailableException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/ServiceUnavailableException.java: * @throws IllegalArgumentException in case the status code set in the response
./javax/ws/rs/sse/Sse.java: throw new IllegalArgumentException("Parameter 'data' must not be null.");
./javax/ws/rs/sse/Sse.java: throw new IllegalArgumentException("Parameter 'data' must not be null.");
./javax/ws/rs/sse/Sse.java: throw new IllegalArgumentException("Parameter 'name' must not be null.");
./javax/ws/rs/sse/SseEventSource.java: * @throws IllegalArgumentException when the provided parameter is {@code null}.
./javax/ws/rs/sse/SseEventSource.java: * @throws IllegalArgumentException when the any of the provided parameters is {@code null}.
./javax/ws/rs/sse/SseEventSource.java: * @throws IllegalArgumentException when the any of the provided parameters is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: * @throws IllegalArgumentException if status is {@code null}.
./javax/ws/rs/WebApplicationException.java: throws IllegalArgumentException {
./javax/ws/rs/WebApplicationException.java: throws IllegalArgumentException {
./javax/ws/rs/WebApplicationException.java: * @throws IllegalArgumentException if the response validation failed.
./javax/ws/rs/WebApplicationException.java: throw new IllegalArgumentException(String.format("Invalid response status code. Expected [%d], was [%d].",
./javax/ws/rs/WebApplicationException.java: * @throws IllegalArgumentException if the response validation failed.
./javax/ws/rs/WebApplicationException.java: throw new IllegalArgumentException(String.format(

On 08/07/2017 12:24, Markus KARG wrote:
Pavel, actually looking at the rest of the *API* (as you suggested) I did not find declaration of IAE, as it is solely part of the *implementation* -- it is rather undocumented that in particular IAE is to be thrown. Hence, as it is undocumented, you could not only replace it by NPE at any time in the RI (and such actually fulfil the expectation of the programmer when reading the JavaDocs), but also any other implementation could never had thrown IAE ever -- but possibly currently throws NPE. So to make your argument valid, we effectively must declare IAE in the JAX-RS JavaDocs -- and I really don't want that...

Due to the scarce time, it is ok to keept the status quo. But I don't buy your argument. ;-)

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 18:06
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Well, if you look at the rest of the API, the pattern is to use IAE even when parameter is null, so .. being consistent with existing API wins over anything else..


On 07/07/2017 17:15, Markus KARG wrote:
So it is by intention that you still use IllegalArgumentException
instead of NPE. Understood. :-)

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 08:11
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Hi Markus,

I'm sorry I'm responding so late, I must have missed this email.

The main issue with Object.requireNonNull is that it throws a NPE instead of IAE, so we can't really use it on most of places - and I believe checking the value and throwing the exception would be much faster than calling Object.requireNonNull, catching the exception, etc..

Regards,
Pavel


On 24/06/2017 00:01, Markus KARG wrote:
A target of JAX-RS 2.1 is support for Java 8. So I wonder why still idioms of the pre-8 age are used in the API implementation instead of Java 8 idioms. For example:

default OutboundSseEvent newEvent(String data) {
if (data == null) {
throw new IllegalArgumentException("Parameter 'data' must not be null.");
}

return newEventBuilder().data(String.class, data).build();
}

This rather looks like Java 7 style, because since Java 8 this typically would be done with Objects utility:

default OutboundSseEvent newEvent(String data) {
Objects.requireNonNull(data, "Parameter 'data' must not be null.");
return newEventBuilder().data(String.class, data).build();
}

(BTW It is simply a question of style whether one would even inline
the check instead of using two code lines, since requireNonNull
actually is function.)

The result not only is a smaller binary but also faster execution, as less custom byte code will get created, verified and loaded. Hence the shared requireNonNull method is much earlier eligible for native compilation.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Donnerstag, 22. Juni 2017 13:23
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] Proposed Final Draft

Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP
JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370
















Re: Proposed Final Draft -- Java 8 Implementation

 

Pavel, actually looking at the rest of the *API* (as you suggested) I did not find declaration of IAE, as it is solely part of the *implementation* -- it is rather undocumented that in particular IAE is to be thrown. Hence, as it is undocumented, you could not only replace it by NPE at any time in the RI (and such actually fulfil the expectation of the programmer when reading the JavaDocs), but also any other implementation could never had thrown IAE ever -- but possibly currently throws NPE. So to make your argument valid, we effectively must declare IAE in the JAX-RS JavaDocs -- and I really don't want that...

Due to the scarce time, it is ok to keept the status quo. But I don't buy your argument. ;-)

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 18:06
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Well, if you look at the rest of the API, the pattern is to use IAE even when parameter is null, so .. being consistent with existing API wins over anything else..


On 07/07/2017 17:15, Markus KARG wrote:
So it is by intention that you still use IllegalArgumentException
instead of NPE. Understood. :-)

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 08:11
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Hi Markus,

I'm sorry I'm responding so late, I must have missed this email.

The main issue with Object.requireNonNull is that it throws a NPE instead of IAE, so we can't really use it on most of places - and I believe checking the value and throwing the exception would be much faster than calling Object.requireNonNull, catching the exception, etc..

Regards,
Pavel


On 24/06/2017 00:01, Markus KARG wrote:
A target of JAX-RS 2.1 is support for Java 8. So I wonder why still idioms of the pre-8 age are used in the API implementation instead of Java 8 idioms. For example:

default OutboundSseEvent newEvent(String data) {
if (data == null) {
throw new IllegalArgumentException("Parameter 'data' must not be null.");
}

return newEventBuilder().data(String.class, data).build();
}

This rather looks like Java 7 style, because since Java 8 this typically would be done with Objects utility:

default OutboundSseEvent newEvent(String data) {
Objects.requireNonNull(data, "Parameter 'data' must not be null.");
return newEventBuilder().data(String.class, data).build();
}

(BTW It is simply a question of style whether one would even inline
the check instead of using two code lines, since requireNonNull
actually is function.)

The result not only is a smaller binary but also faster execution, as less custom byte code will get created, verified and loaded. Hence the shared requireNonNull method is much earlier eligible for native compilation.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io
[mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Donnerstag, 22. Juni 2017 13:23
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] Proposed Final Draft

Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP
JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370













Re: Proposed Final Draft -- Java 8 Implementation

Pavel Bucek
 

Well, if you look at the rest of the API, the pattern is to use IAE even when parameter is null, so .. being consistent with existing API wins over anything else..

On 07/07/2017 17:15, Markus KARG wrote:
So it is by intention that you still use IllegalArgumentException instead of NPE. Understood. :-)

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 08:11
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Hi Markus,

I'm sorry I'm responding so late, I must have missed this email.

The main issue with Object.requireNonNull is that it throws a NPE instead of IAE, so we can't really use it on most of places - and I believe checking the value and throwing the exception would be much faster than calling Object.requireNonNull, catching the exception, etc..

Regards,
Pavel


On 24/06/2017 00:01, Markus KARG wrote:
A target of JAX-RS 2.1 is support for Java 8. So I wonder why still idioms of the pre-8 age are used in the API implementation instead of Java 8 idioms. For example:

default OutboundSseEvent newEvent(String data) {
if (data == null) {
throw new IllegalArgumentException("Parameter 'data' must not be null.");
}

return newEventBuilder().data(String.class, data).build();
}

This rather looks like Java 7 style, because since Java 8 this typically would be done with Objects utility:

default OutboundSseEvent newEvent(String data) {
Objects.requireNonNull(data, "Parameter 'data' must not be null.");
return newEventBuilder().data(String.class, data).build();
}

(BTW It is simply a question of style whether one would even inline
the check instead of using two code lines, since requireNonNull
actually is function.)

The result not only is a smaller binary but also faster execution, as less custom byte code will get created, verified and loaded. Hence the shared requireNonNull method is much earlier eligible for native compilation.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Donnerstag, 22. Juni 2017 13:23
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] Proposed Final Draft

Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP
JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370












Re: Proposed Final Draft -- Java 8 Implementation

 

So it is by intention that you still use IllegalArgumentException instead of NPE. Understood. :-)

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Freitag, 7. Juli 2017 08:11
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] Proposed Final Draft -- Java 8 Implementation

Hi Markus,

I'm sorry I'm responding so late, I must have missed this email.

The main issue with Object.requireNonNull is that it throws a NPE instead of IAE, so we can't really use it on most of places - and I believe checking the value and throwing the exception would be much faster than calling Object.requireNonNull, catching the exception, etc..

Regards,
Pavel


On 24/06/2017 00:01, Markus KARG wrote:
A target of JAX-RS 2.1 is support for Java 8. So I wonder why still idioms of the pre-8 age are used in the API implementation instead of Java 8 idioms. For example:

default OutboundSseEvent newEvent(String data) {
if (data == null) {
throw new IllegalArgumentException("Parameter 'data' must not be null.");
}

return newEventBuilder().data(String.class, data).build();
}

This rather looks like Java 7 style, because since Java 8 this typically would be done with Objects utility:

default OutboundSseEvent newEvent(String data) {
Objects.requireNonNull(data, "Parameter 'data' must not be null.");
return newEventBuilder().data(String.class, data).build();
}

(BTW It is simply a question of style whether one would even inline
the check instead of using two code lines, since requireNonNull
actually is function.)

The result not only is a smaller binary but also faster execution, as less custom byte code will get created, verified and loaded. Hence the shared requireNonNull method is much earlier eligible for native compilation.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io]
On Behalf Of Pavel Bucek
Sent: Donnerstag, 22. Juni 2017 13:23
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] Proposed Final Draft

Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP
JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370








Re: Proposed Final Draft

Andy McCright
 

Hi Pavel,
 
Thank you for the clarification, and my apologies for bringing this up so late - a colleague and I ran into some confusion on this point, so I thought I would bring if forward in hopes that other users might avoid a similar confusion.
 
I have opened a pull request [1] with my suggested changes to the javadoc.  I think this may help users better understand the differences in the Java SE vs EE environments.
 
Thanks again - it has been a pleasure working with you in this expert group!
 
Andy
 
[1] https://github.com/jax-rs/api/pull/560

J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 

----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: Re: [jaxrs] Proposed Final Draft
Date: Fri, Jul 7, 2017 12:25 AM
 

Hi Andy,

it is very late for changing anything..

We are not saying that on Java EE environment ClientBuilder#executorService and #scheduledExecutorService have no effect - but it might sound that way.

The "default" for Java SE is NOT ForkJoinPool#commonPool, since it is not meant for I/O operations. On Java SE, the default is intentionally left as implementation specific.

And I'm not sure what you mean by "what about Future Objects returned from ..." - if there is any need for starting a thread, it should be done on the executor service provided in the client builder. Note that the javadoc for ClientBuilder#executorService mentions:

* Provided executor service will be used for executing asynchronous tasks.

And Invocation#buildGet() (and others):

* Submit the request for an asynchronous invocation and receive a future
* response back.

Which seem to imply what I wrote..

It might be still possible to tweak the javadoc, I'll wait for your reaction - whether this makes sense or not and then will inquire about possible javadoc adjustment.

Thanks and regards,
Pavel


On 07/07/2017 00:35, Andy McCright wrote:
Hi Pavel,
 
If it is not too late, I'm wondering if we could clarify the uses of ClientBuilder.executorService(...) and scheduledExecutorService(...).
 
Are we saying that in a Java EE environment, these methods have no effect?  If so, can we change this text:
When running in a Java EE container, implementations are required to use the container-managed executor service.
 
to:
When running in a Java EE container, this method will have no effect.  The container will always use the container-managed executor service.
 
and a similar change for the executorService method?
 
 
If instead we are saying that in a Java EE container, the default ES and SES are different than in Java SE, we should clarify it like this:
When running in a Java EE container, the default scheduled executor service will be the container-managed service.  In Java SE, this will be the ForkJoinPool service.
 
 
I think we should also clarify what methods will use these services.  The javadoc currently provides some guidance with:
     * @see Invocation.Builder#async()
     * @see Invocation.Builder#rx()
     * @see RxInvokerProvider#getRxInvoker(SyncInvoker, ExecutorService)
and
     * @see SseEventSource.Builder#reconnectingEvery(long, TimeUnit)
 
but what about Future objects returned from methods like buildGet().submit(...)?
 
Thanks,
 
Andy
 


J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: [jaxrs] Proposed Final Draft
Date: Thu, Jun 22, 2017 6:18 AM
 
Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us
know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370




 
 
 
 


Re: Proposed Final Draft -- Java 8 Implementation

Pavel Bucek
 

Hi Markus,

I'm sorry I'm responding so late, I must have missed this email.

The main issue with Object.requireNonNull is that it throws a NPE instead of IAE, so we can't really use it on most of places - and I believe checking the value and throwing the exception would be much faster than calling Object.requireNonNull, catching the exception, etc..

Regards,
Pavel

On 24/06/2017 00:01, Markus KARG wrote:
A target of JAX-RS 2.1 is support for Java 8. So I wonder why still idioms of the pre-8 age are used in the API implementation instead of Java 8 idioms. For example:

default OutboundSseEvent newEvent(String data) {
if (data == null) {
throw new IllegalArgumentException("Parameter 'data' must not be null.");
}

return newEventBuilder().data(String.class, data).build();
}

This rather looks like Java 7 style, because since Java 8 this typically would be done with Objects utility:

default OutboundSseEvent newEvent(String data) {
Objects.requireNonNull(data, "Parameter 'data' must not be null.");
return newEventBuilder().data(String.class, data).build();
}

(BTW It is simply a question of style whether one would even inline the check instead of using two code lines, since requireNonNull actually is function.)

The result not only is a smaller binary but also faster execution, as less custom byte code will get created, verified and loaded. Hence the shared requireNonNull method is much earlier eligible for native compilation.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Donnerstag, 22. Juni 2017 13:23
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] Proposed Final Draft

Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370







Re: Proposed Final Draft

Pavel Bucek
 

Hi Andy,

it is very late for changing anything..

We are not saying that on Java EE environment ClientBuilder#executorService and #scheduledExecutorService have no effect - but it might sound that way.

The "default" for Java SE is NOT ForkJoinPool#commonPool, since it is not meant for I/O operations. On Java SE, the default is intentionally left as implementation specific.

And I'm not sure what you mean by "what about Future Objects returned from ..." - if there is any need for starting a thread, it should be done on the executor service provided in the client builder. Note that the javadoc for ClientBuilder#executorService mentions:

* Provided executor service will be used for executing asynchronous tasks.

And Invocation#buildGet() (and others):

* Submit the request for an asynchronous invocation and receive a future
* response back.

Which seem to imply what I wrote..

It might be still possible to tweak the javadoc, I'll wait for your reaction - whether this makes sense or not and then will inquire about possible javadoc adjustment.

Thanks and regards,
Pavel


On 07/07/2017 00:35, Andy McCright wrote:
Hi Pavel,
 
If it is not too late, I'm wondering if we could clarify the uses of ClientBuilder.executorService(...) and scheduledExecutorService(...).
 
Are we saying that in a Java EE environment, these methods have no effect?  If so, can we change this text:
When running in a Java EE container, implementations are required to use the container-managed executor service.
 
to:
When running in a Java EE container, this method will have no effect.  The container will always use the container-managed executor service.
 
and a similar change for the executorService method?
 
 
If instead we are saying that in a Java EE container, the default ES and SES are different than in Java SE, we should clarify it like this:
When running in a Java EE container, the default scheduled executor service will be the container-managed service.  In Java SE, this will be the ForkJoinPool service.
 
 
I think we should also clarify what methods will use these services.  The javadoc currently provides some guidance with:
     * @see Invocation.Builder#async()
     * @see Invocation.Builder#rx()
     * @see RxInvokerProvider#getRxInvoker(SyncInvoker, ExecutorService)
and
     * @see SseEventSource.Builder#reconnectingEvery(long, TimeUnit)
 
but what about Future objects returned from methods like buildGet().submit(...)?
 
Thanks,
 
Andy
 


J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: [jaxrs] Proposed Final Draft
Date: Thu, Jun 22, 2017 6:18 AM
 
Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us
know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370



 
 



Re: Proposed Final Draft

Andy McCright
 

Hi Pavel,
 
If it is not too late, I'm wondering if we could clarify the uses of ClientBuilder.executorService(...) and scheduledExecutorService(...).
 
Are we saying that in a Java EE environment, these methods have no effect?  If so, can we change this text:
When running in a Java EE container, implementations are required to use the container-managed executor service.
 
to:
When running in a Java EE container, this method will have no effect.  The container will always use the container-managed executor service.
 
and a similar change for the executorService method?
 
 
If instead we are saying that in a Java EE container, the default ES and SES are different than in Java SE, we should clarify it like this:
When running in a Java EE container, the default scheduled executor service will be the container-managed service.  In Java SE, this will be the ForkJoinPool service.
 
 
I think we should also clarify what methods will use these services.  The javadoc currently provides some guidance with:
     * @see Invocation.Builder#async()
     * @see Invocation.Builder#rx()
     * @see RxInvokerProvider#getRxInvoker(SyncInvoker, ExecutorService)
and
     * @see SseEventSource.Builder#reconnectingEvery(long, TimeUnit)
 
but what about Future objects returned from methods like buildGet().submit(...)?
 
Thanks,
 
Andy
 


J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 

----- Original message -----
From: "Pavel Bucek" <pavel.bucek@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: [jaxrs] Proposed Final Draft
Date: Thu, Jun 22, 2017 6:18 AM
 
Dear experts,

we'd like to announce that Proposed Final Draft was published on JCP JSR
370 page [1].

I'd like to encourage you all to review provided artifacts and let us
know if you have any feedback.

Thanks and regards,
Pavel & Santiago

[1] https://jcp.org/en/jsr/detail?id=370



 
 


Re: FW: [jersey/jersey] SseEventSink invokes custom WriterInterceptor with wrong type, then throws NPE (#3592)

 

Pavel,

 

from the view of an application programmer the arguments look quite different: SSE within JAX-RS is not recognized as a different technology, but simply as a push-add-on that will keep the client's state representation continuously updated. So looking from the "top" (the business use case vs. the purely technical bottom) it is quite not understandable why the initial state representation can be produced using WriterInterceptor + MBW, but the updates cannot. In terms of code style, it looks even worse. In contrast to Sergey I need to say that even when I was not fond of Interceptors when Bill came up with the concept, I am a big fan of them meanwhile. The reason is pretty simple: Code style and separation of concers. Let me explain this with an example:

 

The following JAX-RS code produces the initial status on demand and it looks really, really smart as it is not cluttered with any technological code but is pure business domain code:

 

@GET public Optional<HardwareStatus> stuff(@PathParam("id") id) {

      return hardwareService.machine(id).map(Machine::getStatus);

}

 

Since JAX-RS 1.0 times there is a MBW in place for JAXB, since JAX-RS 2.1 for JSON, and possibly the application developer write one for producing PDFs from HardwareStatus. So the MBW's role here is "turn *business object* into network representation (XML, JSON, PDF). With JAX-RS the programmer wants to support Optional as that is produced by the hardware services since Java 8 (and he gets rid of exceptions as he does not care for them anyways). So he just adds an *interceptor* to unwrap. This is totally easy and straightfoward (replace Java class by Java class) to write and much simpler than writing an MBW (compare the actual code to do that and you will see). Interceptors mix in *technical* aspects (like replace Java class by Java class, use Caches, and so on). That single interceptor works with ANY MBW -- even if the developer adds more of them to produce new output formats (like HTML)! Now try to do that with an MBW as suggested: You would end up with either writing many MBWs (each technological-aspect-interceptor multiplied by each output-format-MBW) or by one synthetical MBW that does the M-by-N matrix all-in-one, hence is hard to maintain, is error-one due to ist complexity, and is clearly application specific. In contrast, each single format-MBW, and each single technical-aspect-interceptor, is so clean that it even could get commonly published for other users / projects!

 

Regarding the binding when the interceptor is needed / events being leighweight, I have to say that both is not an issue. Looking at the timing behavior of an event one will notice that processing in-memory (with or without interceptor) is not the top cost, but serializing via the network is. Also, an interceptor is pretty lightweight compared to an MBW as it is just a thin bunch of Java-by-Java replacer while the MBW is serializing data! And yes, certainly on the client one expects that each received event is first sent through all interceptors and he costs again are like zero compared to the network transfer. The binding of an interceptor is trivial: An business application programmer (which is someone different than a network layer programmer) simple expects that all interceptors will be running that are bundled with the application. He just does not want to specifically bind them. Why should he? The interceptor is added to the application to bring it a global solution (here: Support Optional<T>), so why should he not want to bind it globally? If he does not want it be executed, he can dynamically switch it off using a filter that modifies the config on the fly (that's what its good for)!

 

To sum up: From the view of an business application programmer, it would be really really really a big loss and very hard to understand to not support interceptors with SSE! :-)

 

-Markus

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Dienstag, 27. Juni 2017 11:34
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] FW: [jersey/jersey] SseEventSink invokes custom WriterInterceptor with wrong type, then throws NPE (#3592)

 

Hi Pavel

So, when the SSE server reports a new event which will need to be delivered to SSE Client in for ex JSON, MessageBodyWriter is supported, right ?
I'm not understanding why WriterInterceptor is not supported in this case to keep it consistent with the regular response case.

I agree one can write a custom MessageBodyWriter with injected @Providers - believe it or not but I'm nearly 100% sure this is what I used as an argument against introducing Reader/Writer interceptors back in 2.0 :-). Everything you can do with WriterInterceptor can most likely be done with the custom MBW.

But we do have WriterInterceptor now so it is not clear why not just let users use them with SSE too

Cheers, Sergey



On 27/06/17 06:42, Pavel Bucek wrote:

Markus,

yes, the issue is that mostly, you wouldn't want to mix "standard" response processing and SSE.

MessageBodyWriter is slightly different, since there is a type, the ultimate definition of that provider, which can be used for lookup and the registered provider won't have any consequence on running app, unless used as a return type. WriterInterceptor doesn't have anything like that - how would you mark the provider as "please use it only with some particular EventSink"? Also, if we'd think about symmetry - that would mean that we need to invoke ReaderInterceptor per each received client event.

EventSink is not a resource method, we have almost no control of the context from which it is invoked from. Allowing MessageBodyWriters to be invoked is a simplest enhancement compared to "writing only strings". Server sent event is supposed to be lightweight and cheap to send - notice that it doesn't need to be used, writing a string is still supported.

And your usecase - WriterInterceptor is not what you want to use in described scenario. You can implement a MessageBodyWriter, unwrap, lookup the MBW for the type you've unwrapped using injected Providers instance.

Regards,
Pavel


On 26/06/2017 21:45, Markus KARG wrote:

Experts,

 

I know this is really late to discuss, but in fact, I doubt that it was a good decision to take WriterInterceptor out of the processing chain for SSE events.

 

In fact, today I set up a demo app and needed this, so I actually thought that this is a Jersey bug…!

 

Is there any good technical reason that made us strip WriterInterceptor from the processing chain (see below commit)?

 

Scenario where this is a problem: I wanted to add support for Optional<T> to demonstrate Java 8 support of JAX-RS. So I set up a WriterInterceptor which simply unwraps Optional to produce T, so all existing pre-2.1 EntityWriters for T will still work. Great. But fails with SSE! Hence, one must rewrite all WriterIntercepors if support for Optional<T> is needed with SSE. Very bad thing!

 

Why don't we use WriterInterceptors with SSE events?

 

Thanks

-Markus

 

From: Pavel Bucek [mailto:notifications@...]
Sent: Montag, 26. Juni 2017 09:38
To: jersey/jersey
Cc: Markus KARG; Author
Subject: Re: [jersey/jersey] SseEventSink invokes custom WriterInterceptor with wrong type, then throws NPE (#3592)

 

Please see this: jax-rs/spec@b4b0d91


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

 

 


Re: FW: [jersey/jersey] SseEventSink invokes custom WriterInterceptor with wrong type, then throws NPE (#3592)

Sergey Beryozkin
 

Hi Pavel

So, when the SSE server reports a new event which will need to be delivered to SSE Client in for ex JSON, MessageBodyWriter is supported, right ?
I'm not understanding why WriterInterceptor is not supported in this case to keep it consistent with the regular response case.

I agree one can write a custom MessageBodyWriter with injected @Providers - believe it or not but I'm nearly 100% sure this is what I used as an argument against introducing Reader/Writer interceptors back in 2.0 :-). Everything you can do with WriterInterceptor can most likely be done with the custom MBW.

But we do have WriterInterceptor now so it is not clear why not just let users use them with SSE too

Cheers, Sergey



On 27/06/17 06:42, Pavel Bucek wrote:

Markus,

yes, the issue is that mostly, you wouldn't want to mix "standard" response processing and SSE.

MessageBodyWriter is slightly different, since there is a type, the ultimate definition of that provider, which can be used for lookup and the registered provider won't have any consequence on running app, unless used as a return type. WriterInterceptor doesn't have anything like that - how would you mark the provider as "please use it only with some particular EventSink"? Also, if we'd think about symmetry - that would mean that we need to invoke ReaderInterceptor per each received client event.

EventSink is not a resource method, we have almost no control of the context from which it is invoked from. Allowing MessageBodyWriters to be invoked is a simplest enhancement compared to "writing only strings". Server sent event is supposed to be lightweight and cheap to send - notice that it doesn't need to be used, writing a string is still supported.

And your usecase - WriterInterceptor is not what you want to use in described scenario. You can implement a MessageBodyWriter, unwrap, lookup the MBW for the type you've unwrapped using injected Providers instance.

Regards,
Pavel


On 26/06/2017 21:45, Markus KARG wrote:

Experts,

 

I know this is really late to discuss, but in fact, I doubt that it was a good decision to take WriterInterceptor out of the processing chain for SSE events.

 

In fact, today I set up a demo app and needed this, so I actually thought that this is a Jersey bug…!

 

Is there any good technical reason that made us strip WriterInterceptor from the processing chain (see below commit)?

 

Scenario where this is a problem: I wanted to add support for Optional<T> to demonstrate Java 8 support of JAX-RS. So I set up a WriterInterceptor which simply unwraps Optional to produce T, so all existing pre-2.1 EntityWriters for T will still work. Great. But fails with SSE! Hence, one must rewrite all WriterIntercepors if support for Optional<T> is needed with SSE. Very bad thing!

 

Why don't we use WriterInterceptors with SSE events?

 

Thanks

-Markus

 

From: Pavel Bucek [mailto:notifications@...]
Sent: Montag, 26. Juni 2017 09:38
To: jersey/jersey
Cc: Markus KARG; Author
Subject: Re: [jersey/jersey] SseEventSink invokes custom WriterInterceptor with wrong type, then throws NPE (#3592)

 

Please see this: jax-rs/spec@b4b0d91


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.




Re: FW: [jersey/jersey] SseEventSink invokes custom WriterInterceptor with wrong type, then throws NPE (#3592)

Pavel Bucek
 

Markus,

yes, the issue is that mostly, you wouldn't want to mix "standard" response processing and SSE.

MessageBodyWriter is slightly different, since there is a type, the ultimate definition of that provider, which can be used for lookup and the registered provider won't have any consequence on running app, unless used as a return type. WriterInterceptor doesn't have anything like that - how would you mark the provider as "please use it only with some particular EventSink"? Also, if we'd think about symmetry - that would mean that we need to invoke ReaderInterceptor per each received client event.

EventSink is not a resource method, we have almost no control of the context from which it is invoked from. Allowing MessageBodyWriters to be invoked is a simplest enhancement compared to "writing only strings". Server sent event is supposed to be lightweight and cheap to send - notice that it doesn't need to be used, writing a string is still supported.

And your usecase - WriterInterceptor is not what you want to use in described scenario. You can implement a MessageBodyWriter, unwrap, lookup the MBW for the type you've unwrapped using injected Providers instance.

Regards,
Pavel


On 26/06/2017 21:45, Markus KARG wrote:

Experts,

 

I know this is really late to discuss, but in fact, I doubt that it was a good decision to take WriterInterceptor out of the processing chain for SSE events.

 

In fact, today I set up a demo app and needed this, so I actually thought that this is a Jersey bug…!

 

Is there any good technical reason that made us strip WriterInterceptor from the processing chain (see below commit)?

 

Scenario where this is a problem: I wanted to add support for Optional<T> to demonstrate Java 8 support of JAX-RS. So I set up a WriterInterceptor which simply unwraps Optional to produce T, so all existing pre-2.1 EntityWriters for T will still work. Great. But fails with SSE! Hence, one must rewrite all WriterIntercepors if support for Optional<T> is needed with SSE. Very bad thing!

 

Why don't we use WriterInterceptors with SSE events?

 

Thanks

-Markus

 

From: Pavel Bucek [mailto:notifications@...]
Sent: Montag, 26. Juni 2017 09:38
To: jersey/jersey
Cc: Markus KARG; Author
Subject: Re: [jersey/jersey] SseEventSink invokes custom WriterInterceptor with wrong type, then throws NPE (#3592)

 

Please see this: jax-rs/spec@b4b0d91


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.