Basically line number 110 and 113 throws the same king of exception. The reason the 'if' block is added, as i have mentioned on the above comment, UUID.fromString() have a gap in identifying a vali...
Basically line number 110 and 113 throws the same king of exception. The reason the 'if' block is added, as i have mentioned on the above comment, UUID.fromString() have a gap in identifying a valid UUIDs and its just a secondary check. So both section are expected to throw IllegalArgumentException if there is a wrong format. And finally this is caught by line 118 and we re-throw ValidationException in a single place, which is decorated with a proper message and values. If we are not going to code-duplicate line 119 to line 113.