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.
Created attachment 128767 [details] test I have a problem implementing the logging of external hg commands (filed as bug #222841). Mercurial does not receive events about .hg/wlock file on Unix/Linux (possibly on Win too, i haven't checked). The file is created by certain hg commands and is a *broken symlink* pointing to non-existent file. IDE filesystem correctly recognizes such a java.io.File was created but does not propagate the event to ProvidedExtensions... IMHO the problem is java.io.File.exists returns false for such a file and FileObjectFactory.issueIfExists -> touchExists uses the return value of this method. Please see the attached test (to be applied on masterfs)
currently a blocker of #222841 but if you tell me it cannot be fixed i will try to workaround it.
There seems to be a workaround that you can use: http://hg.netbeans.org/ergonomics/rev/ee37515e3a9a On JDK7 I could: use Files.isSymbolicLink, but I am not sure how to make the code work also on JDK6.
sorry jardo, my fault, i gave this a wrong description. My point was different: my problem is that ProvidedExtensions does not receive events about such files - because FileObject cannot be created for these files in FileObjectFactory.java. I'll try harder and write a different more descriptive test.
Created attachment 128902 [details] tests still failing
i modified the tests to demonstrate my point please see the attachment: 1) FileObjTest - true, first time it passes but once you delete the broken link, refresh and create it again, it does not seem to return FileObject for it again 2) ProvidedExtensionsTest.testCreatedDeleteBrokenLinkExternally - fist sequence of create/delete delivers the events fine, but the following sequence of create/delete of the same broken link fails
FileObject can be created, if you ask parent for getChildren(). Take a look at my test.
Integrated into 'main-golden', will be available in build *201212120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/ee37515e3a9a User: Jaroslav Tulach <jtulach@netbeans.org> Log: #223167: Demonstrating that getParent().getChildren() works and makes the broken symlink available
ergonomics#5b551493d8cc
Integrated into 'main-golden', will be available in build *201212170919* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/5b551493d8cc User: Jaroslav Tulach <jtulach@netbeans.org> Log: #223167: Test: FileUtil.toFileObject() returns null for broken symlinks #223167: Indicating the issueIfExists that the file has been noticed during listFiles() and thus it exists whatever its exist() state says