diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2021-05-02 18:22:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-02 18:22:19 +0200 |
commit | b947b3750ce77bbb28addf1a86b7cfaf22d8243d (patch) | |
tree | 52211741e233ef7cd385665fd76adb441b5ba24a /container-core | |
parent | fd902f33fb92b00352fc515a8b37b5580db99387 (diff) |
Fix comparator
Diffstat (limited to 'container-core')
-rw-r--r-- | container-core/src/main/java/com/yahoo/restapi/RestApiImpl.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/container-core/src/main/java/com/yahoo/restapi/RestApiImpl.java b/container-core/src/main/java/com/yahoo/restapi/RestApiImpl.java index 29f1c2d294b..d63add5ed1d 100644 --- a/container-core/src/main/java/com/yahoo/restapi/RestApiImpl.java +++ b/container-core/src/main/java/com/yahoo/restapi/RestApiImpl.java @@ -157,7 +157,7 @@ class RestApiImpl implements RestApi { exceptionMappers.add(new ExceptionMapperHolder<>(RestApiException.class, (context, exception) -> exception.response())); } // Topologically sort children before superclasses, so most the specific match is found by iterating through mappers in order. - exceptionMappers.sort((a, b) -> a.type.isAssignableFrom(b.type) ? 1 : b.type.isAssignableFrom(a.type) ? -1 : 0); + exceptionMappers.sort((a, b) -> (a.type.isAssignableFrom(b.type) ? 1 : 0) + (b.type.isAssignableFrom(a.type) ? -1 : 0)); return exceptionMappers; } |