Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318476 - Expressions View does not evaluate changed expression
Summary: Expressions View does not evaluate changed expression
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 10:35 EDT by MH CLA
Modified: 2010-07-01 11:25 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 MH CLA 2010-06-30 10:35:14 EDT
Build Identifier: 20100617-1415

After upgrading to Eclipse Helios, the expressions view doesn't evaluate my expression

new Date(currentDateMillis)

anymore! It just says "(pending)" as value.

Reproducible: Always

Steps to Reproduce:
1. set breakpoint in a method with a long variable containing a date
2. add an expression "new Date(longValue)"
3.
Comment 1 Darin Wright CLA 2010-06-30 11:17:31 EDT
This works for me. Anything in your .log?
Comment 2 MH CLA 2010-06-30 12:46:47 EDT
Hm, after I changed it to

  new java.util.Date(currentDateMillis)

it works again. I noticed the same behaviour in the display view: 

  return new Date(currentDateMillis);

doesn't work anymore but

   return new java.util.Date(currentDateMillis);


Why that? Why do we have to fully state the package with Helios as the former Eclipse didn't need that?
Comment 3 Darin Wright CLA 2010-06-30 13:21:36 EDT
(In reply to comment #2)
> Why that? Why do we have to fully state the package with Helios as the former
> Eclipse didn't need that?

This should be no different in Helios - the expression is evaluated in the context of the current frame - if the frame has visiblity to Date, it works. If the frame does not have visiblity to Date, you need to fully qualify it.

I verified this by having a class that does not import date and one that does. In the later case using "new Date(...)" worked.
Comment 4 MH CLA 2010-07-01 01:51:39 EDT
Well, it _did_ change in Helios as Ihave such in expressions in Eclipse for years and suddenly in Helios they don't work anymore. There has to be a change in Helios for this. The main projects I work and debug everyday with had not this problem before helios. The very same projects/Java sources/imports suddenly don't "work" for the expressions view ... think about it.
Comment 5 Darin Wright CLA 2010-07-01 11:25:35 EDT
My test shows the same behavior in 3.5 and 3.6.

With the following class I can use the expression "new Date(longValue)"

import java.util.Date;

public class Main {
	public static void main(String[] args) {
		Date date = new Date();
		long longValue = System.currentTimeMillis();
		for (int i = 0; i < 100; i++) {
			longValue += (long) (i * 100000);
		}
	}
}



With the following class I have to use "new java.util.Date(longValue)"

public class Main {
	public static void main(String[] args) {
		long longValue = System.currentTimeMillis();
		for (int i = 0; i < 100; i++) {
			longValue += (long) (i * 100000);
		}
	}
}