diff --git a/platform/lang-impl/src/com/intellij/ui/SpellCheckAwareEditorFieldProviderImpl.java b/platform/lang-impl/src/com/intellij/ui/SpellCheckAwareEditorFieldProviderImpl.java index 48b58387b4fb..41e172239afb 100644 --- a/platform/lang-impl/src/com/intellij/ui/SpellCheckAwareEditorFieldProviderImpl.java +++ b/platform/lang-impl/src/com/intellij/ui/SpellCheckAwareEditorFieldProviderImpl.java @@ -114,7 +114,7 @@ public class SpellCheckAwareEditorFieldProviderImpl implements SpellCheckAwareEd LocalInspectionTool tool = inspectionClass.newInstance(); tools.put(tool.getShortName(), tool); } - catch (Exception e) { + catch (Throwable e) { return null; } } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/SoftWrapDataMapper.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/SoftWrapDataMapper.java index 97f1dfc52048..9872754e4969 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/SoftWrapDataMapper.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/SoftWrapDataMapper.java @@ -579,16 +579,16 @@ public class SoftWrapDataMapper { @Nullable public TextChange get() { - if (myIndex < 0 || myIndex >= mySoftWraps.size()) { + if (myIndex < 0) { return null; } - TextChange result = mySoftWraps.get(myIndex++); - if (isVisible(result)) { - return result; - } - else { - return get(); + while (myIndex < mySoftWraps.size()) { + TextChange result = mySoftWraps.get(myIndex++); + if (isVisible(result)) { + return result; + } } + return null; } } @@ -603,16 +603,16 @@ public class SoftWrapDataMapper { @Nullable public FoldRegion get() { - if (myFoldRegions == null || myIndex < 0 || myIndex >= myFoldRegions.length) { + if (myFoldRegions == null || myIndex < 0) { return null; } - FoldRegion result = myFoldRegions[myIndex++]; - if (result.isExpanded()) { - return get(); - } - else { - return result; + while (myIndex < myFoldRegions.length) { + FoldRegion result = myFoldRegions[myIndex++]; + if (result.isExpanded()) { + return get(); + } } + return null; } } }