|
The implementation of PathImpl#getPathWithoutLeafNode() is just one line: return new PathImpl( nodeList.subList( 0, nodeList.size() - 1 ) );
When nodeList.size() is 0, ArrayList#subList(...) throws an IllegalArgumentException. When the nodeList is empty, I think the method should either return an empty PathImpl (it did something similar before a2ee8f883ea441a8f2d5f21e54f1c418845e4306) or null.
I encountered this problem when I tried to serialize an instance of PathImpl. The serializer called #getPathWithoutLeafNode() and then called it again on the returned PathImpl which eventually leads to the IllegalArgumentException.
|