Skip to content

Commit

Permalink
Bug 37228588 - [37193699->14.1.2.0.1] Unable to change backing map fo…
Browse files Browse the repository at this point in the history
…r an existing caching scheme using cache config override

- rolled back cl 113171 - requires changes to the test

[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v14.1.2.0/": change = 113174]
  • Loading branch information
fryp committed Jan 4, 2025
1 parent d012498 commit f84e5fe
Showing 1 changed file with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.ArrayList;
import java.util.List;

import com.oracle.coherence.common.base.Logger;
import com.tangosol.config.xml.OverrideProcessor;
import com.tangosol.run.xml.XmlElement;
import com.tangosol.run.xml.XmlHelper;
Expand Down Expand Up @@ -75,9 +76,9 @@ else if ("interceptors".equals(xmlElement.getName()))
private void processSchemeMappings(XmlElement xmlBase,
XmlElement xmlOverrideSchemeMappings, String sMappingSubElementName)
{
List<XmlElement> listElements = new ArrayList<>();
XmlElement xmlCurrentElement = xmlBase.getElement(xmlOverrideSchemeMappings.getName());
List<XmlElement> listElements = new ArrayList<>();

XmlElement xmlCurrentElement = xmlBase.getElement(xmlOverrideSchemeMappings.getName());
if (xmlCurrentElement == null)
{
listElements.add(xmlOverrideSchemeMappings);
Expand Down Expand Up @@ -199,8 +200,7 @@ else if (!listElements.contains(xmlElementOverride))
*/
private void processCachingSchemes(XmlElement xmlBase, XmlElement xmlOverrideCachingSchemes)
{
List<XmlElement> listElements = new ArrayList<XmlElement>();
XmlElement xmlCurrentElement = xmlBase.getElement(xmlOverrideCachingSchemes.getName());
List<XmlElement> listElements = new ArrayList<XmlElement>();

for (Object subElements : xmlOverrideCachingSchemes.getElementList())
{
Expand Down Expand Up @@ -229,20 +229,30 @@ private void processCachingSchemes(XmlElement xmlBase, XmlElement xmlOverrideCac

if (sSchemeName.equals(sOverrideSchemeName))
{
if (!xmlElementName.equals(sSubElementName))
XmlElement xmlElementRemove = null;

for (XmlElement xmlEl : listElements)
{
xmlElementBase.setName(sSubElementName);
XmlElement xmlElSchemeName = xmlEl.getElement("scheme-name");
if (xmlElSchemeName != null
&& sOverrideSchemeName.equals(xmlElSchemeName.getValue().toString()))
{
xmlElementRemove = xmlEl;
break;
}
}

xmlElementBase.getElementList().clear();
xmlElementBase.getElementList().addAll(xmlOverride.getElementList());
if (xmlElementRemove != null)
{
listElements.remove(xmlElementRemove);
}

if (listElements.contains(xmlOverride))
if (!xmlElementName.equals(sSubElementName))
{
listElements.remove(xmlOverride);
xmlElementBase.setName(sSubElementName);
}

break;
XmlHelper.overrideElement(xmlElementBase, xmlOverride);
}
else if (!listElements.contains(xmlOverride))
{
Expand All @@ -267,7 +277,7 @@ else if (!listElements.contains(xmlOverride))

if (!listElements.isEmpty())
{
XmlHelper.addElements(xmlCurrentElement, listElements.iterator());
XmlHelper.addElements(xmlBase.getElement(xmlOverrideCachingSchemes.getName()), listElements.iterator());
listElements.clear();
}
}
Expand Down

0 comments on commit f84e5fe

Please sign in to comment.