Bug 1745 - toString() for primitive array types (1GL2TF0)
Summary: toString() for primitive array types (1GL2TF0)
Status: RESOLVED DUPLICATE of bug 8322
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 2.0 M5   Edit
Assignee: Jared Burns CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:18 EDT by Joe Szurszewski CLA
Modified: 2002-03-22 15:23 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Szurszewski CLA 2001-10-10 22:18:36 EDT
JGS & DW
	Primitive arrays don't implement toString(), so we need a method for allowing clients to supply
	a toString()-like 'pretty printer' for primitive arrays.  Could we extend this to also allow
	client-supplied pretty printers for arbitrary types?

	As a first pass, we could just supply the primitive array pretty printers.
Comment 1 Darin Wright CLA 2001-11-01 12:10:14 EST
Currently when I select an array in the variables view, the detail area 
shows "Receiver does not implement selector {0} and signature {1}". 

Two problems
(1) Our error message is not being filled in properly (should say "toString" 
and "()Ljava.lang.String".
(2) We need pretty printers for arrays.
Comment 2 Darin Wright CLA 2001-11-02 13:34:30 EST
The JDIModelPresentation will provide a default style for rendering "toString
()" details for arrays - a simple "toString()" of each value placed inside 
square brackets, seperated by commas.

Comment 3 Joe Szurszewski CLA 2001-11-07 15:26:00 EST
Released first pass.  This is based on an interface implementation, 
IValueDetailProvider (though it isn't exposed yet), that is an inner class to 
JDIModelPresentation.  We no longer lock up the UI thread while doing 
evaluation of toString().  Arbitrary arrays (Object[]) are handled.  The API of 
IDebugModelPresentation has changed to support callback notification of eval 
results to requestor.  There are several known issues:
(1) toString() evals that time out result in a thread collapse in DebugView,
    which clears the VariableView until the eval thread has finished.  We
    need a way to avoid this collapse from affecting the VariablesView.
(2) Eval thread could keep running forever.  Alternative is on timeout to pop 
up dialog informing user of situation and asking if they want to kill the 
program.  
(3) The timeout for evaluation should probably be a preference.  This could 
also be mentioned in the timeout dialog in (2).
Comment 4 Darin Wright CLA 2002-01-16 16:01:42 EST
Fixed toString for multi-dimensional arrays. The if statement did a check in 
the wrong order (first checked if instanceof IJavaObject, rather an IJavaArray).
Comment 5 Darin Wright CLA 2002-02-26 11:36:18 EST
Related to bug# 6417
Comment 6 Darin Wright CLA 2002-03-22 15:15:34 EST
Related to bug# 8322
Comment 7 Jared Burns CLA 2002-03-22 15:23:49 EST

*** This bug has been marked as a duplicate of 8322 ***