1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 06:32:10 +02:00

2005-03-9 Chris Wiebe

temporary fix for type parser timeout
	* browser/org/eclipse/cdt/core/browser/cache/TypeParser.java
This commit is contained in:
Chris Wiebe 2005-03-30 00:07:37 +00:00
parent 7a1f792fe6
commit 1e4dae1a86
2 changed files with 26 additions and 3 deletions

View file

@ -1,3 +1,7 @@
2005-03-9 Chris Wiebe
temporary fix for type parser timeout
* browser/org/eclipse/cdt/core/browser/cache/TypeParser.java
2005-03-13 Bogdan Gheorghe
Updated references to IndexManager to reflect new multi-indexer framework.
* browser/org/eclipse/cdt/internal/core/browser/cache/IndexerDependencies.java

View file

@ -926,11 +926,30 @@ public class TypeParser implements ISourceElementRequestor {
public CodeReader createReader(String finalPath, Iterator workingCopies) {
return ParserUtil.createReader(finalPath, workingCopies);
}
private static final int DEFAULT_PARSER_TIMEOUT = 30;
public int getParserTimeout() {
// here we just reuse the indexer timeout
String timeOut = CCorePlugin.getDefault().getPluginPreferences().getString("CDT_INDEXER_TIMEOUT");
return Integer.valueOf(timeOut).intValue();
//TODO we shouldn't be trying to access the indexer prefs
//TODO clean this up
int timeout = 0;
try {
// here we just reuse the indexer timeout
String str = CCorePlugin.getDefault().getPluginPreferences().getString("CDT_INDEXER_TIMEOUT"); //$NON-NLS-1$
if (str != null && str.length() > 0) {
int val = Integer.valueOf(str).intValue();
if (val > 0) {
timeout = val;
}
}
} catch (NumberFormatException e) {
// do nothing
}
if (timeout == 0) {
timeout = DEFAULT_PARSER_TIMEOUT;
}
return timeout;
}
}