Hi Thomas

I've fixed this one and its now in CVS and the daily build. It was due to
the getDocumentFactory() being called in the constructor of DefaultElement
before its QName had been initialised.

It should be fine now.

James

----- Original Message -----
From: "Thomas Nichols" <[EMAIL PROTECTED]>
To: "dom4j-dev" <[EMAIL PROTECTED]>
Sent: Tuesday, June 19, 2001 9:00 PM
Subject: [dom4j-dev] Is use of "new DefaultElement()" expected to bomb?


>
> Good day,
> The following noddy code throws a NullPointerException:
> ====
> package test;
>
> import org.dom4j.*;
> import org.dom4j.tree.*;
>
> public class Test3 {
>      public static void main (String[] args) {
>          Element testEl = new DefaultElement ("hello");
>      }
> }
>
> ====
>
> The exception trace:
> ====
> Exception in thread "main" java.lang.NullPointerException
> at
org.dom4j.tree.AbstractElement.getDocumentFactory(AbstractElement.java:989)
> at org.dom4j.tree.DefaultElement.<init>(DefaultElement.java:69)
> at test.Test3.main(Test3.java:8)
> ====
>
> In AbstractElement.java:989 a call to getQName() appears to return null.
>
> This is not the usage pattern specified in the docs - but should it be
> forbidden?
>
> Regards,
> Thomas.
>
>
> _______________________________________________
> dom4j-dev mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dom4j-dev
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to