From 589e83b4ceb42a685e70cc4b85a82b2a4729b281 Mon Sep 17 00:00:00 2001 From: Son Hyunjun Date: Sat, 31 Mar 2012 15:24:00 +0900 Subject: [PATCH] [Title] modify error check in about dialog, ImageRegistry [Type] Feature [Module] Skin [Priority] Minor [CQ#] [Redmine#] [Problem] [Cause] [Solution] Change-Id: I2818a0ef5604e5a152d088417885ad4f5c2f5c38 --- .../tizen/emulator/skin/dialog/AboutDialog.java | 56 ++++++++++------------ .../tizen/emulator/skin/image/ImageRegistry.java | 6 +++ 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java index ea39ac1..1f45c51 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java @@ -92,43 +92,23 @@ public class AboutDialog extends SkinDialog { titleLabel.setFont( font ); font.dispose(); - boolean noInformation = false; Properties properties = getProperties(); - if ( null == getProperties() ) { - noInformation = true; - } - - String defaultInformation = "No information"; Text versionText = new Text( composite, SWT.NONE ); - if( noInformation ) { - versionText.setText( "Version" + " : " + defaultInformation ); - }else { - versionText.setText( "Version" + " : Tizen SDK " + getValue( properties, PROP_KEY_VERSION ) ); - } + String version = getValue( properties, PROP_KEY_VERSION ); + versionText.setText( "Version" + " : Tizen SDK " + version ); versionText.setEditable( false ); versionText.setBackground( shell.getDisplay().getSystemColor( SWT.COLOR_WIDGET_BACKGROUND ) ); Text buildText = new Text( composite, SWT.NONE ); - if( noInformation ) { - buildText.setText( "Build time" + " : " + defaultInformation ); - }else { - String time = properties.getProperty( PROP_KEY_BUILD_TIME ); - if( StringUtil.isEmpty( time ) ) { - buildText.setText( "Build time" + " : " + "Not identified" ); - }else { - buildText.setText( "Build time" + " : " + time + " (GMT)" ); - } - } + String time = getValue( properties, PROP_KEY_BUILD_TIME ); + buildText.setText( "Build time" + " : " + time + " (GMT)" ); buildText.setEditable( false ); buildText.setBackground( shell.getDisplay().getSystemColor( SWT.COLOR_WIDGET_BACKGROUND ) ); Text gitText = new Text( composite, SWT.NONE ); - if( noInformation ) { - gitText.setText( "Git version" + " : " + defaultInformation ); - }else { - gitText.setText( "Git version" + " : " + getValue( properties, PROP_KEY_GIT_VERSION ) ); - } + String gitVersion = getValue( properties, PROP_KEY_GIT_VERSION ); + gitText.setText( "Git version" + " : " + gitVersion ); gitText.setEditable( false ); gitText.setBackground( shell.getDisplay().getSystemColor( SWT.COLOR_WIDGET_BACKGROUND ) ); @@ -137,12 +117,28 @@ public class AboutDialog extends SkinDialog { } private String getValue( Properties properties, String key ) { - String property = properties.getProperty( key ); - if( StringUtil.isEmpty( property ) ) { - return "Not identified"; + + if( null != properties ) { + + String property = properties.getProperty( key ); + + if( !StringUtil.isEmpty( property ) ) { + + if( !property.contains( key ) ) { + return property; + }else { + // ex) '${build_git_commit}' is default expression in build.xml + return "Not identified"; + } + + }else { + return "Not identified"; + } + }else { - return property; + return "Not identified"; } + } @Override diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/ImageRegistry.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/image/ImageRegistry.java index c7cd655..8bfc311 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/image/ImageRegistry.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/image/ImageRegistry.java @@ -166,6 +166,12 @@ public class ImageRegistry { String skinPath = getSkinPath( argSkinPath, resolutionWidth, resolutionHeight ); RotationsType rotations = dbiContents.getRotations(); + + if( null == rotations ) { + logger.severe( "Fail to loading rotations element from dbi." ); + return; + } + List rotationList = rotations.getRotation(); for ( RotationType rotation : rotationList ) { -- 2.7.4