use java 7 API — get rid of home grown assertNotNull and notNull

GitOrigin-RevId: 4df1569fc01d15cfbe42b00a5b5edf7c1ea0f5b3
This commit is contained in:
Vladimir Krivosheev
2020-02-11 10:28:15 +01:00
committed by intellij-monorepo-bot
parent d4c05a13ee
commit bac2b6d2f8
292 changed files with 1064 additions and 2093 deletions

View File

@@ -1,4 +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-2020 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.codeInspection.reference;
@@ -19,6 +19,7 @@ import org.jetbrains.uast.visitor.AbstractUastVisitor;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
public class RefJavaUtilImpl extends RefJavaUtil {
private static final Logger LOG = Logger.getInstance(RefJavaUtilImpl.class);
@@ -294,7 +295,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
@Override
public boolean visitReturnExpression(@NotNull UReturnExpression node) {
if (refFrom instanceof RefMethodImpl &&
if (refFrom instanceof RefMethodImpl &&
UastUtils.getParentOfType(node, UMethod.class, false, UClass.class, ULambdaExpression.class) == decl) {
RefMethodImpl refMethod = (RefMethodImpl)refFrom;
refMethod.updateReturnValueTemplate(node.getReturnExpression());
@@ -404,7 +405,7 @@ public class RefJavaUtilImpl extends RefJavaUtil {
UExpression refExpression,
final UElement uFrom,
final RefElement refFrom) {
UMethod uMethod = ObjectUtils.notNull(UastContextKt.toUElement(psiResolved, UMethod.class));
UMethod uMethod = Objects.requireNonNull(UastContextKt.toUElement(psiResolved, UMethod.class));
RefMethodImpl refMethod = (RefMethodImpl)refResolved;
if (refExpression instanceof UCallableReferenceExpression) {