1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-03 05:33:33 +02:00

Hide BadLocationException (see bug 232012).

This commit is contained in:
Sergey Prigogin 2008-06-01 06:59:30 +00:00
parent b589535989
commit d09c6c7601

View file

@ -56,9 +56,9 @@ public class CSpellingEngine extends SpellingEngine {
checker.addListener(listener); checker.addListener(listener);
IDocCommentOwner owner= null; IDocCommentOwner owner= null;
if(document instanceof IDocumentExtension3) { if (document instanceof IDocumentExtension3) {
IDocumentPartitioner partitioner= ((IDocumentExtension3)document).getDocumentPartitioner(ICPartitions.C_PARTITIONING); IDocumentPartitioner partitioner= ((IDocumentExtension3)document).getDocumentPartitioner(ICPartitions.C_PARTITIONING);
if(partitioner instanceof FastCPartitioner) { if (partitioner instanceof FastCPartitioner) {
owner= ((FastCPartitioner)partitioner).getDocCommentOwner(); owner= ((FastCPartitioner)partitioner).getDocCommentOwner();
} }
} }
@ -78,7 +78,7 @@ public class CSpellingEngine extends SpellingEngine {
if (isIgnoringStringLiterals && type.equals(ICPartitions.C_STRING)) if (isIgnoringStringLiterals && type.equals(ICPartitions.C_STRING))
continue; continue;
if(owner!=null) { if (owner!=null) {
IDocCommentDictionary dict= null; IDocCommentDictionary dict= null;
if (type.equals(ICPartitions.C_MULTI_LINE_DOC_COMMENT)) { if (type.equals(ICPartitions.C_MULTI_LINE_DOC_COMMENT)) {
@ -87,7 +87,7 @@ public class CSpellingEngine extends SpellingEngine {
dict= owner.getSinglelineConfiguration().getSpellingDictionary(); dict= owner.getSinglelineConfiguration().getSpellingDictionary();
} }
if(dict instanceof IDocCommentSimpleDictionary) { if (dict instanceof IDocCommentSimpleDictionary) {
ISpellDictionary sd= new DocCommentSpellDictionary((IDocCommentSimpleDictionary)dict); ISpellDictionary sd= new DocCommentSpellDictionary((IDocCommentSimpleDictionary)dict);
checker.addDictionary(sd); checker.addDictionary(sd);
toRemove= sd; toRemove= sd;
@ -139,17 +139,19 @@ public class CSpellingEngine extends SpellingEngine {
checker.execute(new SpellCheckIterator(document, partition, checker.getLocale())); checker.execute(new SpellCheckIterator(document, partition, checker.getLocale()));
} }
if(toRemove != null) { if (toRemove != null) {
checker.removeDictionary(toRemove); checker.removeDictionary(toRemove);
toRemove= null; toRemove= null;
} }
} }
} }
} catch (BadLocationException x) { } catch (BadLocationException x) {
CUIPlugin.log(x); // Ignore BadLocationException since although it does happen from time to time,
// there seems to be not much harm from it.
// CUIPlugin.log(x);
} }
} finally { } finally {
if(toRemove!=null) if (toRemove != null)
checker.removeDictionary(toRemove); checker.removeDictionary(toRemove);
checker.removeListener(listener); checker.removeListener(listener);
} }