Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 182999 - Cannot display an array with null values
Summary: Cannot display an array with null values
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 354906 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-18 12:16 EDT by Olivier Thomann CLA
Modified: 2011-09-20 11:37 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2007-04-18 12:16:04 EDT
Using I20070410-1043, I got a DebugException when trying to display an array with a null value.
The array contained one element that is null.

The error in the display panel was:
org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array
Comment 1 Darin Wright CLA 2007-04-18 13:18:02 EDT
What was in the array? Does not happen for a simple test case such as an array of (big) Integer objects with some null entries.
Comment 2 Olivier Thomann CLA 2007-04-18 13:35:20 EDT
It was an array of Annotation.
I debugged some code in the apt support.
Comment 3 Curtis Windatt CLA 2007-05-11 11:08:08 EDT
Have you seen this again Olivier?  Might be just a fluke with the VM not loading the class in time, in which case it will be nearly impossible to track down.
Comment 4 Olivier Thomann CLA 2007-05-11 11:20:46 EDT
I got it again, but I could never end up with a reproducable case.
Comment 5 Olivier Thomann CLA 2007-05-23 11:12:29 EDT
I got it again.
"Error	The method toArray(Object[]) in the type Collection is not applicable for the arguments ()".

It seems that I have a reproducable test case (at least on my machine).
1) Apply the patch I'll send you shortly.
2) Put a breakpoint line 1967 in org.eclipse.jdt.internal.compiler.batch.Main
3) Run the Compile class that I will send you
4) When you hit the breakpoint, try to display the bootclasspath variable.
5) If it works, go to the return statement and do a "Run to line" and look at the variable value again.
6) It always shows this error for me.
Comment 6 Olivier Thomann CLA 2007-05-23 11:12:49 EDT
This is using I20070522-0010.
Comment 7 Olivier Thomann CLA 2007-05-23 11:54:53 EDT
It seems to be related to the fact that on the breakpoint the array is empty and I tried to expand it.
Comment 8 Olivier Thomann CLA 2007-05-25 14:14:00 EDT
Closing as INVALID.
The problem comes from the fact that the source locations of the corresponding launching configuration contained a project that defined a subset of the class libraries. In this subset, I had a java.util.Collection interface that didn't defined the toArray() method.
Once I removed the project from the list of project in the source locations, it worked as expected.
Is it possible to warn the user about this? I was expecting the classes to come from the current VM, not the source locations. Without debugging it, I would have never been able to understand my mistake.
Comment 9 Michael Rennie CLA 2011-09-20 11:37:29 EDT
*** Bug 354906 has been marked as a duplicate of this bug. ***