spring-projects/spring-data-gemfire — pull request #28 by jxblum (2013-09-24 20:33:19+00:00)
Title: Sgf195 fix

This version of the fix for SGF-195 preserves backwards compatibility with the SDG 1.3.x codebase by sticking with the colocated-with attribute (instead of colocated-with-ref used in the sgf195 branch/pull request) on the bean element, still referring to the name of the Region in GemFire. But now, the Region name is set as a bean alias in the Spring app ctx for the Region bean and a dependency (using depends-on) is being added on the Region that will be colocated with the Region identified by name in the colocated-with attribute.

The AliasReplacingBeanDefinitionParser class is now inappropriately named given the "alias replacing" bit has been removed. In fact, AliasReplacingBeanDefinitionParser could be removed altogether. The methods (especially getBeanClass, getRegionFactoryClass, and isSubregion) could be moved up to the AbstractRegionParser class and the ClientRegionParser could be made to extend AbstractRegionParser. The doParseInternal methods in AbstractRegionParser and ClientRegionParse then become the overridden doParse(Element, ParserContext, BeanDefintion) method from AbstractSingleBeanDefinitionParser. The "super" qualifier is not needed on the call to the AbstractSingleBeanDefinitionParser.doParse(Element, BeanDefinitionBuilder) method inside AbstractRegionParser/ClientRegionParser's doParseInternal methods, given it's signature, and can still be called from the overridden doParse(..) methods in the ClientRegionParser/AbstractRegionParser.

1 thing to note, I am not sure why the GitHub diff below is showing indent spacing as 2 spaces. My IDE is definitely set to use Tabs, with Tab size 4. From the diff below, some lines in the PartitionedRegionParser class, like 75-76 and 82-83, are just indicating that the spacing was changed, and GitHub gives the appearance that it was, but in fact all I was doing on those lines, for instance, was renaming the variable parAttrBuilder -> partitionedAttributesBuilder. Other files in the diff are showing the same thing.