| Chunk |
|---|
| Conflicting content |
|---|
DisposableBean {
public class ClientRegionFactoryBean |
| Solution content |
|---|
public class ClientRegionFactoryBean |
| File |
|---|
| ClientRegionFactoryBean.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Attribute |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
private DataPolicy dataPolicy; private Interest |
| Solution content |
|---|
private DataPolicy dataPolicy; private Interest |
| File |
|---|
| ClientRegionFactoryBean.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Chunk |
|---|
| Conflicting content |
|---|
@Override protected Region |
| Solution content |
|---|
@Override protected Region |
| File |
|---|
| ClientRegionFactoryBean.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Cast expression |
| Comment |
| If statement |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
factory.setDiskStoreName(diskStoreName); } <<<<<<< HEAD Region |
| Solution content |
|---|
factory.setDiskStoreName(diskStoreName); } Region |
| File |
|---|
| ClientRegionFactoryBean.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Attribute |
| Comment |
| If statement |
| Method invocation |
| Method signature |
| Return statement |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
} } /** <<<<<<< HEAD * Sets the CacheLoader used to load data local to the client's Region on cache misses. * * @param cacheLoader a GemFire CacheLoader used to load data into the client Region. * @see com.gemstone.gemfire.cache.CacheLoader */ public void setCacheLoader(CacheLoader |
| Solution content |
|---|
*/
public void setDataPolicy(DataPolicy dataPolicy) {
/**
* Sets the CacheLoader used to load data local to the client's Region on cache misses.
*
* @param cacheLoader a GemFire CacheLoader used to load data into the client Region.
* @see com.gemstone.gemfire.cache.CacheLoader
*/
public void setCacheLoader(CacheLoader |
| File |
|---|
| ClientRegionFactoryBean.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Comment |
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
this.diskStoreName = diskStoreName; } <<<<<<< HEAD /** * Sets the region attributes used for the region used by this factory. * Allows maximum control in specifying the region settings. Used only when * a new region is created. Note that using this method allows for advanced * customization of the region - while it provides a lot of flexibility, * note that it's quite easy to create misconfigured regions (especially in * a client/server scenario). * * @param attributes the attributes to set on a newly created region */ public void setAttributes(RegionAttributes |
| Solution content |
|---|
}
/**
* Sets the snapshots used for loading a newly created region. That
* is, the snapshot will be used only when a new region is created -
* if the region already exists, no loading will be performed.
*
* @param snapshot the snapshot to set
* @see #setName(String)
*/
public void setSnapshot(Resource snapshot) {
this.snapshot = snapshot;
}
} |
| File |
|---|
| ClientRegionFactoryBean.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Comment |
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
import org.w3c.dom.Element; /** <<<<<<< HEAD * Parser for <client-region;gt; definitions. ======= * Parser for <client-region;gt; bean definitions. >>>>>>> 0f819f2e04382756d50be6177e7f5766012ed8a3 * * To avoid eager evaluations, the region interests are declared as nested definition. * |
| Solution content |
|---|
import org.w3c.dom.Element; /** * Parser for <client-region;gt; bean definitions. * * To avoid eager evaluations, the region interests are declared as nested definition. * |
| File |
|---|
| ClientRegionParser.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Comment |
| Chunk |
|---|
| Conflicting content |
|---|
String cacheRefAttributeValue = element.getAttribute("cache-ref");
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
super.doParse(element, builder);
<<<<<<< HEAD
String cacheRefAttribute = element.getAttribute("cache-ref");
builder.addPropertyReference("cache", (StringUtils.hasText(cacheRefAttribute) ? cacheRefAttribute
: GemfireConstants.DEFAULT_GEMFIRE_CACHE_NAME));
ParsingUtils.setPropertyValue(element, builder, "close");
ParsingUtils.setPropertyValue(element, builder, "destroy");
ParsingUtils.setPropertyValue(element, builder, "data-policy", "dataPolicyName");
ParsingUtils.setPropertyValue(element, builder, "name");
ParsingUtils.setPropertyValue(element, builder, "pool-name");
ParsingUtils.setPropertyValue(element, builder, "shortcut");
parseDiskStoreAttribute(element, builder);
boolean dataPolicyFrozen = false;
// TODO why is the DataPolicy determined in the ClientRegionParser and not in the ClientRegionFactoryBean when evaluating the configuration settings?
// set the persistent policy
if (Boolean.parseBoolean(element.getAttribute("persistent"))) {
builder.addPropertyValue("dataPolicy", DataPolicy.PERSISTENT_REPLICATE);
dataPolicyFrozen = true;
}
// eviction + expiration + overflow + optional client region attributes
BeanDefinitionBuilder regionAttributesBuilder = BeanDefinitionBuilder.genericBeanDefinition(
RegionAttributesFactoryBean.class);
boolean overwriteDataPolicy = ParsingUtils.parseEviction(parserContext, element, regionAttributesBuilder);
ParsingUtils.parseOptionalRegionAttributes(parserContext, element, regionAttributesBuilder);
ParsingUtils.parseStatistics(element, regionAttributesBuilder);
// NOTE parsing 'expiration' attributes must happen after parsing the user-defined setting for 'statistics'
// in GemFire this attribute corresponds to the RegionAttributes 'statistics-enabled' setting). If the user
// configured expiration settings (any?), then statistics must be enabled, regardless if the user explicitly
// disabled them.
ParsingUtils.parseExpiration(parserContext, element, regionAttributesBuilder);
// TODO understand why this determination is not made in the FactoryBean?
if (!dataPolicyFrozen && overwriteDataPolicy) {
builder.addPropertyValue("dataPolicy", DataPolicy.NORMAL);
}
=======
validateDataPolicyShortcutMutualExclusion(element, parserContext);
builder.addPropertyReference("cache", (StringUtils.hasText(cacheRefAttributeValue) ? cacheRefAttributeValue
: GemfireConstants.DEFAULT_GEMFIRE_CACHE_NAME));
ParsingUtils.setPropertyValue(element, builder, "close");
ParsingUtils.setPropertyValue(element, builder, "destroy");
ParsingUtils.setPropertyValue(element, builder, "data-policy", "dataPolicyName");
ParsingUtils.setPropertyValue(element, builder, "name");
ParsingUtils.setPropertyValue(element, builder, "persistent");
ParsingUtils.setPropertyValue(element, builder, "pool-name");
ParsingUtils.setPropertyValue(element, builder, "shortcut");
String diskStoreRefAttributeValue = element.getAttribute("disk-store-ref");
if (StringUtils.hasText(diskStoreRefAttributeValue)) {
ParsingUtils.setPropertyValue(element, builder, "disk-store-ref", "diskStoreName");
builder.addDependsOn(diskStoreRefAttributeValue);
}
// Client RegionAttributes for overflow/eviction, expiration and statistics
BeanDefinitionBuilder regionAttributesBuilder = BeanDefinitionBuilder.genericBeanDefinition(
RegionAttributesFactoryBean.class);
ParsingUtils.parseOptionalRegionAttributes(parserContext, element, regionAttributesBuilder);
ParsingUtils.parseStatistics(element, regionAttributesBuilder);
ParsingUtils.parseEviction(parserContext, element, regionAttributesBuilder);
ParsingUtils.parseExpiration(parserContext, element, regionAttributesBuilder);
>>>>>>> 0f819f2e04382756d50be6177e7f5766012ed8a3
builder.addPropertyValue("attributes", regionAttributesBuilder.getBeanDefinition());
|
| Solution content |
|---|
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
super.doParse(element, builder);
validateDataPolicyShortcutMutualExclusion(element, parserContext);
String cacheRefAttributeValue = element.getAttribute("cache-ref");
builder.addPropertyReference("cache", (StringUtils.hasText(cacheRefAttributeValue) ? cacheRefAttributeValue
: GemfireConstants.DEFAULT_GEMFIRE_CACHE_NAME));
ParsingUtils.setPropertyValue(element, builder, "close");
ParsingUtils.setPropertyValue(element, builder, "destroy");
ParsingUtils.setPropertyValue(element, builder, "data-policy", "dataPolicyName");
ParsingUtils.setPropertyValue(element, builder, "name");
ParsingUtils.setPropertyValue(element, builder, "persistent");
ParsingUtils.setPropertyValue(element, builder, "pool-name");
ParsingUtils.setPropertyValue(element, builder, "shortcut");
parseDiskStoreAttribute(element, builder);
// Client RegionAttributes for overflow/eviction, expiration and statistics
BeanDefinitionBuilder regionAttributesBuilder = BeanDefinitionBuilder.genericBeanDefinition(
RegionAttributesFactoryBean.class);
ParsingUtils.parseOptionalRegionAttributes(parserContext, element, regionAttributesBuilder);
ParsingUtils.parseStatistics(element, regionAttributesBuilder);
ParsingUtils.parseEviction(parserContext, element, regionAttributesBuilder);
ParsingUtils.parseExpiration(parserContext, element, regionAttributesBuilder);
builder.addPropertyValue("attributes", regionAttributesBuilder.getBeanDefinition());
|
| File |
|---|
| ClientRegionParser.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
List |
| Solution content |
|---|
List |
| File |
|---|
| ClientRegionParser.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Comment |
| Chunk |
|---|
| Conflicting content |
|---|
for (Element subElement : subElements) {
String subElementLocalName = subElement.getLocalName();
<<<<<<< HEAD
if ("cache-listener".equals(subElementLocalName)) {
builder.addPropertyValue("cacheListeners", ParsingUtils.parseRefOrNestedBeanDeclaration(
parserContext, subElement, builder));
}
else if ("cache-loader".equals(subElementLocalName)) {
builder.addPropertyValue("cacheLoader", ParsingUtils.parseRefOrNestedBeanDeclaration(
parserContext, subElement, builder));
}
else if ("cache-writer".equals(subElementLocalName)) {
builder.addPropertyValue("cacheWriter", ParsingUtils.parseRefOrNestedBeanDeclaration(
parserContext, subElement, builder));
}
else if ("key-interest".equals(subElementLocalName)) {
interests.add(parseKeyInterest(parserContext, subElement));
}
else if ("regex-interest".equals(subElementLocalName)) {
interests.add(parseRegexInterest(parserContext, subElement));
}
}
// TODO is adding an 'interests' property really based on whether there are "sub-elements", or should it be based on whether there are "interests" (as in 'key-interest' and 'regex-interest')?
if (!subElements.isEmpty()) {
=======
if ("cache-listener".equals(name)) {
builder.addPropertyValue("cacheListeners", ParsingUtils.parseRefOrNestedBeanDeclaration(
parserContext, subElement, builder));
}
else if ("key-interest".equals(name)) {
interests.add(parseKeyInterest(subElement, parserContext));
}
else if ("regex-interest".equals(name)) {
interests.add(parseRegexInterest(subElement));
}
}
if (!interests.isEmpty()) {
>>>>>>> 0f819f2e04382756d50be6177e7f5766012ed8a3
builder.addPropertyValue("interests", interests);
}
} |
| Solution content |
|---|
for (Element subElement : subElements) {
String subElementLocalName = subElement.getLocalName();
if ("cache-listener".equals(subElementLocalName)) {
builder.addPropertyValue("cacheListeners", ParsingUtils.parseRefOrNestedBeanDeclaration(
parserContext, subElement, builder));
}
else if ("cache-loader".equals(subElementLocalName)) {
builder.addPropertyValue("cacheLoader", ParsingUtils.parseRefOrNestedBeanDeclaration(
parserContext, subElement, builder));
}
else if ("cache-writer".equals(subElementLocalName)) {
builder.addPropertyValue("cacheWriter", ParsingUtils.parseRefOrNestedBeanDeclaration(
parserContext, subElement, builder));
}
else if ("key-interest".equals(subElementLocalName)) {
interests.add(parseKeyInterest(subElement, parserContext));
}
else if ("regex-interest".equals(subElementLocalName)) {
interests.add(parseRegexInterest(subElement));
}
}
if (!interests.isEmpty()) {
builder.addPropertyValue("interests", interests);
}
} |
| File |
|---|
| ClientRegionParser.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Chunk |
|---|
| Conflicting content |
|---|
}
}
<<<<<<< HEAD
private void parseDiskStoreAttribute(Element element, BeanDefinitionBuilder builder) {
String diskStoreRefAttribute = element.getAttribute("disk-store-ref");
if (StringUtils.hasText(diskStoreRefAttribute)) {
builder.addPropertyValue("diskStoreName", diskStoreRefAttribute);
builder.addDependsOn(diskStoreRefAttribute);
=======
private void validateDataPolicyShortcutMutualExclusion(final Element element, final ParserContext parserContext) {
if (element.hasAttribute("data-policy") && element.hasAttribute("shortcut")) {
parserContext.getReaderContext().error(String.format(
"Only one of [data-policy, shortcut] may be specified with element '%1$s'.", element.getTagName()),
element);
>>>>>>> 0f819f2e04382756d50be6177e7f5766012ed8a3
}
}
|
| Solution content |
|---|
}
}
private void parseDiskStoreAttribute(final Element element, final BeanDefinitionBuilder builder) {
String diskStoreRefAttribute = element.getAttribute("disk-store-ref");
if (StringUtils.hasText(diskStoreRefAttribute)) {
builder.addPropertyValue("diskStoreName", diskStoreRefAttribute);
builder.addDependsOn(diskStoreRefAttribute);
}
}
private void validateDataPolicyShortcutMutualExclusion(final Element element, final ParserContext parserContext) {
if (element.hasAttribute("data-policy") && element.hasAttribute("shortcut")) {
parserContext.getReaderContext().error(String.format(
"Only one of [data-policy, shortcut] may be specified with element '%1$s'.", element.getTagName()),
element);
}
}
|
| File |
|---|
| ClientRegionParser.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| If statement |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
protected void doParseRegion(Element element, ParserContext parserContext, BeanDefinitionBuilder builder,
boolean subRegion) {
throw new UnsupportedOperationException(String.format(
<<<<<<< HEAD
"doParseRegion(:Element, :ParserContext, :BeanDefinitionBuilder, subRegion:boolean) is not supported on %1$s",
getClass().getName()));
}
private Object parseKeyInterest(ParserContext parserContext, Element subElement) {
BeanDefinitionBuilder keyInterestBuilder = BeanDefinitionBuilder.genericBeanDefinition(Interest.class);
parseCommonInterestAttributes(subElement, keyInterestBuilder);
Object key = ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, subElement, keyInterestBuilder,
"key-ref");
keyInterestBuilder.addConstructorArgValue(key);
=======
"doParseRegion(:Element, :ParserContext, :BeanDefinitionBuilder, :boolean) is not supported on %1$s",
getClass().getName()));
}
private Object parseKeyInterest(Element keyInterestElement, ParserContext parserContext) {
BeanDefinitionBuilder keyInterestBuilder = BeanDefinitionBuilder.genericBeanDefinition(Interest.class);
parseCommonInterestAttributes(keyInterestElement, keyInterestBuilder);
keyInterestBuilder.addConstructorArgValue(ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext,
keyInterestElement, keyInterestBuilder, "key-ref"));
>>>>>>> 0f819f2e04382756d50be6177e7f5766012ed8a3
return keyInterestBuilder.getBeanDefinition();
} |
| Solution content |
|---|
protected void doParseRegion(Element element, ParserContext parserContext, BeanDefinitionBuilder builder,
boolean subRegion) {
throw new UnsupportedOperationException(String.format(
"doParseRegion(:Element, :ParserContext, :BeanDefinitionBuilder, :boolean) is not supported on %1$s",
getClass().getName()));
}
private Object parseKeyInterest(Element keyInterestElement, ParserContext parserContext) {
BeanDefinitionBuilder keyInterestBuilder = BeanDefinitionBuilder.genericBeanDefinition(Interest.class);
parseCommonInterestAttributes(keyInterestElement, keyInterestBuilder);
keyInterestBuilder.addConstructorArgValue(ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext,
keyInterestElement, keyInterestBuilder, "key-ref"));
return keyInterestBuilder.getBeanDefinition();
} |
| File |
|---|
| ClientRegionParser.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Method signature |
| Throw statement |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
private Object parseRegexInterest(Element regexInterestElement) {
BeanDefinitionBuilder regexInterestBuilder = BeanDefinitionBuilder.genericBeanDefinition(RegexInterest.class);
<<<<<<< HEAD
parseCommonInterestAttributes(subElement, regexInterestBuilder);
ParsingUtils.setPropertyValue(subElement, regexInterestBuilder, "pattern", "key");
=======
parseCommonInterestAttributes(regexInterestElement, regexInterestBuilder);
ParsingUtils.setPropertyValue(regexInterestElement, regexInterestBuilder, "pattern", "key");
>>>>>>> 0f819f2e04382756d50be6177e7f5766012ed8a3
return regexInterestBuilder.getBeanDefinition();
} |
| Solution content |
|---|
private Object parseRegexInterest(Element regexInterestElement) {
BeanDefinitionBuilder regexInterestBuilder = BeanDefinitionBuilder.genericBeanDefinition(RegexInterest.class);
parseCommonInterestAttributes(regexInterestElement, regexInterestBuilder);
ParsingUtils.setPropertyValue(regexInterestElement, regexInterestBuilder, "pattern", "key");
return regexInterestBuilder.getBeanDefinition();
} |
| File |
|---|
| ClientRegionParser.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
* @author John Blum
*/
abstract class ParsingUtils {
<<<<<<< HEAD
private static Log log = LogFactory.getLog(ParsingUtils.class);
static final String GEMFIRE_VERSION = CacheFactory.getVersion();
=======
private static final Log log = LogFactory.getLog(ParsingUtils.class);
>>>>>>> 0f819f2e04382756d50be6177e7f5766012ed8a3
static void setPropertyValue(Element element, BeanDefinitionBuilder builder, String attributeName,
String propertyName, Object defaultValue) { |
| Solution content |
|---|
* @author John Blum
*/
abstract class ParsingUtils {
private static final Log log = LogFactory.getLog(ParsingUtils.class);
static void setPropertyValue(Element element, BeanDefinitionBuilder builder, String attributeName,
String propertyName, Object defaultValue) { |
| File |
|---|
| ParsingUtils.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
*/ package org.springframework.data.gemfire.client; <<<<<<< HEAD import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; ======= import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; >>>>>>> 0f819f2e04382756d50be6177e7f5766012ed8a3 import org.junit.After; import org.junit.Before; |
| Solution content |
|---|
*/ package org.springframework.data.gemfire.client; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import org.junit.After; import org.junit.Before; |
| File |
|---|
| ClientRegionFactoryBeanTest.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
}
@Test
<<<<<<< HEAD
}
public void testLookupFallbackFailingToUseProvidedShortcut() throws Exception {
ClientRegionFactoryBean |
| Solution content |
|---|
}
@Test
public void testCloseDestroySettings() {
final ClientRegionFactoryBean |
| File |
|---|
| ClientRegionFactoryBeanTest.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Annotation |
| Comment |
| Method declaration |
| Method invocation |
| Method signature |
| Variable |