diff --git a/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpBackrefImpl.java b/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpBackrefImpl.java index 5aa03c2cac45..63bad0e924d7 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpBackrefImpl.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpBackrefImpl.java @@ -104,6 +104,7 @@ public class RegExpBackrefImpl extends RegExpElementImpl implements RegExpBackre return RegExpBackrefImpl.this.resolve(); } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } diff --git a/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpPropertyImpl.java b/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpPropertyImpl.java index b4b9cfe87dd1..8f58881c7f96 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpPropertyImpl.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpPropertyImpl.java @@ -118,6 +118,7 @@ public class RegExpPropertyImpl extends RegExpElementImpl implements RegExpPrope return false; } + @NotNull public Object[] getVariants() { final ASTNode categoryNode = getCategoryNode(); if (categoryNode != null && categoryNode.getText().startsWith("In") && !categoryNode.getText().startsWith("Intelli")) { diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/CompileContextExProxy.java b/java/compiler/impl/src/com/intellij/compiler/impl/CompileContextExProxy.java index e312ca89abe2..5e45940a6e00 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/CompileContextExProxy.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompileContextExProxy.java @@ -141,11 +141,11 @@ public class CompileContextExProxy implements CompileContextEx { return myDelegate.isRebuild(); } - public T getUserData(final Key key) { + public T getUserData(@NotNull final Key key) { return myDelegate.getUserData(key); } - public void putUserData(final Key key, final T value) { + public void putUserData(@NotNull final Key key, final T value) { myDelegate.putUserData(key, value); } diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/CompositeScope.java b/java/compiler/impl/src/com/intellij/compiler/impl/CompositeScope.java index 3f15c8af5ab3..2b8195fbe556 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/CompositeScope.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/CompositeScope.java @@ -89,7 +89,7 @@ public class CompositeScope extends UserDataHolderBase implements CompileScope{ return modules.toArray(new Module[modules.size()]); } - public T getUserData(Key key) { + public T getUserData(@NotNull Key key) { for (CompileScope compileScope : myScopes) { T userData = compileScope.getUserData(key); if (userData != null) { diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/TrackDependenciesScope.java b/java/compiler/impl/src/com/intellij/compiler/impl/TrackDependenciesScope.java index 00a37258adf8..a26e5a50ed40 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/TrackDependenciesScope.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/TrackDependenciesScope.java @@ -66,7 +66,7 @@ public class TrackDependenciesScope extends UserDataHolderBase implements Compil } } - public T getUserData(final Key key) { + public T getUserData(@NotNull final Key key) { T userData = myDelegate.getUserData(key); if (userData != null) { return userData; diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java index 82f02dc6bb91..4a42a17d2966 100644 --- a/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java +++ b/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java @@ -24,6 +24,7 @@ import com.intellij.openapi.util.Computable; import com.intellij.openapi.util.Key; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.pom.Navigatable; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public class DummyCompileContext implements CompileContext { @@ -99,11 +100,11 @@ public class DummyCompileContext implements CompileContext { return null; } - public T getUserData(Key key) { + public T getUserData(@NotNull Key key) { return null; } - public void putUserData(Key key, T value) { + public void putUserData(@NotNull Key key, T value) { } public boolean isMake() { @@ -113,4 +114,4 @@ public class DummyCompileContext implements CompileContext { public boolean isRebuild() { return false; } -} \ No newline at end of file +} diff --git a/java/idea-ui/src/com/intellij/facet/impl/ui/FacetEditorContextBase.java b/java/idea-ui/src/com/intellij/facet/impl/ui/FacetEditorContextBase.java index c54f96d755c0..ac4e67d51576 100644 --- a/java/idea-ui/src/com/intellij/facet/impl/ui/FacetEditorContextBase.java +++ b/java/idea-ui/src/com/intellij/facet/impl/ui/FacetEditorContextBase.java @@ -98,7 +98,7 @@ public abstract class FacetEditorContextBase extends UserDataHolderBase implemen public abstract ArtifactsStructureConfigurableContext getArtifactsStructureContext(); @Nullable - public T getUserData(final Key key) { + public T getUserData(@NotNull final Key key) { T t = super.getUserData(key); if (t == null && myParentContext != null) { t = myParentContext.getUserData(key); diff --git a/java/java-impl/src/com/intellij/psi/impl/compiled/ClsJavaCodeReferenceElementImpl.java b/java/java-impl/src/com/intellij/psi/impl/compiled/ClsJavaCodeReferenceElementImpl.java index 5708a5780715..57adfbf23042 100644 --- a/java/java-impl/src/com/intellij/psi/impl/compiled/ClsJavaCodeReferenceElementImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/compiled/ClsJavaCodeReferenceElementImpl.java @@ -206,6 +206,7 @@ public class ClsJavaCodeReferenceElementImpl extends ClsElementImpl implements P || getManager().areElementsEquivalent(resolve(), element); } + @NotNull public Object[] getVariants() { throw new RuntimeException("Variants are not available for references to compiled code"); } diff --git a/java/java-impl/src/com/intellij/psi/impl/compiled/ClsReferenceExpressionImpl.java b/java/java-impl/src/com/intellij/psi/impl/compiled/ClsReferenceExpressionImpl.java index 61c128e1d647..2983154903b6 100644 --- a/java/java-impl/src/com/intellij/psi/impl/compiled/ClsReferenceExpressionImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/compiled/ClsReferenceExpressionImpl.java @@ -145,6 +145,7 @@ public class ClsReferenceExpressionImpl extends ClsElementImpl implements PsiRef return myPatternExpression.isReferenceTo(element); } + @NotNull public Object[] getVariants() { return myPatternExpression.getVariants(); } diff --git a/java/java-impl/src/com/intellij/psi/impl/compiled/ClsTypeParameterReferenceImpl.java b/java/java-impl/src/com/intellij/psi/impl/compiled/ClsTypeParameterReferenceImpl.java index e1c42bb22e73..2c9c154b800c 100644 --- a/java/java-impl/src/com/intellij/psi/impl/compiled/ClsTypeParameterReferenceImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/compiled/ClsTypeParameterReferenceImpl.java @@ -146,6 +146,7 @@ public class ClsTypeParameterReferenceImpl extends ClsElementImpl implements Psi throw new IncorrectOperationException(CAN_NOT_MODIFY_MESSAGE); } + @NotNull public Object[] getVariants() { throw new RuntimeException("Variants are not available for references to compiled code"); } diff --git a/java/java-impl/src/com/intellij/psi/impl/light/LightClassReference.java b/java/java-impl/src/com/intellij/psi/impl/light/LightClassReference.java index bbfba0ba65eb..ec5f6e4f8a13 100644 --- a/java/java-impl/src/com/intellij/psi/impl/light/LightClassReference.java +++ b/java/java-impl/src/com/intellij/psi/impl/light/LightClassReference.java @@ -228,6 +228,7 @@ public class LightClassReference extends LightElement implements PsiJavaCodeRefe return getManager().areElementsEquivalent(resolve(), element); } + @NotNull public Object[] getVariants() { throw new RuntimeException("Variants are not available for light references"); } diff --git a/java/java-impl/src/com/intellij/psi/impl/light/LightClassReferenceExpression.java b/java/java-impl/src/com/intellij/psi/impl/light/LightClassReferenceExpression.java index 9baa3097148a..add6df030299 100644 --- a/java/java-impl/src/com/intellij/psi/impl/light/LightClassReferenceExpression.java +++ b/java/java-impl/src/com/intellij/psi/impl/light/LightClassReferenceExpression.java @@ -48,6 +48,7 @@ public class LightClassReferenceExpression extends LightClassReference implement return getManager().areElementsEquivalent(resolve(), element); } + @NotNull public Object[] getVariants() { throw new RuntimeException("Variants are not available for light references"); } diff --git a/java/java-impl/src/com/intellij/psi/impl/light/LightMemberReference.java b/java/java-impl/src/com/intellij/psi/impl/light/LightMemberReference.java index 898718bffa88..b02a2c66fb82 100644 --- a/java/java-impl/src/com/intellij/psi/impl/light/LightMemberReference.java +++ b/java/java-impl/src/com/intellij/psi/impl/light/LightMemberReference.java @@ -144,6 +144,7 @@ public class LightMemberReference extends LightElement implements PsiJavaCodeRef return element instanceof PsiClass && element.getManager().areElementsEquivalent(resolve(), element); } + @NotNull public Object[] getVariants() { throw new RuntimeException("Variants are not available for light references"); } diff --git a/java/java-impl/src/com/intellij/psi/impl/light/LightPackageReference.java b/java/java-impl/src/com/intellij/psi/impl/light/LightPackageReference.java index 3c7d906efde6..c6b7e8c8a42d 100644 --- a/java/java-impl/src/com/intellij/psi/impl/light/LightPackageReference.java +++ b/java/java-impl/src/com/intellij/psi/impl/light/LightPackageReference.java @@ -114,6 +114,7 @@ public class LightPackageReference extends LightElement implements PsiJavaCodeRe return getManager().areElementsEquivalent(resolve(), element); } + @NotNull public Object[] getVariants() { throw new RuntimeException("Variants are not available for light references"); } diff --git a/java/java-impl/src/com/intellij/psi/impl/source/PsiEnumConstantImpl.java b/java/java-impl/src/com/intellij/psi/impl/source/PsiEnumConstantImpl.java index 958702a46928..75796c8dd24f 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/PsiEnumConstantImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/PsiEnumConstantImpl.java @@ -202,6 +202,7 @@ public class PsiEnumConstantImpl extends JavaStubPsiElement implem throw new IncorrectOperationException("Invalid operation"); } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } diff --git a/java/java-impl/src/com/intellij/psi/impl/source/PsiImportStaticReferenceElementImpl.java b/java/java-impl/src/com/intellij/psi/impl/source/PsiImportStaticReferenceElementImpl.java index a61ed6a614ba..1528fd1b25dc 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/PsiImportStaticReferenceElementImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/PsiImportStaticReferenceElementImpl.java @@ -383,6 +383,7 @@ public class PsiImportStaticReferenceElementImpl extends CompositePsiElement imp PsiScopesUtil.resolveAndWalk(proc, this, null, true); } + @NotNull public Object[] getVariants() { // IMPLEMENT[dsl] return ArrayUtil.EMPTY_OBJECT_ARRAY; diff --git a/java/java-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceElementImpl.java b/java/java-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceElementImpl.java index 2ce9002a3470..1d6aff6e3c01 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceElementImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceElementImpl.java @@ -694,6 +694,7 @@ public class PsiJavaCodeReferenceElementImpl extends CompositePsiElement impleme myCachedTextSkipWhiteSpaceAndComments = null; } + @NotNull public Object[] getVariants() { final ElementFilter filter; switch (getKind()) { diff --git a/java/java-impl/src/com/intellij/psi/impl/source/PsiLabelReference.java b/java/java-impl/src/com/intellij/psi/impl/source/PsiLabelReference.java index c18ec0be8e82..fe1dac35655c 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/PsiLabelReference.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/PsiLabelReference.java @@ -86,6 +86,7 @@ public class PsiLabelReference implements PsiReference{ return resolve() == element; } + @NotNull public Object[] getVariants(){ final List result = new ArrayList(); PsiElement context = myStatement; diff --git a/java/java-impl/src/com/intellij/psi/impl/source/javadoc/PsiDocMethodOrFieldRef.java b/java/java-impl/src/com/intellij/psi/impl/source/javadoc/PsiDocMethodOrFieldRef.java index 0798658ad3c3..350ee4ee1644 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/javadoc/PsiDocMethodOrFieldRef.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/javadoc/PsiDocMethodOrFieldRef.java @@ -116,6 +116,7 @@ public class PsiDocMethodOrFieldRef extends CompositePsiElement implements PsiDo } return new MyReference(method) { + @NotNull public PsiElement[] getVariants() { final List lst = new ArrayList(); for (PsiMethod method : methods) { @@ -240,6 +241,7 @@ public class PsiDocMethodOrFieldRef extends CompositePsiElement implements PsiDo return myReferencee == null ? JavaResolveResult.EMPTY_ARRAY : new JavaResolveResult[]{new CandidateInfo(myReferencee, PsiSubstitutor.EMPTY)}; } + @NotNull public PsiElement[] getVariants(){ final List vars = new ArrayList(); final PsiElement scope = getScope(); diff --git a/java/java-impl/src/com/intellij/psi/impl/source/javadoc/PsiDocParamRef.java b/java/java-impl/src/com/intellij/psi/impl/source/javadoc/PsiDocParamRef.java index 1c785c586311..992e92302a3a 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/javadoc/PsiDocParamRef.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/javadoc/PsiDocParamRef.java @@ -100,6 +100,7 @@ public class PsiDocParamRef extends CompositePsiElement implements PsiDocTagValu return getManager().areElementsEquivalent(resolve(), element); } + @NotNull public Object[] getVariants() { final PsiElement firstChild = getFirstChild(); if (firstChild instanceof PsiDocToken && ((PsiDocToken)firstChild).getTokenType().equals(JavaDocTokenType.DOC_TAG_VALUE_LT)) { diff --git a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/MethodPropertyReference.java b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/MethodPropertyReference.java index c0d884843bf2..a582a4d69936 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/MethodPropertyReference.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/MethodPropertyReference.java @@ -23,6 +23,7 @@ import com.intellij.psi.xml.XmlAttribute; import com.intellij.psi.xml.XmlAttributeValue; import com.intellij.psi.xml.XmlTag; import com.intellij.util.IncorrectOperationException; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** @@ -93,6 +94,7 @@ public class MethodPropertyReference extends BasicAttributeValueReference { return super.handleElementRename(newElementName); } + @NotNull public Object[] getVariants() { return JspSpiUtil.getMethodPropertyReferenceVariants(this, resolveClass(), myReadable); } diff --git a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PsiPackageReference.java b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PsiPackageReference.java index 57e715307b89..3dc30b5f557e 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PsiPackageReference.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/PsiPackageReference.java @@ -46,6 +46,7 @@ public class PsiPackageReference extends PsiPolyVariantReferenceBase (PsiPackage)myReferenceSet.getReference(myIndex - 1).resolve(); } + @NotNull public Object[] getVariants() { final PsiPackage psiPackage = getContext(); if (psiPackage == null) return ArrayUtil.EMPTY_OBJECT_ARRAY; @@ -88,4 +89,4 @@ public class PsiPackageReference extends PsiPolyVariantReferenceBase public PackageReferenceSet getReferenceSet() { return myReferenceSet; } -} \ No newline at end of file +} diff --git a/java/java-impl/src/com/intellij/psi/impl/source/tree/java/PsiNameValuePairImpl.java b/java/java-impl/src/com/intellij/psi/impl/source/tree/java/PsiNameValuePairImpl.java index a24afb5db17b..9b0cf8fd6df9 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/tree/java/PsiNameValuePairImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/tree/java/PsiNameValuePairImpl.java @@ -185,6 +185,7 @@ public class PsiNameValuePairImpl extends CompositePsiElement implements PsiName return element instanceof PsiMethod && element.equals(resolve()); } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } diff --git a/java/java-impl/src/com/intellij/psi/impl/source/tree/java/PsiNewExpressionImpl.java b/java/java-impl/src/com/intellij/psi/impl/source/tree/java/PsiNewExpressionImpl.java index 379787a85ad1..08b7ec622f15 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/tree/java/PsiNewExpressionImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/tree/java/PsiNewExpressionImpl.java @@ -160,6 +160,7 @@ public class PsiNewExpressionImpl extends ExpressionPsiElement implements PsiNew return null; } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/WordCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/WordCompletionTest.java index 772d769a79ab..a91ff5ed2da1 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/WordCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/WordCompletionTest.java @@ -48,6 +48,7 @@ public class WordCompletionTest extends CompletionTestCase { return true; } + @NotNull public Object[] getVariants() { return new Object[]{"MySoftVariant"}; } @@ -66,6 +67,7 @@ public class WordCompletionTest extends CompletionTestCase { return false; } + @NotNull public Object[] getVariants() { return new Object[]{"MyHardVariant"}; } diff --git a/platform/lang-api/src/com/intellij/openapi/roots/ProjectRootsTraversing.java b/platform/lang-api/src/com/intellij/openapi/roots/ProjectRootsTraversing.java index d6391c012be2..8649f0ac31dc 100644 --- a/platform/lang-api/src/com/intellij/openapi/roots/ProjectRootsTraversing.java +++ b/platform/lang-api/src/com/intellij/openapi/roots/ProjectRootsTraversing.java @@ -24,6 +24,7 @@ import com.intellij.openapi.util.UserDataHolderBase; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.PathUtil; import com.intellij.util.PathsList; +import org.jetbrains.annotations.NotNull; import java.util.HashSet; import java.util.List; @@ -125,11 +126,11 @@ public class ProjectRootsTraversing { myCurrentModuleManager = restored; } - public T getUserData(Key key) { + public T getUserData(@NotNull Key key) { return myUserData.getUserData(key); } - public void putUserData(Key key, T value) { + public void putUserData(@NotNull Key key, T value) { myUserData.putUserData(key, value); } diff --git a/platform/lang-api/src/com/intellij/psi/PsiReferenceBase.java b/platform/lang-api/src/com/intellij/psi/PsiReferenceBase.java index 3e150e937ab2..99aeb7473dd5 100644 --- a/platform/lang-api/src/com/intellij/psi/PsiReferenceBase.java +++ b/platform/lang-api/src/com/intellij/psi/PsiReferenceBase.java @@ -118,6 +118,7 @@ public abstract class PsiReferenceBase implements PsiRefer return resolveTo; } + @NotNull public Object[] getVariants() { return EMPTY_ARRAY; } diff --git a/platform/lang-api/src/com/intellij/psi/TokenType.java b/platform/lang-api/src/com/intellij/psi/TokenType.java index 795d8cd74301..86f287796823 100644 --- a/platform/lang-api/src/com/intellij/psi/TokenType.java +++ b/platform/lang-api/src/com/intellij/psi/TokenType.java @@ -16,7 +16,6 @@ package com.intellij.psi; import com.intellij.lang.Language; -import com.intellij.openapi.fileTypes.FileTypes; import com.intellij.psi.tree.IElementType; import com.intellij.psi.tree.IFileElementType; diff --git a/platform/lang-api/src/com/intellij/psi/util/PsiUtilBase.java b/platform/lang-api/src/com/intellij/psi/util/PsiUtilBase.java index b4026f9fc6b5..34509ab6cb43 100644 --- a/platform/lang-api/src/com/intellij/psi/util/PsiUtilBase.java +++ b/platform/lang-api/src/com/intellij/psi/util/PsiUtilBase.java @@ -254,11 +254,11 @@ public class PsiUtilBase { return null; } - public T getUserData(Key key) { + public T getUserData(@NotNull Key key) { return null; } - public void putUserData(Key key, T value) { + public void putUserData(@NotNull Key key, T value) { } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/reference/RefEntityImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/reference/RefEntityImpl.java index 1f5492eb9c23..33e2bf36b7ea 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/reference/RefEntityImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/reference/RefEntityImpl.java @@ -28,6 +28,7 @@ import com.intellij.codeInspection.InspectionsBundle; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.Key; import gnu.trove.THashMap; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; @@ -90,7 +91,7 @@ public abstract class RefEntityImpl implements RefEntity { } @Nullable - public T getUserData(Key key){ + public T getUserData(@NotNull Key key){ synchronized(this){ if (myUserMap == null) return null; //noinspection unchecked @@ -106,7 +107,7 @@ public abstract class RefEntityImpl implements RefEntity { }); } - public void putUserData(Key key, T value){ + public void putUserData(@NotNull Key key, T value){ synchronized(this){ if (myUserMap == null){ if (value == null) return; diff --git a/platform/lang-impl/src/com/intellij/injected/editor/RangeMarkerWindow.java b/platform/lang-impl/src/com/intellij/injected/editor/RangeMarkerWindow.java index a7cecb3acf8b..134eb1c6b5b1 100644 --- a/platform/lang-impl/src/com/intellij/injected/editor/RangeMarkerWindow.java +++ b/platform/lang-impl/src/com/intellij/injected/editor/RangeMarkerWindow.java @@ -65,11 +65,11 @@ public class RangeMarkerWindow implements RangeMarkerEx { myHostMarker.setGreedyToRight(greedy); } - public T getUserData(final Key key) { + public T getUserData(@NotNull final Key key) { return myHostMarker.getUserData(key); } - public void putUserData(final Key key, final T value) { + public void putUserData(@NotNull final Key key, final T value) { myHostMarker.putUserData(key, value); } @@ -91,4 +91,4 @@ public class RangeMarkerWindow implements RangeMarkerEx { public boolean isGreedyToLeft() { return myHostMarker.isGreedyToLeft(); } -} \ No newline at end of file +} diff --git a/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java b/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java index 65ea995863cb..5458638bce6b 100644 --- a/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java +++ b/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java @@ -145,11 +145,11 @@ public class MockPsiManager extends PsiManagerEx { public void finishBatchFilesProcessingMode() { } - public T getUserData(Key key) { + public T getUserData(@NotNull Key key) { return null; } - public void putUserData(Key key, T value) { + public void putUserData(@NotNull Key key, T value) { } public boolean isDisposed() { @@ -250,4 +250,4 @@ public class MockPsiManager extends PsiManagerEx { public CacheManager getCacheManager() { return myCompositeCacheManager; } -} \ No newline at end of file +} diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/PsiMultiReference.java b/platform/lang-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/PsiMultiReference.java index 31b845def30a..c1670b02592f 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/PsiMultiReference.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/PsiMultiReference.java @@ -127,6 +127,7 @@ public class PsiMultiReference implements PsiPolyVariantReference { return false; } + @NotNull public Object[] getVariants() { Set variants = new HashSet(); for(PsiReference ref: myReferences) { diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EmptyMarkupModel.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EmptyMarkupModel.java index 907486af825e..eb86a65e1c29 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EmptyMarkupModel.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EmptyMarkupModel.java @@ -54,11 +54,11 @@ public class EmptyMarkupModel implements MarkupModelEx { return RangeHighlighter.EMPTY_ARRAY; } - public T getUserData(Key key) { + public T getUserData(@NotNull Key key) { return null; } - public void putUserData(Key key, T value) { + public void putUserData(@NotNull Key key, T value) { } public void dispose() { diff --git a/platform/testFramework/src/com/intellij/mock/MockDocument.java b/platform/testFramework/src/com/intellij/mock/MockDocument.java index 6eee48594df8..07ff7eb4db50 100644 --- a/platform/testFramework/src/com/intellij/mock/MockDocument.java +++ b/platform/testFramework/src/com/intellij/mock/MockDocument.java @@ -156,12 +156,12 @@ public class MockDocument implements DocumentEx { } @SuppressWarnings({"unchecked"}) - public T getUserData(Key key) { + public T getUserData(@NotNull Key key) { return (T)myUserData.get(key); } @SuppressWarnings({"unchecked"}) - public void putUserData(Key key, T value) { + public void putUserData(@NotNull Key key, T value) { myUserData.put(key, value); } diff --git a/platform/util/src/com/intellij/openapi/util/UserDataHolderBase.java b/platform/util/src/com/intellij/openapi/util/UserDataHolderBase.java index b2acd934eed1..056dee0267ff 100644 --- a/platform/util/src/com/intellij/openapi/util/UserDataHolderBase.java +++ b/platform/util/src/com/intellij/openapi/util/UserDataHolderBase.java @@ -70,12 +70,12 @@ public class UserDataHolderBase implements UserDataHolderEx, Cloneable { } } - public T getUserData(Key key) { + public T getUserData(@NotNull Key key) { final Map map = myUserMap; return map == null ? null : (T)map.get(key); } - public void putUserData(Key key, T value) { + public void putUserData(@NotNull Key key, T value) { Map map = getOrCreateMap(); if (value == null) { diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/java/LanguageReference.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/java/LanguageReference.java index 91c903b30694..65b760e0d65a 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/java/LanguageReference.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/java/LanguageReference.java @@ -26,6 +26,7 @@ import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.EmptyIcon; import org.intellij.plugins.intelliLang.inject.InjectedLanguage; import org.intellij.plugins.intelliLang.util.StringLiteralReference; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** @@ -47,6 +48,7 @@ final class LanguageReference extends StringLiteralReference { return false; } + @NotNull public Object[] getVariants() { final String[] ids = InjectedLanguage.getAvailableLanguageIDs(); return ContainerUtil.map2Array(ids, LookupElement.class, new Function() { diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/java/RegExpEnumReference.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/java/RegExpEnumReference.java index 38c5550c8f51..f2c43283e887 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/java/RegExpEnumReference.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/java/RegExpEnumReference.java @@ -42,6 +42,7 @@ final class RegExpEnumReference extends StringLiteralReference { myPattern = pattern; } + @NotNull public Object[] getVariants() { final Set values = getEnumValues(); if (values == null || values.size() == 0) { @@ -68,4 +69,4 @@ final class RegExpEnumReference extends StringLiteralReference { private Set getEnumValues() { return RegExpUtil.getEnumValues(myValue.getProject(), myPattern); } -} \ No newline at end of file +} diff --git a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntAttributeReference.java b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntAttributeReference.java index 578ef2bea5ef..22020a7de486 100644 --- a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntAttributeReference.java +++ b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntAttributeReference.java @@ -51,6 +51,7 @@ public class AntAttributeReference extends AntGenericReference { return null; } + @NotNull public Object[] getVariants() { final AntTypeDefinition def = getElement().getTypeDefinition(); return (def == null) ? EMPTY_ARRAY : def.getAttributes(); diff --git a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntElementNameReference.java b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntElementNameReference.java index c20fad203729..b2386f52706d 100644 --- a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntElementNameReference.java +++ b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntElementNameReference.java @@ -117,6 +117,7 @@ public class AntElementNameReference extends AntGenericReference { return true; } + @NotNull public Object[] getVariants() { if (getAttribute() != null) { return EMPTY_ARRAY; // scriptdef or mactodef params will be handled by XML implementation diff --git a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntEntityReference.java b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntEntityReference.java index 3587b5e64e51..2817c3ba8835 100644 --- a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntEntityReference.java +++ b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntEntityReference.java @@ -62,6 +62,7 @@ public class AntEntityReference implements PsiReference { return myXmlRef.isReferenceTo(element); } + @NotNull public Object[] getVariants() { return EMPTY_ARRAY; } diff --git a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntMacroDefParameterReference.java b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntMacroDefParameterReference.java index e9875c15a2ea..d20fb6294d12 100644 --- a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntMacroDefParameterReference.java +++ b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntMacroDefParameterReference.java @@ -97,6 +97,7 @@ public class AntMacroDefParameterReference extends AntGenericReference { return null; } + @NotNull @SuppressWarnings({"HardCodedStringLiteral"}) public Object[] getVariants() { final Set variants = StringSetSpinAllocator.alloc(); diff --git a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntPropertyReference.java b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntPropertyReference.java index b3427d0320ab..8368aa6954d3 100644 --- a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntPropertyReference.java +++ b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntPropertyReference.java @@ -119,6 +119,7 @@ public class AntPropertyReference extends AntGenericReference { return AntBundle.message("unknown.property", getCanonicalText()); } + @NotNull public Object[] getVariants() { final AntElement currentElement = getElement(); final Set variants = PsiElementSetSpinAllocator.alloc(); diff --git a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntRefIdReference.java b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntRefIdReference.java index 64981f1b7404..ba26c6183476 100644 --- a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntRefIdReference.java +++ b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntRefIdReference.java @@ -77,6 +77,7 @@ public class AntRefIdReference extends AntGenericReference { } } + @NotNull public Object[] getVariants() { final Set variants = PsiElementSetSpinAllocator.alloc(); try { diff --git a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntTargetReference.java b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntTargetReference.java index ffe35c35979f..4eb610c7a65f 100644 --- a/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntTargetReference.java +++ b/plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntTargetReference.java @@ -153,6 +153,7 @@ public class AntTargetReference extends AntGenericReference { } } + @NotNull public Object[] getVariants() { final AntElement element = getElement(); if (element instanceof AntAntImpl) { diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocParameterReferenceImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocParameterReferenceImpl.java index 3c404ff89079..7d9fecffa82a 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocParameterReferenceImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocParameterReferenceImpl.java @@ -131,6 +131,7 @@ public class GrDocParameterReferenceImpl extends GroovyDocPsiElementImpl impleme return getManager().areElementsEquivalent(element, resolve()); } + @NotNull public Object[] getVariants() { final PsiElement owner = GrDocCommentUtil.findDocOwner(this); final PsiElement firstChild = getFirstChild(); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/auxiliary/annotation/GrAnnotationNameValuePairImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/auxiliary/annotation/GrAnnotationNameValuePairImpl.java index 291a41b6201c..39b33c697d3c 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/auxiliary/annotation/GrAnnotationNameValuePairImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/auxiliary/annotation/GrAnnotationNameValuePairImpl.java @@ -145,6 +145,7 @@ public class GrAnnotationNameValuePairImpl extends GroovyPsiElementImpl implemen return element instanceof PsiMethod && getManager().areElementsEquivalent(element, resolve()); } + @NotNull public Object[] getVariants() { GrAnnotation anno = getAnnotation(); if (anno != null) { diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/GrConstructorInvocationImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/GrConstructorInvocationImpl.java index 63a2d15ef922..363e43c92a6f 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/GrConstructorInvocationImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/GrConstructorInvocationImpl.java @@ -160,6 +160,7 @@ public class GrConstructorInvocationImpl extends GroovyPsiElementImpl implements } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/references/MavenModulePsiReference.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/references/MavenModulePsiReference.java index a475a6ca0885..48fde73e1ec1 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/references/MavenModulePsiReference.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/references/MavenModulePsiReference.java @@ -56,6 +56,7 @@ public class MavenModulePsiReference extends MavenPsiReference implements LocalQ return getPsiFile(file); } + @NotNull public Object[] getVariants() { List> files = MavenDomUtil.collectProjectModels(getProject()); diff --git a/plugins/testng/src/com/theoryinpractice/testng/TestNGReferenceContributor.java b/plugins/testng/src/com/theoryinpractice/testng/TestNGReferenceContributor.java index 4a63ce22c848..930feff3bbbe 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/TestNGReferenceContributor.java +++ b/plugins/testng/src/com/theoryinpractice/testng/TestNGReferenceContributor.java @@ -109,6 +109,7 @@ public class TestNGReferenceContributor extends PsiReferenceContributor { return null; } + @NotNull public Object[] getVariants() { final List list = new ArrayList(); final PsiClass cls = PsiUtil.getTopLevelClass(getElement()); @@ -159,6 +160,7 @@ public class TestNGReferenceContributor extends PsiReferenceContributor { return null; } + @NotNull public Object[] getVariants() { List list = new ArrayList(); PsiClass cls = PsiUtil.getTopLevelClass(getElement()); @@ -189,6 +191,7 @@ public class TestNGReferenceContributor extends PsiReferenceContributor { return null; } + @NotNull public Object[] getVariants() { List list = new ArrayList(); diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/binding/ReferenceInForm.java b/plugins/ui-designer/src/com/intellij/uiDesigner/binding/ReferenceInForm.java index 0a62834a3ded..3e94d99bad1c 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/binding/ReferenceInForm.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/binding/ReferenceInForm.java @@ -25,6 +25,7 @@ import com.intellij.psi.PsiPlainTextFile; import com.intellij.psi.PsiReference; import com.intellij.util.ArrayUtil; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; /** * @author Eugene Zhuravlev @@ -75,6 +76,7 @@ public abstract class ReferenceInForm implements PsiReference { return resolve() == element; } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/PrefixReferenceImpl.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/PrefixReferenceImpl.java index 6d4405a33751..a4f86fddd633 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/PrefixReferenceImpl.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/PrefixReferenceImpl.java @@ -22,6 +22,7 @@ import org.intellij.lang.xpath.psi.QNameElement; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; class PrefixReferenceImpl extends ReferenceBase implements PrefixReference { @@ -45,6 +46,7 @@ class PrefixReferenceImpl extends ReferenceBase implements PrefixReference { return element.equals(resolve()); } + @NotNull public Object[] getVariants() { // handled in XPathCompletionData return EMPTY_ARRAY; @@ -69,4 +71,4 @@ class PrefixReferenceImpl extends ReferenceBase implements PrefixReference { final String prefix = getCanonicalText(); return !namespaceContext.getKnownPrefixes(myProvider.getContextElement()).contains(prefix); } -} \ No newline at end of file +} diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/ReferenceBase.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/ReferenceBase.java index c2887c2f3ddf..877e17e1010d 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/ReferenceBase.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/ReferenceBase.java @@ -65,6 +65,7 @@ public abstract class ReferenceBase implements PsiReference { return Comparing.equal(resolve(), element); } + @NotNull public abstract Object[] getVariants(); public boolean isSoft() { diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathFunctionCallImpl.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathFunctionCallImpl.java index 43e3035dfa52..5be6c8dc1c40 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathFunctionCallImpl.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathFunctionCallImpl.java @@ -156,6 +156,7 @@ public class XPathFunctionCallImpl extends XPathElementImpl implements XPathFunc } } + @NotNull public Object[] getVariants() { return EMPTY_ARRAY; } diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathNodeTestImpl.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathNodeTestImpl.java index 952a4510ff74..17916be11749 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathNodeTestImpl.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathNodeTestImpl.java @@ -110,6 +110,7 @@ public class XPathNodeTestImpl extends XPathElementImpl implements XPathNodeTest super(element, nameNode); } + @NotNull public Object[] getVariants() { // handled in XPathCompletionData return EMPTY_ARRAY; diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathVariableReferenceImpl.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathVariableReferenceImpl.java index 261c7479b3bd..580f738e5047 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathVariableReferenceImpl.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathVariableReferenceImpl.java @@ -133,6 +133,7 @@ public class XPathVariableReferenceImpl extends XPathElementImpl implements XPat return false; } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/references/AttributeReference.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/references/AttributeReference.java index df35fc89239a..2f60e3559541 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/references/AttributeReference.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/references/AttributeReference.java @@ -33,6 +33,7 @@ class AttributeReference extends SimpleAttributeReference { mySoft = soft; } + @NotNull public Object[] getVariants() { return ResolveUtil.collect(myMatcher.variantMatcher()); } diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/references/ExternalResourceReference.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/references/ExternalResourceReference.java index c633ad6fd1e9..3548f3f84302 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/references/ExternalResourceReference.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/references/ExternalResourceReference.java @@ -102,6 +102,7 @@ class ExternalResourceReference implements PsiReference, QuickFixProvider implements DomFileElement< getRootElement().accept(visitor); } - public T getUserData(Key key) { + public T getUserData(@NotNull Key key) { return (T)myUserData.get(key); } - public void putUserData(Key key, T value) { + public void putUserData(@NotNull Key key, T value) { myUserData.put(key, value); } diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/GenericDomValueReference.java b/xml/dom-impl/src/com/intellij/util/xml/impl/GenericDomValueReference.java index 4877c1bbdef5..d01679d80738 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/GenericDomValueReference.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/GenericDomValueReference.java @@ -177,6 +177,7 @@ public class GenericDomValueReference extends PsiReferenceBase im return null; } + @NotNull public Object[] getVariants() { final Converter converter = getConverter(); if (converter instanceof EnumConverter || converter == ResolvingConverter.BOOLEAN_CONVERTER) { diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/GenericValueReferenceProvider.java b/xml/dom-impl/src/com/intellij/util/xml/impl/GenericValueReferenceProvider.java index 4a9a36133de6..9fea4de86318 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/GenericValueReferenceProvider.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/GenericValueReferenceProvider.java @@ -172,6 +172,7 @@ public class GenericValueReferenceProvider extends PsiReferenceProvider { if (ReflectionCache.isAssignable(Integer.class, clazz)) { return new PsiReference[]{new GenericDomValueReference((GenericDomValue)domValue) { + @NotNull public Object[] getVariants() { return new Object[]{"0"}; } diff --git a/xml/dom-openapi/src/com/intellij/util/xml/converters/DelimitedListConverter.java b/xml/dom-openapi/src/com/intellij/util/xml/converters/DelimitedListConverter.java index 8f490a2d9054..e8b12e646afb 100644 --- a/xml/dom-openapi/src/com/intellij/util/xml/converters/DelimitedListConverter.java +++ b/xml/dom-openapi/src/com/intellij/util/xml/converters/DelimitedListConverter.java @@ -185,6 +185,7 @@ public abstract class DelimitedListConverter extends ResolvingConverter extends ResolvingConverter extends ResolvingConverter impl return multiResolveReference(convertString(value, myContext), myContext); } + @NotNull public Object[] getVariants() { return getReferenceVariants(myContext, myGenericDomValue, getRangeInElement()); } diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/AttributeValueSelfReference.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/AttributeValueSelfReference.java index 7a687801d24f..9ecba6f551a2 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/AttributeValueSelfReference.java +++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/AttributeValueSelfReference.java @@ -18,6 +18,7 @@ package com.intellij.psi.impl.source.resolve.reference.impl.providers; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; import com.intellij.util.ArrayUtil; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** @@ -41,6 +42,7 @@ public class AttributeValueSelfReference extends BasicAttributeValueReference { return myElement; } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/DtdReferencesProvider.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/DtdReferencesProvider.java index b3a385933adb..66a3b512b747 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/DtdReferencesProvider.java +++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/DtdReferencesProvider.java @@ -136,6 +136,7 @@ public class DtdReferencesProvider extends PsiReferenceProvider { return myElement.getManager().areElementsEquivalent(element, resolve()); } + @NotNull public Object[] getVariants() { final XmlNSDescriptor rootTagNSDescriptor = getNsDescriptor(); return rootTagNSDescriptor != null ? @@ -226,6 +227,7 @@ public class DtdReferencesProvider extends PsiReferenceProvider { return myElement.getManager().areElementsEquivalent(resolve(), element); } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/IdRefReference.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/IdRefReference.java index 1c884cde28e0..c8ec76e80668 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/IdRefReference.java +++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/IdRefReference.java @@ -157,6 +157,7 @@ public class IdRefReference extends BasicAttributeValueReference { return result[0]; } + @NotNull public Object[] getVariants() { final List result = new LinkedList(); diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/SchemaReferencesProvider.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/SchemaReferencesProvider.java index 35d215cd7583..068b66c16d6a 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/SchemaReferencesProvider.java +++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/SchemaReferencesProvider.java @@ -116,6 +116,7 @@ public class SchemaReferencesProvider extends PsiReferenceProvider { } } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } @@ -170,6 +171,7 @@ public class SchemaReferencesProvider extends PsiReferenceProvider { return myElement.getManager().areElementsEquivalent(resolve(), element); } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } @@ -454,6 +456,7 @@ public class SchemaReferencesProvider extends PsiReferenceProvider { } } + @NotNull public Object[] getVariants() { final XmlTag tag = PsiTreeUtil.getParentOfType(myElement, XmlTag.class); if (tag == null) return null; diff --git a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URIReferenceProvider.java b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URIReferenceProvider.java index 6dbcab0dbda9..860cad0634d9 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URIReferenceProvider.java +++ b/xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URIReferenceProvider.java @@ -88,6 +88,7 @@ public class URIReferenceProvider extends PsiReferenceProvider { return myReference.resolve(); } + @NotNull public Object[] getVariants() { return ArrayUtil.EMPTY_OBJECT_ARRAY; } diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/TagNameReference.java b/xml/impl/src/com/intellij/psi/impl/source/xml/TagNameReference.java index b1a0683c35ab..80270442197b 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/xml/TagNameReference.java +++ b/xml/impl/src/com/intellij/psi/impl/source/xml/TagNameReference.java @@ -169,6 +169,7 @@ public class TagNameReference implements PsiReference { return getElement().getManager().areElementsEquivalent(element, resolve()); } + @NotNull public Object[] getVariants(){ final PsiElement element = getElement(); if(!myStartTagFlag){ diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeImpl.java index f0c74823fe05..a4a329875749 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeImpl.java +++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlAttributeImpl.java @@ -420,6 +420,7 @@ public class XmlAttributeImpl extends XmlElementImpl implements XmlAttribute { return getManager().areElementsEquivalent(element, resolve()); } + @NotNull public Object[] getVariants() { final List> variants = new ArrayList>(); diff --git a/xml/impl/src/com/intellij/xml/util/AnchorReference.java b/xml/impl/src/com/intellij/xml/util/AnchorReference.java index 1b8bff853027..e829e1df2ff5 100644 --- a/xml/impl/src/com/intellij/xml/util/AnchorReference.java +++ b/xml/impl/src/com/intellij/xml/util/AnchorReference.java @@ -196,6 +196,7 @@ class AnchorReference implements PsiReference, EmptyResolveMessageProvider { return myElement.getManager().areElementsEquivalent(element,resolve()); } + @NotNull public Object[] getVariants() { final Map idMap = getIdMap(); if (idMap == null) return ArrayUtil.EMPTY_OBJECT_ARRAY;