Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Dltk-dev] any objections to changing the "toString" of the CollectionType?

Now we get something like this in the debugger:

"number[8]"

What does that say? Nobody can see whats really in it without really expanding it and so on
The Rhino debugger (the old one) did this:

"Array(10.0,200.0,30.0,40.0,5006.0,700.0,200.0,"johan")"

Of course not the complete array values limit it (currently 100 values)

This is the code:

public String formatValue(IScriptValue value) {
        StringBuffer sb = new StringBuffer();
        sb.append(value.getRawValue()); // == Array
        sb.append("("); // == Array

        try {
            IVariable[] variables2 = value.getVariables();
            if (variables2.length > 0) {
                int length = variables2.length;
                length = length > 100 ? 100 : length;
                for (int i = 0; i < variables2.length; i++) {
                    sb.append(variables2[i].getValue().getValueString());
                    sb.append(",");
                }
                sb.setLength(sb.length() - 1);
            }
        } catch (DebugException ex) {
            ex.printStackTrace();
        }
        sb.append(")"); // == Array

        addInstanceId(value, sb);

        return sb.toString();
    }

Should i commit this? Or are you guys liking the current behavior better?

johan


Back to the top