You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xml-commons-dev@xerces.apache.org by bu...@apache.org on 2006/01/19 06:06:40 UTC
DO NOT REPLY [Bug 38316] New: - [sax][patch] Fix for Attributes2Impl issues
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38316>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38316
Summary: [sax][patch] Fix for Attributes2Impl issues
Product: XmlCommons
Version: 1.x
Platform: Other
OS/Version: other
Status: NEW
Severity: normal
Priority: P2
Component: SAX
AssignedTo: commons-dev@xml.apache.org
ReportedBy: nbeyer@kc.rr.com
CC: mrglavas@ca.ibm.com
Attached is a fix for a couple issues in the Attributes2Impl class. This should
resolve the following issues [1][2].
[1]
https://sourceforge.net/tracker/index.php?func=detail&aid=1207064&group_id=29449&atid=396219
[2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6205431
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
DO NOT REPLY [Bug 38316] - [sax][patch] Fix for Attributes2Impl issues
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38316>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38316
nbeyer@kc.rr.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #17446|0 |1
is obsolete| |
------- Additional Comments From nbeyer@kc.rr.com 2006-01-31 03:47 -------
Created an attachment (id=17543)
--> (http://issues.apache.org/bugzilla/attachment.cgi?id=17543&action=view)
Attributes2Impl.java Patch
I completely rewrote the implementation of this class. I tried to model it
after the implementations of the AttributesImpl class.
Let me know what you think.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
DO NOT REPLY [Bug 38316] - [sax][patch] Fix for Attributes2Impl issues
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38316>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38316
------- Additional Comments From mrglavas@ca.ibm.com 2006-01-23 06:27 -------
Hi Nathan,
With your patch there still appear to be conditions where an
ArrayIndexOutOfBoundsException could be thrown. Consider the case where the
object has been cleared (which sets the length to zero). The call to
System.arraycopy() assumes that the length of the new array is longer than the
old one, but if length < declared.length that isn't true so you would get an
exception.
Aside from the exceptions thrown, the current code also has a performance
issue. With the new size of the array always set to the length of the attribute
list, there will be a new array allocated and an array copy just about every
time an attributed is added. AttributesImpl doubles the size of its String
array when it runs out of space in the current one. The same should probably be
done with the boolean arrays in Attributes2Impl.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
DO NOT REPLY [Bug 38316] - [sax][patch] Fix for Attributes2Impl issues
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38316>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38316
------- Additional Comments From mrglavas@ca.ibm.com 2006-02-25 08:23 -------
Looks pretty good. A couple things jumped out at me while reviewing it. The use
of java.util.Arrays creates a dependency on JDK 1.2. I'm pretty sure the SAX
API otherwise compiles on JDK 1.1.8. The Arrays class is being used to set all
of the values in the data array to false when the Attributes object is cleared.
I don't see the benefit of that. It appears that when the data array is
created, its initial size will always be 100 which seems a bit too large.
A discussion [1] has just started on the SAX development list which has sparked
the possibility of a new maintenance release of SAX (I guess it would be SAX
2.0.3). On the thread, I mentioned the bugs in Attributes2Impl and cited this
report (in addition to the other two [2][3]). I would like to see the ASF copy
of SAX stay in synch with the official distribution. Perhaps your patch will
get merged into it. I'm going to hold off making changes here until there's a
resolution in the SAX community.
[1] http://sourceforge.net/mailarchive/forum.php?thread_id=9795444&forum_id=1472
[2] https://sourceforge.net/tracker/index.php?
func=detail&aid=1207064&group_id=29449&atid=396219
[3] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6205431
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
DO NOT REPLY [Bug 38316] - [sax][patch] Fix for Attributes2Impl issues
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38316>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38316
mrglavas@ca.ibm.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |commons-dev@xml.apache.org
AssignedTo|commons-dev@xml.apache.org |nbeyer@kc.rr.com
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are on the CC list for the bug, or are watching someone who is.
DO NOT REPLY [Bug 38316] - [sax][patch] Fix for Attributes2Impl issues
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38316>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38316
------- Additional Comments From nbeyer@kc.rr.com 2006-01-19 06:08 -------
Created an attachment (id=17446)
--> (http://issues.apache.org/bugzilla/attachment.cgi?id=17446&action=view)
Attributes2Impl patch
A patch to resolve NPE and IndexOutOfBoundsExceptions.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.