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.
Starting seeing this in my dev build as soon as I open it. No idea how to reproduce. Anyway, UCS.sV is simply doing vars.put("MIMETYPE", fo.getMIMEType()); which ought to be safe but apparently some FileObject is returning null from getMIMEType(). This is forbidden according to FileObject Javadoc. Probably a regression due to recent MIME handling changes.
I will put in a hotfix.
Also found a possibly related problem that if you open a Java source from a CVS filesystem, you get no syntax coloring. I fixed VcsFileSystem to return null for mimeType and this seems to be corrected. (AbstractFileSystem.Info.mimeType should return null unless the FS has specific knowledge about the type of the file.) Not sure exactly why this would have been recently broken but perhaps the semantics of FileUtil.getMIMEType(FileObject) was changed.
Please review patches and specifically semantics of FU.gMT(FO). committed * Up-To-Date 1.92 openide/src/org/openide/filesystems/FileUtil.java committed * Up-To-Date 1.260 vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java
Jesse, maybe the behaviour is caused by my Friday changes in FU. I tried to simulate the behaviour and reenabled one of my mimetype tests, but they all seem to pass without problem. openide/test/unit/src/org/openide/filesystems/FileObjectTestHid.java,v <-- FileObjectTestHid.java new revision: 1.33 Anyway thanks for fix and sorry for trouble.
I've got it. UCS.sV is calling getMIMEType() on folder. I thought that this is supposed to return null, but apperently it used to return something else (at least on VCS filesystems). After Jesse's fix it returns content/unknown. Any opinion on what it should return? I can write test to guarentee that (at least on filesystems we run tests on - means everything except VCS).
Well it's pretty stupid to actually call it on a folder, of course. Nonetheless the Javadoc does say that it will never return null, and that "content/unknown" is the fallback. Would be good if UCS.sV stopped calling gMT for folders.
Added test to cover that: openide/test/unit/src/org/openide/filesystems/FileObjectTestHid.java,v <-- FileObjectTestHid.java new revision: 1.34
*** Issue 43365 has been marked as a duplicate of this issue. ***