Skip to content

Improve error handling when creating empty WayPoints #18

@jenetics

Description

@jenetics

Trying to create a new WayPoint with

WayPoint.builder().build();

creates a NPE:

java.lang.NullPointerException
	at java.util.Objects.requireNonNull(Objects.java:203)
	at io.jenetics.jpx.WayPoint.<init>(WayPoint.java:158)
	at io.jenetics.jpx.WayPoint.<init>(WayPoint.java:67)
	at io.jenetics.jpx.WayPoint$Builder.build(WayPoint.java:952)

It is not allowed to create an empty WayPoint, but the NPE is not very clear in this case. It would be better to throw a IllegalStateException (or something similar) with a proper error message.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions