Skip to content

Commit

Permalink
XmlOptionsFactoryBean initializes empty XmlOptions by default and use…
Browse files Browse the repository at this point in the history
…s efficient entrySet iteration

Issue: SPR-12383
  • Loading branch information
jhoeller committed Oct 28, 2014
1 parent cb09513 commit ad2d595
Showing 1 changed file with 5 additions and 4 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,14 +30,15 @@
* in the {@link XmlBeansMarshaller}.
*
* @author Arjen Poutsma
* @author Juergen Hoeller
* @since 3.0
* @see XmlOptions
* @see #setOptions(java.util.Map)
* @see XmlBeansMarshaller#setXmlOptions(XmlOptions)
*/
public class XmlOptionsFactoryBean implements FactoryBean<XmlOptions> {

private XmlOptions xmlOptions;
private XmlOptions xmlOptions = new XmlOptions();


/**
Expand All @@ -51,8 +52,8 @@ public class XmlOptionsFactoryBean implements FactoryBean<XmlOptions> {
public void setOptions(Map<String, ?> optionsMap) {
this.xmlOptions = new XmlOptions();
if (optionsMap != null) {
for (String option : optionsMap.keySet()) {
this.xmlOptions.put(option, optionsMap.get(option));
for (Map.Entry<String, ?> option : optionsMap.entrySet()) {
this.xmlOptions.put(option.getKey(), option.getValue());
}
}
}
Expand Down

0 comments on commit ad2d595

Please sign in to comment.