diff options
author | Karsten Thoms | 2018-02-24 14:02:16 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-02-24 16:00:00 +0000 |
commit | ccb9f3de46a5e7c6801a7cead1e3a8e938d90866 (patch) | |
tree | 9d6bd3bcfd2896bbabbf9ff6a7bcd01a47950951 | |
parent | 113e773e53e827e2495b0710e781964bc40d9674 (diff) | |
download | eclipse.platform.swt-ccb9f3de46a5e7c6801a7cead1e3a8e938d90866.tar.gz eclipse.platform.swt-ccb9f3de46a5e7c6801a7cead1e3a8e938d90866.tar.xz eclipse.platform.swt-ccb9f3de46a5e7c6801a7cead1e3a8e938d90866.zip |
Bug 531633 - Replace usage of System.getProperty("file.separator")
Change-Id: I609d4b7e6415a113e2afcf790cc72d9a7c6199c0
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
7 files changed, 15 insertions, 9 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java index 0f790edd2d..8613d61248 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.browser; +import java.io.*; import java.net.*; import java.util.*; @@ -112,7 +113,7 @@ class IE extends WebBrowser { static final String EXTENSION_PDF = ".pdf"; //$NON-NLS-1$ static final String HTML_DOCUMENT = "HTML Document"; //$NON-NLS-1$ static final int MAX_PDF = 20; - static final char SEPARATOR_OS = System.getProperty ("file.separator").charAt (0); //$NON-NLS-1$ + static final char SEPARATOR_OS = File.separatorChar; static final String PROPERTY_IEVERSION = "org.eclipse.swt.browser.IEVersion"; //$NON-NLS-1$ static final String VALUE_DEFAULT = "default"; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java b/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java index 3c5cb33810..f2a1c3925a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java @@ -55,7 +55,7 @@ public class Library { static { DELIMITER = System.getProperty("line.separator"); //$NON-NLS-1$ - SEPARATOR = System.getProperty("file.separator"); //$NON-NLS-1$ + SEPARATOR = File.separator; USER_HOME = System.getProperty ("user.home"); SWT_LIB_DIR = ".swt" + SEPARATOR + "lib" + SEPARATOR + os() + SEPARATOR + arch(); //$NON-NLS-1$ $NON-NLS-2$ JAVA_VERSION = parseVersion(System.getProperty("java.version")); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java index b4eee43e69..fcf1a93364 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java +++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java @@ -193,7 +193,7 @@ class WebKit extends WebBrowser { static final int MAX_PROGRESS = 100; static final int[] MIN_VERSION = {1, 2, 0}; static final int SENTINEL_KEYPRESS = -1; - static final char SEPARATOR_FILE = System.getProperty ("file.separator").charAt (0); //$NON-NLS-1$ + static final char SEPARATOR_FILE = File.separatorChar; static final int STOP_PROPOGATE = 1; static final String DOMEVENT_DRAGSTART = "dragstart"; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java index c28e8521cb..63743b0d01 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java @@ -11,6 +11,8 @@ package org.eclipse.swt.widgets; +import java.io.*; + import org.eclipse.swt.*; import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.gtk.*; @@ -35,7 +37,7 @@ import org.eclipse.swt.internal.gtk.*; */ public class DirectoryDialog extends Dialog { String message = "", filterPath = ""; - static final String SEPARATOR = System.getProperty ("file.separator"); + static final String SEPARATOR = File.separator; private static final int PATH_MAX = 1024; /** diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java index cf4aa5b618..1f3a646a74 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java @@ -11,6 +11,8 @@ package org.eclipse.swt.widgets; +import java.io.*; + import org.eclipse.swt.*; import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.gtk.*; @@ -46,7 +48,7 @@ public class FileDialog extends Dialog { boolean overwrite = false; boolean uriMode; long /*int*/ handle; - static final char SEPARATOR = System.getProperty ("file.separator").charAt (0); + static final char SEPARATOR = File.separatorChar; static final char EXTENSION_SEPARATOR = ';'; static final char FILE_EXTENSION_SEPARATOR = '.'; private static final int PATH_MAX = 1024; diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java index b3d29ba405..509d943911 100644 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java +++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java @@ -12,6 +12,8 @@ package org.eclipse.swt.examples.clipboard; import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter; +import java.io.File; + import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.custom.StyledText; @@ -324,12 +326,11 @@ void createFileTransfer(Composite copyParent, Composite pasteParent){ FileDialog dialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI); String result = dialog.open(); if (result != null && result.length() > 0){ - String separator = System.getProperty("file.separator"); String path = dialog.getFilterPath(); String[] names = dialog.getFileNames(); for (String name : names) { TableItem item = new TableItem(copyFileTable, SWT.NONE); - item.setText(path+separator+name); + item.setText(path+File.separator+name); } } })); diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java index ccceae24dc..3a9a8122dd 100644 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java +++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java @@ -13,6 +13,7 @@ package org.eclipse.swt.examples.dnd; import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter; +import java.io.File; import java.net.MalformedURLException; import java.net.URL; @@ -511,11 +512,10 @@ private void createDragTypes(Composite parent) { String result = dialog.open(); if (result != null && result.length() > 0) { fileList.removeAll(); - String separator = System.getProperty("file.separator"); String path = dialog.getFilterPath(); String[] names = dialog.getFileNames(); for (String name : names) { - fileList.add(path + separator + name); + fileList.add(path + File.separatorChar + name); } } })); |