.
.
.
As of Mustang b45, the Descriptor.setFields() javadoc says (extract):
[...]
Throws:
RuntimeOperationsException - if the change fails for any reason. Wrapped exception is IllegalArgumentException if fieldNames or fieldValues is null, or if the arrays are of different lengths, or if there is an illegal value in one of them. Wrapped exception is UnsupportedOperationException if the descriptor is immutable, and the call would change its contents.
[...]
and the ImmutableDescriptor.setFields() javadoc says (extract):
[...]
Throws:
RuntimeOperationsException - for illegal value for field Names or field Values. Neither can be null. The array lengths must be equal. If the call would succeed on a mutable descriptor and change its contents, then this exception will be thrown and the wrapped exception will be UnsupportedOperationException.
[...]
1) The latter javadoc should be aligned on the former.
2) The current implementation is not compliant in the case there is an illegal value in the fieldNames array. With both empty String and null values, a RuntimeOperationsException is effectively thrown but the awaited wrapped IllegalArgumentException is not there.
Notice modelmbean.DescriptorSupport.setFields() does the expected exception wrapping (so there is an asymmetry).