[Title] Fix potential bug as sonar report
authorBon-Yong Lee <bonyong.lee@samsung.com>
Wed, 19 Dec 2012 01:39:09 +0000 (10:39 +0900)
committerBon-Yong Lee <bonyong.lee@samsung.com>
Wed, 19 Dec 2012 01:39:09 +0000 (10:39 +0900)
[Desc.]
[Issue]

23 files changed:
org.tizen.common.connection/src/org/tizen/common/connection/ui/ConnectionExplorer.java
org.tizen.common.sdblib/src/org/tizen/sdblib/ICrashReportServiceListener.java [changed mode: 0644->0755]
org.tizen.common.sdblib/src/org/tizen/sdblib/IDevice.java [changed mode: 0644->0755]
org.tizen.common.sdblib/src/org/tizen/sdblib/IShellOutputReceiver.java [changed mode: 0644->0755]
org.tizen.common.sdblib/src/org/tizen/sdblib/LogReceiver.java [changed mode: 0644->0755]
org.tizen.common.sdblib/src/org/tizen/sdblib/MultiLineReceiver.java [changed mode: 0644->0755]
org.tizen.common.sdblib/src/org/tizen/sdblib/SyncService.java [changed mode: 0644->0755]
org.tizen.common.sign/src/org/tizen/common/sign/model/SignatureConstants.java [changed mode: 0644->0755]
org.tizen.common.sign/src/org/tizen/common/sign/signer/TizenSigner.java [changed mode: 0644->0755]
org.tizen.common.sign/src/org/tizen/common/sign/util/SigningProfileUtil.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/AppIdGenerator.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/CommonPlugin.java
org.tizen.common/src/org/tizen/common/IApplicationConfiguration.java
org.tizen.common/src/org/tizen/common/config/ExpressionParser.java
org.tizen.common/src/org/tizen/common/file/VirtualFileHandler.java
org.tizen.common/src/org/tizen/common/rds/ui/preference/PropertyAndPreferencePage.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/ui/view/console/ConsoleManager.java
org.tizen.common/src/org/tizen/common/util/CipherUtil.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/util/FileUtil.java
org.tizen.common/src/org/tizen/common/util/HostUtil.java
org.tizen.common/src/org/tizen/common/util/ISdbCommandHelper.java [changed mode: 0644->0755]
org.tizen.common/src/org/tizen/common/util/PropertyUtil.java
org.tizen.common/src/org/tizen/common/util/cache/FontCache.java

index fec0b83..fd3a53a 100755 (executable)
@@ -28,7 +28,6 @@ package org.tizen.common.connection.ui;
 import java.io.File;
 import java.io.IOException;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
 
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IContributionItem;
old mode 100644 (file)
new mode 100755 (executable)
index 7c3111a..af75387
@@ -38,5 +38,5 @@ public interface ICrashReportServiceListener {
      * @param device The device where the event is created.
      * @param remoteCSPath The absolute path on the given device.
      */
-    public void fileCreated(IDevice device, String remoteCSPath);
+    void fileCreated(IDevice device, String remoteCSPath);
 }
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index c2abe58..11a93d2
@@ -23,13 +23,13 @@ import java.io.IOException;
  */
 public interface IDevice {
     /** Serial number of the first connected emulator. */
-    public final static String FIRST_EMULATOR_SN = "emulator-26100"; //$NON-NLS-1$
+    String FIRST_EMULATOR_SN = "emulator-26100"; //$NON-NLS-1$
     /** Device change bit mask: {@link DeviceState} change. */
-    public static final int CHANGE_STATE = 0x0001;
+    int CHANGE_STATE = 0x0001;
     /** Device change bit mask: {@link Client} list change. */
-    public static final int CHANGE_CLIENT_LIST = 0x0002;
+    int CHANGE_CLIENT_LIST = 0x0002;
     /** Device change bit mask: build info change. */
-    public static final int CHANGE_BUILD_INFO = 0x0004;
+    int CHANGE_BUILD_INFO = 0x0004;
     
     /**
      * The architecture of a device.
@@ -84,38 +84,38 @@ public interface IDevice {
     /**
      * Returns the serial number of the device.
      */
-    public String getSerialNumber();
+    String getSerialNumber();
 
     /**
      * Returns the name of the device.
      */
-    public String getDeviceName();
+    String getDeviceName();
 
-    public DeviceState getState();
+    DeviceState getState();
 
     /**
      * Returns if the device is ready.
      *
      * @return <code>true</code> if {@link #getState()} returns {@link DeviceState#ONLINE}.
      */
-    public boolean isOnline();
+    boolean isOnline();
 
     /**
      * Returns <code>true</code> if the device is an emulator.
      */
-    public boolean isEmulator();
+    boolean isEmulator();
     
     /**
      * Returns {@link Arch} about device architecture.
      */
-    public Arch getArch();
+    Arch getArch();
 
     /**
      * Returns if the device is offline.
      *
      * @return <code>true</code> if {@link #getState()} returns {@link DeviceState#OFFLINE}.
      */
-    public boolean isOffline();
+    boolean isOffline();
 
     /**
      * Returns a {@link SyncService} object to push / pull files to and from the device.
@@ -127,13 +127,13 @@ public interface IDevice {
      * @throws SdbCommandRejectedException if sdb rejects the command
      * @throws IOException if the connection with sdb failed.
      */
-    public SyncService getSyncService()
+    SyncService getSyncService()
             throws TimeoutException, SdbCommandRejectedException, IOException;
 
     /**
      * Returns a {@link FileListingService} for this device.
      */
-    public FileListingService getFileListingService();
+    FileListingService getFileListingService();
 
     /**
      * Executes a shell command on the device and return SdbShellProcess
@@ -143,7 +143,7 @@ public interface IDevice {
      *
      * @see SdbShellProcess
      */
-    public SdbShellProcess executeShellCommand(String command) throws IOException;
+    SdbShellProcess executeShellCommand(String command) throws IOException;
 
     /**
      * Executes a shell command on the device, and sends the result to a <var>receiver</var>
@@ -162,7 +162,7 @@ public interface IDevice {
      * @see #executeShellCommand(String, IShellOutputReceiver, int)
      * @see SdbPreferences#getTimeOut()
      */
-    public void executeShellCommand(String command, IShellOutputReceiver receiver)
+    void executeShellCommand(String command, IShellOutputReceiver receiver)
             throws TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException,
             IOException;
 
@@ -193,7 +193,7 @@ public interface IDevice {
      *
      * @see SdbPreferences#getTimeOut()
      */
-    public void executeShellCommand(String command, IShellOutputReceiver receiver,
+    void executeShellCommand(String command, IShellOutputReceiver receiver,
             int maxTimeToOutputResponse)
             throws TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException,
             IOException;
@@ -208,7 +208,7 @@ public interface IDevice {
      * @throws SdbCommandRejectedException if sdb rejects the command
      * @throws IOException in case of I/O error on the connection.
      */
-    public void runEventLogService(LogReceiver receiver)
+    void runEventLogService(LogReceiver receiver)
             throws TimeoutException, SdbCommandRejectedException, IOException;
 
     /**
@@ -223,7 +223,7 @@ public interface IDevice {
      * @throws SdbCommandRejectedException if sdb rejects the command
      * @throws IOException in case of I/O error on the connection.
      */
-    public void runLogService(String logname, LogReceiver receiver)
+    void runLogService(String logname, LogReceiver receiver)
             throws TimeoutException, SdbCommandRejectedException, IOException;
 
     /**
@@ -236,7 +236,7 @@ public interface IDevice {
      * @throws SdbCommandRejectedException if sdb rejects the command
      * @throws IOException in case of I/O error on the connection.
      */
-    public void createForward(int localPort, int remotePort)
+    void createForward(int localPort, int remotePort)
             throws TimeoutException, SdbCommandRejectedException, IOException;
 
     /**
@@ -249,7 +249,7 @@ public interface IDevice {
      * @throws SdbCommandRejectedException if sdb rejects the command
      * @throws IOException in case of I/O error on the connection.
      */
-    public void removeForward(int localPort, int remotePort)
+    void removeForward(int localPort, int remotePort)
             throws TimeoutException, SdbCommandRejectedException, IOException;
 
     /**
@@ -261,7 +261,7 @@ public interface IDevice {
      * @throws SdbCommandRejectedException if sdb rejects the command
      * @throws IOException in case of I/O error on the connection.
      */
-    public String syncPackageToDevice(String localFilePath)
+    String syncPackageToDevice(String localFilePath)
             throws TimeoutException, SdbCommandRejectedException, IOException;
 
     /**
@@ -274,7 +274,7 @@ public interface IDevice {
      *            performing the action.
      * @throws IOException if file removal failed
      */
-    public void removeRemotePackage(String remoteFilePath)
+    void removeRemotePackage(String remoteFilePath)
             throws TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException,
             IOException;
 }
old mode 100644 (file)
new mode 100755 (executable)
index 76b63e7..4df697e
@@ -27,18 +27,18 @@ public interface IShellOutputReceiver {
      * @param offset The offset at which the new data starts.
      * @param length The length of the new data.
      */
-    public void addOutput(byte[] data, int offset, int length);
+    void addOutput(byte[] data, int offset, int length);
 
     /**
      * Called at the end of the process execution (unless the process was
      * canceled). This allows the receiver to terminate and flush whatever
      * data was not yet processed.
      */
-    public void flush();
+    void flush();
 
     /**
      * Cancel method to stop the execution of the remote shell command.
      * @return true to cancel the execution of the command.
      */
-    public boolean isCancelled();
+    boolean isCancelled();
 };
old mode 100644 (file)
new mode 100755 (executable)
index ac7ec70..234a935
@@ -62,7 +62,7 @@ public final class LogReceiver {
          * Sent when a new {@link LogEntry} has been parsed by the {@link LogReceiver}.
          * @param entry the new log entry.
          */
-        public void newEntry(LogEntry entry);
+        void newEntry(LogEntry entry);
         
         /**
          * Sent when new raw data is coming from the log service.
@@ -70,7 +70,7 @@ public final class LogReceiver {
          * @param offset the offset into the buffer signaling the beginning of the new data.
          * @param length the length of the new data.
          */
-        public void newData(byte[] data, int offset, int length);
+        void newData(byte[] data, int offset, int length);
     }
 
     /** Current {@link LogEntry} being read, before sending it to the listener. */
old mode 100644 (file)
new mode 100755 (executable)
index 9463cfa..979a376
@@ -129,26 +129,26 @@ public final class SyncService {
          * Sent when the transfer starts
          * @param totalWork the total amount of work.
          */
-        public void start(int totalWork);
+        void start(int totalWork);
         /**
          * Sent when the transfer is finished or interrupted.
          */
-        public void stop();
+        void stop();
         /**
          * Sent to query for possible cancellation.
          * @return true if the transfer should be stopped.
          */
-        public boolean isCanceled();
+        boolean isCanceled();
         /**
          * Sent when a sub task is started.
          * @param name the name of the sub task.
          */
-        public void startSubTask(String name);
+        void startSubTask(String name);
         /**
          * Sent when some progress have been made.
          * @param work the amount of work done.
          */
-        public void advance(int work);
+        void advance(int work);
     }
 
     /**
old mode 100644 (file)
new mode 100755 (executable)
index deb698a..93c3430
@@ -2,9 +2,9 @@ package org.tizen.common.sign.model;
 
 public interface SignatureConstants {
     
-    public static final String AUTHOR = "author";
-    public static final String DISTRIBUTOR = "distributor";
-    public static final String DISTRIBUTOR_1ST = DISTRIBUTOR + "1";
-    public static final String DISTRIBUTOR_2ND = DISTRIBUTOR + "2";
+    String AUTHOR = "author";
+    String DISTRIBUTOR = "distributor";
+    String DISTRIBUTOR_1ST = DISTRIBUTOR + "1";
+    String DISTRIBUTOR_2ND = DISTRIBUTOR + "2";
     
 }
old mode 100644 (file)
new mode 100755 (executable)
index 471fb09..4993c13
 
 package org.tizen.common.sign.signer;
 
-import org.tizen.common.core.application.InstallPathConfig;
+import hashsign.HashingSigning;
+
 import org.tizen.common.sign.util.SigningProfileUtil;
-import org.tizen.common.util.FileUtil;
 import org.tizen.common.util.StringUtil;
-import hashsign.HashingSigning;
 
 public class TizenSigner {
 
old mode 100644 (file)
new mode 100755 (executable)
index b665386..ae2189b
@@ -34,9 +34,12 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.security.InvalidKeyException;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.crypto.BadPaddingException;
+import javax.crypto.IllegalBlockSizeException;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -50,8 +53,8 @@ import javax.xml.transform.stream.StreamResult;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -132,7 +135,17 @@ public class SigningProfileUtil
                String tempPass = itemElement.getAttribute(ITEM_ATTR_PASS);
                try {
             tempPass = CipherUtil.getDecryptedString(tempPass);
-        } catch (Exception e) {
+        }
+               catch ( InvalidKeyException e)
+               {
+            logger.error("Exception occurred while decrypting signing password", e);
+        }
+               catch (IllegalBlockSizeException e)
+        {
+            logger.error("Exception occurred while decrypting signing password", e);
+        }
+               catch (BadPaddingException e)
+        {
             logger.error("Exception occurred while decrypting signing password", e);
         }
                final String pass = tempPass;
@@ -357,7 +370,17 @@ public class SigningProfileUtil
             }
             IFile xmlFile = ResourcesPlugin.getWorkspace().getRoot().getFile(location);
             xmlFile.refreshLocal(IResource.DEPTH_INFINITE, null);
-        } catch (Exception e) {
+        }
+        catch ( final ParserConfigurationException e )
+        {
+            org.tizen.common.util.log.Logger.error( e.getMessage(), e );
+        }
+        catch ( final FileNotFoundException e )
+        {
+            org.tizen.common.util.log.Logger.error( e.getMessage(), e );
+        }
+        catch ( final CoreException e )
+        {
             org.tizen.common.util.log.Logger.error( e.getMessage(), e );
         }
     }
@@ -374,7 +397,17 @@ public class SigningProfileUtil
         String pass = new String(item.getPassword());
         try {
             pass = CipherUtil.getEncryptedString(pass);
-        } catch (Exception e) {
+        }
+        catch ( final InvalidKeyException e )
+        {
+            logger.error("Exception occurred while encrypting signing password", e);
+        }
+        catch ( final IllegalBlockSizeException e )
+        {
+            logger.error("Exception occurred while encrypting signing password", e);
+        }
+        catch ( final BadPaddingException e )
+        {
             logger.error("Exception occurred while encrypting signing password", e);
         }
         passAttr.setNodeValue(pass);
@@ -430,7 +463,16 @@ public class SigningProfileUtil
                                 String pass = profileItemElement.getAttribute(SigningProfileUtil.ITEM_ATTR_PASS);
                                 try {
                                     pass = CipherUtil.getDecryptedString(pass);
-                                } catch (Exception e) {
+                                }
+                                catch (InvalidKeyException e)
+                                {
+                                    logger.error("Exception occurred while decrypting signing password", e);
+                                }
+                                catch (IllegalBlockSizeException e)
+                                {
+                                    logger.error("Exception occurred while decrypting signing password", e);
+                                } catch (BadPaddingException e)
+                                {
                                     logger.error("Exception occurred while decrypting signing password", e);
                                 }
                                 profileItem.setPassword(pass.toCharArray());
old mode 100644 (file)
new mode 100755 (executable)
index d526e0f..95d5406
 package org.tizen.common;
 
 import java.math.BigInteger;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 
+import javax.crypto.BadPaddingException;
 import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
 import javax.crypto.KeyGenerator;
+import javax.crypto.NoSuchPaddingException;
 import javax.crypto.SecretKey;
 import javax.crypto.spec.SecretKeySpec;
 
@@ -67,13 +72,12 @@ public class AppIdGenerator implements Factory<String> {
      */
     @Override
     public String create() {
-        String appID = "";
         try {
-            appID = generate();
+            return generate();
         } catch (Exception e) {
-            logger.error( e.toString() );
+            logger.error( "Exception occurred:", e );
+            return "";
         }
-        return appID;
     }
 
     final char[] PSEUDO_CHARS = { '0', '1', '2', '3', '4', '5', '6', '7',
@@ -91,9 +95,6 @@ public class AppIdGenerator implements Factory<String> {
                                             "PRIVT",
                                             "WIDGT"
                                             };
-    // Number of reserved AppID
-    static final int RESERVED_APPID_NUMBER = 3;
-
     private String convertBytesToAlphaNumeric(byte in[], int size) {
         BigInteger randomBigInt = new BigInteger(in).abs();
         StringBuffer out = new StringBuffer(size + 1);
@@ -108,7 +109,9 @@ public class AppIdGenerator implements Factory<String> {
         return ret;
     }
 
-    private byte[] generateRandomBytes(int size) throws Exception {
+    private byte[] generateRandomBytes(int size)
+    throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException
+    {
         SecureRandom random = new SecureRandom();
         KeyGenerator keyGen = KeyGenerator.getInstance("AES");
         keyGen.init(128);
@@ -126,9 +129,11 @@ public class AppIdGenerator implements Factory<String> {
         return cipher.doFinal(bytes);
     }
 
-    private boolean check(String appId) {
-        for (int i = 0; i < RESERVED_APPID_NUMBER; ++ i) {
-            if (appId.indexOf(RESERVED_APPID[i]) == 0) {
+    private boolean check( String appId ) {
+        for ( final String prefix : RESERVED_APPID )
+        {
+            if ( appId.startsWith( prefix ) )
+            {
                 return false;
             }
         }
index 515e810..2ad69fb 100755 (executable)
@@ -28,10 +28,7 @@ package org.tizen.common;
 import org.apache.log4j.spi.RepositorySelector;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
 import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.RegistryFactory;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -47,9 +44,6 @@ import org.tizen.common.ui.page.preference.TizenBasePreferencePage;
 import org.tizen.common.util.DialogUtil;
 import org.tizen.common.util.HostUtil;
 import org.tizen.common.util.OSChecker;
-import org.tizen.common.util.ObjectUtil;
-import org.tizen.common.util.PluginUtil;
-import org.tizen.common.util.StringUtil;
 import org.tizen.common.util.log.Logger;
 import org.tizen.sdblib.CrashReportService;
 import org.tizen.sdblib.ICrashReportServiceListener;
index 89f9035..ff1e3f7 100755 (executable)
@@ -39,7 +39,7 @@ public interface IApplicationConfiguration {
      * \r
      * @return default build configuration\r
      */\r
-    public String getDefaultConfiguration();\r
+    String getDefaultConfiguration();\r
 \r
     /**\r
      * Returns a native's binary name.\r
@@ -48,7 +48,7 @@ public interface IApplicationConfiguration {
      * \r
      * @return a binary name\r
      */\r
-    public String getBinaryName();\r
+    String getBinaryName();\r
 \r
     /**\r
      * Create a appid.\r
@@ -57,7 +57,7 @@ public interface IApplicationConfiguration {
      * \r
      * @return a new appid\r
      */\r
-    public String generateAppId();\r
+    String generateAppId();\r
 \r
     /**\r
      * Return the appid from a manifest.xml.\r
@@ -66,12 +66,12 @@ public interface IApplicationConfiguration {
      * \r
      * @return a appid\r
      */\r
-    public String getAppId();\r
+    String getAppId();\r
 \r
     /**\r
      * Return a project type which is supported by Tizen.\r
      * \r
      * @return a project type\r
      */\r
-    public TizenProjectType getTizenProjectType();\r
+    TizenProjectType getTizenProjectType();\r
 }
\ No newline at end of file
index 2e45198..9595dcb 100755 (executable)
@@ -144,6 +144,9 @@ ExpressionParser
                         break;\r
                     }\r
                     variableWriter.write( (char) ch );\r
+                    break;\r
+                default:\r
+                    break;\r
                 }\r
             }\r
             \r
index a0f4f03..aed4ea7 100755 (executable)
@@ -374,9 +374,13 @@ extends AbstractFileHandler
        getFile(
                final String path
        )
-       throws IOException
        {
                logger.trace( "Path :{}", path );
+               
+               if ( null == path )
+               {
+                   return null;
+               }
 
                final String[] fragments = getCanonicalFragments( path );
 
@@ -391,7 +395,6 @@ extends AbstractFileHandler
                                logger.debug( "in-processing directory :{}", dir );
                                
                                return null;
-//                             throw new IOException( "Can't access " + path );
                        }
                }
 
@@ -775,13 +778,7 @@ extends AbstractFileHandler
        )
        throws IOException
        {
-               File file = null;
-               try {
-                       file = getFile( path );
-               } catch ( Throwable e )
-               {
-                       logger.warn( "Exception :{}", e );
-               }
+               final File file = getFile( path );
                if ( null != file )
                {
                        file.setAttribute( name, value );
old mode 100644 (file)
new mode 100755 (executable)
index cd418e6..aa6efd4
@@ -35,23 +35,9 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Link;
-import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 import org.eclipse.ui.IWorkbenchPropertyPage;
 import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.tizen.common.util.log.Logger;
-
-//import org.eclipse.jdt.core.IJavaProject;
-//import org.eclipse.jdt.core.JavaCore;
-//import org.eclipse.jdt.core.JavaModelException;
-//
-//import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
-//import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
-//import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
-//import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
-//import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
-//import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
-//import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField;
 
 /**
  * Base for project property and preference pages
@@ -208,17 +194,12 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
             openWorkspacePreferences(data);
         } else {
             HashSet<IProject> projectsWithSpecifics= new HashSet<IProject>();
-            try {
-                IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
-//                IProject[] projects = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
-                for (int i= 0; i < projects.length; i++) {
-                    IProject curr= projects[i];
-                    if (hasProjectSpecificOptions(curr.getProject())) {
-                        projectsWithSpecifics.add(curr);
-                    }
+            IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+            for (int i= 0; i < projects.length; i++) {
+                IProject curr= projects[i];
+                if (hasProjectSpecificOptions(curr.getProject())) {
+                    projectsWithSpecifics.add(curr);
                 }
-            } catch (Exception e) {
-                Logger.log(e);
             }
             ProjectSelectionDialog dialog= new ProjectSelectionDialog(getShell(), projectsWithSpecifics);
             if (dialog.open() == Window.OK) {
@@ -305,12 +286,6 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement
     }
 
     /* (non-Javadoc)
-     * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
-     */
-    public void init(IWorkbench workbench) {
-    }
-
-    /* (non-Javadoc)
      * @see org.eclipse.ui.IWorkbenchPropertyPage#getElement()
      */
     public IAdaptable getElement() {
index e2adfd7..125be79 100755 (executable)
@@ -25,6 +25,7 @@
 */
 package org.tizen.common.ui.view.console;
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
 import org.eclipse.jface.text.IDocument;
@@ -90,14 +91,37 @@ implements IConsolePrinter
         this.consoleName = newName;
         Runnable runnable = new Runnable() {
             public void run() {
-                Class<?> cls;
-                Method method;
-                try {
+                Class<?> cls = null;
+                Method method = null;
+                try
+                {
                     cls = Class.forName("org.eclipse.ui.console.AbstractConsole");
                     method = cls.getDeclaredMethod("setName", String.class);
                     method.setAccessible(true);
                     method.invoke(getConsole(), consoleName);
-                } catch (Exception e) {
+                }
+                catch (SecurityException e)
+                {
+                    ConsolePlugin.log(e);
+                }
+                catch (IllegalArgumentException e)
+                {
+                    ConsolePlugin.log(e);
+                }
+                catch (ClassNotFoundException e)
+                {
+                    ConsolePlugin.log(e);
+                }
+                catch (NoSuchMethodException e)
+                {
+                    ConsolePlugin.log(e);
+                }
+                catch (IllegalAccessException e)
+                {
+                    ConsolePlugin.log(e);
+                }
+                catch (InvocationTargetException e)
+                {
                     ConsolePlugin.log(e);
                 }
             }
old mode 100644 (file)
new mode 100755 (executable)
index 2521a44..f15be02
 
 package org.tizen.common.util;
 
+import java.security.InvalidKeyException;
+
+import javax.crypto.BadPaddingException;
 import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
 import javax.crypto.SecretKey;
 import javax.crypto.SecretKeyFactory;
 import javax.crypto.spec.DESedeKeySpec;
@@ -61,13 +65,15 @@ public class CipherUtil {
         }
     }
     
-    private static byte[] decryptByDES(byte[] bytes) throws Exception{
+    private static byte[] decryptByDES(byte[] bytes)
+    throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
         DES_CIPHER.init(Cipher.DECRYPT_MODE, SECRETE_KEY);
         
         return DES_CIPHER.doFinal(bytes);
     }
     
-    private static byte[] encryptByDES(String s) throws Exception {
+    private static byte[] encryptByDES(String s)
+    throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
         DES_CIPHER.init(Cipher.ENCRYPT_MODE, SECRETE_KEY);
         
         return DES_CIPHER.doFinal(s.getBytes());
@@ -79,8 +85,12 @@ public class CipherUtil {
      * @param s cipher message which will be decrypted.
      * @return decrypted plain text.
      * @author Ho Namkoong {@literal <ho.namkoong@samsung.com>} (S-Core)
+     * @throws BadPaddingException 
+     * @throws IllegalBlockSizeException 
+     * @throws InvalidKeyException 
      */
-    public static String getDecryptedString(String s) throws Exception {
+    public static String getDecryptedString(String s)
+    throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
         return new String(decryptByDES(Base64.decode(s)));
     }
     
@@ -90,8 +100,12 @@ public class CipherUtil {
      * @param s plain text which will be encrypted.
      * @return encrypted cipher text.
      * @author Ho Namkoong {@literal <ho.namkoong@samsung.com>} (S-Core)
+     * @throws BadPaddingException 
+     * @throws IllegalBlockSizeException 
+     * @throws InvalidKeyException 
      */
-    public static String getEncryptedString(String s) throws Exception {
+    public static String getEncryptedString(String s)
+    throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
         return new String(Base64.encode(encryptByDES(s)));
     }
 }
index 0e7f335..2d3259c 100755 (executable)
@@ -601,7 +601,9 @@ public class FileUtil {
             do {
                 c = contentsReader.read(chars);
                 if (c == -1)
+                {
                     break;
+                }
                 buffer.append(chars, 0, c);
             } while (c != -1);
             contentsReader.close();
index 44658ad..f9308bd 100755 (executable)
@@ -33,7 +33,6 @@ import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.FileWriter;
old mode 100644 (file)
new mode 100755 (executable)
index 1f08ac6..8d10b2f
@@ -38,11 +38,11 @@ public interface ISdbCommandHelper {
      * @param expectedResult
      * @throws Exception
      */
-    public void runCommand(String command, boolean rCode, String expectedResult) throws Exception;
+    void runCommand(String command, boolean rCode, String expectedResult) throws Exception;
     /**
      * get command's result all line array
      * 
      * @return all result line
      */
-    public String[] getResultLineStrings();
+    String[] getResultLineStrings();
 }
index e10bf19..ac3d016 100755 (executable)
@@ -72,7 +72,8 @@ public abstract class PropertyUtil {
                Properties props = new Properties();
                try {
                        props.load(inputStream);
-               } catch (IOException e) {
+               } catch ( final IOException e ) {
+                   logger.info( "Ignore exception" );
                } finally {
                        tryClose( inputStream );
                }
@@ -83,6 +84,7 @@ public abstract class PropertyUtil {
                try {
                        props.store(outputStream, null);
                } catch (IOException e) {
+                   logger.info( "Ignore exception" );
                        return false;
                } finally {
                        tryClose( outputStream );
@@ -100,6 +102,7 @@ public abstract class PropertyUtil {
                }
                catch ( IOException e )
                {
+            logger.info( "Ignore exception" );
                        return false;
                } finally {
                        tryClose( writer );
index 7a77e61..ec303fd 100755 (executable)
@@ -25,6 +25,8 @@
 */\r
 package org.tizen.common.util.cache;\r
 \r
+import static org.tizen.common.util.ArrayUtil.pickupFirst;\r
+\r
 import java.util.ArrayList;\r
 import java.util.List;\r
 \r
@@ -61,32 +63,30 @@ public class FontCache {
      * @return Font or null on error\r
      */\r
     synchronized public static Font getFont(FontData fd) {\r
-        try {\r
-            boolean disposed = false;\r
-            OneFont toRemove = null;\r
-            for (OneFont of : _existing) {\r
-                if (of.matches(fd)) {\r
-                    if (of.getFont().isDisposed()) {\r
-                        disposed = true;\r
-                        toRemove = of;\r
-                        break;\r
-                    }\r
-\r
-                    return of.getFont(); \r
+        if ( null == fd )\r
+        {\r
+            return null;\r
+        }\r
+        boolean disposed = false;\r
+        OneFont toRemove = null;\r
+        for (OneFont of : _existing) {\r
+            if (of.matches(fd)) {\r
+                if (of.getFont().isDisposed()) {\r
+                    disposed = true;\r
+                    toRemove = of;\r
+                    break;\r
                 }\r
-            }\r
-            if (disposed) {\r
-                _existing.remove(toRemove);\r
-            }\r
 \r
-            OneFont of = new OneFont(fd);\r
-            _existing.add(of);\r
-            return of.getFont();\r
-        } catch (Exception err) {\r
-            err.printStackTrace();\r
+                return of.getFont(); \r
+            }\r
+        }\r
+        if (disposed) {\r
+            _existing.remove(toRemove);\r
         }\r
 \r
-        return null;\r
+        OneFont of = new OneFont(fd);\r
+        _existing.add(of);\r
+        return of.getFont();\r
     }\r
 \r
     synchronized public static int getCount() {\r
@@ -100,20 +100,13 @@ public class FontCache {
      * @return Font or null on error\r
      */\r
     public static Font getFont(Font font) {\r
-        try {\r
-            if (font == null || font.isDisposed())\r
-            {\r
-                return null;\r
-            }\r
-\r
-            FontData fd = font.getFontData()[0];\r
-            return getFont(fd);\r
-\r
-        } catch (Exception err) {\r
-            err.printStackTrace();\r
+        if (font == null || font.isDisposed())\r
+        {\r
+            return null;\r
         }\r
 \r
-        return null;\r
+        FontData fd = pickupFirst( font.getFontData() );\r
+        return getFont(fd);\r
     }\r
 \r
     /**\r
@@ -125,32 +118,29 @@ public class FontCache {
      * @return Font or null on error\r
      */\r
     synchronized public static Font getFont(String fontName, int height, int style) {\r
-        try {\r
-            boolean disposed = false;\r
-            OneFont toRemove = null;\r
-            for (OneFont of : _existing) {\r
-                if (of.getName().equals(fontName) && of.getHeight() == height && of.getStyle() == style) {\r
-                    if (of.getFont().isDisposed()) {\r
-                        disposed = true;\r
-                        toRemove = of;\r
-                        break;\r
-                    }\r
-                    return of.getFont();\r
+        if ( null == fontName )\r
+        {\r
+            return null;\r
+        }\r
+        boolean disposed = false;\r
+        OneFont toRemove = null;\r
+        for (OneFont of : _existing) {\r
+            if (of.getName().equals(fontName) && of.getHeight() == height && of.getStyle() == style) {\r
+                if (of.getFont().isDisposed()) {\r
+                    disposed = true;\r
+                    toRemove = of;\r
+                    break;\r
                 }\r
+                return of.getFont();\r
             }\r
-            if (disposed) {\r
-                _existing.remove(toRemove);\r
-            }\r
-\r
-            OneFont of = new OneFont(fontName, height, style);\r
-            _existing.add(of);\r
-            return of.getFont();\r
         }\r
-        catch (Exception err) {\r
-            err.printStackTrace();\r
+        if (disposed) {\r
+            _existing.remove(toRemove);\r
         }\r
 \r
-        return null;\r
+        OneFont of = new OneFont(fontName, height, style);\r
+        _existing.add(of);\r
+        return of.getFont();\r
     }\r
 }\r
 \r