Skip to content

Commit

Permalink
Code review changes [Without automated reformat]
Browse files Browse the repository at this point in the history
  • Loading branch information
SougandhS committed Sep 24, 2024
1 parent 35e4282 commit eb547ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class EventFilter implements IDebugEventFilter {
public DebugEvent[] filterDebugEvents(DebugEvent[] events) {
if (events.length == 1) {
DebugEvent event = events[0];
if (event.getSource() instanceof IJavaVariable && event.getKind() == DebugEvent.CHANGE) {
if (((IJavaVariable) event.getSource()).getDebugTarget().equals(getDebugTarget())) {
if (event.getSource() instanceof IJavaVariable jvar && event.getKind() == DebugEvent.CHANGE) {
if (jvar.getDebugTarget().equals(getDebugTarget())) {
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.text.MessageFormat;

import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
Expand Down Expand Up @@ -220,10 +221,17 @@ public int breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint) {
.getTopStackFrame();
IJavaProject project = lineBreakpoint.getJavaProject(frame);
if (project == null) {
IMarker marker = breakpoint.getMarker(); // my changes
IMarker marker = breakpoint.getMarker();
if (marker != null) {
IResource res = marker.getResource();
project = JavaCore.create(res.getProject());
IProject curProject = res.getProject();
if (curProject != null) {
project = JavaCore.create(curProject);
} else {
fireConditionHasErrors(lineBreakpoint, new Message[] {
new Message(JDIDebugBreakpointMessages.JavaLineBreakpoint_Unable_to_compile_conditional_breakpoint___missing_Java_project_context__1, -1) });
return SUSPEND;
}
} else {
fireConditionHasErrors(lineBreakpoint, new Message[] {
new Message(JDIDebugBreakpointMessages.JavaLineBreakpoint_Unable_to_compile_conditional_breakpoint___missing_Java_project_context__1, -1) });
Expand Down

0 comments on commit eb547ad

Please sign in to comment.