Bug 577894 - Backport Bug 577341 from 4.22 to 4.6 Change-Id: I1cb454ab0ad3f59c2d21a8c9f10cc8336951b667 Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.debug/+/190084 Tested-by: Sarika Sinha <sarika.sinha@in.ibm.com> Reviewed-by: Sarika Sinha <sarika.sinha@in.ibm.com>
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java index fb50ce9..2a54c85 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
@@ -16,8 +16,6 @@ import java.io.Reader; import java.io.Writer; import java.util.ArrayList; -import java.util.Arrays; -import java.util.function.Predicate; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -73,12 +71,15 @@ StringBuffer strNewValue = new StringBuffer(FILE_STRING); if (attributeOldValue instanceof String && ((String) attributeOldValue).length() != 0) { String strOldValue = (String) attributeOldValue; - boolean exists = Arrays.asList(strOldValue.split(",")).stream().anyMatch(new Predicate<String>() { //$NON-NLS-1$ - @Override - public boolean test(String x) { - return x.trim().equals(FILE_STRING); + boolean exists = false; + String[] splittedArray = strOldValue.split(","); //$NON-NLS-1$ + for (int i = 0; i < splittedArray.length; i++) { + String item = splittedArray[i]; + if (item.trim().equals(FILE_STRING)) { + exists = true; + break; } - }); + } if (!exists) { strNewValue.append(", ").append(strOldValue); //$NON-NLS-1$ } else {