diff --git a/platform/core-impl/src/com/intellij/openapi/editor/ex/PrioritizedDocumentListener.java b/platform/core-impl/src/com/intellij/openapi/editor/ex/PrioritizedDocumentListener.java index 40510a7cd79f..20614b9f9aba 100644 --- a/platform/core-impl/src/com/intellij/openapi/editor/ex/PrioritizedDocumentListener.java +++ b/platform/core-impl/src/com/intellij/openapi/editor/ex/PrioritizedDocumentListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package com.intellij.openapi.editor.ex; import com.intellij.openapi.editor.event.DocumentListener; +import org.jetbrains.annotations.NotNull; import java.util.Comparator; @@ -40,8 +41,7 @@ public interface PrioritizedDocumentListener extends DocumentListener { return getPriority(o1) - getPriority(o2); } - private int getPriority(Object o) { - assert o != null; + private int getPriority(@NotNull Object o) { if (o instanceof PrioritizedDocumentListener) return ((PrioritizedDocumentListener)o).getPriority(); return Integer.MAX_VALUE; } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPass.java index 94538a518e1d..6dc614983563 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPass.java @@ -58,7 +58,7 @@ public class IdentifierHighlighterPass extends TextEditorHighlightingPass { private final Collection myWriteAccessRanges = Collections.synchronizedList(new ArrayList()); private final int myCaretOffset; - protected IdentifierHighlighterPass(final Project project, final PsiFile file, final Editor editor) { + protected IdentifierHighlighterPass(@NotNull Project project, @NotNull PsiFile file, @NotNull Editor editor) { super(project, editor.getDocument(), false); myFile = file; myEditor = editor; @@ -91,9 +91,7 @@ public class IdentifierHighlighterPass extends TextEditorHighlightingPass { if (!PsiDocumentManager.getInstance(myProject).isUncommited(myEditor.getDocument())) { // when document is committed, try to check injected stuff - it's fast Editor injectedEditor = InjectedLanguageUtil.getEditorForInjectedLanguageNoCommit(myEditor, myFile, myCaretOffset); - if (injectedEditor != null) { - myTarget = TargetElementUtilBase.getInstance().findTargetElement(injectedEditor, flags, injectedEditor.getCaretModel().getOffset()); - } + myTarget = TargetElementUtilBase.getInstance().findTargetElement(injectedEditor, flags, injectedEditor.getCaretModel().getOffset()); } }