From: Bowon Ryu Date: Wed, 16 Dec 2020 05:36:27 +0000 (+0900) Subject: [NUI] Fix build warning CA1820 X-Git-Tag: accepted/tizen/unified/20210219.040944~156 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15e51d09e8106da490c0f715f4128c673f9fd464;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Fix build warning CA1820 CA1820: Test for empty strings using string length Signed-off-by: Bowon Ryu --- diff --git a/src/Tizen.NUI/src/internal/NUICoreBackend.cs b/src/Tizen.NUI/src/internal/NUICoreBackend.cs index 3ec90d6..6562101 100755 --- a/src/Tizen.NUI/src/internal/NUICoreBackend.cs +++ b/src/Tizen.NUI/src/internal/NUICoreBackend.cs @@ -138,7 +138,7 @@ namespace Tizen.NUI NDalicPINVOKE.SWIGStringHelper.RegistCallback(); args[0] = Tizen.Applications.Application.Current.ApplicationInfo.ExecutablePath; - if ("" == args[0]) + if (string.IsNullOrEmpty(args[0])) { args[0] = this.GetType().Assembly.FullName; } diff --git a/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs b/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs index bfe97d7..c70d268 100755 --- a/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs +++ b/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs @@ -207,7 +207,7 @@ namespace Tizen.NUI.Xaml } var namespaceUri = reader.NamespaceURI; - if (reader.LocalName.Contains(".") && namespaceUri == "") + if (reader.LocalName.Contains(".") && string.IsNullOrEmpty(namespaceUri)) namespaceUri = ((IXmlNamespaceResolver)reader).LookupNamespace(""); var propertyName = new XmlName(namespaceUri, reader.LocalName); diff --git a/src/Tizen.NUI/src/internal/XamlBinding/BindingExpression.cs b/src/Tizen.NUI/src/internal/XamlBinding/BindingExpression.cs index e754104..f1a7642 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/BindingExpression.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/BindingExpression.cs @@ -205,7 +205,7 @@ namespace Tizen.NUI.Binding IEnumerable GetPart(string part) { part = part.Trim(); - if (part == string.Empty) + if (string.IsNullOrEmpty(part)) throw new FormatException("Path contains an empty part"); BindingExpressionPart indexer = null; diff --git a/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageView.cs index 26c195d..07117ca 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageView.cs @@ -170,7 +170,7 @@ namespace Tizen.NUI.BaseComponents { tlog.Fatal(tag, $"[VAV START[ [{GetId()}] CurrentFrame SET"); - if (mResourceURL == null || mResourceURL == String.Empty) + if (string.IsNullOrEmpty(mResourceURL)) { throw new InvalidOperationException("Resource Url not yet Set"); } @@ -338,7 +338,7 @@ namespace Tizen.NUI.BaseComponents { tlog.Fatal(tag, $"[VAV START[ [{GetId()}] AnimationState={AnimationState}, PlayState={PlayState}"); - if (mResourceURL == null || mResourceURL == String.Empty) + if (string.IsNullOrEmpty(mResourceURL)) { throw new InvalidOperationException("Resource Url not yet Set"); } @@ -381,7 +381,7 @@ namespace Tizen.NUI.BaseComponents { tlog.Fatal(tag, $"[VAV START[ [{GetId()}] AnimationState={AnimationState}, PlayState={PlayState}"); - if (mResourceURL == null || mResourceURL == String.Empty) + if (string.IsNullOrEmpty(mResourceURL)) { throw new InvalidOperationException("Resource Url not yet Set"); } @@ -406,7 +406,7 @@ namespace Tizen.NUI.BaseComponents { tlog.Fatal(tag, $"[VAV START[ [{GetId()}] endAction:({endAction}), PlayState={PlayState}"); - if (mResourceURL == null || mResourceURL == String.Empty) + if (string.IsNullOrEmpty(mResourceURL)) { throw new InvalidOperationException("Resource Url not yet Set"); } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index fa34110..e800cd8 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -1198,7 +1198,7 @@ namespace Tizen.NUI.BaseComponents alphaMaskUrl?.Dispose(); } - if (_resourceUrl == "") + if (string.IsNullOrEmpty(_resourceUrl)) { PropertyValue resourceUrl = new PropertyValue(_resourceUrl); imageMap?.Insert(ImageVisualProperty.URL, resourceUrl);