aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Moffatt2011-08-09 11:26:02 (EDT)
committerRemy Suen2011-08-17 13:48:38 (EDT)
commit473fc66d967f5fd9dc1950af9440a7440af49932 (patch)
treee4d3f4b5127abdff0dfd05281e7bda5ba6eb487c
parent72dcf09277e525f7bdc14855539570be0a188412 (diff)
downloadeclipse.platform.ui-473fc66d967f5fd9dc1950af9440a7440af49932.zip
eclipse.platform.ui-473fc66d967f5fd9dc1950af9440a7440af49932.tar.gz
eclipse.platform.ui-473fc66d967f5fd9dc1950af9440a7440af49932.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;