8223914: specification of j.l.c.MethodTypeDesc::of should document better the exceptions thrown
Reviewed-by: rriggs
This commit is contained in:
parent
23b2871246
commit
ff2fa1e422
@ -65,7 +65,9 @@ public interface MethodTypeDesc
|
||||
* @param returnDesc a {@linkplain ClassDesc} describing the return type
|
||||
* @param paramDescs {@linkplain ClassDesc}s describing the argument types
|
||||
* @return a {@linkplain MethodTypeDesc} describing the desired method type
|
||||
* @throws NullPointerException if any argument is {@code null}
|
||||
* @throws NullPointerException if any argument or its contents are {@code null}
|
||||
* @throws IllegalArgumentException if any element of {@code paramDescs} is a
|
||||
* {@link ClassDesc} for {@code void}
|
||||
*/
|
||||
static MethodTypeDesc of(ClassDesc returnDesc, ClassDesc... paramDescs) {
|
||||
return new MethodTypeDescImpl(returnDesc, paramDescs);
|
||||
|
@ -286,5 +286,23 @@ public class MethodTypeDescTest extends SymbolicDescTest {
|
||||
catch (IllegalArgumentException e) {
|
||||
// good
|
||||
}
|
||||
|
||||
try {
|
||||
MethodTypeDesc r = MethodTypeDesc.of(CD_int, null);
|
||||
fail("ClassDesc array should not be null");
|
||||
}
|
||||
catch (NullPointerException e) {
|
||||
// good
|
||||
}
|
||||
|
||||
try {
|
||||
ClassDesc[] paramDescs = new ClassDesc[1];
|
||||
paramDescs[0] = null;
|
||||
MethodTypeDesc r = MethodTypeDesc.of(CD_int, paramDescs);
|
||||
fail("ClassDesc should not be null");
|
||||
}
|
||||
catch (NullPointerException e) {
|
||||
// good
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user