Implementation error?

Dear Rong,

In Locatable class constructor, “links” must not be null or empty, otherwise error will be triggered.

if (links != null && links.isEmpty()) {
throw new IllegalArgumentException(“empty links”);
}

However, in Locatable subclasses such as Party, Actor, Person, etc., “links” can be null if not specified.
It is also stated in the specification that links will have the optionality of “0…1”.
Is it an error or is intended?

Cheers,

Dear Saran,

not sure I understand you correctly.
If links is null, the exception would not be thrown.
Only if links is not null but is empty an exception is thrown, which I think is correct?

Cheers,
Sebastian

Saran Kong wrote:

Hi all,

Exactly, the null value will not trigger the exception. Only empty
list will in this case. This is desired semantics according to the
specs.

Cheers,
Rong

Dear Sebastian, Rong

Thank you very much. Now I got your point.

Cheers,