Minor refactoring to simplify the logic in the org.springframework.data.gemfire.config.AbstractRegionParser.isSubRegion(:Element) method. In addition, added test cases in the newly created AbstractRegionParserTest class.

This commit is contained in:
John Blum
2013-11-01 13:52:55 -07:00
parent 5267cb8e05
commit 5766fa070d
2 changed files with 93 additions and 1 deletions

View File

@@ -52,7 +52,8 @@ abstract class AbstractRegionParser extends AbstractSingleBeanDefinitionParser {
protected abstract Class<?> getRegionFactoryClass();
protected boolean isSubRegion(Element element) {
return element.getParentNode().getLocalName() == null? false: element.getParentNode().getLocalName().endsWith("region");
return (element.getParentNode().getLocalName() != null
&& element.getParentNode().getLocalName().endsWith("region"));
}
@Override