I'm usign Hibernate validator 6.0.14. I'm getting a IndexOutOfBoundsException in my application using Spring Boot 2, Spring Data REST.
Probably the bug comes from Spring but, PathImpl method
raises a IndexOutOfBoundsException.
Debugging I see the nodeList is empty and of course when you do
the exception is raised.
This is your source code just to point out better where the problem is (line 373 in HV 6.0.14):
This is the stack trace of the exception:
I opened a bug in Spring Data REST (https://jira.spring.io/projects/DATAREST/issues/DATAREST-1342) as well.
Could you paste the stack trace here too?
From what I can see, the issue is that Spring tries to serialize the PathImpl in JSON whereas it's not really designed to allow that.
I suppose one possibility to work around the issue would be to register a specific Jackson serializer for PathImpl. There must be a way to do that in Spring.
Thanks for your reply. I'm sure your are right. I opened a bug here for completeness. I'll try the workaround you suggested. Oliver Drotbohm from Spring already asked me for more info though.
Thanks
I will rename getPathWithoutLeafNode to createCopyWithoutLeafNode. It's definitely not a getter so it's better to not have a getter name.
That won't solve your issue though as some getters of NodeImpl will fail as they should only be used for certain types.
PathImpl and NodeImpl are definitely not designed to be serialized by Jackson.
Thanks for your support