diff options
author | Sarika Sinha | 2022-01-27 19:30:07 +0000 |
---|---|---|
committer | Sarika Sinha | 2022-01-27 19:31:33 +0000 |
commit | dca8b409c07981e7656fef71dcb952db5042f700 (patch) | |
tree | d7916a0b156ed0a81c151a8c82c2ca77a2f33af0 | |
parent | 1241f922021351a7422022eef119af7c3ae99549 (diff) | |
download | eclipse.platform.debug-R4_6_maintenance.tar.gz eclipse.platform.debug-R4_6_maintenance.tar.xz eclipse.platform.debug-R4_6_maintenance.zip |
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>
-rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java | 15 |
1 files changed, 8 insertions, 7 deletions
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 fb50ce9dc..2a54c851b 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.PrintWriter; 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 @@ public final class XMLMemento { 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 { |