From 56bc2958908e976d00e78233591c6d9a76121a06 Mon Sep 17 00:00:00 2001 From: xstefank Date: Tue, 7 Mar 2017 13:27:21 +0100 Subject: [PATCH] [JBEAP-9251] Wrong error msg in datasource wizard for duplicate JNDI name --- .../shared/subsys/jca/wizard/DataSourceJndiItem.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gui/src/main/java/org/jboss/as/console/client/shared/subsys/jca/wizard/DataSourceJndiItem.java b/gui/src/main/java/org/jboss/as/console/client/shared/subsys/jca/wizard/DataSourceJndiItem.java index 95a70fd51..a67444682 100644 --- a/gui/src/main/java/org/jboss/as/console/client/shared/subsys/jca/wizard/DataSourceJndiItem.java +++ b/gui/src/main/java/org/jboss/as/console/client/shared/subsys/jca/wizard/DataSourceJndiItem.java @@ -31,11 +31,12 @@ class DataSourceJndiItem extends JndiNameItem { private final List existingDataSources; private final String defaultErrMessage; + private String errMessage; public DataSourceJndiItem(final List existingDataSources) { super("jndiName", "JNDI Name"); this.existingDataSources = existingDataSources; - this.defaultErrMessage = getErrMessage(); + this.defaultErrMessage = super.getErrMessage(); } @Override @@ -46,13 +47,18 @@ public boolean validate(final String value) { for (T dataSource : existingDataSources) { if (dataSource.getJndiName().equals(value)) { duplicateJndiName = true; - setErrMessage(Console.CONSTANTS.duplicate_data_source_jndi()); + this.errMessage = Console.CONSTANTS.duplicate_data_source_jndi(); break; } } } else { - setErrMessage(defaultErrMessage); + this.errMessage = defaultErrMessage; } return parentValid && !duplicateJndiName; } + + @Override + public String getErrMessage() { + return this.errMessage; + } }