Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325290 - Can't evaluate new Object[] { 5 }: InvalidTypeException: Generated value..
Summary: Can't evaluate new Object[] { 5 }: InvalidTypeException: Generated value..
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows Vista
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-14 16:04 EDT by Chris West (Faux) CLA
Modified: 2020-02-16 09:11 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris West (Faux) CLA 2010-09-14 16:04:05 EDT
Build Identifier: 

Attempting to evaluate (ctrl+shift+i inspect/ctrl+shift+d display) code containing "new Object[] { 5 }" will give an InvalidTypeException:

Generated value (int) is not compatible with declared type (java.lang.Object).
Thread [Worker-7] (Suspended (exception InvalidTypeException))	
	ValueImpl.checkValue(Value, Type, VirtualMachineImpl) line: 192	
	ArrayReferenceImpl.checkValues(List, Type) line: 295	
	ArrayReferenceImpl.setValues(int, List, int, int) line: 251	
	ArrayReferenceImpl.setValue(int, Value) line: 209	
	JDIArrayValue.setValue(int, IJavaValue) line: 86	
	ArrayInitializerInstruction.execute() line: 45	
	Interpreter.execute() line: 66	
...



Reproducible: Always

Steps to Reproduce:
1. Debug code looking like:
import java.util.Arrays;

class Pony {
  public static void main(String[] args) {
    System.out.println(Arrays.toString(new Object[] { 5 }));
  }
}
2.  Breakpoint the line.
3. Highlight "new Object[] { 5 }"
4. ctrl+shift+i inspect or ctrl+shift+d display the highlighted expression.
5. Error will be reported (without stack trace aaaa).
Comment 1 Darin Wright CLA 2010-09-14 16:35:53 EDT
Looks literals used to initialize arrays are not autoboxed properly.
Comment 2 Eclipse Genie CLA 2020-02-16 09:11:20 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.