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.
In the code for /org/netbeans/core/filesystems/MIMEResolverImpl.java version 1.14, I found what looks like a typo in the following lines: int l = s.indexOf(';'); if (i>=0) s = s.substring(0, l-1); In that second line, the variable 'i' probably is a typo for 'l' This is code that supposedly trims optional parameters out of Strings representing MIME types
Since pkuzel's version 1.2, no less! The code is clearly wrong. The condition will always be true. If there is no ';' in s, s.substring(0,-2) will be called, which cannot be good - should throw IndexOutOfBoundsException if it ever gets here. The only explanation I have is that no one else ever tried putting <mime> inside <file>, either in real life or in unit tests. Radek or Petr please try writing a test that tries to do this, confirm that it doesn't work, fix the typo, confirm that that makes it work.
Fixed. /cvs/core/src/org/netbeans/core/filesystems/MIMEResolverImpl.java,v new revision: 1.15; previous revision: 1.14 /cvs/core/test/unit/src/org/netbeans/core/filesystems/MIMEResolverImplTest.java, new revision: 1.9; previous revision: 1.8 /cvs/core/test/unit/src/org/netbeans/core/filesystems/code-fs.xml,v new revision: 1.3; previous revision: 1.2 /cvs/core/test/unit/src/org/netbeans/core/filesystems/data-fs.xml,v new revision: 1.3; previous revision: 1.2
closing.