Author: vyemialyanchyk
Date: 2011-01-05 10:55:28 -0500 (Wed, 05 Jan 2011)
New Revision: 27916
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.properties
Log:
https://issues.jboss.org/browse/JBIDE-8027 - correct message in case of null execution
context, fixed
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2011-01-05
15:05:26 UTC (rev 27915)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2011-01-05
15:55:28 UTC (rev 27916)
@@ -34,6 +34,7 @@
import java.util.Iterator;
import java.util.Map;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
@@ -67,11 +68,11 @@
}
public Object execute(Command c) {
- // to avoid npe, in case when configuration closed from other thread during it's
load time
if (executionContext != null) {
return executionContext.execute(c);
}
- return null;
+ final String msg =
NLS.bind(ConsoleMessages.ConsoleConfiguration_null_execution_context, getName());
+ throw new HibernateConsoleRuntimeException(msg);
}
public ConsoleConfigurationPreferences prefs = null;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java 2011-01-05
15:05:26 UTC (rev 27915)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java 2011-01-05
15:55:28 UTC (rev 27916)
@@ -16,6 +16,7 @@
public static String ConsoleConfiguration_invalid_configuration;
public static String ConsoleConfiguration_persistence_unit_not_found;
public static String ConsoleConfiguration_problems_while_loading_database_driverclass;
+ public static String ConsoleConfiguration_null_execution_context;
public static String JavaPage_no_info;
public static String JavaPage_not_allowed;
public static String KnownConfigurations_could_not_write_state;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.properties 2011-01-05
15:05:26 UTC (rev 27915)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.properties 2011-01-05
15:55:28 UTC (rev 27916)
@@ -9,6 +9,7 @@
ConsoleConfiguration_invalid_configuration=invalid configuration
ConsoleConfiguration_persistence_unit_not_found=Persistence unit not found:
''{0}''.
ConsoleConfiguration_problems_while_loading_database_driverclass=Problems while loading
database driverclass ({0})
+ConsoleConfiguration_null_execution_context=Command execution interrupted: Execution
context is null, ''{0}'' console configuration is closed.
JavaPage_no_info=<no info>
JavaPage_not_allowed=System.exit not allowed\!
KnownConfigurations_could_not_write_state=Could not write state