SVACE: The standard has been applied(Critical).
authorJaeMin Kim <jm.jemin.kim@samsung.com>
Wed, 30 Aug 2017 06:03:42 +0000 (15:03 +0900)
committer허형석/개발플랫폼팀/L5/ <harry.heo@samsung.com>
Fri, 1 Sep 2017 07:40:26 +0000 (16:40 +0900)
- HANDLE_LEAK(256442) ConnectionHistoryJSONParser
- HANDLE_LEAK(256443) SSHUtil
- HANDLE_LEAK(256444) SSHUtil
- HANDLE_LEAK(256449) ConnectionHistoryJSONWriter
- HANDLE_LEAK(256444) WebGitIndexParser
- DEREF_OF_NULL.EX(256624) RootstrapViewProvider
- DEREF_OF_NULL.EX(256626) RootstrapViewProvider

Signed-off-by: JaeMin Kim <jm.jemin.kim@samsung.com>
org.tizen.nativeplatform.project.wizard/src/org/tizen/nativeplatform/project/wizard/git/parser/WebGitIndexParser.java
org.tizen.nativeplatform.win/src/org/tizen/nativeplatform/win/remote/connection/history/ConnectionHistoryJSONParser.java
org.tizen.nativeplatform.win/src/org/tizen/nativeplatform/win/remote/connection/history/ConnectionHistoryJSONWriter.java
org.tizen.nativeplatform.win/src/org/tizen/nativeplatform/win/rootstrap/RootstrapViewProvider.java
org.tizen.nativeplatform.win/src/org/tizen/nativeplatform/win/util/SSHUtil.java

index 424cdd1..f40ba7e 100644 (file)
@@ -121,6 +121,11 @@ public class WebGitIndexParser implements IGitIndexParser {
             while ((line = in.readLine()) != null) {
                 out.write(line + "\n");
             }
+
+            if (cacheFile.exists()) {
+                return true;
+            }
+
         } catch (MalformedURLException e) {
             e.printStackTrace();
             throw new InterruptedException(e.toString());
@@ -131,9 +136,6 @@ public class WebGitIndexParser implements IGitIndexParser {
             IOUtil.tryClose(in);
             IOUtil.tryClose(out);
         }
-        if (cacheFile.exists()) {
-            return true;
-        }
         return false;
     }
 
index dd20e2e..c25d5bd 100644 (file)
@@ -80,9 +80,10 @@ public class ConnectionHistoryJSONParser {
                 }
             }
         } catch (Exception e) {
-            IOUtil.tryClose(fileReader);
             logger.error(resources.getString("Err.filaedToParseJson"), e);
             return false;
+        } finally {
+            IOUtil.tryClose(fileReader);
         }
         return true;
     }
index d5ca688..16efa38 100644 (file)
@@ -61,7 +61,6 @@ public class ConnectionHistoryJSONWriter {
             String json = gson.toJson(ConnectionHistory.getConnectionList());
             writer = new FileWriter(jsonFile);
             writer.write(json);
-            writer.close();
         } catch (Exception e) {
             logger.error(resources.getString("Err.filaedToParseJson"), e);
             return false;
index dd1b98b..5871496 100644 (file)
@@ -117,7 +117,7 @@ public class RootstrapViewProvider implements IRootstrapViewProvider {
             }
         }
 
-        if (createAction != null) {
+        if (createAction != null && connectAction != null && disconnectAction != null) {
             if (RemoteConnectionManager.connected()) {
                 createAction.getAction().setEnabled(true);
                 connectAction.getAction().setEnabled(false);
index 0be10d0..d39d645 100644 (file)
@@ -93,9 +93,10 @@ public class SSHUtil {
                 return false;
             }
         } catch (Exception e) {
+            logger.error("Failed to register authorized key", e);
+        } finally {
             IOUtil.tryClose(fileReader);
             IOUtil.tryClose(reader);
-            logger.error("Failed to register authorized key", e);
         }
         return true;
     }