[Title] Qualify source in static analysis
authorBon-Yong Lee <bonyong.lee@samsung.com>
Wed, 29 Aug 2012 03:50:21 +0000 (12:50 +0900)
committerBon-Yong Lee <bonyong.lee@samsung.com>
Wed, 29 Aug 2012 03:50:21 +0000 (12:50 +0900)
[Type]      Enhancement
[Module]    Sub
[Priority]  Minor
[CQ#]       // CQ Issue Number
[Redmine#]  // Redmine Isuue Number
[Problem]   // Problem Description
[Cause]     // Cause Description
[Solution]  // Solution Description
[TestCase]  // Executed the test-target (How to)

19 files changed:
org.tizen.common.connection/src/org/tizen/common/connection/ConnectionPlugin.java
org.tizen.common.connection/src/org/tizen/common/connection/debugtools/ToolsInstall.java
org.tizen.common.connection/src/org/tizen/common/connection/explorer/ConnectionExplorerContentProvider.java [changed mode: 0644->0755]
org.tizen.common.connection/src/org/tizen/common/connection/explorer/ConnectionExplorerPanel.java
org.tizen.common.connection/src/org/tizen/common/connection/log/LogPanel.java
org.tizen.common.connection/src/org/tizen/common/connection/sdblib/dnd/FileEntryDropAdapter.java [changed mode: 0644->0755]
org.tizen.common.connection/src/org/tizen/common/connection/ui/ConnectionExplorer.java
org.tizen.common.connection/src/org/tizen/common/connection/ui/LogView.java [changed mode: 0644->0755]
org.tizen.common.connection/src/org/tizen/common/connection/ui/TizenRemoteFileDialog.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/CommonPlugin.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/core/application/InstallPathConfig.java
org.tizen.common/src/org/tizen/common/core/application/UpdateManager.java
org.tizen.common/src/org/tizen/common/ui/view/console/ConsoleManager.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/ui/widget/PictureLabel.java
org.tizen.common/src/org/tizen/common/util/FileUtil.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/util/HostUtil.java
org.tizen.common/src/org/tizen/common/util/OpenBrowserUtil.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/util/PropertyUtil.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/util/cache/NamedColorCache.java [changed mode: 0644->0755]

index 09d28fd..19930b3 100755 (executable)
@@ -234,7 +234,9 @@ public class ConnectionPlugin extends AbstractUIPlugin {
         plugin = null;
         int deviceCnt = SmartDevelopmentBridge.getBridge().getDevices().length;
         if (deviceCnt==0)
+        {
             SmartDevelopmentBridge.disconnectBridge();
+        }
         super.stop(context);
     }
 
index 75f7af0..7b3b16a 100755 (executable)
@@ -203,7 +203,9 @@ class InstallProgress implements IRunnableWithProgress {
         // check directory exist
         try {
             if (!checkDirectory(TizenPlatformConstants.TOOLS_TARGET_PATH))
+            {
                 makeDirectory(TizenPlatformConstants.TOOLS_TARGET_PATH);
+            }
         } catch (CoreException e) {
             Logger.error("Error to check or make directory", e);
         }
@@ -218,11 +220,15 @@ class InstallProgress implements IRunnableWithProgress {
         for ( DebugTool dt : installDebugTools ) {
             if (device.isEmulator()) {
                 if (!dt.getArchitecture().contains("86"))
+                {
                     continue;
+                }
             }
             else {
                 if (!dt.getArchitecture().contains("arm"))
+                {
                     continue;
+                }
             }
             
             threadName = "OnDemandInstallThread-" + dt.getPackagename();
old mode 100644 (file)
new mode 100755 (executable)
index f469f27..238ee38
  */
 package org.tizen.common.connection.explorer;
 
+import static org.tizen.sdblib.FileListingService.TYPE_DIRECTORY;
+import static org.tizen.sdblib.FileListingService.TYPE_DIRECTORY_LINK;
+import static org.tizen.sdblib.FileListingService.TYPE_LINK;
+import static org.tizen.sdblib.FileListingService.TYPE_ROOT_DEVICE;
+import static org.tizen.sdblib.FileListingService.TYPE_ROOT_EMULATOR;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.Viewer;
-import org.tizen.sdblib.FileListingService;
 import org.tizen.sdblib.FileListingService.FileEntry;
 import org.tizen.sdblib.IDevice;
 import org.tizen.sdblib.SmartDevelopmentBridge;
 
 public class ConnectionExplorerContentProvider implements ITreeContentProvider
 {
+    protected static final Set<?> PARENT_TYPES =
+    Collections.unmodifiableSet( new HashSet<Object>( Arrays.asList(
+        TYPE_DIRECTORY_LINK,
+        TYPE_LINK,
+        TYPE_DIRECTORY,
+        TYPE_ROOT_EMULATOR,
+        TYPE_ROOT_DEVICE
+    ) ) );
 
     @Override
     public void dispose()
@@ -91,16 +109,7 @@ public class ConnectionExplorerContentProvider implements ITreeContentProvider
         if (arg0 instanceof FileEntry)
         {
             FileEntry entry = (FileEntry) arg0;
-            if (entry.getType() == FileListingService.TYPE_DIRECTORY_LINK)
-                return true;
-            else if (entry.getType() == FileListingService.TYPE_LINK)
-                return true;
-            else if (entry.getType() == FileListingService.TYPE_DIRECTORY)
-                return true;
-            else if (entry.getType() == FileListingService.TYPE_ROOT_EMULATOR)
-                return true;
-            else if (entry.getType() == FileListingService.TYPE_ROOT_DEVICE)
-                return true;
+            return PARENT_TYPES.contains( entry.getType() );
         }
         return false;
     }
index f629d87..d88395f 100755 (executable)
@@ -120,7 +120,7 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
 
     private ToolItem pushToolItem;
     private ToolItem pullToolItem;
-    private ToolItem emulStartToolItem;
+//    private ToolItem emulStartToolItem;
 
     private MenuManager subMenu;
     private Action actionPush;
@@ -305,7 +305,7 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
     {
         pushToolItem = push;
         pullToolItem = pull;
-        emulStartToolItem = start;
+//        emulStartToolItem = start;
     }
 
     public void setActions(MenuManager pSubMenu, Action pActionPush, Action pActionPull, Action pActionRefresh, Action pActionRename, Action pActionProperty,
@@ -912,7 +912,9 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
                     {
                         ret = FileDialogUtils.allowFileOverwrite(f.getName());
                         if( ret == IDialogConstants.CANCEL_ID)
+                        {
                             break;
+                        }
                     } else
                     {
                         ret = FileDialogUtils.checkOverwrite(f.getName());
@@ -1048,7 +1050,9 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
         Tree tree = treeViewer.getTree();
         FileEntry entry = null;
         if (tree.getSelectionCount() > 0)
+        {
             entry = getSingleFileEntry();
+        }
 
         if (entry != null)
         {
@@ -1067,8 +1071,11 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
                         tree.setSelection(item);
                     }
                 }
-            } else
+            }
+            else
+            {
                 currentDevice = null;
+            }
         }
         ConnectionPlugin.getDefault().setCurrentDevice(currentDevice);
         ConnectionPlugin.getDefault().notifySelectionListeners(entry);
@@ -1165,7 +1172,9 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
             TreeItem[] items = tree.getSelection();
             return (FileEntry) items[0].getData();
         } else
+        {
             return null;
+        }
     }
 
     @Override
index cb7fca8..b7c92fb 100755 (executable)
@@ -595,7 +595,9 @@ public class LogPanel extends Panel implements IDeviceChangeListener
             {
                 int ret = FileDialogUtils.allowFileOverwrite(fileName);
                 if( ret == IDialogConstants.CANCEL_ID)
+                {
                     again = true;
+                }
             }
         } while (again);
 
old mode 100644 (file)
new mode 100755 (executable)
index a67e03d..55f0d12
@@ -55,15 +55,18 @@ public class FileEntryDropAdapter implements IDropActionDelegate {
                        if (target != null && target instanceof IResource) {
                                resource = (IResource) target;
                                if (resource.getType() == IResource.FILE && resource.getParent() != null)
+                               {
                                        resource = resource.getParent();
+                               }
                        }
                }
 
-               String[] entries = FileEntryTransfer.getInstance().fromByteArray(
-                               (byte[]) source);
+               String[] entries = FileEntryTransfer.getInstance().fromByteArray( (byte[]) source);
 
                if (entries.length < 1)
+               {
                        return false;
+               }
 
                SyncService sync = null;
                try {
@@ -85,7 +88,9 @@ public class FileEntryDropAdapter implements IDropActionDelegate {
                        for (int i = 0; i < entries.length; i++) {
                                File f = new File(entries[i]);
                                if (resource == null )
+                               {
                                        return false;
+                               }
                                IPath localPath = resource.getFullPath().append(f.getName());
                                IResource newRes = resource.getWorkspace().getRoot().findMember(localPath);
 
index 0b5f061..e23daa2 100755 (executable)
@@ -163,11 +163,15 @@ public class ConnectionExplorer extends ViewPart
         if (event.keyCode == SWT.F5)
         {
             if (length == 1)
+            {
                 actionRefresh();
+            }
         } else if (event.keyCode == SWT.F2)
         {
             if (length == 1)
+            {
                 actionRename();
+            }
         } else if (event.keyCode == SWT.DEL)
         {
             actionDelete();
old mode 100644 (file)
new mode 100755 (executable)
index 97b6167..c466ebd
@@ -166,7 +166,9 @@ public final class LogView extends ViewPart
                             if (logPanel.getSelectionLogTab() != null)
                             {
                                 if (a.isChecked())
+                                {
                                     a.setChecked(a.isChecked());
+                                }
                                 logPanel.setLevel(i, a.isChecked());
                             }
                         }
old mode 100644 (file)
new mode 100755 (executable)
index f858014..0b0afa1
@@ -75,7 +75,9 @@ public class TizenRemoteFileDialog {
                                    throws IllegalArgumentException {
 
         if (parent == null || device == null)
+        {
             throw new IllegalArgumentException();
+        }
 
         display = parent.getDisplay();
         shell = createNewShell(parent);
@@ -126,7 +128,9 @@ public class TizenRemoteFileDialog {
 
         // set default path to the top item.
         if (pathTree.getSelection().length > 0)
+        {
             pathTreeViewer.getTree().setTopItem(pathTree.getSelection()[0]);
+        }
 
         remoteContentProvider.setInitialize(true);
         pathTreeViewer.refresh();
@@ -317,14 +321,18 @@ public class TizenRemoteFileDialog {
 
         while (!loopShell.isDisposed()) {
             if (!tmpDisplay.readAndDispatch())
+            {
                 tmpDisplay.sleep();
+            }
         }
         display.update();
     }
 
     private void setDefaultPath(final String corePath) {
         if (corePath == null)
+        {
             defaultPath = "/";
+        }
 
         String command = "ls " + TizenPlatformConstants.PRIVATE_PLATFORM_CORE_PATH + "/*/files/core.* 2&>/dev/null | wc -l";
 
old mode 100644 (file)
new mode 100755 (executable)
index 736d1d7..f545edb
@@ -92,8 +92,10 @@ public class CommonPlugin extends AbstractUIPlugin {
         if (OSChecker.isWindows()) {
             String dllPath = InstallPathConfig.getSdbWinUsbApiPath();
             if (!HostUtil.exists(dllPath))
+            {
                 DialogUtil.openMessageDialog("There is no " + dllPath + ".\n" +
                         "It's not mandatory but you may have problem in using sdb through USB.");
+            }
         }
     }
 
@@ -129,7 +131,9 @@ public class CommonPlugin extends AbstractUIPlugin {
     @Override
     protected void initializeDefaultPreferences( final IPreferenceStore store ) {
         if (InstallPathConfig.getSDKPath() != null)
+        {
             store.setDefault(TizenBasePreferencePage.KEY_SDKLOCATION, InstallPathConfig.getSDKPath());
+        }
         store.setDefault(TizenBasePreferencePage.KEY_SDKUPDATE, TizenBasePreferencePage.VALUE_SDKUPDATE_DEFAULT);
     }
 
index 57d8a60..e661b44 100755 (executable)
@@ -185,7 +185,9 @@ final public class InstallPathConfig {
     }
     private static String getRegistryValue(String node, String key) {
         if (!OSChecker.isWindows())
+        {
             return null;
+        }
 
         BufferedReader br = null;
         String value = "";
index 0213b27..0af22d4 100755 (executable)
@@ -135,9 +135,13 @@ public class UpdateManager implements IStartup {
                String exeInstaller = null;
                
                if(OSChecker.isWindows())
+               {
                        exeInstaller = EXECUTE_INSTALLER_COMMAND_FOR_WINDOWS;
+               }
                else
+               {
                        exeInstaller = EXECUTE_INSTALLER_COMMAND;
+               }
                        
                return exeInstaller;
        }
old mode 100644 (file)
new mode 100755 (executable)
index 2c41b34..41aa25b
@@ -114,7 +114,9 @@ implements IConsolePrinter
                }
                
                if(this.consoleFocus)
+               {
                        showConsoleView();
+               }
                
                return console;
        }
index fb871f3..a5cf09b 100755 (executable)
@@ -176,7 +176,9 @@ public class PictureLabel extends Canvas {
                                width = imageWidth + 2;\r
                        }\r
                        else\r
+                       {\r
                                width = textWidth + 2;\r
+                       }\r
                        height = textHeight + imageHeight + 7;\r
                } else if (image != null) {\r
                        Rectangle bounds = image.getBounds();\r
old mode 100644 (file)
new mode 100755 (executable)
index 59befe2..9bd80fc
@@ -24,6 +24,7 @@
  */
 package org.tizen.common.util;
 
+import static org.tizen.common.util.IOUtil.redirect;
 import static org.tizen.common.util.IOUtil.tryClose;
 
 import java.io.BufferedInputStream;
@@ -73,10 +74,14 @@ public class FileUtil {
      */
     public static boolean createDirectory(String dirName, String destDir) {
         if (dirName == null)
+        {
             throw new NullPointerException();
+        }
 
         if (destDir == null)
+        {
             destDir = System.getProperty("user.dir");
+        }
 
         String fullPath = FilenameUtil.addTailingPath(destDir, dirName);
 
@@ -96,7 +101,9 @@ public class FileUtil {
      */
     public static boolean createTextFile(File file, String text, String encoding) throws IOException {
         if (!file.createNewFile())
+        {
             return false;
+        }
 
         return writeTextFile(file, text, encoding);
     }
@@ -130,10 +137,14 @@ public class FileUtil {
      */
     public static boolean createTextFile(String fileName, String text, String destDir, String encoding) throws IOException {
         if (fileName == null)
+        {
             throw new NullPointerException();
+        }
 
         if (destDir == null)
+        {
             destDir = System.getProperty("user.dir");
+        }
 
         String fullPath = FilenameUtil.addTailingPath(destDir, fileName);
 
@@ -171,9 +182,7 @@ public class FileUtil {
         } catch (IOException e) {
             throw e;
         } finally {
-            if (out != null) {
-                out.close();
-            }
+            tryClose( out );
         }
 
         return true;
@@ -214,9 +223,9 @@ public class FileUtil {
 
         try {
             in = new BufferedReader(new InputStreamReader(input, encoding), BUFFER_SIZE);
-            IOUtil.redirect( in, text );
+            redirect( in, text );
         } finally {
-            IOUtil.tryClose( in );
+            tryClose( in );
         }
 
         return text.toString();
index 012a60c..6499c66 100755 (executable)
 */
 package org.tizen.common.util;
 
+import static org.tizen.common.util.IOUtil.redirect;
 import static org.tizen.common.util.IOUtil.tryClose;
+import static org.tizen.common.util.StringUtil.isEmpty;
+import static org.tizen.common.util.StringUtil.trim;
 
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
@@ -36,10 +39,14 @@ import java.io.FileWriter;
 import java.io.InputStreamReader;
 import java.nio.channels.FileChannel;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.tizen.common.ui.view.console.ConsoleManager;
 
 public abstract class HostUtil{
     
+    protected static Logger logger = LoggerFactory.getLogger( HostUtil.class );
+    
     public static final String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
     public static final String FILE_SEPARATOR = System.getProperty("file.separator"); //$NON-NLS-1$
     
@@ -47,29 +54,25 @@ public abstract class HostUtil{
     private static final String SHELL_COMMAND_WINDOW= "cmd"; //$NON-NLS-1$
     
     public static String getContents(String filePath) {
-        BufferedReader input = null;
+        FileReader input = null;
         StringBuilder contents = new StringBuilder();
-        String line = null;
         
         try {
-            input = new BufferedReader(new FileReader(filePath));
-            while((line=input.readLine())!=null){
-                contents.append(line);
-                contents.append(LINE_SEPARATOR);
-            }
+            input = new FileReader(filePath);
+            redirect( input, contents );
+            return trim( contents.toString() );
         }catch(Exception e) {
-//            e.printStackTrace();
             return null;
         }finally{
-            tryClose( input );
+            tryClose( input, contents );
         }
-        
-        return contents.toString().trim();
     }
 
     public static boolean exists(String path) {
-        if( path == null || path.equals("") ) //$NON-NLS-1$
+        if( isEmpty( path ) )
+        {
             return false;
+        }
 
         File file = new File( path );
 
@@ -94,9 +97,11 @@ public abstract class HostUtil{
             e.printStackTrace();
             return false;
         } finally{
-            System.out.println("HostUtil execute - exit value : " + i);
+            logger.info( "HostUtil execute - exit value : {}", i );
             if(proc!=null)    
+            {
                 proc.destroy();
+            }
         }
         
         return i==0;
@@ -110,20 +115,20 @@ public abstract class HostUtil{
         String[] fullCommand = getCommand(command);
 
         Runtime run = Runtime.getRuntime();
-          Process p = null;
-          
-          int i = 0;
-          try{
-           p = run.exec(fullCommand);
-           i = p.waitFor();
-           StreamGobbler gb1 = new StreamGobbler(p.getInputStream());
-           StreamGobbler gb2 = new StreamGobbler(p.getErrorStream());
-           gb1.start();
-           gb2.start();
-          }catch(Exception e){
-              e.printStackTrace();
-              return false;
-          
+        Process p = null;
+
+        int i = 0;
+        try{
+            p = run.exec(fullCommand);
+            i = p.waitFor();
+            StreamGobbler gb1 = new StreamGobbler(p.getInputStream());
+            StreamGobbler gb2 = new StreamGobbler(p.getErrorStream());
+            gb1.start();
+            gb2.start();
+        }catch(Exception e){
+            e.printStackTrace();
+            return false;
+        } 
         return i == 0;
     }
 
@@ -140,51 +145,51 @@ public abstract class HostUtil{
         String[] fullCommand = getCommand(command);
 
         Runtime run = Runtime.getRuntime();
-          Process p = null;
+        Process p = null;
 
-          StreamGobbler gb1 = null;
-          StreamGobbler gb2 = null;
-          try{
-           p = run.exec(fullCommand, envp, dir);
-           gb1 = new StreamGobbler(p.getInputStream());
-           gb2 = new StreamGobbler(p.getErrorStream());
-           gb1.start();
-           gb2.start();
-          }catch(Exception e){
-              e.printStackTrace();
-              return false;
-          }finally{
-              System.out.println(gb1.getResult());
-              System.out.println(gb2.getResult());
-          
+        StreamGobbler gb1 = null;
+        StreamGobbler gb2 = null;
+        try{
+            p = run.exec(fullCommand, envp, dir);
+            gb1 = new StreamGobbler(p.getInputStream());
+            gb2 = new StreamGobbler(p.getErrorStream());
+            gb1.start();
+            gb2.start();
+        }catch(Exception e){
+            e.printStackTrace();
+            return false;
+        }finally{
+            logger.debug( "Output Stream :{}", gb1.getResult() );
+            logger.debug( "Error Stream :{}", gb2.getResult() );
+        } 
         return true;
     }
 
     public static String returnExecute(String command, String workingDir) {
-        
+
         if(command == null) {
             return null;
         }
         BufferedReader input = null;
         StringBuilder contents = new StringBuilder();
         String line = null;
-        
+
         Process proc = null;
-        
+
         String[] fullCommand = getCommand(command);
-        
+
         try {
-                ProcessBuilder pb = new ProcessBuilder();
-                pb.command(fullCommand);
-                if(workingDir != null) {
-                    pb.directory(new File(workingDir));
-                }
-                proc = pb.start();
-                input = new BufferedReader(new InputStreamReader(proc.getInputStream()));
-                while((line=input.readLine())!=null){
-                    contents.append(line);
-                    contents.append(LINE_SEPARATOR);
-                }
+            ProcessBuilder pb = new ProcessBuilder();
+            pb.command(fullCommand);
+            if(workingDir != null) {
+                pb.directory(new File(workingDir));
+            }
+            proc = pb.start();
+            input = new BufferedReader(new InputStreamReader(proc.getInputStream()));
+            while((line=input.readLine())!=null){
+                contents.append(line);
+                contents.append(LINE_SEPARATOR);
+            }
         } catch (Exception e) {
             e.printStackTrace();
             return null;
@@ -229,7 +234,9 @@ public abstract class HostUtil{
             proc.waitFor();
             // abnormal termination
             if (proc.exitValue() != 0)
+            {
                 throw new Exception("Failed to execute command: " + command);
+            }
         } finally {
             tryClose( input );
             if(proc!=null)
@@ -243,9 +250,9 @@ public abstract class HostUtil{
         
         return returnExecute(command, null);
     }
-    
+
     public static String[] getCommand(String command){
-        
+
         if(OSChecker.isWindows()){
             return new String[]{SHELL_COMMAND_WINDOW,"/c",command}; //$NON-NLS-1$
         }else
@@ -253,21 +260,21 @@ public abstract class HostUtil{
             return new String[]{SHELL_COMMAND_LINUX,"-c",command}; //$NON-NLS-1$
         }
     }
-    
+
     /**
-    * @deprecated Use {@link FileUtil#createFile(File)}, 
-    * {@link FileUtil#createFile(String)}, 
-    * {@link FileUtil#createFile(String, String)} 
-    * or 
-    * {@link FileUtil#createTextFile(File, String, String)}, 
-    * {@link FileUtil#createTextFile(String, String, String)}, 
-    * {@link FileUtil#createTextFile(String, String, String, String)} 
-    * and 
-    * {@link FileUtil#createDirectory(File)}, 
-    * {@link FileUtil#createDirectory(String)}, 
-    * {@link FileUtil#createDirectory(String, String)} 
-    * instead.
-    */
+     * @deprecated Use {@link FileUtil#createFile(File)}, 
+     * {@link FileUtil#createFile(String)}, 
+     * {@link FileUtil#createFile(String, String)} 
+     * or 
+     * {@link FileUtil#createTextFile(File, String, String)}, 
+     * {@link FileUtil#createTextFile(String, String, String)}, 
+     * {@link FileUtil#createTextFile(String, String, String, String)} 
+     * and 
+     * {@link FileUtil#createDirectory(File)}, 
+     * {@link FileUtil#createDirectory(String)}, 
+     * {@link FileUtil#createDirectory(String, String)} 
+     * instead.
+     */
     @Deprecated
     public static boolean createFile(String path, String contents) {
         BufferedWriter output = null;
@@ -276,7 +283,9 @@ public abstract class HostUtil{
             
             File folder = file.getParentFile();
             if(folder!=null)
+            {
                 folder.mkdirs();
+            }
             
             file.createNewFile();
             
@@ -304,21 +313,21 @@ public abstract class HostUtil{
         FileOutputStream fos=null;
         FileChannel fcin=null;
         FileChannel fcout=null;
-        
+
         canExecute = srcFile.canExecute();
-        
+
         desFile= new File(des);
         File paths = new File(desFile.getAbsolutePath().substring(0, desFile.getAbsolutePath().lastIndexOf("/"))); //$NON-NLS-1$
         if (!paths.exists()) {
             paths.mkdirs();
         }
-        
+
         try {
             fis= new FileInputStream(srcFile);
             fos= new FileOutputStream(desFile);
             fcin= fis.getChannel();
             fcout= fos.getChannel();
-        
+
             long size= fcin.size();
             fcin.transferTo(0, size, fcout);
             desFile.setExecutable(canExecute);
old mode 100644 (file)
new mode 100755 (executable)
index c1123ea..85abf75
@@ -75,9 +75,13 @@ public class OpenBrowserUtil {
                                        IWorkbenchBrowserSupport browserSupport= PlatformUI.getWorkbench().getBrowserSupport();\r
                                        IWebBrowser browser;\r
                                        if (useExternalBrowser)\r
+                                       {\r
                                                browser= browserSupport.getExternalBrowser();\r
+                                       }\r
                                        else\r
+                                       {\r
                                                browser= browserSupport.createBrowser(null);\r
+                                       }\r
                                        browser.openURL(url);\r
                                } catch (PartInitException ex) {\r
                                    MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Error", "Opening url failed: " + ex.getMessage());\r
old mode 100644 (file)
new mode 100755 (executable)
index 9e338c3..fa97edd
@@ -25,6 +25,7 @@
 package org.tizen.common.util;
 
 import static org.tizen.common.util.IOUtil.tryClose;
+import static org.tizen.common.util.StringUtil.isEmpty;
 
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
@@ -42,8 +43,10 @@ public abstract class PropertyUtil {
                        reader = new BufferedReader(new FileReader(fileName));
                        String line = "";
                        while((line=reader.readLine()) != null) {
-                           if ("".equals(line.trim()))
+                           if ( isEmpty( line ) )
+                           {
                                continue;
+                           }
                                int index = line.indexOf("=");
                                String key =line.substring(0,index);
                                String value = line.substring(index+1);
old mode 100644 (file)
new mode 100755 (executable)
index 08203df..681654f
@@ -24,6 +24,8 @@
 */
 package org.tizen.common.util.cache;
 
+import static org.tizen.common.util.SWTUtil.tryDispose;
+
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.RGB;
 import org.tizen.common.util.Assert;
@@ -63,26 +65,15 @@ public class NamedColorCache {
        public void setColor(String key, RGB rgb){
                int index = getIndex(key);
                if(index<0)
+               {
                        return;
-               
-               Color color = colors[index];
-               if(color!=null){
-                       color.dispose();
-                       color=null;
                }
                
+               tryDispose( colors[index] );
                colors[index] = new Color( SWTUtil.getDisplay(), rgb );
        }
        
        public void dispose(){
-               for(int i=0;i<colors.length;i++){
-                       Color color = colors[i];
-                       if(color!=null){
-                               color.dispose();
-                               color=null;
-                       }
-               }
+           tryDispose( colors );
        }
-       
-       
 }