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.
null characters (ascii 0x0) are being inserted into xml comments when TLD files are being read in. This shows up in the source editor as little boxes at the end of each XML comment. This causes a problem when parsing TLD files (which happens during initial reading and two-way editing). The parser throws an exception complaining about illegal chars in comments, and then misses some XML tags. The result is that data is lost from the TLDs, for example tags go awol, the jsp version is set to null (I think this caused a previously intermittent problem where the version upgrade dialog came up unexpectedly). basically, the tag library editor is unusable because of this.
Investigation indicates that this bug is caused by an XML parser difference in 3.4, together with a not terribly wise use of one of the parser APIs. in TaglibDocumentHandler, which implements the LexicalHandler interface, there is a method comment(chars[], start, length) intended to handle XML comments. The current code converts the chars array to a String by using new String(chars). This assumes that the char array will be exactly the same length of the string. This assumption proved correct on previous parsers, but was a dangerous assumption to make. On the parser being used in 3.4, the chars array is usually longer than the String, probably for a more efficent implementation. The start and length parameters are used to figure out the correct string length. The solution is to create the String using new String(chars, start,length).
fixed in release34. Fix in trunk will happen as side effect to change to use the standard XML parser APIs instead of relying in xerces to get the parser.
I can reproduce this in NB3.4 RC2 by creating a new tag library as follows: 1. Create a new web module. 2. Select WEB-INF/classes 3. Create a new tag library. 4. Create a new tag. 5. Generate tag handlers. 6. Inspect the TLD - it has the same characters. I'm using Win2K, JDK1.4.0
*** Issue 28192 has been marked as a duplicate of this issue. ***
I committed the fix that handles comment strings properly, along with changes that remove the dependency on the xerces parser, but instead use the org.openide.xml.XMLUtil factory APIs to get an XMLReader.
Verified in NetBeans dev build 200302220100.
*** Issue 25173 has been marked as a duplicate of this issue. ***