Hi,
The addAttribute method in Attributes2Impl throws a NullPointerException, as the two private boolean arrays(declared, specified) in this class are never initialised.
Logged In: YES user_id=1428164
Here's a patch for Attributes2Impl that should resolve this issue, as well as fix a bug in the addAttribute method.
<patch> Index: org/xml/sax/ext/Attributes2Impl.java =================================================================== --- org/xml/sax/ext/Attributes2Impl.java (revision 368246) +++ org/xml/sax/ext/Attributes2Impl.java (working copy) @@ -44,7 +44,11 @@ /** * Construct a new, empty Attributes2Impl object. */ - public Attributes2Impl () { } + public Attributes2Impl () { + super (); + declared = new boolean[0]; + specified = new boolean[0]; + }
@@ -229,7 +232,7 @@
int length = getLength ();
- if (length < specified.length) { + if (length != specified.length) { boolean newFlags [];
newFlags = new boolean [length];
</patch>
Log in to post a comment.
Logged In: YES
user_id=1428164
Here's a patch for Attributes2Impl that should resolve this
issue, as well as fix a bug in the addAttribute method.
<patch>
Index: org/xml/sax/ext/Attributes2Impl.java
===================================================================
--- org/xml/sax/ext/Attributes2Impl.java (revision 368246)
+++ org/xml/sax/ext/Attributes2Impl.java (working copy)
@@ -44,7 +44,11 @@
/**
* Construct a new, empty Attributes2Impl object.
*/
- public Attributes2Impl () { }
+ public Attributes2Impl () {
+ super ();
+ declared = new boolean[0];
+ specified = new boolean[0];
+ }
@@ -229,7 +232,7 @@
int length = getLength ();
- if (length < specified.length) {
+ if (length != specified.length) {
boolean newFlags [];
newFlags = new boolean [length];
</patch>