Skip to content

Commit

Permalink
[Refactor] list initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
samatstariongroup committed Sep 30, 2024
1 parent 8fdbb33 commit 0f56ef5
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions uml4net/POCO/Classification/Operation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public class Operation : IOperation
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue)]
[Implements(implementation: "IBehavioralFeature.Method")]
public List<IBehavior> Method { get; set; }
public List<IBehavior> Method { get; set; } = new List<IBehavior>();

/// <summary>
/// The ordered set of formal Parameters of this BehavioralFeature.
Expand Down Expand Up @@ -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<IParameter> OwnedParameter { get; set; }
public List<IParameter> OwnedParameter { get; set; } = new List<IParameter>();

/// <summary>
/// An optional set of Constraints specifying the state of the system when the Operation is completed.
Expand All @@ -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<IType> RaisedException { get; set; }
public List<IType> RaisedException { get; set; } = new List<IType>();

/// <summary>
/// The Operations that are redefined by this Operation.
Expand Down
2 changes: 1 addition & 1 deletion uml4net/POCO/CommonStructure/Comment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class Comment : IComment
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue)]
[Implements(implementation: "IComment.AnnotatedElement")]
public List<IElement> AnnotatedElement { get; set; }
public List<IElement> AnnotatedElement { get; set; } = new List<IElement>();

/// <summary>
/// Specifies a string that is the comment.
Expand Down
2 changes: 1 addition & 1 deletion uml4net/POCO/CommonStructure/Constraint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class Constraint : IConstraint
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)]
[Implements(implementation: "IConstraint.ConstrainedElement")]
public List<IElement> ConstrainedElement { get; set; }
public List<IElement> ConstrainedElement { get; set; } = new List<IElement>();

/// <summary>
/// Specifies the Namespace that owns the Constraint.
Expand Down
2 changes: 1 addition & 1 deletion uml4net/POCO/Interactions/InteractionConstraint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class InteractionConstraint : IInteractionConstraint
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)]
[Implements(implementation: "IConstraint.ConstrainedElement")]
public List<IElement> ConstrainedElement { get; set; }
public List<IElement> ConstrainedElement { get; set; } = new List<IElement>();

/// <summary>
/// Indicates the Dependencies that reference this NamedElement as a client."
Expand Down
8 changes: 4 additions & 4 deletions uml4net/POCO/SimpleClassifiers/Reception.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,30 +185,30 @@ public class Reception : IReception
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue)]
[Implements(implementation: "IBehavioralFeature.Method")]
public List<IBehavior> Method { get; set; }
public List<IBehavior> Method { get; set; } = new List<IBehavior>();

/// <summary>
/// The ordered set of formal Parameters of this BehavioralFeature.
/// </summary>
[Property(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)]
[Implements(implementation: "IBehavioralFeature.OwnedParameter")]
[SubsettedProperty(propertyName: "Namespace.OwnedMember")]
public List<IParameter> OwnedParameter { get; set; }
public List<IParameter> OwnedParameter { get; set; } = new List<IParameter>();

/// <summary>
/// The ParameterSets owned by this BehavioralFeature.
/// </summary>
[Property(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue)]
[Implements(implementation: "IBehavioralFeature.OwnedParameterSet")]
[SubsettedProperty(propertyName: "Namespace.OwnedMember")]
public List<IParameterSet> OwnedParameterSet { get; set; }
public List<IParameterSet> OwnedParameterSet { get; set; } = new List<IParameterSet>();

/// <summary>
/// The Types representing exceptions that may be raised during an invocation of this BehavioralFeature.
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue)]
[Implements(implementation: "IBehavioralFeature.RaisedException")]
public List<IType> RaisedException { get; set; }
public List<IType> RaisedException { get; set; } = new List<IType>();

/// <summary>
/// The Classifiers that have this Feature as a feature.
Expand Down
2 changes: 1 addition & 1 deletion uml4net/POCO/Values/DurationConstraint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class DurationConstraint : IDurationConstraint
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)]
[Implements(implementation: "IConstraint.ConstrainedElement")]
public List<IElement> ConstrainedElement { get; set; }
public List<IElement> ConstrainedElement { get; set; } = new List<IElement>();

/// <summary>
/// Specifies the Namespace that owns the Constraint.
Expand Down
2 changes: 1 addition & 1 deletion uml4net/POCO/Values/IntervalConstraint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class IntervalConstraint : IIntervalConstraint
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)]
[Implements(implementation: "IConstraint.ConstrainedElement")]
public List<IElement> ConstrainedElement { get; set; }
public List<IElement> ConstrainedElement { get; set; } = new List<IElement>();

/// <summary>
/// Indicates the Dependencies that reference this NamedElement as a client."
Expand Down
2 changes: 1 addition & 1 deletion uml4net/POCO/Values/TimeConstraint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class TimeConstraint : ITimeConstraint
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true)]
[Implements(implementation: "IConstraint.ConstrainedElement")]
public List<IElement> ConstrainedElement { get; set; }
public List<IElement> ConstrainedElement { get; set; } = new List<IElement>();

/// <summary>
/// Indicates the Dependencies that reference this NamedElement as a client."
Expand Down

0 comments on commit 0f56ef5

Please sign in to comment.