Author: dgolovin
Date: 2009-06-09 18:08:48 -0400 (Tue, 09 Jun 2009)
New Revision: 15831
Added:
trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/MetaUIPlugin.java
Modified:
trunk/common/plugins/org.jboss.tools.common.meta.ui/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/search/MetaSearchResultPage.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SpecialWizardSupport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsRenameListener.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableLoaderImpl.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-351 bad exception handling fix
Modified: trunk/common/plugins/org.jboss.tools.common.meta.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.meta.ui/META-INF/MANIFEST.MF 2009-06-09
22:02:52 UTC (rev 15830)
+++ trunk/common/plugins/org.jboss.tools.common.meta.ui/META-INF/MANIFEST.MF 2009-06-09
22:08:48 UTC (rev 15831)
@@ -29,3 +29,4 @@
org.jboss.tools.common.meta.ui.form,
org.jboss.tools.common.meta.ui.attribute.editor,
org.jboss.tools.common.meta.ui.search
+Bundle-Activator: org.jboss.tools.common.meta.ui.MetaUIPlugin
Added:
trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/MetaUIPlugin.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/MetaUIPlugin.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/MetaUIPlugin.java 2009-06-09
22:08:48 UTC (rev 15831)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.meta.ui;
+
+import org.jboss.tools.common.log.BaseUIPlugin;
+
+/**
+ * @author eskimo
+ *
+ */
+public class MetaUIPlugin extends BaseUIPlugin {
+
+ private static MetaUIPlugin plugin;
+ /**
+ *
+ */
+ public MetaUIPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static MetaUIPlugin getDefault() {
+ return plugin;
+ }
+
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/MetaUIPlugin.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/search/MetaSearchResultPage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/search/MetaSearchResultPage.java 2009-06-09
22:02:52 UTC (rev 15830)
+++
trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/search/MetaSearchResultPage.java 2009-06-09
22:08:48 UTC (rev 15831)
@@ -13,7 +13,10 @@
import java.text.MessageFormat;
import org.jboss.tools.common.meta.ui.Messages;
+import org.jboss.tools.common.meta.ui.MetaUIPlugin;
import org.jboss.tools.common.model.ui.navigator.NavigatorLabelProvider;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.jface.viewers.*;
import org.eclipse.search.ui.*;
import org.eclipse.swt.layout.*;
@@ -46,12 +49,17 @@
search.removeListener(this);
search.addListener(this);
this.uiState = uiState;
- if(viewer != null) {
- try {
- viewer.refresh();
- } catch (Exception e) {
- //ignore
- }
+ if (viewer != null) {
+ SafeRunner.run(new ISafeRunnable() {
+
+ public void run() throws Exception {
+ viewer.refresh();
+ }
+
+ public void handleException(Throwable exception) {
+ MetaUIPlugin.getDefault().logError(exception);
+ }
+ });
}
}
@@ -147,7 +155,15 @@
Display.getDefault().asyncExec(new Runnable() {
public void run() {
if(viewer == null || newInput == null) return;
- try { viewer.refresh(); } catch (Exception e) {}
+ SafeRunner.run(new ISafeRunnable() {
+
+ public void run() throws Exception {
+ viewer.refresh();
+ }
+
+ public void handleException(Throwable exception) {
+ MetaUIPlugin.getDefault().logError(exception);
+ }});
}
});
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SpecialWizardSupport.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SpecialWizardSupport.java 2009-06-09
22:02:52 UTC (rev 15830)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/SpecialWizardSupport.java 2009-06-09
22:08:48 UTC (rev 15831)
@@ -113,7 +113,7 @@
* May return preset or previosly entered data (name-value)
*/
public String[][] getInfo(int stepId) {
- return null;
+ return new String[0][0];
}
/*
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsRenameListener.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsRenameListener.java 2009-06-09
22:02:52 UTC (rev 15830)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsRenameListener.java 2009-06-09
22:08:48 UTC (rev 15831)
@@ -47,7 +47,7 @@
public void checkFileSystemRename(IResourceChangeEvent event) {
String[] r = processDelta(event.getDelta());
- if(r == null) return;
+ if(r.length == 0) return;
pathRenamed(r[0], r[1]);
}
@@ -64,7 +64,7 @@
}
}
}
- return null;
+ return new String[0];
}
private String[] extractRename(IResourceDelta delta) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableLoaderImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableLoaderImpl.java 2009-06-09
22:02:52 UTC (rev 15830)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/SharableLoaderImpl.java 2009-06-09
22:08:48 UTC (rev 15831)
@@ -72,14 +72,10 @@
if(sc == null) {
Properties p = new Properties();
if(hasName) p.setProperty("name", name);
- try {
- sc = (SharableElement)sharable.getModel().createModelObject(en, p);
- sc.setScopeExists(PROJECT, false);
- sharable.addChild(sc);
- if(!hasName) sharable.setName(name);
- } catch (Exception e) {
-
ModelPlugin.getPluginLog().logError("SharableLoaderImpl:loadChild:" +
e.getMessage());
- }
+ sc = (SharableElement)sharable.getModel().createModelObject(en, p);
+ sc.setScopeExists(PROJECT, false);
+ sharable.addChild(sc);
+ if(!hasName) sharable.setName(name);
}
if(sc != null) {
if(sc instanceof SharableContainerImpl)
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java 2009-06-09
22:02:52 UTC (rev 15830)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java 2009-06-09
22:08:48 UTC (rev 15831)
@@ -18,7 +18,6 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
@@ -219,7 +218,7 @@
refComponents = comp.getReferences();
for (IVirtualReference virtualReference : refComponents) {
IVirtualComponent component = virtualReference.getReferencedComponent();
- if(component!=null && !component.isBinary() &&
JavaEEProjectUtilities.isDynamicWebComponent(component)) {
+ if(component!=null && !component.isBinary() &&
J2EEProjectUtilities.isDynamicWebComponent(component)) {
ISeamProject seamProject = SeamCorePlugin.getSeamProject(component.getProject(),
false);
if(seamProject!=null) {
return seamProject;