Skip to content

Commit

Permalink
ExcpetionLocalizationResource should take a variable from an argument
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Aug 18, 2023
1 parent 34042cd commit 1b96153
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
// - 489298: Wrap EclipseLink's Bean Validation calls in doPrivileged blocks when security is enabled
package org.eclipse.persistence.internal.localization.i18n;

import org.eclipse.persistence.config.PersistenceUnitProperties;

import java.util.ListResourceBundle;

/**
Expand Down Expand Up @@ -227,8 +225,8 @@ public class ExceptionLocalizationResource extends ListResourceBundle {
{ "jpa21-ddl-source-script-io-exception", "An IO error occurred with the source ddl generation script: {0}."},
{ "jpa21-ddl-invalid-source-script-type", "The source script provided {0} is of an invalid type {0}. Valid source script types are: java.io.Reader or a string designating a file URL."},
{ "jpa21-ddl-invalid-target-script-type", "The target script provided {0} is of an invalid type {0}. Valid target script types are: java.io.Writer or a string designating a file URL."},
{ "jpa21-ddl-drop-script-target-not-specified", "When generating DDL to scripts, a drop script target must be specified using the ["+ PersistenceUnitProperties.SCHEMA_GENERATION_SCRIPTS_DROP_TARGET+"] property."},
{ "jpa21-ddl-create-script-target-not-specified", "When generating DDL to scripts, a create script target must be specified using the ["+ PersistenceUnitProperties.SCHEMA_GENERATION_SCRIPTS_CREATE_TARGET+"] property."},
{ "jpa21-ddl-drop-script-target-not-specified", "When generating DDL to scripts, a drop script target must be specified using the [{0}] property."},
{ "jpa21-ddl-create-script-target-not-specified", "When generating DDL to scripts, a create script target must be specified using the [{0}] property."},
//criteria API IllegalArgumentExceptions
{ "jpa_criteriaapi_no_corresponding_element_in_result", "Element {0} does not correspond to an element in the query result."},
{ "jpa_criteriaapi_invalid_result_index", "index {0} invalid for result list of size {1}."},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2022 IBM Corporation. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -4754,7 +4754,7 @@ protected void writeDDLToFiles(SchemaManager mgr, String appLocation, Object cre
if (createDDLJdbc == null) {
// Using EclipseLink properties, the create script has a default.
// Using JPA properties, the user must specify the target else an exception must be thrown.
throw new IllegalArgumentException(ExceptionLocalization.buildMessage("jpa21-ddl-create-script-target-not-specified"));
throw new IllegalArgumentException(ExceptionLocalization.buildMessage("jpa21-ddl-create-script-target-not-specified", new Object[]{SCHEMA_GENERATION_SCRIPTS_CREATE_TARGET}));
} else if (createDDLJdbc instanceof Writer) {
mgr.outputCreateDDLToWriter((Writer) createDDLJdbc);
} else {
Expand All @@ -4767,7 +4767,7 @@ protected void writeDDLToFiles(SchemaManager mgr, String appLocation, Object cre
if (dropDDLJdbc == null) {
// Using EclipseLink properties, the drop script has a default.
// Using JPA properties, the user must specify the target else an exception must be thrown.
throw new IllegalArgumentException(ExceptionLocalization.buildMessage("jpa21-ddl-drop-script-target-not-specified"));
throw new IllegalArgumentException(ExceptionLocalization.buildMessage("jpa21-ddl-drop-script-target-not-specified", new Object[]{SCHEMA_GENERATION_SCRIPTS_DROP_TARGET}));
} else if (dropDDLJdbc instanceof Writer) {
mgr.outputDropDDLToWriter((Writer) dropDDLJdbc);
} else if (dropDDLJdbc instanceof String) {
Expand Down

0 comments on commit 1b96153

Please sign in to comment.