Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordeboer2005-11-18 00:52:52 +0000
committerdeboer2005-11-18 00:52:52 +0000
commit953ed1d1c10663c84b607370d0d948d0d9a33d8d (patch)
tree931685998a5b454c4fe708ee406893e70aaf5980 /plugins/org.eclipse.wst.server.ui
parent2c11fcf985a16edb2bfa0aa510562f11b48110c2 (diff)
downloadwebtools.servertools-953ed1d1c10663c84b607370d0d948d0d9a33d8d.tar.gz
webtools.servertools-953ed1d1c10663c84b607370d0d948d0d9a33d8d.tar.xz
webtools.servertools-953ed1d1c10663c84b607370d0d948d0d9a33d8d.zip
[116778] Stack overflow when module contains itself
Diffstat (limited to 'plugins/org.eclipse.wst.server.ui')
-rw-r--r--plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java3
-rw-r--r--plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java46
2 files changed, 6 insertions, 43 deletions
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java
index cf5bf9c8f..3bcb80790 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java
@@ -425,7 +425,8 @@ public class RunOnServerActionDelegate implements IWorkbenchWindowActionDelegate
IStructuredSelection select = (IStructuredSelection) sel;
Iterator iterator = select.iterator();
- selection = iterator.next();
+ if (iterator.hasNext())
+ selection = iterator.next();
if (iterator.hasNext()) { // more than one selection (should never happen)
action.setEnabled(false);
selection = null;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
index bf441c95c..9e2df33df 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
@@ -288,7 +288,8 @@ public class ModifyModulesComposite extends Composite {
IModule module = (IModule) iterator.next();
try {
IModule[] children = server.getChildModules(new IModule[] { module }, null);
- childModuleMap.put(new ChildModuleMapKey(module), children);
+ if (children != null && children.length > 0)
+ childModuleMap.put(new ChildModuleMapKey(module), children);
} catch (Exception e) {
// ignore
}
@@ -299,7 +300,8 @@ public class ModifyModulesComposite extends Composite {
IModule module = (IModule) iterator.next();
try {
IModule[] children = server.getChildModules(new IModule[] { module }, null);
- childModuleMap.put(new ChildModuleMapKey(module), children);
+ if (children != null && children.length > 0)
+ childModuleMap.put(new ChildModuleMapKey(module), children);
} catch (Exception e) {
// ignore
}
@@ -515,46 +517,6 @@ public class ModifyModulesComposite extends Composite {
removeAll.setEnabled(deployed.size() > 1);
}
- /*protected void addChildren(TreeItem item, IModule[] module) {
- try {
- IModule[] children = (IModule[]) childModuleMap.get(new ChildModuleMapKey(module));
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- IModule child = children[i];
- TreeItem childItem = new TreeItem(item, SWT.NONE);
- childItem.setText(slp.getText(child));
- childItem.setImage(slp.getImage(child));
- childItem.setData(child);
- parentTreeItemMap.put(childItem, item);
-
- int size2 = module.length;
- IModule[] module2 = new IModule[size2 + 1];
- System.arraycopy(module, 0, module2, 0, size2);
- module2[size2] = child;
- addChildren(childItem, module2);
- }
- }
- } catch (Exception e) {
- // ignore
- }
- }*/
-
- /*protected void fillTree(Tree tree, List modules2) {
- tree.removeAll();
-
- Iterator iterator = modules2.iterator();
- while (iterator.hasNext()) {
- IModule module = (IModule) iterator.next();
- TreeItem item = new TreeItem(tree, SWT.NONE);
- item.setText(slp.getText(module));
- item.setImage(slp.getImage(module));
- item.setData(module);
- parentTreeItemMap.put(item, item);
- addChildren(item, new IModule[] { module });
- }
- }*/
-
protected void add(boolean all) {
if (all) {
IModule[] modules2 = new IModule[modules.size()];

Back to the top