EA-1470856 - IVFAE: FileManagerImpl.findFile

GitOrigin-RevId: 3b1a170cb8070e9db3ca033d03dead7902a83895
This commit is contained in:
Egor Ushakov
2024-09-19 10:58:15 +02:00
committed by intellij-monorepo-bot
parent 8abf0312a8
commit ecb477656c

View File

@@ -1,18 +1,4 @@
/*
* 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.
*/
// 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.execution.scratch;
import com.intellij.debugger.NoDataException;
@@ -39,9 +25,9 @@ import java.util.List;
* @author Eugene Zhuravlev
*/
public class JavaScratchPositionManager extends PositionManagerImpl{
private final VirtualFile myScratchFile;
private final @NotNull VirtualFile myScratchFile;
public JavaScratchPositionManager(DebugProcessImpl debugProcess, VirtualFile scratchFile) {
public JavaScratchPositionManager(@NotNull DebugProcessImpl debugProcess, @NotNull VirtualFile scratchFile) {
super(debugProcess);
myScratchFile = scratchFile;
}
@@ -87,7 +73,7 @@ public class JavaScratchPositionManager extends PositionManagerImpl{
@Nullable
@Override
protected PsiFile getPsiFileByLocation(Project project, Location location) {
if (location == null) {
if (location == null || !myScratchFile.isValid()) {
return null;
}
final ReferenceType refType = location.declaringType();