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.

Bug 244319

Summary: replace VCSProxy with nio.Path
Product: versioncontrol Reporter: Ondrej Vrabec <ovrabec>
Component: CodeAssignee: Ondrej Vrabec <ovrabec>
Status: NEW ---    
Severity: normal CC: alexvsimon, jtulach, terje7601, tstupka, vkvashin, vv159170
Priority: P2    
Version: 8.0   
Hardware: PC   
OS: Linux   
Issue Type: TASK Exception Reporter:
Bug Depends on: 198982    
Bug Blocks:    

Description Ondrej Vrabec 2014-05-06 06:58:13 UTC
In order for the VCS core to potentially go into TW, VCSProxy should be replaced with java.nio.Path now that we're on JDK7.
VCSProxy is slow in some situations because it requires conversions from FileObjecs -> Files which touches disk and slows down the process. It is a standardized interface so everything can be hidden behind it. In future NB FileObjects might have a native conversions directly to Paths (similar to the current converts to Files) so the VCSProxy will be obsolete.
Comment 1 Ondrej Vrabec 2014-05-06 06:59:19 UTC
i will play with it and hopefully later provide a patch to review
Comment 2 Ondrej Vrabec 2014-05-06 15:02:59 UTC
I didn't get too far. I am stuck on converting a FileObject to java.nio.Path. There is no method that converts it directly so the only way is probably Paths.get(FO.getPath()) which probably works only for FOs based on java.io.File. The method delegates to FileSystems.getDefault().getPath(first, more) which most likely ends with an Exception because it probably accepts only standard paths (/home/...) and would not work for jar filesystems, layer FS etc. and i doubt it knows how to convert a remote FO.
I guess there needs to be a FO.toPath method or FileUtil.toPath(FO).
Comment 3 Jaroslav Tulach 2014-05-06 19:10:56 UTC
Please get in touch with Jarda HavlĂ­n, he could introduce FileObject.toPath while working on issue 198982.