From 0f56ef5c625ba775d3771a1ba6979a87a1df1d0e Mon Sep 17 00:00:00 2001 From: samatstarion Date: Mon, 30 Sep 2024 16:54:13 +0200 Subject: [PATCH] [Refactor] list initialization --- uml4net/POCO/Classification/Operation.cs | 6 +++--- uml4net/POCO/CommonStructure/Comment.cs | 2 +- uml4net/POCO/CommonStructure/Constraint.cs | 2 +- uml4net/POCO/Interactions/InteractionConstraint.cs | 2 +- uml4net/POCO/SimpleClassifiers/Reception.cs | 8 ++++---- uml4net/POCO/Values/DurationConstraint.cs | 2 +- uml4net/POCO/Values/IntervalConstraint.cs | 2 +- uml4net/POCO/Values/TimeConstraint.cs | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/uml4net/POCO/Classification/Operation.cs b/uml4net/POCO/Classification/Operation.cs index 29b7e5cd..0b795827 100644 --- a/uml4net/POCO/Classification/Operation.cs +++ b/uml4net/POCO/Classification/Operation.cs @@ -227,7 +227,7 @@ public class Operation : IOperation /// [Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue)] [Implements(implementation: "IBehavioralFeature.Method")] - public List Method { get; set; } + public List Method { get; set; } = new List(); /// /// The ordered set of formal Parameters of this BehavioralFeature. @@ -346,7 +346,7 @@ public class Operation : IOperation [Property(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)] [RedefinedByProperty("BehavioralFeature-ownedParameter")] [Implements(implementation: "IOperation.OwnedParameter")] - public List OwnedParameter { get; set; } + public List OwnedParameter { get; set; } = new List(); /// /// An optional set of Constraints specifying the state of the system when the Operation is completed. @@ -370,7 +370,7 @@ public class Operation : IOperation [Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue)] [RedefinedProperty("BehavioralFeature-raisedException")] [Implements(implementation: "IOperation.RaisedException")] - public List RaisedException { get; set; } + public List RaisedException { get; set; } = new List(); /// /// The Operations that are redefined by this Operation. diff --git a/uml4net/POCO/CommonStructure/Comment.cs b/uml4net/POCO/CommonStructure/Comment.cs index a49de8cd..d2b30a22 100644 --- a/uml4net/POCO/CommonStructure/Comment.cs +++ b/uml4net/POCO/CommonStructure/Comment.cs @@ -54,7 +54,7 @@ public class Comment : IComment /// [Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue)] [Implements(implementation: "IComment.AnnotatedElement")] - public List AnnotatedElement { get; set; } + public List AnnotatedElement { get; set; } = new List(); /// /// Specifies a string that is the comment. diff --git a/uml4net/POCO/CommonStructure/Constraint.cs b/uml4net/POCO/CommonStructure/Constraint.cs index 9eaf56ae..a872f416 100644 --- a/uml4net/POCO/CommonStructure/Constraint.cs +++ b/uml4net/POCO/CommonStructure/Constraint.cs @@ -56,7 +56,7 @@ public class Constraint : IConstraint /// [Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)] [Implements(implementation: "IConstraint.ConstrainedElement")] - public List ConstrainedElement { get; set; } + public List ConstrainedElement { get; set; } = new List(); /// /// Specifies the Namespace that owns the Constraint. diff --git a/uml4net/POCO/Interactions/InteractionConstraint.cs b/uml4net/POCO/Interactions/InteractionConstraint.cs index 593526b7..4f952e46 100644 --- a/uml4net/POCO/Interactions/InteractionConstraint.cs +++ b/uml4net/POCO/Interactions/InteractionConstraint.cs @@ -91,7 +91,7 @@ public class InteractionConstraint : IInteractionConstraint /// [Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)] [Implements(implementation: "IConstraint.ConstrainedElement")] - public List ConstrainedElement { get; set; } + public List ConstrainedElement { get; set; } = new List(); /// /// Indicates the Dependencies that reference this NamedElement as a client." diff --git a/uml4net/POCO/SimpleClassifiers/Reception.cs b/uml4net/POCO/SimpleClassifiers/Reception.cs index 98fd41b0..dfaa3c40 100644 --- a/uml4net/POCO/SimpleClassifiers/Reception.cs +++ b/uml4net/POCO/SimpleClassifiers/Reception.cs @@ -185,7 +185,7 @@ public class Reception : IReception /// [Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue)] [Implements(implementation: "IBehavioralFeature.Method")] - public List Method { get; set; } + public List Method { get; set; } = new List(); /// /// The ordered set of formal Parameters of this BehavioralFeature. @@ -193,7 +193,7 @@ public class Reception : IReception [Property(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)] [Implements(implementation: "IBehavioralFeature.OwnedParameter")] [SubsettedProperty(propertyName: "Namespace.OwnedMember")] - public List OwnedParameter { get; set; } + public List OwnedParameter { get; set; } = new List(); /// /// The ParameterSets owned by this BehavioralFeature. @@ -201,14 +201,14 @@ public class Reception : IReception [Property(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue)] [Implements(implementation: "IBehavioralFeature.OwnedParameterSet")] [SubsettedProperty(propertyName: "Namespace.OwnedMember")] - public List OwnedParameterSet { get; set; } + public List OwnedParameterSet { get; set; } = new List(); /// /// The Types representing exceptions that may be raised during an invocation of this BehavioralFeature. /// [Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue)] [Implements(implementation: "IBehavioralFeature.RaisedException")] - public List RaisedException { get; set; } + public List RaisedException { get; set; } = new List(); /// /// The Classifiers that have this Feature as a feature. diff --git a/uml4net/POCO/Values/DurationConstraint.cs b/uml4net/POCO/Values/DurationConstraint.cs index 7cdc830a..e23e166b 100644 --- a/uml4net/POCO/Values/DurationConstraint.cs +++ b/uml4net/POCO/Values/DurationConstraint.cs @@ -83,7 +83,7 @@ public class DurationConstraint : IDurationConstraint /// [Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)] [Implements(implementation: "IConstraint.ConstrainedElement")] - public List ConstrainedElement { get; set; } + public List ConstrainedElement { get; set; } = new List(); /// /// Specifies the Namespace that owns the Constraint. diff --git a/uml4net/POCO/Values/IntervalConstraint.cs b/uml4net/POCO/Values/IntervalConstraint.cs index f9b79395..52e80dd7 100644 --- a/uml4net/POCO/Values/IntervalConstraint.cs +++ b/uml4net/POCO/Values/IntervalConstraint.cs @@ -91,7 +91,7 @@ public class IntervalConstraint : IIntervalConstraint /// [Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)] [Implements(implementation: "IConstraint.ConstrainedElement")] - public List ConstrainedElement { get; set; } + public List ConstrainedElement { get; set; } = new List(); /// /// Indicates the Dependencies that reference this NamedElement as a client." diff --git a/uml4net/POCO/Values/TimeConstraint.cs b/uml4net/POCO/Values/TimeConstraint.cs index 42e1cdba..431cc75b 100644 --- a/uml4net/POCO/Values/TimeConstraint.cs +++ b/uml4net/POCO/Values/TimeConstraint.cs @@ -91,7 +91,7 @@ public class TimeConstraint : ITimeConstraint /// [Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)] [Implements(implementation: "IConstraint.ConstrainedElement")] - public List ConstrainedElement { get; set; } + public List ConstrainedElement { get; set; } = new List(); /// /// Indicates the Dependencies that reference this NamedElement as a client."