Author: max.andersen(a)jboss.com
Date: 2007-10-31 14:52:14 -0400 (Wed, 31 Oct 2007)
New Revision: 4605
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
Log:
fixed NPE when deleting/editing console configs
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2007-10-31
18:32:51 UTC (rev 4604)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2007-10-31
18:52:14 UTC (rev 4605)
@@ -164,19 +164,20 @@
ConsoleConfiguration[] cfgs = getConfigurations();
for (int i = 0; i < cfgs.length; i++) {
ConsoleConfiguration configuration = cfgs[i];
- removeConfiguration(configuration);
+ removeConfiguration(configuration, false);
}
}
- public void removeConfiguration(final ConsoleConfiguration configuration) {
+ // added forUpdate as a workaround for letting listeners know it is done to update the
configuration so they don't cause removal issues.
+ public void removeConfiguration(final ConsoleConfiguration configuration, final boolean
forUpdate) {
ConsoleConfiguration oldConfig = (ConsoleConfiguration)
getRepositoriesMap().remove(configuration.getName() );
if (oldConfig != null) {
oldConfig.removeConsoleConfigurationListener(sfListener);
fireNotification(new Notification() {
public void notify(KnownConfigurationsListener listener) {
- listener.configurationRemoved(configuration);
+ listener.configurationRemoved(configuration, forUpdate);
}
});
oldConfig.reset();
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java 2007-10-31
18:32:51 UTC (rev 4604)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java 2007-10-31
18:52:14 UTC (rev 4605)
@@ -31,5 +31,5 @@
public void sessionFactoryClosing(ConsoleConfiguration configuration, SessionFactory
closingFactory);
- public void configurationRemoved(ConsoleConfiguration root);
+ public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate);
}
\ No newline at end of file
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2007-10-31
18:32:51 UTC (rev 4604)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2007-10-31
18:52:14 UTC (rev 4605)
@@ -52,7 +52,7 @@
childrenCreated=false;
}
- public void configurationRemoved(ConsoleConfiguration root) {
+ public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate) {
markChildrenForReload();
}
Show replies by date