You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "Andreas Veithen (Jira)" <ji...@apache.org> on 2023/06/18 22:06:00 UTC

[jira] [Created] (AXIOM-519) NullPointerException after using setOptimize(true) on a plain OMText node

Andreas Veithen created AXIOM-519:
-------------------------------------

             Summary: NullPointerException after using setOptimize(true) on a plain OMText node
                 Key: AXIOM-519
                 URL: https://issues.apache.org/jira/browse/AXIOM-519
             Project: Axiom
          Issue Type: Bug
          Components: LLOM
    Affects Versions: 1.3.0
            Reporter: Andreas Veithen
            Assignee: Andreas Veithen
             Fix For: 2.0.0


The following code works in 1.2.22, but throws a {{NullPointerException}} in 1.3.0 and later versions:

{code:java}
OMFactory factory = OMAbstractFactory.getOMFactory();
OMElement element = factory.createOMElement("root", null);
OMText text = factory.createOMText(element,
        Base64.getEncoder().encodeToString("foobar".getBytes(StandardCharsets.UTF_8)));
text.setOptimize(true);
OMOutputFormat format = new OMOutputFormat();
format.setDoOptimize(true);
element.serialize(System.out, format);
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org