mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
better nullability
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -86,7 +86,7 @@ public class JavaStackFrame extends XStackFrame {
|
||||
myEqualityObject = update ? NodeManagerImpl.getContextKeyForFrame(myDescriptor.getFrameProxy()) : null;
|
||||
myDebugProcess = ((DebugProcessImpl)descriptor.getDebugProcess());
|
||||
myNodeManager = myDebugProcess.getXdebugProcess().getNodeManager();
|
||||
myXSourcePosition = myDescriptor.getSourcePosition() != null ? DebuggerUtilsEx.toXSourcePosition(myDescriptor.getSourcePosition()) : null;
|
||||
myXSourcePosition = DebuggerUtilsEx.toXSourcePosition(myDescriptor.getSourcePosition());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -716,15 +716,17 @@ public abstract class DebuggerUtilsEx extends DebuggerUtils {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static XSourcePosition toXSourcePosition(@NotNull SourcePosition position) {
|
||||
VirtualFile file = position.getFile().getVirtualFile();
|
||||
if (file == null) {
|
||||
file = position.getFile().getOriginalFile().getVirtualFile();
|
||||
public static XSourcePosition toXSourcePosition(@Nullable SourcePosition position) {
|
||||
if (position != null) {
|
||||
VirtualFile file = position.getFile().getVirtualFile();
|
||||
if (file == null) {
|
||||
file = position.getFile().getOriginalFile().getVirtualFile();
|
||||
}
|
||||
if (file != null) {
|
||||
return new JavaXSourcePosition(position, file);
|
||||
}
|
||||
}
|
||||
if (file == null) {
|
||||
return null;
|
||||
}
|
||||
return new JavaXSourcePosition(position, file);
|
||||
return null;
|
||||
}
|
||||
|
||||
private static class JavaXSourcePosition implements XSourcePosition, ExecutionPointHighlighter.HighlighterProvider {
|
||||
|
||||
Reference in New Issue
Block a user