utils: cleanup/nullability

This commit is contained in:
Anton Makeev
2018-09-03 13:43:07 +02:00
parent e66890a6d2
commit 6dbafbea32
2 changed files with 7 additions and 9 deletions
@@ -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<File> virtualToIoFiles(@NotNull Collection<? extends VirtualFile> scope) {
return ContainerUtil.map2List(scope, file -> virtualToIoFile(file));
public static List<File> virtualToIoFiles(@NotNull Collection<? extends VirtualFile> files) {
return ContainerUtil.map2List(files, file -> virtualToIoFile(file));
}
@NotNull
@@ -207,7 +207,7 @@ public class ContainerUtil extends ContainerUtilRt {
@NotNull
@Contract(pure = true)
public static <T> Collection<T> unmodifiableOrEmptyCollection(Collection<? extends T> original) {
public static <T> Collection<T> unmodifiableOrEmptyCollection(@NotNull Collection<? extends T> 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 <T> List<T> unmodifiableOrEmptyList(List<? extends T> original) {
public static <T> List<T> unmodifiableOrEmptyList(@NotNull List<? extends T> 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 <T> Set<T> unmodifiableOrEmptySet(Set<? extends T> original) {
public static <T> Set<T> unmodifiableOrEmptySet(@NotNull Set<? extends T> 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 <K,V> Map<K,V> unmodifiableOrEmptyMap(Map<? extends K, ? extends V> original) {
public static <K,V> Map<K,V> unmodifiableOrEmptyMap(@NotNull Map<? extends K, ? extends V> original) {
int size = original.size();
if (size == 0) {
return Collections.emptyMap();