diff --git a/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/ReferenceParameterInfoHandler.java b/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/ReferenceParameterInfoHandler.java index 899270929d7e..b1f882c6214d 100644 --- a/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/ReferenceParameterInfoHandler.java +++ b/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/ReferenceParameterInfoHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 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. @@ -45,7 +45,7 @@ public class ReferenceParameterInfoHandler implements ParameterInfoHandler= 0 ? (PsiElement)objectsToView[index]:null); @@ -95,7 +95,7 @@ public class ReferenceParameterInfoHandler implements ParameterInfoHandler { // Find element for parameter info should also set ItemsToShow in context and may set highlighted element @Nullable - ParameterOwner findElementForParameterInfo(final CreateParameterInfoContext context); + ParameterOwner findElementForParameterInfo(@NotNull CreateParameterInfoContext context); // Usually context.showHint - void showParameterInfo(@NotNull final ParameterOwner element, final CreateParameterInfoContext context); + void showParameterInfo(@NotNull final ParameterOwner element, @NotNull CreateParameterInfoContext context); // Null returns leads to removing hint @Nullable - ParameterOwner findElementForUpdatingParameterInfo(final UpdateParameterInfoContext context); - void updateParameterInfo(@NotNull final ParameterOwner o, final UpdateParameterInfoContext context); + ParameterOwner findElementForUpdatingParameterInfo(@NotNull UpdateParameterInfoContext context); + void updateParameterInfo(@NotNull final ParameterOwner parameterOwner, @NotNull UpdateParameterInfoContext context); // Can be null if parameter info does not track parameter index - @Nullable String getParameterCloseChars(); + @Nullable + String getParameterCloseChars(); boolean tracksParameterIndex(); // context.setEnabled / context.setupUIComponentPresentation - void updateUI(ParameterType p, ParameterInfoUIContext context); + void updateUI(ParameterType p, @NotNull ParameterInfoUIContext context); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/TargetElementUtilBase.java b/platform/lang-impl/src/com/intellij/codeInsight/TargetElementUtilBase.java index 59f2c99c9130..bc759ae1cfa0 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/TargetElementUtilBase.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/TargetElementUtilBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 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. @@ -118,9 +118,6 @@ public class TargetElementUtilBase { /** * @deprecated adjust offset with PsiElement should be used instead to provide correct checking for identifier part - * @param document - * @param offset - * @return */ public static int adjustOffset(Document document, final int offset) { return adjustOffset(null, document, offset); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyAnnotationAttributeInfoHandler.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyAnnotationAttributeInfoHandler.java index 7a58e0d3de07..8d6705087992 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyAnnotationAttributeInfoHandler.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyAnnotationAttributeInfoHandler.java @@ -154,7 +154,7 @@ public class GroovyAnnotationAttributeInfoHandler implements ParameterInfoHandle } @Override - public void updateParameterInfo(@NotNull GrAnnotationArgumentList o, @NotNull UpdateParameterInfoContext context) { + public void updateParameterInfo(@NotNull GrAnnotationArgumentList parameterOwner, @NotNull UpdateParameterInfoContext context) { context.setHighlightedParameter(findAnnotationMethod(context.getFile(), context.getEditor())); } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java index 0df8cf1329be..25ad76be2231 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java @@ -102,11 +102,11 @@ public class GroovyParameterInfoHandler implements ParameterInfoHandlerWithTabAc return ArrayUtil.EMPTY_OBJECT_ARRAY; } - public GroovyPsiElement findElementForParameterInfo(CreateParameterInfoContext context) { + public GroovyPsiElement findElementForParameterInfo(@NotNull CreateParameterInfoContext context) { return findAnchorElement(context.getEditor().getCaretModel().getOffset(), context.getFile()); } - public GroovyPsiElement findElementForUpdatingParameterInfo(UpdateParameterInfoContext context) { + public GroovyPsiElement findElementForUpdatingParameterInfo(@NotNull UpdateParameterInfoContext context) { return findAnchorElement(context.getEditor().getCaretModel().getOffset(), context.getFile()); } @@ -210,7 +210,7 @@ public class GroovyParameterInfoHandler implements ParameterInfoHandlerWithTabAc return resolveResult.isInvokedOnProperty() || resolveResult.getElement() instanceof PsiVariable; } - public void updateParameterInfo(@NotNull GroovyPsiElement place, UpdateParameterInfoContext context) { + public void updateParameterInfo(@NotNull GroovyPsiElement place, @NotNull UpdateParameterInfoContext context) { final PsiElement parameterOwner = context.getParameterOwner(); if (parameterOwner != place) { context.removeHint(); @@ -318,7 +318,7 @@ public class GroovyParameterInfoHandler implements ParameterInfoHandlerWithTabAc return true; } - public void updateUI(Object o, ParameterInfoUIContext context) { + public void updateUI(Object o, @NotNull ParameterInfoUIContext context) { CodeInsightSettings settings = CodeInsightSettings.getInstance(); if (o == null) return; diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyTypeParameterInfoHandler.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyTypeParameterInfoHandler.java index 63560d25f0ec..4924d0175b33 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyTypeParameterInfoHandler.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyTypeParameterInfoHandler.java @@ -100,7 +100,7 @@ public class GroovyTypeParameterInfoHandler implements ParameterInfoHandlerWithT @Nullable @Override - public GrTypeArgumentList findElementForParameterInfo(CreateParameterInfoContext context) { + public GrTypeArgumentList findElementForParameterInfo(@NotNull CreateParameterInfoContext context) { final GrTypeArgumentList parameterList = ParameterInfoUtils.findParentOfType(context.getFile(), context.getOffset(), GrTypeArgumentList.class); if (parameterList != null) { @@ -121,19 +121,19 @@ public class GroovyTypeParameterInfoHandler implements ParameterInfoHandlerWithT } @Override - public void showParameterInfo(@NotNull GrTypeArgumentList element, CreateParameterInfoContext context) { + public void showParameterInfo(@NotNull GrTypeArgumentList element, @NotNull CreateParameterInfoContext context) { context.showHint(element, element.getTextRange().getStartOffset() + 1, this); } @Nullable @Override - public GrTypeArgumentList findElementForUpdatingParameterInfo(UpdateParameterInfoContext context) { + public GrTypeArgumentList findElementForUpdatingParameterInfo(@NotNull UpdateParameterInfoContext context) { return ParameterInfoUtils.findParentOfType(context.getFile(), context.getOffset(), GrTypeArgumentList.class); } @Override - public void updateParameterInfo(@NotNull GrTypeArgumentList o, UpdateParameterInfoContext context) { - int index = ParameterInfoUtils.getCurrentParameterIndex(o.getNode(), context.getOffset(), getActualParameterDelimiterType()); + public void updateParameterInfo(@NotNull GrTypeArgumentList parameterOwner, @NotNull UpdateParameterInfoContext context) { + int index = ParameterInfoUtils.getCurrentParameterIndex(parameterOwner.getNode(), context.getOffset(), getActualParameterDelimiterType()); context.setCurrentParameter(index); final Object[] objectsToView = context.getObjectsToView(); context.setHighlightedParameter(index < objectsToView.length && index >= 0 ? (PsiElement)objectsToView[index] : null); @@ -151,7 +151,7 @@ public class GroovyTypeParameterInfoHandler implements ParameterInfoHandlerWithT } @Override - public void updateUI(PsiTypeParameter p, ParameterInfoUIContext context) { + public void updateUI(PsiTypeParameter p, @NotNull ParameterInfoUIContext context) { @NonNls StringBuilder buffer = new StringBuilder(); buffer.append(p.getName()); int highlightEndOffset = buffer.length(); diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathParameterInfoHandler.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathParameterInfoHandler.java index 7eb1e913a619..59df3329a9f4 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathParameterInfoHandler.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathParameterInfoHandler.java @@ -43,7 +43,7 @@ public class XPathParameterInfoHandler implements ParameterInfoHandler 0) { diff --git a/python/src/com/jetbrains/python/PyParameterInfoHandler.java b/python/src/com/jetbrains/python/PyParameterInfoHandler.java index b3f99f2f6344..5aec4444193b 100644 --- a/python/src/com/jetbrains/python/PyParameterInfoHandler.java +++ b/python/src/com/jetbrains/python/PyParameterInfoHandler.java @@ -51,7 +51,7 @@ public class PyParameterInfoHandler implements ParameterInfoHandler