From 80da6a36ef0fc1a2170cce30e092ab033004060d Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Fri, 3 Jul 2015 16:00:34 +0300 Subject: [PATCH] Cleanup (warnings) --- .../LightFixtureCompletionTestCase.java | 18 +++++++++++++++++- .../psi/impl/SharedPsiElementImplUtil.java | 3 ++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/java/testFramework/src/com/intellij/codeInsight/completion/LightFixtureCompletionTestCase.java b/java/testFramework/src/com/intellij/codeInsight/completion/LightFixtureCompletionTestCase.java index 5adb7db771c9..de0d8309866c 100644 --- a/java/testFramework/src/com/intellij/codeInsight/completion/LightFixtureCompletionTestCase.java +++ b/java/testFramework/src/com/intellij/codeInsight/completion/LightFixtureCompletionTestCase.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.codeInsight.completion; import com.intellij.codeInsight.lookup.LookupElement; @@ -5,6 +20,7 @@ import com.intellij.codeInsight.lookup.LookupEvent; import com.intellij.codeInsight.lookup.LookupManager; import com.intellij.codeInsight.lookup.impl.LookupImpl; import com.intellij.openapi.command.WriteCommandAction; +import com.intellij.openapi.util.text.StringUtil; import com.intellij.testFramework.LightProjectDescriptor; import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase; import org.jetbrains.annotations.NotNull; @@ -30,7 +46,7 @@ public abstract class LightFixtureCompletionTestCase extends LightCodeInsightFix } protected void configureByFile(String path) { - myFixture.configureFromExistingVirtualFile(myFixture.copyFileToProject(path, com.intellij.openapi.util.text.StringUtil.getShortName(path, '/'))); + myFixture.configureFromExistingVirtualFile(myFixture.copyFileToProject(path, StringUtil.getShortName(path, '/'))); complete(); } diff --git a/platform/core-impl/src/com/intellij/psi/impl/SharedPsiElementImplUtil.java b/platform/core-impl/src/com/intellij/psi/impl/SharedPsiElementImplUtil.java index d1a6b81e1a9a..c202ef617d18 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/SharedPsiElementImplUtil.java +++ b/platform/core-impl/src/com/intellij/psi/impl/SharedPsiElementImplUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -67,6 +67,7 @@ public class SharedPsiElementImplUtil { for (final PsiReference reference : element.getReferences()) { if (reference == null) { LOG.error(element); + continue; } for (TextRange range : ReferenceRange.getRanges(reference)) { LOG.assertTrue(range != null, reference);