Topics

Proposed Final Draft -- Java 8 Implementation


 

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


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







 

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








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












 

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













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
















 

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

















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



















 

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




















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