[NUI] fix warnings. add null argument exception and comments.
authoreverLEEst(SangHyeon Lee) <dltkdgus1764@gmail.com>
Fri, 13 May 2022 09:32:53 +0000 (02:32 -0700)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 27 May 2022 06:02:37 +0000 (15:02 +0900)
src/Tizen.NUI.Components/Controls/ScrollableBase.cs

index e478e55..6cba3ea 100755 (executable)
@@ -27,8 +27,11 @@ namespace Tizen.NUI.Components
     /// ScrollEventArgs is a class to record scroll event arguments which will sent to user.
     /// </summary>
     /// <since_tizen> 8 </since_tizen>
+    [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1001: Types that own disposable fields should be disposable.", Justification = "Scroll event is temporarily used for notifying scroll position update, so position will not be disposed during the event processing.")]
     public class ScrollEventArgs : EventArgs
     {
+        // Position class is derived class of Disposable class and they will be implicitly disposed by DisposeQueue,
+        // so that there will be no memory leak.
         private Position position;
         private Position scrollPosition;
 
@@ -1720,6 +1723,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected virtual void Decelerating(float velocity, Animation animation)
         {
+            if (animation == null) throw new ArgumentNullException(nameof(animation));
             // Decelerating using deceleration equation ===========
             //
             // V   : velocity (pixel per millisecond)