From 2fa8ef7f332f2da8efc845f31ec76d092a1b01d9 Mon Sep 17 00:00:00 2001 From: Daniil Ovchinnikov Date: Tue, 14 Feb 2017 19:05:04 +0300 Subject: [PATCH] @NotNull --- .../groovy/extensions/GroovyNamedArgumentProvider.java | 4 ++-- .../groovy/lang/GroovyConstructorNamedArgumentProvider.java | 4 ++-- .../groovy/lang/GroovyMethodReturnNamedArgumentProvider.java | 4 ++-- .../groovy/lang/GroovySourceCodeNamedArgumentProvider.java | 4 ++-- .../swingBuilder/SwingBuilderNamedArgumentProvider.java | 4 ++-- .../plugins/groovy/lang/GroovyMapAttributeTest.groovy | 3 ++- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/extensions/GroovyNamedArgumentProvider.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/extensions/GroovyNamedArgumentProvider.java index 74ffc3018459..5de93a543bc7 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/extensions/GroovyNamedArgumentProvider.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/extensions/GroovyNamedArgumentProvider.java @@ -45,7 +45,7 @@ public abstract class GroovyNamedArgumentProvider { @Nullable PsiElement resolve, @Nullable String argumentName, boolean forCompletion, - Map result) { + @NotNull Map result) { // no op } @@ -54,7 +54,7 @@ public abstract class GroovyNamedArgumentProvider { @Nullable GroovyResolveResult resolveResult, @Nullable String argumentName, boolean forCompletion, - Map result) { + @NotNull Map result) { getNamedArguments(call, resolve, argumentName, forCompletion, result); } diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovyConstructorNamedArgumentProvider.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovyConstructorNamedArgumentProvider.java index b9274369878c..63ff008a57c0 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovyConstructorNamedArgumentProvider.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovyConstructorNamedArgumentProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -56,7 +56,7 @@ public class GroovyConstructorNamedArgumentProvider extends GroovyNamedArgumentP @Nullable PsiElement resolve, @Nullable String argumentName, boolean forCompletion, - Map result) { + @NotNull Map result) { if (!(call instanceof GrNewExpression)) return; if (resolve != null) { diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovyMethodReturnNamedArgumentProvider.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovyMethodReturnNamedArgumentProvider.java index a0303f512ba2..4ac81a535306 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovyMethodReturnNamedArgumentProvider.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovyMethodReturnNamedArgumentProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -37,7 +37,7 @@ public class GroovyMethodReturnNamedArgumentProvider extends GroovyNamedArgument @Nullable PsiElement resolve, @Nullable String argumentName, boolean forCompletion, - Map result) { + @NotNull Map result) { if (!forCompletion || !(resolve instanceof PsiMethod)) return; PsiType returnType = ((PsiMethod)resolve).getReturnType(); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovySourceCodeNamedArgumentProvider.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovySourceCodeNamedArgumentProvider.java index 9bf95b799931..acd27ea278b2 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovySourceCodeNamedArgumentProvider.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovySourceCodeNamedArgumentProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -37,7 +37,7 @@ public class GroovySourceCodeNamedArgumentProvider extends GroovyNamedArgumentPr @Nullable PsiElement resolve, @Nullable String argumentName, boolean forCompletion, - Map result) { + @NotNull Map result) { if (resolve instanceof GrMethod) { result.putAll(((GrMethod)resolve).getNamedParameters()); } diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/swingBuilder/SwingBuilderNamedArgumentProvider.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/swingBuilder/SwingBuilderNamedArgumentProvider.java index ab4117abd2e6..a6a402d99f31 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/swingBuilder/SwingBuilderNamedArgumentProvider.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/swingBuilder/SwingBuilderNamedArgumentProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -42,7 +42,7 @@ public class SwingBuilderNamedArgumentProvider extends GroovyNamedArgumentProvid @Nullable PsiElement resolve, @Nullable String argumentName, boolean forCompletion, - Map result) { + @NotNull Map result) { PsiType returnType = resolve == null ? null : ((PsiMethod)resolve).getReturnType(); PsiClass aClass = PsiTypesUtil.getPsiClass(returnType); if (aClass == null) return; diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyMapAttributeTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyMapAttributeTest.groovy index 4af6105d6621..ad758ebdaf08 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyMapAttributeTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyMapAttributeTest.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -469,6 +469,7 @@ class Test { private doTestCompletionWithinMap(String text, String text2 = null) { PlatformTestUtil.registerExtension GroovyNamedArgumentProvider.EP_NAME, new GroovyNamedArgumentProvider() { + @NotNull @Override Map getNamedArguments(@NotNull GrListOrMap literal) { ['foo': NamedArgumentDescriptor.SIMPLE_NORMAL, 'bar': NamedArgumentDescriptor.SIMPLE_NORMAL]