Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2013-11-22 12:58:27 -0500
committerMatthias Sohn2013-11-22 17:42:24 -0500
commitdbfa3e36071ea89990b64b47905c4a78d7555e1c (patch)
treed68c41e79e56a9a6cc378b20396b7550fcf249dd /org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/variables
parentdd15ed98779b602d49c71cc3f13a7fb7989d68c6 (diff)
downloadegit-dbfa3e36071ea89990b64b47905c4a78d7555e1c.tar.gz
egit-dbfa3e36071ea89990b64b47905c4a78d7555e1c.tar.xz
egit-dbfa3e36071ea89990b64b47905c4a78d7555e1c.zip
[findBugs] Fix reliance on default encoding
Using UTF-8 if not otherwise specified is a better choice. Change-Id: Icc07c4b0be57c0765b9d3cd872e3b3a0ab18be08 Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/variables')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/variables/DynamicVariablesTest.java18
1 files changed, 5 insertions, 13 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/variables/DynamicVariablesTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/variables/DynamicVariablesTest.java
index 3a6739e1c..e5b6b7363 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/variables/DynamicVariablesTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/variables/DynamicVariablesTest.java
@@ -10,10 +10,6 @@ package org.eclipse.egit.ui.variables;
import static org.junit.Assert.assertEquals;
import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
import java.util.Collections;
import org.eclipse.core.resources.IProject;
@@ -32,6 +28,7 @@ import org.eclipse.egit.ui.test.TestUtil;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.junit.JGitTestUtil;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
@@ -103,15 +100,10 @@ public class DynamicVariablesTest extends EGitTestCase {
RepositoryProvider.map(project, GitProvider.class.getName());
RepositoryProvider.map(project2, GitProvider.class.getName());
- File f = new File(repository.getWorkTree(), TEST_PROJECT + "/"
- + TEST_FILE);
- Writer fileWriter = new OutputStreamWriter(new FileOutputStream(f),
- "UTF-8");
- fileWriter.write("Some data");
- fileWriter.close();
- FileWriter fileWriter2 = new FileWriter(new File(repository2.getWorkTree(), TEST_FILE2));
- fileWriter2.write("Some other data");
- fileWriter2.close();
+ JGitTestUtil.write(new File(repository.getWorkTree(), TEST_PROJECT
+ + "/" + TEST_FILE), "Some data");
+ JGitTestUtil.write(new File(repository2.getWorkTree(), TEST_FILE2),
+ "Some other data");
project.refreshLocal(IResource.DEPTH_INFINITE, null);
project2.refreshLocal(IResource.DEPTH_INFINITE, null);
git = new Git(repository);

Back to the top