Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2020-01-13 09:03:01 +0000
committerLars Vogel2020-01-13 15:23:09 +0000
commita1993f28ebe965a670c7d8dec06f21d7de7c82e8 (patch)
treeaab5b5752d46097ed51c27b76e80a35383c64546
parentca2063f00952b7bd2926422eee3af47c8a435413 (diff)
downloadeclipse.platform.text-a1993f28ebe965a670c7d8dec06f21d7de7c82e8.tar.gz
eclipse.platform.text-a1993f28ebe965a670c7d8dec06f21d7de7c82e8.tar.xz
eclipse.platform.text-a1993f28ebe965a670c7d8dec06f21d7de7c82e8.zip
Use System.lineSeparator()
Benefit of this way rather than System.getProperty("line.separator") is that there are no security checks. Change-Id: I3ff085c291a6c279f3a434134c3bfdd6ffea0353 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/AbstractControlContentAssistSubjectAdapter.java2
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java2
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java2
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java2
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ConvertLineDelimitersAction.java2
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConvertLineDelimitersAction.java2
7 files changed, 7 insertions, 7 deletions
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
index 089709dcb..885f9cbd4 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
@@ -803,7 +803,7 @@ public class TextFileBufferManager implements ITextFileBufferManager {
* @since 3.3
*/
protected String getLineDelimiterPreference(IPath location, LocationKind locationKind) {
- return System.getProperty("line.separator"); //$NON-NLS-1$
+ return System.lineSeparator();
}
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/contentassist/AbstractControlContentAssistSubjectAdapter.java b/org.eclipse.jface.text/src/org/eclipse/jface/contentassist/AbstractControlContentAssistSubjectAdapter.java
index e70ce7abc..a57bd688a 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/contentassist/AbstractControlContentAssistSubjectAdapter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/contentassist/AbstractControlContentAssistSubjectAdapter.java
@@ -164,7 +164,7 @@ public abstract class AbstractControlContentAssistSubjectAdapter implements ICon
@Override
public String getLineDelimiter() {
- return System.getProperty("line.separator"); //$NON-NLS-1$
+ return System.lineSeparator();
}
/**
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java
index 48011ecb1..706e1b1dd 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java
@@ -110,7 +110,7 @@ public class CopyToClipboardAction extends Action {
return;
IBaseLabelProvider labelProvider= fViewer.getLabelProvider();
- String lineDelim= System.getProperty("line.separator"); //$NON-NLS-1$
+ String lineDelim= System.lineSeparator();
StringBuilder buf= new StringBuilder();
Iterator<?> iter= getSelection();
while (iter.hasNext()) {
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
index 71b13baa1..b73f4b1ad 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
@@ -838,7 +838,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension,
if (fInitialLineDelimiter != null)
return fInitialLineDelimiter;
- String sysLineDelimiter= System.getProperty("line.separator"); //$NON-NLS-1$
+ String sysLineDelimiter= System.lineSeparator();
String[] delimiters= getLegalLineDelimiters();
Assert.isTrue(delimiters.length > 0);
for (String delimiter : delimiters) {
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java b/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java
index fceca67e3..e40f9be6f 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java
@@ -506,7 +506,7 @@ public class TextUtilities {
if (lineDelimiter != null)
return lineDelimiter;
- String sysLineDelimiter= System.getProperty("line.separator"); //$NON-NLS-1$
+ String sysLineDelimiter= System.lineSeparator();
String[] delimiters= document.getLegalLineDelimiters();
Assert.isTrue(delimiters.length > 0);
for (String delimiter : delimiters) {
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ConvertLineDelimitersAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ConvertLineDelimitersAction.java
index 6c984ce70..1d99fd2b1 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ConvertLineDelimitersAction.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ConvertLineDelimitersAction.java
@@ -60,7 +60,7 @@ public class ConvertLineDelimitersAction extends FileBufferOperationAction {
protected ConvertLineDelimitersAction(String lineDelimiter, String label) {
super(new ConvertLineDelimitersOperation(lineDelimiter));
- setText(constructLabel(label, lineDelimiter, System.getProperty("line.separator"))); //$NON-NLS-1$
+ setText(constructLabel(label, lineDelimiter, System.lineSeparator()));
fLabel= Action.removeMnemonics(label);
}
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConvertLineDelimitersAction.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConvertLineDelimitersAction.java
index eaf3d69a9..dce4b8679 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConvertLineDelimitersAction.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConvertLineDelimitersAction.java
@@ -73,7 +73,7 @@ public class ConvertLineDelimitersAction extends TextEditorAction {
super(bundle, prefix, editor);
fLineDelimiter= lineDelimiter;
- String platformLineDelimiter= System.getProperty("line.separator"); //$NON-NLS-1$
+ String platformLineDelimiter= System.lineSeparator();
setText(getString(getLabelKey(fLineDelimiter, platformLineDelimiter)));
update();

Back to the top