Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 546168 - FileInfoAttributesMatcher.supportCreatedKey() is not implemented correctly
Summary: FileInfoAttributesMatcher.supportCreatedKey() is not implemented correctly
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.9   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.12 M1   Edit
Assignee: Andrey Loskutov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-06 04:37 EDT by Dani Megert CLA
Modified: 2019-04-08 10:33 EDT (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 Dani Megert CLA 2019-04-06 04:37:07 EDT
4.11 and before.

FileInfoAttributesMatcher.supportCreatedKey() is not implemented correctly

It no longer works since Java uses plain numbers as version, e.g. 9.

As a result, creation data and creation time attributes don't show up when using Java 9 or newer.
Comment 1 Andrey Loskutov CLA 2019-04-06 05:47:13 EDT
(In reply to Dani Megert from comment #0)
> 4.11 and before.
> 
> FileInfoAttributesMatcher.supportCreatedKey() is not implemented correctly
> 
> It no longer works since Java uses plain numbers as version, e.g. 9.

And it is also not needed, since we have target platform >= 1.8, and the code was to check >= 1.7.

The fix is trivial and we only need remove not used code.
Comment 2 Dani Megert CLA 2019-04-06 06:01:30 EDT
(In reply to Andrey Loskutov from comment #1)
> (In reply to Dani Megert from comment #0)
> > 4.11 and before.
> > 
> > FileInfoAttributesMatcher.supportCreatedKey() is not implemented correctly
> > 
> > It no longer works since Java uses plain numbers as version, e.g. 9.
> 
> And it is also not needed, since we have target platform >= 1.8, and the
> code was to check >= 1.7.
> 
> The fix is trivial and we only need remove not used code.
Correct :-).
Comment 3 Andrey Loskutov CLA 2019-04-06 06:16:12 EDT
(In reply to Dani Megert from comment #2)
> > 
> > The fix is trivial and we only need remove not used code.
> Correct :-).

Dani, do you have an idea, why this code only supports Windows and Mac for the file creation attribute? I would allow this now for all platforms, I guess this was not supported earlier on Linux.
Comment 4 Eclipse Genie CLA 2019-04-06 06:29:12 EDT
New Gerrit change created: https://git.eclipse.org/r/140145
Comment 5 Andrey Loskutov CLA 2019-04-06 06:30:45 EDT
(In reply to Eclipse Genie from comment #4)
> New Gerrit change created: https://git.eclipse.org/r/140145

This only removed version check. Next one will remove platform check, I will test it on Monday on Linux.
Comment 6 Eclipse Genie CLA 2019-04-06 06:42:25 EDT
New Gerrit change created: https://git.eclipse.org/r/140146
Comment 8 Dani Megert CLA 2019-04-06 09:48:51 EDT
(In reply to Andrey Loskutov from comment #3)
> (In reply to Dani Megert from comment #2)
> > > 
> > > The fix is trivial and we only need remove not used code.
> > Correct :-).
> 
> Dani, do you have an idea, why this code only supports Windows and Mac for
> the file creation attribute? I would allow this now for all platforms, I
> guess this was not supported earlier on Linux.
Correct. The code is 9 years old.
Comment 9 Andrey Loskutov CLA 2019-04-08 10:31:14 EDT
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created: https://git.eclipse.org/r/140146

While debugging this on RHEL 7.4 I see that sun.nio.fs.UnixNativeDispatcher.birthtimeSupported() returns false and the code in sun.nio.fs.UnixFileAttributes.creationTime() does return lastModifiedTime();

That is on both Java 8 and Java 11. So I guess it makes no sense to push patch https://git.eclipse.org/r/140146 to master yet.

See also https://unix.stackexchange.com/questions/20460/how-do-i-do-a-ls-and-then-sort-the-results-by-date-created.
Comment 10 Andrey Loskutov CLA 2019-04-08 10:33:59 EDT
Verified in I20190407-1800.