EA-66233 - NPE: ExceptionBreakpoint.getEventMessage

This commit is contained in:
Egor.Ushakov
2015-03-17 20:13:44 +03:00
parent 307d43af33
commit 226e6ebd53
7 changed files with 20 additions and 8 deletions
@@ -733,4 +733,14 @@ public abstract class DebuggerUtilsEx extends DebuggerUtils {
if (file == null) return null;
return file.findElementAt(offset);
}
public static String getLocationMethodQName(@NotNull Location location) {
StringBuilder res = new StringBuilder();
ReferenceType type = location.declaringType();
if (type != null) {
res.append(type.name()).append('.');
}
res.append(location.method().name());
return res.toString();
}
}
@@ -235,7 +235,7 @@ public class ExportDialog extends DialogWrapper {
}
return DebuggerBundle.message(
"export.threads.stackframe.format",
location.declaringType().name() + "." + location.method().name(),
DebuggerUtilsEx.getLocationMethodQName(location),
sourceName,
location.lineNumber()
);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* 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.
@@ -25,6 +25,7 @@ import com.intellij.debugger.DebuggerManagerEx;
import com.intellij.debugger.SourcePosition;
import com.intellij.debugger.engine.*;
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.debugger.impl.DebuggerUtilsEx;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
@@ -177,7 +178,7 @@ public class ExceptionBreakpoint extends Breakpoint<JavaExceptionBreakpointPrope
}
}
final Location location = event.location();
final String locationQName = location.declaringType().name() + "." + location.method().name();
final String locationQName = DebuggerUtilsEx.getLocationMethodQName(location);
String locationFileName;
try {
locationFileName = location.sourceName();
@@ -28,6 +28,7 @@ import com.intellij.debugger.engine.SuspendContextImpl;
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.debugger.engine.jdi.VirtualMachineProxy;
import com.intellij.debugger.engine.requests.RequestManagerImpl;
import com.intellij.debugger.impl.DebuggerUtilsEx;
import com.intellij.debugger.impl.PositionUtil;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.application.ApplicationManager;
@@ -215,7 +216,7 @@ public class FieldBreakpoint extends BreakpointWithHighlighter<JavaFieldBreakpoi
@Override
public String getEventMessage(final LocatableEvent event) {
final Location location = event.location();
final String locationQName = location.declaringType().name() + "." + location.method().name();
final String locationQName = DebuggerUtilsEx.getLocationMethodQName(location);
String locationFileName;
try {
locationFileName = location.sourceName();
@@ -419,7 +419,7 @@ public class LineBreakpoint extends BreakpointWithHighlighter {
if (printFullTrace) {
builder.append(DebuggerBundle.message(
"status.line.breakpoint.reached.full.trace",
location.declaringType().name() + "." + location.method().name())
DebuggerUtilsEx.getLocationMethodQName(location))
);
try {
final List<StackFrame> frames = event.thread().frames();
@@ -432,7 +432,7 @@ public class LineBreakpoint extends BreakpointWithHighlighter {
else {
builder.append(DebuggerBundle.message(
"status.line.breakpoint.reached",
location.declaringType().name() + "." + location.method().name(),
DebuggerUtilsEx.getLocationMethodQName(location),
sourceName,
getLineIndex() + 1
));
@@ -180,7 +180,7 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
public String getEventMessage(@NotNull LocatableEvent event) {
final Location location = event.location();
final String locationQName = location.declaringType().name() + "." + location.method().name();
final String locationQName = DebuggerUtilsEx.getLocationMethodQName(location);
String locationFileName = "";
try {
locationFileName = location.sourceName();
@@ -168,7 +168,7 @@ public class WildcardMethodBreakpoint extends Breakpoint<JavaMethodBreakpointPro
public String getEventMessage(LocatableEvent event) {
final Location location = event.location();
final String locationQName = location.declaringType().name() + "." + location.method().name();
final String locationQName = DebuggerUtilsEx.getLocationMethodQName(location);
String locationFileName = "";
try {
locationFileName = location.sourceName();