aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Moffatt2011-08-09 11:26:02 (EDT)
committerPaul Webster2011-08-25 10:22:03 (EDT)
commit1e6c7041bc55ab6c0c932de94d5ac6051f07cac5 (patch)
tree2f09fe9717162a4a2658841c55e75d3283bdb659
parentf6e303ec496fa46c724e11a4b7dc9793caf1281c (diff)
downloadeclipse.platform.ui-1e6c7041bc55ab6c0c932de94d5ac6051f07cac5.zip
eclipse.platform.ui-1e6c7041bc55ab6c0c932de94d5ac6051f07cac5.tar.gz
eclipse.platform.ui-1e6c7041bc55ab6c0c932de94d5ac6051f07cac5.tar.bz2
Fix for Bug 351752 - Attempting to import a malformed EJB jar
with Archive File wizard causes StackOverflowError
-rw-r--r--bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/ZipLeveledStructureProvider.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/ZipLeveledStructureProvider.java b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/ZipLeveledStructureProvider.java
index de1430b..f96ccce 100644
--- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/ZipLeveledStructureProvider.java
+++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/ZipLeveledStructureProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -72,7 +72,9 @@ public class ZipLeveledStructureProvider implements
}
ZipEntry parent;
- if (pathname.segmentCount() == 1) {
+ if (pathname.segmentCount() == 0) {
+ return null;
+ } else if (pathname.segmentCount() == 1) {
parent = root;
} else {
parent = createContainer(pathname.removeLastSegments(1));
@@ -134,13 +136,13 @@ public class ZipLeveledStructureProvider implements
String pathOrig = new String(path);
for (int i = 0; i < stripLevel; i++) {
int firstSep = path.indexOf('/');
- // If the first character was a seperator we must strip to the next
- // seperator as well
+ // If the first character was a separator we must strip to the next
+ // separator as well
if (firstSep == 0) {
path = path.substring(1);
firstSep = path.indexOf('/');
}
- // No seperator wasw present so we're in a higher directory right
+ // No separator was present so we're in a higher directory right
// now
if (firstSep == -1) {
return pathOrig;