From f44074753c623dc0cc05bb4f27a5f87db30e8faf Mon Sep 17 00:00:00 2001 From: Radek Felcman Date: Mon, 17 Jul 2023 15:57:37 +0200 Subject: [PATCH] Bugfix for - Missing error message when calling JpaHelper.getReportQuery() with wrong argument Fixes #1893 Signed-off-by: Radek Felcman --- .../main/java/org/eclipse/persistence/jpa/JpaHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/jpa/JpaHelper.java b/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/jpa/JpaHelper.java index 8efd1ab54c8..9699cd69b81 100644 --- a/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/jpa/JpaHelper.java +++ b/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/jpa/JpaHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -91,7 +91,7 @@ public static ReportQuery getReportQuery(Query query) { return (ReportQuery)dbQuery; } - throw new IllegalArgumentException(ExceptionLocalization.buildMessage("jpa_helper_invalid_report_query" + query.getClass())); + throw new IllegalArgumentException(ExceptionLocalization.buildMessage("jpa_helper_invalid_report_query", new Object[]{query.getClass()})); } /** @@ -102,7 +102,7 @@ public static DatabaseQuery getDatabaseQuery(Query query) { return ((JpaQuery)query).getDatabaseQuery(); } - throw new IllegalArgumentException(ExceptionLocalization.buildMessage("jpa_helper_invalid_query" + query.getClass())); + throw new IllegalArgumentException(ExceptionLocalization.buildMessage("jpa_helper_invalid_query", new Object[]{query.getClass()})); } /** @@ -119,7 +119,7 @@ public static ReadAllQuery getReadAllQuery(Query query) { return (ReadAllQuery)dbQuery; } - throw new IllegalArgumentException(ExceptionLocalization.buildMessage("jpa_helper_invalid_read_all_query" + query.getClass())); + throw new IllegalArgumentException(ExceptionLocalization.buildMessage("jpa_helper_invalid_read_all_query", new Object[]{query.getClass()})); } /**