From 969a501efb8a5d64cb28a534843400aed0c4f6ba Mon Sep 17 00:00:00 2001 From: Alexandr Evstigneev Date: Fri, 7 Jun 2024 10:05:37 +0400 Subject: [PATCH] Added explicit annotations to the RenameUtil.isValidName Annotations taken from the method business logic. GitOrigin-RevId: 5816bc381cb0db5827351a9359500d4d92511517 --- .../src/com/intellij/refactoring/rename/RenameUtil.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/refactoring/src/com/intellij/refactoring/rename/RenameUtil.java b/platform/refactoring/src/com/intellij/refactoring/rename/RenameUtil.java index 9eb5457940b7..46cf837252fb 100644 --- a/platform/refactoring/src/com/intellij/refactoring/rename/RenameUtil.java +++ b/platform/refactoring/src/com/intellij/refactoring/rename/RenameUtil.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.refactoring.rename; import com.intellij.codeInsight.CodeInsightUtilCore; @@ -361,8 +361,10 @@ public final class RenameUtil { } } - public static boolean isValidName(final Project project, final PsiElement psiElement, final String newName) { - if (newName == null || newName.length() == 0) { + public static boolean isValidName(@Nullable final Project project, + @NotNull final PsiElement psiElement, + @Nullable final String newName) { + if (StringUtil.isEmpty(newName)) { return false; } final Condition inputValidator = RenameInputValidatorRegistry.getInputValidator(psiElement);