Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2019-10-25 06:47:19 +0000
committerLars Vogel2019-10-25 07:25:01 +0000
commit2af90f71fd5d941a9a06a458e3c05462a36dbc8d (patch)
tree2b2a569a82ee15ab6991b085aa87e361566bd6cb
parent4fd07bfb4de9ce993173aa1d8d752ca27c8537e0 (diff)
downloadeclipse.platform.text-2af90f71fd5d941a9a06a458e3c05462a36dbc8d.tar.gz
eclipse.platform.text-2af90f71fd5d941a9a06a458e3c05462a36dbc8d.tar.xz
eclipse.platform.text-2af90f71fd5d941a9a06a458e3c05462a36dbc8d.zip
Use StringBuilder in FileBuffersForLinkFiles test
Change-Id: I4014e857c0d972add902e0b59815baace0ff1971 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java2
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileTool.java7
2 files changed, 8 insertions, 1 deletions
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java
index d15154f70..fcb1d0ea2 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java
@@ -94,7 +94,7 @@ public class FileBuffersForLinkedFiles extends FileBufferFunctions {
@Override
protected boolean modifyUnderlyingFile() throws Exception {
- FileTool.write(fExternalFile.getAbsolutePath(), new StringBuffer("Changed content of linked file"));
+ FileTool.write(fExternalFile.getAbsolutePath(), "Changed content of linked file");
fExternalFile.setLastModified(1000);
IFile iFile= FileBuffers.getWorkspaceFileAtLocation(getPath());
iFile.refreshLocal(IResource.DEPTH_INFINITE, null);
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileTool.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileTool.java
index efe2bc040..3ec3867c4 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileTool.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileTool.java
@@ -190,12 +190,19 @@ public class FileTool {
return s;
}
+ @Deprecated
public static void write(String fileName, StringBuffer content) throws IOException {
try (Writer writer= new FileWriter(fileName)) {
writer.write(content.toString());
}
}
+ public static void write(String fileName, String content) throws IOException {
+ try (Writer writer= new FileWriter(fileName)) {
+ writer.write(content);
+ }
+ }
+
public static void delete(IPath path) {
File file= FileBuffers.getSystemFileAtLocation(path);
delete(file);

Back to the top