mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
take 3: augmenting IDEA-148802 Java Scratch files debugging: debugger ignores breakpoints in module classes and doesn't show their sources
This commit is contained in:
+13
-19
@@ -33,7 +33,6 @@ import com.sun.jdi.request.ClassPrepareRequest;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -52,12 +51,7 @@ public class JavaScratchPositionManager extends PositionManagerImpl{
|
||||
@Override
|
||||
public List<Location> locationsOfLine(@NotNull ReferenceType type, @NotNull SourcePosition position) throws NoDataException {
|
||||
checkPosition(position);
|
||||
try {
|
||||
return super.locationsOfLine(type, position);
|
||||
}
|
||||
catch (NoDataException e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return super.locationsOfLine(type, position);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -65,24 +59,14 @@ public class JavaScratchPositionManager extends PositionManagerImpl{
|
||||
public List<ClassPrepareRequest> createPrepareRequests(@NotNull ClassPrepareRequestor requestor,
|
||||
@NotNull SourcePosition position) throws NoDataException {
|
||||
checkPosition(position);
|
||||
try {
|
||||
return super.createPrepareRequests(requestor, position);
|
||||
}
|
||||
catch (NoDataException e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return super.createPrepareRequests(requestor, position);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<ReferenceType> getAllClasses(@NotNull SourcePosition position) throws NoDataException {
|
||||
checkPosition(position);
|
||||
try {
|
||||
return super.getAllClasses(position);
|
||||
}
|
||||
catch (NoDataException e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return super.getAllClasses(position);
|
||||
}
|
||||
|
||||
private void checkPosition(@NotNull SourcePosition position) throws NoDataException{
|
||||
@@ -91,6 +75,16 @@ public class JavaScratchPositionManager extends PositionManagerImpl{
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public SourcePosition getSourcePosition(Location location) throws NoDataException {
|
||||
final SourcePosition position = super.getSourcePosition(location);
|
||||
if (position == null) {
|
||||
throw NoDataException.INSTANCE; // delegate to other managers
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected PsiFile getPsiFileByLocation(Project project, Location location) {
|
||||
|
||||
Reference in New Issue
Block a user