[hg] main-silver: #225350: Call the original getToStringValue(),...

  • From:
  • To:
  • Subject: [hg] main-silver: #225350: Call the original getToStringValue(),...
  • Date: Fri, 25 Jan 2013 13:37:04 -0800

changeset 9938912f8635 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/9938912f8635
description:
        #225350: Call the original getToStringValue(), which truncates long 
Strings by default to prevent from memory overflow.

diffstat:

 
debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/ToolTipAnnotation.java
 |  16 +---------
 1 files changed, 1 insertions(+), 15 deletions(-)

diffs (33 lines):

diff --git 
a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/ToolTipAnnotation.java
 
b/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/ToolTipAnnotation.java
--- 
a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/ToolTipAnnotation.java
+++ 
b/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/ToolTipAnnotation.java
@@ -109,8 +109,6 @@
 
 public class ToolTipAnnotation extends Annotation implements Runnable {
 
-    private static final int TO_STRING_LENGTH_LIMIT = 10000;
-
     private static final Set<String> JAVA_KEYWORDS = new 
HashSet<String>(Arrays.asList(new String[] {
         "abstract",     "continue",     "for",          "new",         
"switch",
         "assert",      "default",      "goto",         "package",      
"synchronized",
@@ -218,19 +216,7 @@
             if (v instanceof ObjectVariable) {
                 tooltipVariable = (ObjectVariable) v;
                 try {
-                    String toString = null;
-                    try {
-                        java.lang.reflect.Method toStringMethod =
-                                v.getClass().getMethod("getToStringValue",  
// NOI18N
-                                                       new Class[] { 
Integer.TYPE });
-                        toStringMethod.setAccessible(true);
-                        toString = (String) toStringMethod.invoke(v, 
TO_STRING_LENGTH_LIMIT);
-                    } catch (Exception ex) {
-                        Exceptions.printStackTrace(ex);
-                    }
-                    if (toString == null) {
-                        toString = ((ObjectVariable) v).getToStringValue();
-                    }
+                    String toString = tooltipVariable.getToStringValue();
                     toolTipText = expression + " = " +
                         (type.length () == 0 ?
                             "" :

[hg] main-silver: #225350: Call the original getToStringValue(),...

mentlicher 01/25/2013

Project Features

About this Project

Debugger was started in November 2009, is owned by tpavek, and has 29 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close