Bug 459212 - Debug details formatter never works work for java.util.Date objects
Summary: Debug details formatter never works work for java.util.Date objects
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2015-02-05 07:06 EST by Jakub G. CLA
Modified: 2023-10-16 12:54 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub G. CLA 2015-02-05 07:06:45 EST
STR:
---

1. Install Eclipse 4.4 Luna on Windows 7
2. Open `Window > Preferences` : `Java > Debug > Detail Formatters`
3. Add formatter for `java.util.Calendar` with any valid content, say `"XX"`
4. Add a very same formatter for `java.util.Date`
5. Create a sample unit test:

```
package my.package;

import java.util.Calendar;
import java.util.Date;
import org.junit.Test;

public class MyTest {

  @Test
  public void testXX() {
    Date ddd = new Date(111, 11, 11);
    Calendar ccc = Calendar.getInstance();

    System.out.println(ddd);
  }
}
```

6. Put a breakpoint on the `println` line
7. Debug the test as a JUnit test
8. Open `Variables` or `Expressions` view to inspect contents of the variables

Result:
-------

Detail formatter for Calendar is properly applied: output is: `XX`
Detail formatter for Date is NOT properly applied: output is:

```
Detail formatter error:
		Evaluations must contain either an expression or a block of well-formed statements
```

Additional info:
---------------

It seems that whatever code I put in the formatter for Date, it always breaks. I didn't find though any info about it in the internet other than someone else's post from 2009:

http://www.eclipse.org/forums/index.php/t/82652/

Is someone able to reproduce the issue?
Comment 1 Sarika Sinha CLA 2015-02-05 07:32:08 EST
Yes, I can reproduce the bug on Mars 4.5 also.
Comment 2 Eclipse Genie CLA 2019-10-31 15:36:12 EDT
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.
Comment 3 Sarika Sinha CLA 2019-11-04 06:40:37 EST
Same as before.
Comment 4 Eclipse Genie CLA 2021-10-25 11:24:25 EDT
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.
Comment 5 Eclipse Genie CLA 2023-10-16 12:54:49 EDT
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.