From a197efc5e1b0316261d0e76255dcb5d46addb32f Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Fri, 6 Sep 2024 16:22:32 +0200 Subject: [PATCH] fix: removed unreachable code --- .../org/tkit/onecx/bookmark/domain/daos/BookmarkDAO.java | 4 +--- .../rs/internal/controllers/BookmarkRestController.java | 6 ------ src/test/resources/data/test-internal.xml | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/tkit/onecx/bookmark/domain/daos/BookmarkDAO.java b/src/main/java/org/tkit/onecx/bookmark/domain/daos/BookmarkDAO.java index c8d3a4c..ad38fa1 100644 --- a/src/main/java/org/tkit/onecx/bookmark/domain/daos/BookmarkDAO.java +++ b/src/main/java/org/tkit/onecx/bookmark/domain/daos/BookmarkDAO.java @@ -35,9 +35,7 @@ public PageResult findBookmarksByCriteria(BookmarkSearchCriteria crite addSearchStringPredicate(predicates, cb, root.get(Bookmark_.appId), criteria.getAppId()); addSearchStringPredicate(predicates, cb, root.get(Bookmark_.userId), ApplicationContext.get().getPrincipal()); - if (!predicates.isEmpty()) { - cq.where(predicates.toArray(new Predicate[] {})); - } + cq.where(predicates.toArray(new Predicate[] {})); cq.orderBy(cb.desc(root.get(AbstractTraceableEntity_.CREATION_DATE))); return createPageQuery(cq, Page.of(criteria.getPageNumber(), criteria.getPageSize())).getPageResult(); } catch (Exception ex) { diff --git a/src/main/java/org/tkit/onecx/bookmark/rs/internal/controllers/BookmarkRestController.java b/src/main/java/org/tkit/onecx/bookmark/rs/internal/controllers/BookmarkRestController.java index 7f24a4e..29437ee 100644 --- a/src/main/java/org/tkit/onecx/bookmark/rs/internal/controllers/BookmarkRestController.java +++ b/src/main/java/org/tkit/onecx/bookmark/rs/internal/controllers/BookmarkRestController.java @@ -16,7 +16,6 @@ import org.tkit.onecx.bookmark.domain.daos.BookmarkDAO; import org.tkit.onecx.bookmark.rs.internal.mappers.BookmarkMapper; import org.tkit.onecx.bookmark.rs.internal.mappers.ExceptionMapper; -import org.tkit.quarkus.jpa.exceptions.ConstraintException; import org.tkit.quarkus.log.cdi.LogService; import gen.org.tkit.onecx.bookmark.rs.internal.BookmarksInternalApi; @@ -79,11 +78,6 @@ public Response searchBookmarksByCriteria(BookmarkSearchCriteriaDTO bookmarkSear return Response.ok(bookmarkMapper.mapPage(bookmarks)).build(); } - @ServerExceptionMapper - public RestResponse exception(ConstraintException ex) { - return exceptionMapper.exception(ex); - } - @ServerExceptionMapper public RestResponse constraint(ConstraintViolationException ex) { return exceptionMapper.constraint(ex); diff --git a/src/test/resources/data/test-internal.xml b/src/test/resources/data/test-internal.xml index ac6b6d9..4bacb3b 100644 --- a/src/test/resources/data/test-internal.xml +++ b/src/test/resources/data/test-internal.xml @@ -1,7 +1,7 @@ - +