mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
bug fixed: show object's synthetic "val$..." fields under object's node when the object is not frame's 'this' object
This commit is contained in:
@@ -39,6 +39,7 @@ import com.intellij.util.StringBuilderSpinAllocator;
|
||||
import com.sun.jdi.*;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -147,7 +148,7 @@ public class ClassRenderer extends NodeRendererImpl{
|
||||
final List<Field> fields = refType.allFields();
|
||||
if (fields.size() > 0) {
|
||||
for (final Field field : fields) {
|
||||
if (!shouldDisplay(field)) {
|
||||
if (!shouldDisplay(evaluationContext, objRef, field)) {
|
||||
continue;
|
||||
}
|
||||
children.add(nodeManager.createNode(nodeDescriptorFactory.getFieldDescriptor(parentDescriptor, objRef, field), evaluationContext));
|
||||
@@ -164,13 +165,15 @@ public class ClassRenderer extends NodeRendererImpl{
|
||||
builder.setChildren(children);
|
||||
}
|
||||
|
||||
private boolean shouldDisplay(Field field) {
|
||||
private boolean shouldDisplay(EvaluationContext context, @NotNull ObjectReference objInstance, @NotNull Field field) {
|
||||
final boolean isSynthetic = DebuggerUtils.isSynthetic(field);
|
||||
if (!SHOW_SYNTHETICS && isSynthetic) {
|
||||
return false;
|
||||
}
|
||||
if (isSynthetic && StringUtil.startsWith(field.name(), FieldDescriptorImpl.OUTER_LOCAL_VAR_FIELD_PREFIX)) {
|
||||
return false;
|
||||
if (isSynthetic) {
|
||||
if (objInstance.equals(context.getThisObject()) && StringUtil.startsWith(field.name(), FieldDescriptorImpl.OUTER_LOCAL_VAR_FIELD_PREFIX)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(!SHOW_STATIC && field.isStatic()) {
|
||||
return false;
|
||||
|
||||
+2
@@ -32,4 +32,6 @@ public interface EvaluationContext extends StackFrameContext{
|
||||
Project getProject();
|
||||
|
||||
ClassLoaderReference getClassLoader() throws EvaluateException;
|
||||
|
||||
Value getThisObject();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user