Fixed some Prevent issues 99/10999/1
authorkh5325.kim <kh5325.kim@samsung.com>
Wed, 16 Oct 2013 03:56:41 +0000 (12:56 +0900)
committerkh5325.kim <kh5325.kim@samsung.com>
Wed, 16 Oct 2013 03:56:41 +0000 (12:56 +0900)
Change-Id: I737af2769ea54a823b1dbb216fad1d9de65cd415
Signed-off-by: kh5325.kim <kh5325.kim@samsung.com>
org.tizen.common/src/org/tizen/common/core/application/InstallPathConfig.java
org.tizen.common/src/org/tizen/common/rds/ui/preference/PropertyAndPreferencePage.java
org.tizen.common/src/org/tizen/common/util/HostUtil.java

index 2a98aa6..cb86b7b 100755 (executable)
@@ -529,12 +529,16 @@ final public class InstallPathConfig {
         String sdkPath = defaultHomePath + File.separatorChar + SDKSUFFIX;
         boolean status = true;
         if (HostUtil.exists(sdkPath)) {
-            String[] fileContent = HostUtil.getContents(sdkPath).split("=");
-            if (HostUtil.exists(fileContent[1])) {
-                sdkInstallPath = fileContent[1];
-            }
-            else {
+            String contents = HostUtil.getContents(sdkPath);
+            if (StringUtil.isEmpty(contents)) {
                 status = false;
+            } else {
+                String[] fileContent = contents.split("=");
+                if (HostUtil.exists(fileContent[1])) {
+                    sdkInstallPath = fileContent[1];
+                } else {
+                    status = false;
+                }
             }
         } else {
             status = false;
index aa6efd4..33f5b3e 100755 (executable)
@@ -24,6 +24,7 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.dialogs.ControlEnableState;
 import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.PreferenceDialog;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
@@ -211,13 +212,19 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
 
     protected final void openWorkspacePreferences(Object data) {
         String id= getPreferencePageID();
-        PreferencesUtil.createPreferenceDialogOn(getShell(), id, new String[] { id }, data).open();
+        PreferenceDialog dialog= PreferencesUtil.createPreferenceDialogOn(getShell(), id, new String[] { id }, data);
+        if (dialog != null) {
+            dialog.open();
+        }
     }
 
     protected final void openProjectProperties(IProject project, Object data) {
         String id= getPropertyPageID();
         if (id != null) {
-            PreferencesUtil.createPropertyDialogOn(getShell(), project, id, new String[] { id }, data).open();
+            PreferenceDialog dialog= PreferencesUtil.createPropertyDialogOn(getShell(), project, id, new String[] { id }, data);
+            if (dialog != null) {
+                dialog.open();
+            }
         }
     }
 
index 8a55b3d..34bc8f2 100755 (executable)
@@ -30,15 +30,10 @@ import static org.tizen.common.util.StringUtil.isEmpty;
 import static org.tizen.common.util.StringUtil.trim;
 
 import java.io.BufferedReader;
-import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.FileReader;
-import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.nio.channels.FileChannel;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;