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 164290

Summary: "Externally deleted file" from FileUtil.isArchiveFile(URL)
Product: platform Reporter: Jesse Glick <jglick>
Component: FilesystemsAssignee: Jiri Skrivanek <jskrivanek>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Jesse Glick 2009-05-01 22:11:45 UTC
While doing a clean build on a Maven project I got:

java.lang.IllegalStateException: WARNING(please REPORT):  Externally deleted file:
/space/src/hudson/tool-autoinstallation/core/target/classes  (For additional information see:
http://wiki.netbeans.org/wiki/view/FileSystems)
[catch] at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory.printWarning(FileObjectFactory.java:243)
        at
org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory.checkCacheState(FileObjectFactory.java:226)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory.issueIfExist(FileObjectFactory.java:275)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory.getFileObject(FileObjectFactory.java:193)
        at
org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory.getValidFileObject(FileObjectFactory.java:630)
        at org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem.getFileObject(FileBasedFileSystem.java:134)
        at org.netbeans.modules.masterfs.filebasedfs.FileBasedURLMapper.getFileObjects(FileBasedURLMapper.java:128)
        at org.netbeans.modules.masterfs.MasterURLMapper.getFileObjects(MasterURLMapper.java:62)
        at org.openide.filesystems.URLMapper.findFileObject(URLMapper.java:213)
        at org.openide.filesystems.FileUtil.isArchiveFile(FileUtil.java:1864)
        at org.netbeans.modules.java.source.usages.BuildArtifactMapperImpl.getTarget(BuildArtifactMapperImpl.java:191)
        at
org.netbeans.modules.java.source.usages.BuildArtifactMapperImpl.classCacheUpdated(BuildArtifactMapperImpl.java:289)
[...]

I don't think there's anything wrong BuildArtifactMapperImpl calling this method; the problem seems to be in FileUtil
itself.
Comment 1 Jiri Skrivanek 2009-05-04 11:34:20 UTC
It is harmless in this case. It can happen when you edit a class while doing a clean build and target/classes is deleted
at the moment. Since it is only INFO message it should be there for cases where it really means that refresh should be
called after external modification of files.
Comment 2 Jesse Glick 2009-05-04 17:12:17 UTC
If it is harmless then a stack trace that asks to be reported should not be printed. I think
URLMapper.findFileObject(URL) should be guaranteed never to produce this warning, since there is nothing that the caller
of the method could be doing better. It would be better to suppress the warning altogether (or log at FINE for use by
someone specifically looking for these) than to produce bogus warnings in a quite routine situation.
Comment 3 Jiri Skrivanek 2009-05-14 13:00:39 UTC
*** Issue 165057 has been marked as a duplicate of this issue. ***
Comment 4 Jiri Skrivanek 2009-05-14 13:10:04 UTC
*** Issue 164847 has been marked as a duplicate of this issue. ***
Comment 5 Jiri Skrivanek 2009-05-14 16:01:18 UTC
Warning logged with FINE level.
core-main #71a5f9504595