Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 195875

Summary: User defined Logical Structures don't work in 1.6 JRE but do work in 1.6 JDK
Product: [Eclipse Project] JDT Reporter: Brad Cupit <bradcupit>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: bradcupit, darin.eclipse
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard: stalebug
Attachments:
Description Flags
User Defined Logical Structure to reproduce the bug
none
screenshot of bug
none
shot of Execution Environment settings to reproduce the bug none

Description Brad Cupit CLA 2007-07-09 14:47:17 EDT
Build ID: I20070621-1340

Steps To Reproduce:
1. Under Preferences -> Java -> 'Installed JREs' make sure that a 1.6 JRE is selected (not a 1.6 JDK)
2. Under Preferences -> Java -> Compiler make sure compiler compliance level is set to 6.0 (or 5.0)
3. Setup a logical structure for the java.lang.String class (any logical structure will do)
4. Turn on Logical Structures in the Variables view
5. Debug a project and bring up a String variable in the Variables view
6. Expand the variable and see the following error: Evalutations must contain either an expression or a block of well-formed statements
7. Under Preferences -> Java -> Installer JREs switch to a JDK and see that Logical Structures work normally

More information:
I tried several different class types for logical structures (java.lang.String, java.util.Calendar, the built-in Logical Structures, and java.math.BigDecimal). The BigDecimal type and the built-in Logical Structures consistently worked, regardless of the JRE/JDK setting. String and Calendar consistently failed in a 1.6 JRE being compiled as 1.6 code.

Logical Structures did not work under a 1.6 JRE When code was compiled as 1.5 or 1.6
Logical Structures always worked under a 1.6 JDK
Logical Structures always worked when code was compiled as 1.4 (regardless of the default Installed JRE)

Since the default JRE listed under 'Installed JREs' when Eclipse is first installed is always a JRE (and not a JDK) this bug is somewhat visible.

Reproduced in Eclipse 3.3 RC4 and 3.3 final.
OS: Windows Vista Enterprise Edition
VMs: Sun JDK 1.6.0_02, and 1.6.0_01, and 1.6.0, and Sun Java SDK 1.4.2_15
Comment 1 Brad Cupit CLA 2007-07-09 14:55:18 EDT
Created attachment 73362 [details]
User Defined Logical Structure to reproduce the bug

This attachment can be imported (File -> Import -> General -> Preferences -> Next) to add a logical structure for the java.lang.String class that will reproduce the bug. This attachment is only for convenience when reproducing the bug, as it seems to occur on the String class regardless of how the Logical Structure is defined.
Comment 2 Brad Cupit CLA 2007-10-30 16:14:51 EDT
(In reply to comment #0)
> Logical Structures did not work under a 1.6 JRE When code was compiled as 1.5
> or 1.6
Quick clarification, this means "types like String and Calendar do not work under a 1.6 JRE" (other types, like BigDecimal, for some reason always work, even in a 1.6 JRE)
Comment 3 Darin Wright CLA 2007-10-31 16:01:46 EDT
I am not able to reproduce on XP. The imported the structure, compiled a project using 1.5, and debugged on 1.6.
Comment 4 Brad Cupit CLA 2007-11-02 22:28:01 EDT
(In reply to comment #3)
> I am not able to reproduce on XP. The imported the structure, compiled a
> project using 1.5, and debugged on 1.6.
> 
Hrmm...I was able to reproduce it on XP. Are you sure that a JRE (and not a JDK) was checked under Preferences -> Java -> Installed JREs?
Comment 5 Brad Cupit CLA 2007-11-02 22:28:51 EDT
Oh one other thing, I'm using a Sun JRE/JDK
Comment 6 Darin Wright CLA 2009-06-02 16:31:24 EDT
Cannot reproduce on 3.5Rc3. Closing as works for me.
Comment 7 Brad Cupit CLA 2009-07-02 13:50:43 EDT
(In reply to comment #6)
> Cannot reproduce on 3.5Rc3. Closing as works for me.

The bug still happens with Eclipse 3.5 final (not, I didn't try with 3.5 RC3)
Just to recap, write the following code:

public class Main {
	public static void main(String[] args) {
		String x = "123";
		System.out.println(x);
	}
}

1. setup the Sun JRE (not the JDK) as the default
2. ensure the JRE is checked under Execution Environments
3. import the attached StringLogicalStructures.epf
4. set a breakpoint on the System.out.println line
5. press the "Show Logical Structure" button in Variables view
6. click the '+' next to the x variable
7. see the bug (attached screenshot)

this was done on a brand new, empty workspace.
Sun JRE  1.6.0_10

Under Execution Environments, when I check the JRE, most logical structures don't work, but when I check the JDK, logical structures do work.

I can upload a screencast if that would be helpful.
Comment 8 Brad Cupit CLA 2009-07-02 13:51:10 EDT
Created attachment 140707 [details]
screenshot of bug
Comment 9 Brad Cupit CLA 2009-07-02 13:54:04 EDT
Created attachment 140708 [details]
shot of Execution Environment settings to reproduce the bug
Comment 10 Eclipse Genie CLA 2019-01-08 09:40:26 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.

If you have further information on the current state of the bug, please add it. 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.