Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Chen2012-02-23 04:10:38 -0500
committerWilliam Chen2012-02-23 04:10:38 -0500
commit9621cbdba3c14763c7d9785301e6b33cc2a387ea (patch)
tree7bb7dbda2352307101116322502722bec418c03b
parent81a02a6fb32a772a6f77deb8270ecb797b44c1e1 (diff)
downloadorg.eclipse.tcf-9621cbdba3c14763c7d9785301e6b33cc2a387ea.tar.gz
org.eclipse.tcf-9621cbdba3c14763c7d9785301e6b33cc2a387ea.tar.xz
org.eclipse.tcf-9621cbdba3c14763c7d9785301e6b33cc2a387ea.zip
Target Explorer: Fix two high-priority issues found by FindBugs.
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.xml2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/preferences/TargetExplorerPreferencePage.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/preferences/PreferencePage.java)3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ViewerStateManager.java16
3 files changed, 13 insertions, 8 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.xml
index c5212cfe8..953fb26c7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.xml
@@ -124,7 +124,7 @@
<!-- Preference page contributions -->
<extension point="org.eclipse.ui.preferencePages">
<page
- class="org.eclipse.tcf.te.ui.preferences.PreferencePage"
+ class="org.eclipse.tcf.te.ui.preferences.TargetExplorerPreferencePage"
id="org.eclipse.tcf.te.ui.preferences.general"
name="%preference.page.name">
</page>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/preferences/PreferencePage.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/preferences/TargetExplorerPreferencePage.java
index 705157487..e79b18f03 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/preferences/PreferencePage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/preferences/TargetExplorerPreferencePage.java
@@ -9,6 +9,7 @@
*******************************************************************************/
package org.eclipse.tcf.te.ui.preferences;
+import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -22,7 +23,7 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
/**
* Target Explorer top preference page implementation.
*/
-public class PreferencePage extends org.eclipse.jface.preference.PreferencePage implements IWorkbenchPreferencePage {
+public class TargetExplorerPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ViewerStateManager.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ViewerStateManager.java
index aa33252f5..e9e4e56ec 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ViewerStateManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ViewerStateManager.java
@@ -12,9 +12,13 @@ package org.eclipse.tcf.te.ui.trees;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -142,9 +146,9 @@ public class ViewerStateManager {
}
@Override
public void run() throws Exception {
- BufferedReader reader = null;
+ Reader reader = null;
try {
- reader = new BufferedReader(new FileReader(stateFile));
+ reader = new BufferedReader(new InputStreamReader(new FileInputStream(stateFile), "UTF-8")); //$NON-NLS-1$
XMLMemento root = XMLMemento.createReadRoot(reader);
loadViewerState(root);
}
@@ -226,9 +230,9 @@ public class ViewerStateManager {
}
@Override
public void run() throws Exception {
- BufferedWriter writer = null;
+ Writer writer = null;
try {
- writer = new BufferedWriter(new FileWriter(stateFile));
+ writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(stateFile), "UTF-8")); //$NON-NLS-1$
root.save(writer);
}
finally {

Back to the top