diff options
author | Alexander Kurtakov | 2020-08-13 07:39:46 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2020-08-13 07:39:46 +0000 |
commit | 9834b0e8ea73543e7235c923301ee653e0e64f5d (patch) | |
tree | 242e4dd3c77968e3aa06eb6de4ace78d3e8d0a3d | |
parent | 863cf23d5d9a289f424776e12247331a273813d9 (diff) | |
download | rt.equinox.p2-I20200825-1800.tar.gz rt.equinox.p2-I20200825-1800.tar.xz rt.equinox.p2-I20200825-1800.zip |
Bug 477007 - Do not use white space in XMLY20200825-1200Y20200824-1310Y20200823-1200Y20200822-1200Y20200821-1200Y20200820-1200Y20200819-1200Y20200818-1200Y20200817-1210Y20200817-0450Y20200816-1200Y20200815-1200Y20200814-1200Y20200814-0650Y20200814-0630Y20200813-1200S4_17_0_RC1S4_17_0_M3I20200828-0150I20200826-1800I20200826-0600I20200825-1800I20200825-0600I20200824-1900I20200824-0600I20200823-1800I20200823-0600I20200822-1800I20200822-0600I20200821-1800I20200821-0440I20200820-0230I20200819-1800I20200819-0600I20200818-1800I20200818-0900I20200818-0600I20200818-0340I20200817-1800I20200817-0920I20200817-0600I20200817-0450I20200816-1800I20200816-0600I20200815-1800I20200815-0600I20200814-1800I20200814-1040I20200814-0640I20200814-0330I20200813-1800
Switch the opt-out useWhitespace to opt-in ignoreWhitespace.
Change-Id: If971295794f033041284016fbc64795c1448a4ef
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
2 files changed, 25 insertions, 25 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java index 0922d3ce9..a31a7515d 100644 --- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java +++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java @@ -7,7 +7,7 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -22,7 +22,7 @@ import org.eclipse.equinox.p2.metadata.Version; public class XMLWriter implements XMLConstants { - static final boolean useWhitespace = Boolean.getBoolean("p2.useWhitespace"); //$NON-NLS-1$ + static final boolean ignoreWhitespace = Boolean.getBoolean("p2.ignoreWhitespace"); //$NON-NLS-1$ public static class ProcessingInstruction { @@ -84,7 +84,7 @@ public class XMLWriter implements XMLConstants { if (this.open) { println('>'); } - if (useWhitespace) { + if (!ignoreWhitespace) { indent(); } print('<'); @@ -312,23 +312,23 @@ public class XMLWriter implements XMLConstants { } private void println(char c) { - if (useWhitespace) { - this.pw.println(c); - } else { + if (ignoreWhitespace) { this.pw.print(c); + } else { + this.pw.println(c); } } private void println(String s) { - if (useWhitespace) { - this.pw.println(s); - } else { + if (ignoreWhitespace) { this.pw.print(s); + } else { + this.pw.println(s); } } private void println() { - if (useWhitespace) { + if (!ignoreWhitespace) { this.pw.println(); } } @@ -345,7 +345,7 @@ public class XMLWriter implements XMLConstants { if (s.length() == 0) { println(); } else { - if (useWhitespace) { + if (!ignoreWhitespace) { indent(); } println(escape ? escape(s) : s); @@ -353,7 +353,7 @@ public class XMLWriter implements XMLConstants { } private void indent() { - if (useWhitespace) { + if (!ignoreWhitespace) { for (int i = this.elements.size(); i > 0; i -= 1) { print(this.indent); } diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java index d096cb415..66a64c7de 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java @@ -25,7 +25,7 @@ import java.util.Map; public class XMLWriter extends PrintWriter { protected int tab; - static final boolean useWhitespace = Boolean.getBoolean("p2.useWhitespace"); //$NON-NLS-1$ + static final boolean ignoreWhitespace = Boolean.getBoolean("p2.ignoreWhitespace"); //$NON-NLS-1$ /* constants */ protected static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //$NON-NLS-1$ @@ -71,9 +71,9 @@ public class XMLWriter extends PrintWriter { sb.append("\""); //$NON-NLS-1$ } sb.append(">"); //$NON-NLS-1$ - if (shouldTab && useWhitespace) + if (shouldTab && !ignoreWhitespace) printTabulation(); - if (newLine && useWhitespace) + if (newLine && !ignoreWhitespace) println(sb.toString()); else print(sb.toString()); @@ -110,16 +110,16 @@ public class XMLWriter extends PrintWriter { // Encode special XML characters into the equivalent character references. // These five are defined by default for all XML documents. switch (c) { - case '<' : - return "lt"; //$NON-NLS-1$ - case '>' : - return "gt"; //$NON-NLS-1$ - case '"' : - return "quot"; //$NON-NLS-1$ - case '\'' : - return "apos"; //$NON-NLS-1$ - case '&' : - return "amp"; //$NON-NLS-1$ + case '<': + return "lt"; //$NON-NLS-1$ + case '>': + return "gt"; //$NON-NLS-1$ + case '"': + return "quot"; //$NON-NLS-1$ + case '\'': + return "apos"; //$NON-NLS-1$ + case '&': + return "amp"; //$NON-NLS-1$ } return null; } |