|
Re: question(bug) about setNodeValue: msg#00119java.enhydra.xmlc
At 02:25 PM 9/18/2003 +0800, you wrote: hi, [snip] The reason why the null pointer is happening is that the writeText() method doesn't do a null check on the text string being passed in..... protected final void writeText(String text) throws IOException { int len = text.length(); char ch; // FIXME: here we make a nasty assumption about all characters // less than fMaxCharacterValue && MAX_ENTITY_QUICK_CHECK_CHAR // are valid. This is probably ok. The fMaxCharacterValue check // is needed for 7-bit encodings. for (int idx = 0; idx < len; idx++) { ch = text.charAt(idx); if ((ch <= fMaxCharacterValue) && (ch <= MAX_ENTITY_QUICK_CHECK_CHAR) && (!fEntityQuickCheck[ch])) { fOut.write(ch); // Fast path. } else { writeCharacter(ch); } } } My codes like this: Hmm...... So, does this mean that the initial value shouldn't have been modified? In the DOM, what is the initial value of a Text node? Can it be null or would that, by definition, mean that there wouldn't be a text node in the first place? It it couldn't be null as an initial value and passing null to setNodeValue() is supposed to leave the initial value alone rather than set it to null, then how could a Text node value of null be passed to BaseDOMFormatter#writeText()? We could certainly do the null check in the writeText() method, but should we have to do that? Would that even be the correct thing to do? Seems like the bug here might lay somewhere in the Xerces1 DOM implemementation. Thoughts anyone? So, what happened with setNodeValue? Your guess is as good as mine. I'll look into it a bit and hopefully others will to. Jake Thanks!
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [Ann] Jivan 1.0 RC 1, Arno Schatz |
|---|---|
| Next by Date: | Re: question(bug) about setNodeValue, Jacob Kjome |
| Previous by Thread: | question(bug) about setNodeValue, linuxman |
| Next by Thread: | Re: question(bug) about setNodeValue, Jacob Kjome |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |