Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-03-12 13:40:34 +0000
committerMarkus Schorn2008-03-12 13:40:34 +0000
commitfe1f5608eb11ab602d5d92c9913a1c53e013a171 (patch)
treeff993765c7e64a24a1a7b9e754a4a72d304dd712 /core/org.eclipse.cdt.core/parser
parent0545a83691e5fb6619f8885a4e673c18b997d7ad (diff)
downloadorg.eclipse.cdt-fe1f5608eb11ab602d5d92c9913a1c53e013a171.tar.gz
org.eclipse.cdt-fe1f5608eb11ab602d5d92c9913a1c53e013a171.tar.xz
org.eclipse.cdt-fe1f5608eb11ab602d5d92c9913a1c53e013a171.zip
Improved handling of unexpected exceptions in the indexer, related to bug 221796.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java17
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java3
2 files changed, 11 insertions, 9 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java
index 3974161d378..a2a01509eb6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java
@@ -626,12 +626,17 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
}
IIndexFileLocation[] ifls= orderedIFLs.toArray(new IIndexFileLocation[orderedIFLs.size()]);
- addSymbols(ast, ifls, fIndex, 1, false, configHash, fTodoTaskUpdater, pm);
- for (IIndexFileLocation ifl : ifls) {
- info= getFileInfo(linkageID, ifl);
- assert info != null;
- if (info != null) {
- info.fIsUpdated= true;
+ try {
+ addSymbols(ast, ifls, fIndex, 1, false, configHash, fTodoTaskUpdater, pm);
+ }
+ finally {
+ // mark as updated in any case, to avoid parsing files that caused an exception to be thrown.
+ for (IIndexFileLocation ifl : ifls) {
+ info= getFileInfo(linkageID, ifl);
+ assert info != null;
+ if (info != null) {
+ info.fIsUpdated= true;
+ }
}
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java
index e5c195c6767..399a5096e78 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java
@@ -8,7 +8,6 @@
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
-
package org.eclipse.cdt.internal.core.pdom;
import java.util.ArrayList;
@@ -199,11 +198,9 @@ abstract public class PDOMWriter {
} catch (RuntimeException e) {
stati.add(CCorePlugin.createStatus(
NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath()), e));
- break;
} catch (PDOMNotImplementedError e) {
stati.add(CCorePlugin.createStatus(
NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath()), e));
- break;
}
if (i<ifls.length-1) {
updateFileCount(0, 0, 1); // update header count

Back to the top