mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 19:35:36 +02:00
Improved handling of unexpected exceptions in the indexer, related to bug 221796.
This commit is contained in:
parent
0545a83691
commit
fe1f5608eb
2 changed files with 11 additions and 9 deletions
|
@ -626,12 +626,17 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
IIndexFileLocation[] ifls= orderedIFLs.toArray(new IIndexFileLocation[orderedIFLs.size()]);
|
IIndexFileLocation[] ifls= orderedIFLs.toArray(new IIndexFileLocation[orderedIFLs.size()]);
|
||||||
addSymbols(ast, ifls, fIndex, 1, false, configHash, fTodoTaskUpdater, pm);
|
try {
|
||||||
for (IIndexFileLocation ifl : ifls) {
|
addSymbols(ast, ifls, fIndex, 1, false, configHash, fTodoTaskUpdater, pm);
|
||||||
info= getFileInfo(linkageID, ifl);
|
}
|
||||||
assert info != null;
|
finally {
|
||||||
if (info != null) {
|
// mark as updated in any case, to avoid parsing files that caused an exception to be thrown.
|
||||||
info.fIsUpdated= true;
|
for (IIndexFileLocation ifl : ifls) {
|
||||||
|
info= getFileInfo(linkageID, ifl);
|
||||||
|
assert info != null;
|
||||||
|
if (info != null) {
|
||||||
|
info.fIsUpdated= true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.pdom;
|
package org.eclipse.cdt.internal.core.pdom;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -199,11 +198,9 @@ abstract public class PDOMWriter {
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
stati.add(CCorePlugin.createStatus(
|
stati.add(CCorePlugin.createStatus(
|
||||||
NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath()), e));
|
NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath()), e));
|
||||||
break;
|
|
||||||
} catch (PDOMNotImplementedError e) {
|
} catch (PDOMNotImplementedError e) {
|
||||||
stati.add(CCorePlugin.createStatus(
|
stati.add(CCorePlugin.createStatus(
|
||||||
NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath()), e));
|
NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath()), e));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (i<ifls.length-1) {
|
if (i<ifls.length-1) {
|
||||||
updateFileCount(0, 0, 1); // update header count
|
updateFileCount(0, 0, 1); // update header count
|
||||||
|
|
Loading…
Add table
Reference in a new issue