mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-173562 "Log message to console" for emulated method breakpoints prints an empty line - cleanup
This commit is contained in:
@@ -330,23 +330,26 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getEventMessage(@NotNull LocatableEvent event) {
|
||||
return getEventMessage(event, getFileName());
|
||||
}
|
||||
|
||||
static String getEventMessage(@NotNull LocatableEvent event, String defaultFileName) {
|
||||
Location location = event.location();
|
||||
if (event instanceof MethodEntryEvent) {
|
||||
return getEventMessage(true, ((MethodEntryEvent)event).method(), location, getFileName());
|
||||
return getEventMessage(true, ((MethodEntryEvent)event).method(), location, defaultFileName);
|
||||
}
|
||||
if (event instanceof MethodExitEvent) {
|
||||
return getEventMessage(false, ((MethodExitEvent)event).method(), location, getFileName());
|
||||
return getEventMessage(false, ((MethodExitEvent)event).method(), location, defaultFileName);
|
||||
}
|
||||
Object entryProperty = event.request().getProperty(METHOD_ENTRY_KEY);
|
||||
if (entryProperty instanceof Boolean) {
|
||||
return getEventMessage((Boolean)entryProperty, location.method(), location, getFileName());
|
||||
return getEventMessage((Boolean)entryProperty, location.method(), location, defaultFileName);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
static String getEventMessage(boolean entry, Method method, Location location, String defaultFileName) {
|
||||
private static String getEventMessage(boolean entry, Method method, Location location, String defaultFileName) {
|
||||
String locationQName = DebuggerUtilsEx.getLocationMethodQName(location);
|
||||
String locationFileName;
|
||||
try {
|
||||
|
||||
+1
-15
@@ -38,12 +38,9 @@ import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.util.PatternUtil;
|
||||
import com.intellij.util.StringBuilderSpinAllocator;
|
||||
import com.intellij.xdebugger.breakpoints.XBreakpoint;
|
||||
import com.sun.jdi.Location;
|
||||
import com.sun.jdi.Method;
|
||||
import com.sun.jdi.ReferenceType;
|
||||
import com.sun.jdi.event.LocatableEvent;
|
||||
import com.sun.jdi.event.MethodEntryEvent;
|
||||
import com.sun.jdi.event.MethodExitEvent;
|
||||
import com.sun.jdi.request.MethodEntryRequest;
|
||||
import com.sun.jdi.request.MethodExitRequest;
|
||||
import one.util.streamex.StreamEx;
|
||||
@@ -182,18 +179,7 @@ public class WildcardMethodBreakpoint extends Breakpoint<JavaMethodBreakpointPro
|
||||
}
|
||||
|
||||
public String getEventMessage(@NotNull LocatableEvent event) {
|
||||
Location location = event.location();
|
||||
if (event instanceof MethodEntryEvent) {
|
||||
return MethodBreakpoint.getEventMessage(true, ((MethodEntryEvent)event).method(), location, "");
|
||||
}
|
||||
if (event instanceof MethodExitEvent) {
|
||||
return MethodBreakpoint.getEventMessage(false, ((MethodExitEvent)event).method(), location, "");
|
||||
}
|
||||
Object entryProperty = event.request().getProperty(METHOD_ENTRY_KEY);
|
||||
if (entryProperty instanceof Boolean) {
|
||||
return MethodBreakpoint.getEventMessage((Boolean)entryProperty, location.method(), location, "");
|
||||
}
|
||||
return "";
|
||||
return MethodBreakpoint.getEventMessage(event, "");
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
|
||||
Reference in New Issue
Block a user