[
https://issues.apache.org/jira/browse/CONFIGURATION-767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory updated CONFIGURATION-767:
------------------------------------------
Description:
You get a {{NullPointerException}} in {{XMLConfiguration#createTransformer()}}
when no {{FileLocator}} is set.
For example:
{code:java}
XMLConfiguration xmlConfig = new XMLConfiguration();
xmlConfig.setRootElementName("IAmRoot");
StringWriter sw = new StringWriter();
xmlConfig.write(sw);
{code}
Yields:
{noformat}
java.lang.NullPointerException
at
org.apache.commons.configuration2.XMLConfiguration.createTransformer(XMLConfiguration.java:884)
at
org.apache.commons.configuration2.XMLConfiguration.write(XMLConfiguration.java:1045)
...
{noformat}
was:
You get a {{NullPointerException}} in {{XMLConfiguration#createTransformer()}}
when no {{FileLocator}} is set.
For example:
{code:java}
XMLConfiguration xmlConfig = new XMLConfiguration();
xmlConfig.setRootElementName("IAmRoot");
xmlConfig.setProperty("Child", "Alexander");
StringWriter sw = new StringWriter();
xmlConfig.write(sw);
{code}
Yields:
{noformat}
java.lang.NullPointerException
at
org.apache.commons.configuration2.XMLConfiguration.createTransformer(XMLConfiguration.java:884)
at
org.apache.commons.configuration2.XMLConfiguration.write(XMLConfiguration.java:1045)
...
{noformat}
> NullPointerException in XMLConfiguration#createTransformer() when no
> FileLocator is set
> ---------------------------------------------------------------------------------------
>
> Key: CONFIGURATION-767
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-767
> Project: Commons Configuration
> Issue Type: Bug
> Reporter: Gary D. Gregory
> Priority: Major
>
> You get a {{NullPointerException}} in
> {{XMLConfiguration#createTransformer()}} when no {{FileLocator}} is set.
> For example:
> {code:java}
> XMLConfiguration xmlConfig = new XMLConfiguration();
> xmlConfig.setRootElementName("IAmRoot");
> StringWriter sw = new StringWriter();
> xmlConfig.write(sw);
> {code}
> Yields:
> {noformat}
> java.lang.NullPointerException
> at
> org.apache.commons.configuration2.XMLConfiguration.createTransformer(XMLConfiguration.java:884)
> at
> org.apache.commons.configuration2.XMLConfiguration.write(XMLConfiguration.java:1045)
> ...
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)