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.
When creating a new file type, it's necessary to specify a MIME type. NetBeans allow one to use, for example: text/x-myformat but not: text/x-my-format (notice the extra hyphen) It says that is "Not a valid MIME type.". However, if someone searches in the official IANA's list of MIME Media Types at http://www.iana.org/assignments/media-types/, one can see MIME types such: text/xml-external-parsed-entity at http://www.iana.org/assignments/media-types/text/, standardized by RFC3023 (http://www.rfc-editor.org/rfc/rfc3023.txt). Since one cannot create a new file type with a MIME type like the one above, this bug clearly limits NetBeans' capacity of recognizing existing file types - as well the creation of new ones with this characteristic -, hence the choice to assign to P2 priority (Critical usability problem).
Jesse, here is the test. I don't feel skilled enough to fix the regexp. diff -r 1c8906e41ba0 apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/ui/wizard/loader/FileRecognitionPanelTest.java --- a/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/ui/wizard/loader/FileRecognitionPanelTest.java Thu Mar 11 10:47:08 2010 +0100 +++ b/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/ui/wizard/loader/FileRecognitionPanelTest.java Thu Mar 11 10:54:56 2010 +0100 @@ -59,6 +59,10 @@ assertValidity(Result.VALID, "text/docbook+xml", "whatever", "", true); assertValidity(Result.VALID, "text/x-docbook+xml", "whatever", "", true); } + public void testCheckValidityBug181809() throws Exception { + assertValidity(Result.VALID, "text/x-my-format", "", "mfmt", false); + } + enum Result {VALID, INFO, ERROR} private static void assertValidity(Result expected, String mimeType, String namespace, String extension, boolean byElement) { AtomicBoolean error = new AtomicBoolean();
Trivial workaround - pick a different MIME type, then search & replace in sources afterwards.
*** This bug has been marked as a duplicate of bug 181285 ***