From b8859eff552e69bd0461ea001135b2c1b98be703 Mon Sep 17 00:00:00 2001 From: "kh5325.kim" Date: Mon, 21 Oct 2013 14:11:21 +0900 Subject: [PATCH] Fixed some Prevent issues Change-Id: I416cbba308573998db496c44f859768fb9fe50d1 Signed-off-by: kh5325.kim --- .../org/tizen/common/connection/log/LogPanel.java | 11 +- .../common/classloader/AbstractClassSource.java | 2 +- .../common/core/command/prompter/SWTPrompter.java | 330 ++++++++++----------- 3 files changed, 173 insertions(+), 170 deletions(-) diff --git a/org.tizen.common.connection/src/org/tizen/common/connection/log/LogPanel.java b/org.tizen.common.connection/src/org/tizen/common/connection/log/LogPanel.java index b5978d8..be97ce0 100755 --- a/org.tizen.common.connection/src/org/tizen/common/connection/log/LogPanel.java +++ b/org.tizen.common.connection/src/org/tizen/common/connection/log/LogPanel.java @@ -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); + } } } } diff --git a/org.tizen.common/src/org/tizen/common/classloader/AbstractClassSource.java b/org.tizen.common/src/org/tizen/common/classloader/AbstractClassSource.java index 53ea4bf..3f7b357 100755 --- a/org.tizen.common/src/org/tizen/common/classloader/AbstractClassSource.java +++ b/org.tizen.common/src/org/tizen/common/classloader/AbstractClassSource.java @@ -49,7 +49,7 @@ implements ClassSource final URL url = getResource( path ); logger.trace( "URL :{}", url ); - return url.openStream(); + return ( url != null ) ? url.openStream() : null; } } diff --git a/org.tizen.common/src/org/tizen/common/core/command/prompter/SWTPrompter.java b/org.tizen.common/src/org/tizen/common/core/command/prompter/SWTPrompter.java index c11348b..66b8e57 100755 --- a/org.tizen.common/src/org/tizen/common/core/command/prompter/SWTPrompter.java +++ b/org.tizen.common/src/org/tizen/common/core/command/prompter/SWTPrompter.java @@ -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