Source:
<code>public ResourcePool parseResourceConfiguration(final Element fragment) { final String elementName = fragment.getLocalName(); if ("cluster-shared".equals(elementName)) { final String sharing = fragment.getAttribute("sharing"); return new SharedClusteredResourcePoolImpl(sharing); } else if ("cluster-fixed".equals(elementName)) { final Attr fromAttr = fragment.getAttributeNode("from"); final String from = (fromAttr == null ? null : fromAttr.getValue()); final String unitValue = fragment.getAttribute("unit").toUpperCase(); final MemoryUnit sizeUnits; try { sizeUnits = MemoryUnit.valueOf(unitValue); } catch (IllegalArgumentException e) { throw new XmlConfigurationException(String.format("XML configuration element <%s> 'unit' attribute '%s' is not valid", elementName, unitValue), e); } final String sizeValue; try { sizeValue = fragment.getFirstChild().getNodeValue(); } catch (DOMException e) { throw new XmlConfigurationException(String.format("XML configuration element <%s> value is not valid", elementName), e); } final long size; try { size = Long.parseLong(sizeValue); } catch (NumberFormatException e) { throw new XmlConfigurationException(String.format("XML configuration element <%s> value '%s' is not valid", elementName, sizeValue), e); } return new FixedClusteredResourcePoolImpl(from, size, sizeUnits); } else if("clustered".equals(elementName)) <START> { <END> return new ThinClusteredResourcePoolImpl(); } throw new XmlConfigurationException(String.format("XML configuration element <%s> in <%s> is not supported", fragment.getTagName(), (fragment.getParentNode() == null ? "null" : fragment.getParentNode().getLocalName()))); }</code><technical_language>Code style</technical_language>

Target:
public ResourcePool parseResourceConfiguration(final Element fragment) { final String elementName = fragment.getLocalName(); if ("clustered-shared".equals(elementName)) { final String sharing = fragment.getAttribute("sharing"); return new SharedClusteredResourcePoolImpl(sharing); } else if ("clustered-dedicated".equals(elementName)) { final Attr fromAttr = fragment.getAttributeNode("from"); final String from = (fromAttr == null ? null : fromAttr.getValue()); final String unitValue = fragment.getAttribute("unit").toUpperCase(); final MemoryUnit sizeUnits; try { sizeUnits = MemoryUnit.valueOf(unitValue); } catch (IllegalArgumentException e) { throw new XmlConfigurationException(String.format("XML configuration element <%s> 'unit' attribute '%s' is not valid", elementName, unitValue), e); } final String sizeValue; try { sizeValue = fragment.getFirstChild().getNodeValue(); } catch (DOMException e) { throw new XmlConfigurationException(String.format("XML configuration element <%s> value is not valid", elementName), e); } final long size; try { size = Long.parseLong(sizeValue); } catch (NumberFormatException e) { throw new XmlConfigurationException(String.format("XML configuration element <%s> value '%s' is not valid", elementName, sizeValue), e); } return new DedicatedClusteredResourcePoolImpl(from, size, sizeUnits); } else if("clustered".equals(elementName)) { return new ClusteredResourcePoolImpl(); } throw new XmlConfigurationException(String.format("XML configuration element <%s> in <%s> is not supported", fragment.getTagName(), (fragment.getParentNode() == null ? "null" : fragment.getParentNode().getLocalName()))); }