Bug 171092 - Permit FileSystem.Status to work on SFS from unit tests
Permit FileSystem.Status to work on SFS from unit tests
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Filesystems
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Jesse Glick
issues@platform
: API_REVIEW_FAST
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-28 16:23 UTC by Jesse Glick
Modified: 2009-09-01 07:30 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
Proposed patch (missing apichanges) (17.68 KB, patch)
2009-08-28 18:06 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2009-08-28 16:23:39 UTC
Currently from unit tests file attributes on the SFS such as displayName are not honored. Since there is a different SFS
implementation when core.startup is loaded, need an API to share the FS.Status implementation and avoid code duplication.
Comment 1 Jesse Glick 2009-08-28 18:06:30 UTC
Created attachment 86798 [details]
Proposed patch (missing apichanges)
Comment 2 Jesse Glick 2009-08-28 18:07:46 UTC
Please review.
Comment 3 Jaroslav Tulach 2009-08-28 21:04:03 UTC
Y01 Put the implementation into non-public package. openide.filesystems and core.startup can use it and then you will 
not need to introduce the new public method at all.
Comment 4 Jesse Glick 2009-08-28 21:13:40 UTC
Y01 - that is what I considered first but core.startup has a regular dep on openide.filesystems and cannot use
non-public packages. I definitely do not wish to introduce another impl dep when we should be cleaning the ones we
already have.
Comment 5 Jaroslav Tulach 2009-08-31 10:01:36 UTC
Imho, just change FileSystem.java to

    private static final DEFAULT_STATUS = new SFSStatus();
    public Status getStatus() {
        return isDefault() ? DEFAULT_STATUS : STATUS_NONE; 
    }

and in core.startup don't override the getStatus method. That seems like the least disruptive API change. It is 
compatible inside NetBeans based application. Slightly incompatible for external use, but nobody shall really suffer 
from such change.
Comment 6 Jesse Glick 2009-08-31 14:04:35 UTC
Good idea, I think that would work.
Comment 7 Jaroslav Tulach 2009-08-31 14:25:01 UTC
I am adding the API_REVIEW_FAST back, it is still a functional API change and I would recommend to document it in 
apichanges.xml. No need to wait with integration, imho.
Comment 8 Jesse Glick 2009-08-31 14:52:15 UTC
Some minor complications are caused by the fact that, due to jtulach's ADD_FS in 4701064c3bc5 and 43328c9c8232,

  new Repository(FileUtil.createMemoryFileSystem()).getDefaultFileSystem().isDefault() == false

contrary to what one might expect, and changing isDefault to say

  return repository != null && this == repository.getDefaultFileSystem();

does not work either (because repository == null). This code is so convoluted I do not dare touch it.
Comment 9 Jesse Glick 2009-08-31 16:03:53 UTC
core-main #5cef92d30652
Comment 10 Quality Engineering 2009-09-01 06:03:04 UTC
Integrated into 'main-golden', will be available in build *200909010201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/5cef92d30652
User: Jesse Glick <jglick@netbeans.org>
Log: Issue #171092: use the same FileSystem.Status implementation for unit tests as in full platform.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo