Fixed some Prevent issues 34/11134/2
authorkh5325.kim <kh5325.kim@samsung.com>
Mon, 21 Oct 2013 05:11:21 +0000 (14:11 +0900)
committerkh5325.kim <kh5325.kim@samsung.com>
Mon, 21 Oct 2013 05:20:27 +0000 (14:20 +0900)
Change-Id: I416cbba308573998db496c44f859768fb9fe50d1
Signed-off-by: kh5325.kim <kh5325.kim@samsung.com>
org.tizen.common.connection/src/org/tizen/common/connection/log/LogPanel.java
org.tizen.common/src/org/tizen/common/classloader/AbstractClassSource.java
org.tizen.common/src/org/tizen/common/core/command/prompter/SWTPrompter.java

index b5978d8..be97ce0 100755 (executable)
@@ -869,12 +869,15 @@ public class LogPanel implements IDeviceChangeListener
                 level = oldTab.getLogLevel();
             }
 
-            for (int i = level.ordinal(); i < bEnable.length; i++)
+            if (level != null)
             {
-                bEnable[i] = true;
-                if (oldTab == null)
+                for (int i = level.ordinal(); i < bEnable.length; i++)
                 {
-                    updateLevelMode(i, true);
+                    bEnable[i] = true;
+                    if (oldTab == null)
+                    {
+                        updateLevelMode(i, true);
+                    }
                 }
             }
         }
index 53ea4bf..3f7b357 100755 (executable)
@@ -49,7 +49,7 @@ implements ClassSource
         final URL url = getResource( path );\r
         logger.trace( "URL :{}", url );\r
         \r
-        return url.openStream();\r
+        return ( url != null ) ? url.openStream() : null;\r
     }\r
 \r
 }\r
index c11348b..66b8e57 100755 (executable)
@@ -65,178 +65,178 @@ SWTPrompter
 extends AbstractPrompter
 implements Prompter
 {
-       
-       /**
-        * Create dialog for user interaction
-        
-        * @param question message for dialog
-        * @param optionNames option names for dialog
-        * @param defaultOptionIndex initial selection for option
-        
-        * @return {@link Dialog} for user selection
-        */
-       protected
-       Dialog
-       createDialog(
-               final String question,
-               final String[] optionNames,
-               final int defaultOptionIndex
-       )
-       {
-               return new MessageDialog(
-                       getActiveShell(),
-                       "Question",
-                       null,
-                       question,
-                       MessageDialog.QUESTION,
-                       optionNames,
-                       defaultOptionIndex
-               )
-               {
-                       protected void buttonPressed( int buttonId )
-                       {
-                               setReturnCode( buttonId );
-                               close();
-                       }
-               };
-       }
+    
+    /**
+     * Create dialog for user interaction
+     * 
+     * @param question message for dialog
+     * @param optionNames option names for dialog
+     * @param defaultOptionIndex initial selection for option
+     * 
+     * @return {@link Dialog} for user selection
+     */
+    protected
+    Dialog
+    createDialog(
+        final String question,
+        final String[] optionNames,
+        final int defaultOptionIndex
+    )
+    {
+        return new MessageDialog(
+            getActiveShell(),
+            "Question",
+            null,
+            question,
+            MessageDialog.QUESTION,
+            optionNames,
+            defaultOptionIndex
+        )
+        {
+            protected void buttonPressed( int buttonId )
+            {
+                setReturnCode( buttonId );
+                close();
+            }
+        };
+    }
 
-       /* (non-Javadoc)
-        * @see org.tizen.common.core.command.Prompter#interact(java.lang.String, org.tizen.common.core.command.prompter.Option[])
-        */
-       @Override
-       public
-       Option
-       interact(
-               final String question,
-               final Option... options
-       )
-       {
-               final HashSet<Option> reducedOptions = new LinkedHashSet<Option>();
-               Option defaultOption = null;
-               final ArrayList<String> optionNames = new ArrayList<String>();
-               for ( final Option option : options )
-               {
-                       if ( reducedOptions.contains( option ) )
-                       {
-                               throw new IllegalArgumentException(
-                                       "Question can't have duplicated choice(s) :" + option
-                               );
-                       }
-                       optionNames.add( option.getName() );
-                       reducedOptions.add( option );
-                       if ( option.isDefault() )
-                       {
-                               if ( null != defaultOption )
-                               {
-                                       throw new IllegalArgumentException(
-                                               "Question must have only one default choice"
-                                       );
-                               }
-                                       
-                               defaultOption = option;
-                       }
-               }
-               final int defaultIndex = optionNames.indexOf( defaultOption.getName() );
-               
-               return exec( new SWTRunner<Option>()
+    /* (non-Javadoc)
+     * @see org.tizen.common.core.command.Prompter#interact(java.lang.String, org.tizen.common.core.command.prompter.Option[])
+     */
+    @Override
+    public
+    Option
+    interact(
+        final String question,
+        final Option... options
+    )
+    {
+        final HashSet<Option> reducedOptions = new LinkedHashSet<Option>();
+        Option defaultOption = null;
+        final ArrayList<String> optionNames = new ArrayList<String>();
+        for ( final Option option : options )
         {
-                   /* (non-Javadoc)
-                    * @see org.tizen.common.util.SWTRunner#process()
-                    */
-                   public Option process() {
-                       final Dialog dialog = createDialog( question, optionNames.toArray( new String[0] ), defaultIndex );
-                       dialog.open();
-                       return options[dialog.getReturnCode()];
-                   }
-               } );
-       }
+            if ( reducedOptions.contains( option ) )
+            {
+                throw new IllegalArgumentException(
+                    "Question can't have duplicated choice(s) :" + option
+                );
+            }
+            optionNames.add( option.getName() );
+            reducedOptions.add( option );
+            if ( option.isDefault() )
+            {
+                if ( null != defaultOption )
+                {
+                    throw new IllegalArgumentException(
+                        "Question must have only one default choice"
+                    );
+                }
+                    
+                defaultOption = option;
+            }
+        }
+        final int defaultIndex = ( defaultOption != null ) ? optionNames.indexOf( defaultOption.getName() ) : 0;
+        
+        return exec( new SWTRunner<Option>()
+        {
+            /* (non-Javadoc)
+             * @see org.tizen.common.util.SWTRunner#process()
+             */
+            public Option process() {
+                final Dialog dialog = createDialog( question, optionNames.toArray( new String[0] ), defaultIndex );
+                dialog.open();
+                return options[dialog.getReturnCode()];
+            }
+        } );
+    }
 
-       /* (non-Javadoc)
-        * @see org.tizen.common.core.command.Prompter#notify(java.lang.String, java.lang.Object[])
-        */
-       @Override
-       public void
-       notify(
-               final String message
-       )
-       {
-               asyncExec( new Runnable() {
-                       
-                       /* (non-Javadoc)
-                        * @see java.lang.Runnable#run()
-                        */
-                       @Override
-                       public void run() {
-                               NotifierDialog.notify( "Notify", message, NotificationType.INFO );
-                       }
-               } );
-       }
+    /* (non-Javadoc)
+     * @see org.tizen.common.core.command.Prompter#notify(java.lang.String, java.lang.Object[])
+     */
+    @Override
+    public void
+    notify(
+        final String message
+    )
+    {
+        asyncExec( new Runnable() {
+            
+            /* (non-Javadoc)
+             * @see java.lang.Runnable#run()
+             */
+            @Override
+            public void run() {
+                NotifierDialog.notify( "Notify", message, NotificationType.INFO );
+            }
+        } );
+    }
 
-       /* (non-Javadoc)
-        * @see org.tizen.common.core.command.Prompter#cancel()
-        */
-       @Override
-       public void cancel() {
-       }
+    /* (non-Javadoc)
+     * @see org.tizen.common.core.command.Prompter#cancel()
+     */
+    @Override
+    public void cancel() {
+    }
 
-       /* (non-Javadoc)
-        * @see org.tizen.common.core.command.Prompter#password(java.lang.String)
-        */
-       @Override
-       public
-       Object password(
-               final String message
-       )
-       {
-               return exec( new SWTRunner<char[]>()
+    /* (non-Javadoc)
+     * @see org.tizen.common.core.command.Prompter#password(java.lang.String)
+     */
+    @Override
+    public
+    Object password(
+        final String message
+    )
+    {
+        return exec( new SWTRunner<char[]>()
         {
-                       /* (non-Javadoc)
-                        * @see java.lang.Runnable#run()
-                        */
-                       @Override
-                       public char[] process()
-                       {
-                           final PasswordInputDialog dialog =
-                               new PasswordInputDialog( "Password Input Dialog", message );
-                           
-                               dialog.open();
-                               
-                               if ( IDialogConstants.OK_ID != dialog.getReturnCode() )
-                               {
-                                   return null;
-                               }
-                               
-                               return trim( dialog.getValue() ).toCharArray();
-                       }
-               } );
-               
-               
-               
-       }
+            /* (non-Javadoc)
+             * @see java.lang.Runnable#run()
+             */
+            @Override
+            public char[] process()
+            {
+                final PasswordInputDialog dialog =
+                    new PasswordInputDialog( "Password Input Dialog", message );
+                
+                dialog.open();
+                
+                if ( IDialogConstants.OK_ID != dialog.getReturnCode() )
+                {
+                    return null;
+                }
+                
+                return trim( dialog.getValue() ).toCharArray();
+            }
+        } );
+        
+        
+        
+    }
 
-       /* (non-Javadoc)
-        * @see org.tizen.common.core.command.Prompter#error(java.lang.String, java.lang.Object[])
-        */
-       @Override
-       public
-       void
-       error(
-               final String message
-       )
-       {
-               syncExec( new Runnable() {
-                       
-                       /* (non-Javadoc)
-                        * @see java.lang.Runnable#run()
-                        */
-                       @Override
-                       public void run() {
-                               MessageDialog.openError( getActiveShell(), "Error", message );
-                       }
-               } );
-                       
-       }
+    /* (non-Javadoc)
+     * @see org.tizen.common.core.command.Prompter#error(java.lang.String, java.lang.Object[])
+     */
+    @Override
+    public
+    void
+    error(
+        final String message
+    )
+    {
+        syncExec( new Runnable() {
+            
+            /* (non-Javadoc)
+             * @see java.lang.Runnable#run()
+             */
+            @Override
+            public void run() {
+                MessageDialog.openError( getActiveShell(), "Error", message );
+            }
+        } );
+            
+    }
 
     /* (non-Javadoc)
      * @see org.tizen.common.core.command.Prompter#batch(java.util.Collection)