Fix for Bug 446055 Background Indexer Crash Recovery (err_grp: 6675354d)
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
index 334b810..7dc6347 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
@@ -15,6 +15,7 @@
 import java.net.URI;
 import java.util.Enumeration;
 import java.util.zip.ZipEntry;
+import java.util.zip.ZipError;
 import java.util.zip.ZipFile;
 
 import org.eclipse.core.resources.IFile;
@@ -260,6 +261,13 @@
 			}
 			this.manager.removeIndex(this.containerPath);
 			return false;
+		} catch (ZipError e) { // merge with the code above using '|' when we move to 1.7
+			if (JobManager.VERBOSE) {
+				org.eclipse.jdt.internal.core.util.Util.verbose("-> failed to index " + this.containerPath + " because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$
+				e.printStackTrace();
+			}
+			this.manager.removeIndex(this.containerPath);
+			return false;
 		}
 		return true;
 	}