From 6dbafbea325ccfcd9cb3f729d7f2bcf0eef8695a Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Fri, 31 Aug 2018 14:04:10 +0200 Subject: [PATCH] utils: cleanup/nullability --- .../src/com/intellij/openapi/vfs/VfsUtilCore.java | 8 +++----- .../src/com/intellij/util/containers/ContainerUtil.java | 8 ++++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/platform/core-api/src/com/intellij/openapi/vfs/VfsUtilCore.java b/platform/core-api/src/com/intellij/openapi/vfs/VfsUtilCore.java index 425561a3f398..421a614cb8e3 100644 --- a/platform/core-api/src/com/intellij/openapi/vfs/VfsUtilCore.java +++ b/platform/core-api/src/com/intellij/openapi/vfs/VfsUtilCore.java @@ -1,6 +1,4 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vfs; import com.intellij.openapi.diagnostic.Logger; @@ -414,8 +412,8 @@ public class VfsUtilCore { return VirtualFileManager.constructUrl(URLUtil.FILE_PROTOCOL, path); } - public static List virtualToIoFiles(@NotNull Collection scope) { - return ContainerUtil.map2List(scope, file -> virtualToIoFile(file)); + public static List virtualToIoFiles(@NotNull Collection files) { + return ContainerUtil.map2List(files, file -> virtualToIoFile(file)); } @NotNull diff --git a/platform/util/src/com/intellij/util/containers/ContainerUtil.java b/platform/util/src/com/intellij/util/containers/ContainerUtil.java index c10a9426670f..d8c1493ea44d 100644 --- a/platform/util/src/com/intellij/util/containers/ContainerUtil.java +++ b/platform/util/src/com/intellij/util/containers/ContainerUtil.java @@ -207,7 +207,7 @@ public class ContainerUtil extends ContainerUtilRt { @NotNull @Contract(pure = true) - public static Collection unmodifiableOrEmptyCollection(Collection original) { + public static Collection unmodifiableOrEmptyCollection(@NotNull Collection original) { int size = original.size(); if (size == 0) { return emptyList(); @@ -222,7 +222,7 @@ public class ContainerUtil extends ContainerUtilRt { @NotNull @Contract(pure = true) - public static List unmodifiableOrEmptyList(List original) { + public static List unmodifiableOrEmptyList(@NotNull List original) { int size = original.size(); if (size == 0) { return emptyList(); @@ -237,7 +237,7 @@ public class ContainerUtil extends ContainerUtilRt { @NotNull @Contract(pure = true) - public static Set unmodifiableOrEmptySet(Set original) { + public static Set unmodifiableOrEmptySet(@NotNull Set original) { int size = original.size(); if (size == 0) { return Collections.emptySet(); @@ -252,7 +252,7 @@ public class ContainerUtil extends ContainerUtilRt { @NotNull @Contract(pure = true) - public static Map unmodifiableOrEmptyMap(Map original) { + public static Map unmodifiableOrEmptyMap(@NotNull Map original) { int size = original.size(); if (size == 0) { return Collections.emptyMap();