This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Remove (deprecate) FileSytem.getActions(). Discussed offline with Jarda.
Analysis: The method is used in called from http://hg.netbeans.org/releases/file/35b2705af4c1/openide.loaders/src/org/openide/actions/FileSystemAction.java however it is not widely used. The only related usage is "Refresh" action when scan on focus is disabled. However that one is explicitly added by openide.loaders: http://hg.netbeans.org/releases/file/35b2705af4c1/openide.loaders/src/org/openide/actions/FileSystemAction.java#l155 The method in question is implemented in masterfs where it delegates to various version control systems, but my feeling is that none of the standard ones provides any actions anymore.
Created attachment 146817 [details] Deprecations and an XXX comment showing the problematic place Turns out I was wrong. The FileSystemAction is heavily used by versioning (see the XXX comment in my diff). As our EOL rules say, we should not deprecate something that is being used. What to do now? #1 - e.g. leave the work on Sváťa and his server_split branch - e.g. move getActions into the part of filesystem that will be deprecated. #2 - change versioning to register the actions without the help of FileSystemAction.
I think we need a review. I suggest Tomáš Zezula, Sváťa Dědic, Tomáš Stupka and Jarda Havlín to be my reviewers. Can you decide during next week how to proceed?
Both possibilities are OK for me. Mostly question for VCS.
According to Tomáš Stupka versioning modules won't be needed on server side. As such #1 is viable option. However, if masterfs is needed, we need to split the module into non-UI and UI part as well.
masterfs will be needed AFAIK, since it contains the _real_ and tested implementation of local filesystem (while LocalFileSystem is only used as a writable config layer + in tests)
(In reply to Jaroslav Tulach from comment #2) > What to do now? > > #1 - e.g. leave the work on Sváťa and his server_split branch - e.g. move > getActions into the part of filesystem that will be deprecated. > > #2 - change versioning to register the actions without the help of > FileSystemAction. I think both: as we probably release some 8.x minor/micro version in the future, we may do #2 and deprecate the getActions(). According to EOL process, we will be able to remove getActions in the next major version (#1) - the branch should not be merged into a minor version anyway.
(In reply to Svata Dedic from comment #7) > (In reply to Jaroslav Tulach from comment #2) > > What to do now? > > > > #1 - e.g. leave the work on Sváťa and his server_split branch - e.g. move > > getActions into the part of filesystem that will be deprecated. > > > > #2 - change versioning to register the actions without the help of > > FileSystemAction. > > future, we may do #2 and deprecate the getActions(). Well, that is not my #2. My #2 requested complete rewrite of versioning modules. I am not sure we can do just your #2 - NetBeans EOL policy asks us to eliminate all usages before marking an element deprecated.
The decision of the review meeting is to replace the getActions(Set<FileObject> fos) method with something like public Lookup getActions(Set<FileObject> fos); and change FileSystemAction to extract actions from here in provided method. Thanks. I'll prepare new version of the patch and let you know.
Created attachment 147158 [details] Introducing FileSystem.findExtrasFor instead of getActions Please approve this API change. I'll use it in masterfs and versioning and integrate by middle of next week. Unless there are objections.
Created attachment 147232 [details] Final patch with changes in masterfs and versioning.masterfs
Unless there are objections I integrate tomorrow.
Seems good to me. Just two small comments: TZ01: FileBasedFileSystem:311 final Lookup lkp = ap.findExtrasFor(foSet); while (retVal == null && it.hasNext()) { if (lkp != null) { AnnotationProvider ap = it.next(); arr.add(lkp); retVal = ap.actions(foSet); } shouldn't be better to return Lookup.EMPTY and not check for null. TZ02: arr.toArray(new Lookup[0]) should be arr.toArray(new Lookup[arr.size()]) for better performance.
Integrated as ergonomics#d68c68d54fcd I fixed TZ02. As far TZ01 - the method is SPI and it is easier to leave more flexibility for the providers and check for null in the infrastructure. It maches the original behavior of actions. I left it as it was in the original patch.
Integrated into 'main-silver', will be available in build *201407220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/d68c68d54fcd User: Jaroslav Tulach <jtulach@netbeans.org> Log: #243265: Deprecating getActions and replacing the method with univeral bag-of-things - e.g. Lookup - in order to make filesystems independent on AWT in the future.