diff options
author | Dani Megert | 2015-10-30 17:40:31 +0000 |
---|---|---|
committer | Dani Megert | 2015-10-30 17:40:31 +0000 |
commit | d5b9678a12d6740cdb04acc43e2fec78c2512366 (patch) | |
tree | 92475be139292be6f28cec955b9eb7109cf455ec /org.eclipse.text/src/org/eclipse/jface/text | |
parent | b3bb2adfa45d29c74b79070ac9d3dfc459787a16 (diff) | |
download | eclipse.platform.text-d5b9678a12d6740cdb04acc43e2fec78c2512366.tar.gz eclipse.platform.text-d5b9678a12d6740cdb04acc43e2fec78c2512366.tar.xz eclipse.platform.text-d5b9678a12d6740cdb04acc43e2fec78c2512366.zip |
Fixed bug 397610: "org.eclipse.core.runtime.AssertionFailedException" in "org.eclipse.jface.text.source.AnnotationModel.getRegionAnnotationIterator()"
Diffstat (limited to 'org.eclipse.text/src/org/eclipse/jface/text')
-rw-r--r-- | org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java b/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java index 0d88e72db15..b23cc3a6960 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -12,6 +12,7 @@ package org.eclipse.jface.text.source; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.IdentityHashMap; import java.util.Iterator; @@ -738,9 +739,8 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens Position[] positions= document.getPositions(IDocument.DEFAULT_CATEGORY, offset, length, canStartBefore, canEndAfter); return new AnnotationsInterator(positions, fPositions); } catch (BadPositionCategoryException e) { - //can not happen - Assert.isTrue(false); - return null; + // can happen if e.g. the document doesn't contain such a category, or when removed in a different thread + return Collections.EMPTY_LIST.iterator(); } } |