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

Bug 317541

Summary: Show blank as the last modified for a file with no last modified
Product: [Tools] Target Management Reporter: Masao Nishimoto <e03616>
Component: RSEAssignee: David McKnight <dmcknigh>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: enhancement    
Priority: P3 CC: dmcknigh, jwsnyder, mcgrawk
Version: 3.2   
Target Milestone: 3.2.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch to only return string for modified time when using formatted none

Description Masao Nishimoto CLA 2010-06-21 22:31:26 EDT
When the last modified timestamp of a local file is 0, The Properties view shows "Last modified" as "January 1, 1970 9:00:00 AM" (in case of JST).  The enhancement requirement is to show blank as the Windows Explorer does.
Comment 1 David McKnight CLA 2010-07-07 15:22:40 EDT
I've committed the fix to cvs.
Comment 2 Martin Oberhuber CLA 2010-08-19 08:49:19 EDT
Dave - I see some risk that your change can produce a ClassCastException as regression: when client requests an unformatted date, the old code returned null (which can be cast to Date). Now you return String "" (which cannot be cast to Date).

Reopening - please address.

In general, I would appreciate seeing patches attached in bugzilla for any change in the Maintenance Stream.
Comment 3 David McKnight CLA 2010-08-19 08:55:06 EDT
(In reply to comment #2)
> Dave - I see some risk that your change can produce a ClassCastException as
> regression: when client requests an unformatted date, the old code returned
> null (which can be cast to Date). Now you return String "" (which cannot be
> cast to Date).

Martin, I don't know what your problem is here.  The getPropertyValue() API returns an Object.  There is no requirement or expectation that a Date be returned.  In fact, in the formatted case, it is also a String that is returned, not a Date.
Comment 4 Martin Oberhuber CLA 2010-08-19 11:35:34 EDT
It's true that the API returns an Object.

But, in the past, when a client requested an Object for Property 
   ISystemPropertyConstants.P_FILE_LASTMODIFIED
it would always have returned a Date or null (which could be cast)

You haven't changed the binary API signature, and it's true that there is no formal API contract specifying what sort of Object is returned when. But still, you have changed the functionality. And this may cause a regression which is unnecessary.

After all, the fix you want to make is for the System view. Which requests a formatted date, which is returned as a String.

I'm just asking that you make your change in a safer way, i.e. return the "" only if a formatted Date is requested.
Comment 5 David McKnight CLA 2010-08-19 12:39:16 EDT
Created attachment 177024 [details]
patch to only return string for modified time when using formatted

Fair enough, I can change this so as long as that doesn't effect what we show the user.  Here's a patch that changes to the return the value of "" only in formatted cases.  In RSE UI cases, it should be the formatted value that gets displayed so this change should preserve the original fix.
Comment 6 Martin Oberhuber CLA 2010-08-19 12:43:10 EDT
Thanks - looks good to me. Can you commit this after testing that the original intent of the fix is indeed preserved ?
Comment 7 David McKnight CLA 2010-08-19 12:50:33 EDT
(In reply to comment #6)
> Thanks - looks good to me. Can you commit this after testing that the original
> intent of the fix is indeed preserved ?

I checked and the fix is preserved so I've committed the change.
Comment 8 David McKnight CLA 2010-08-30 11:39:14 EDT
Marking this as fixed since the update was committed.
Comment 9 Martin Oberhuber CLA 2010-11-09 08:27:50 EST
Verified that this has been released to 3.3m3 as well.