Skip to content

Commit 9fba643

Browse files
committed
C#: Address review comments.
1 parent 2bbd555 commit 9fba643

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/ArrayCreation.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ abstract class ExplicitArrayCreation<SyntaxNode> : ArrayCreation<SyntaxNode> whe
1313
{
1414
protected ExplicitArrayCreation(ExpressionNodeInfo info) : base(info.SetKind(ExprKind.ARRAY_CREATION)) { }
1515

16-
public abstract ArrayTypeSyntax TypeSyntax { get; }
16+
protected abstract ArrayTypeSyntax TypeSyntax { get; }
1717

1818
public abstract InitializerExpressionSyntax Initializer { get; }
1919

2020
protected override void Populate()
2121
{
2222
var child = 0;
23-
bool explicitlySized = false;
23+
var explicitlySized = false;
2424

25-
if(TypeSyntax is null)
25+
if (TypeSyntax is null)
2626
{
2727
cx.ModelError(Syntax, "Array has unexpected type syntax");
2828
}
@@ -33,7 +33,7 @@ protected override void Populate()
3333
{
3434
// Create an expression which simulates the explicit size of the array
3535

36-
if (Initializer != null)
36+
if (!(Initializer is null))
3737
{
3838
// An implicitly-sized array must have an initializer.
3939
// Guard it just in case.
@@ -59,7 +59,7 @@ protected override void Populate()
5959
}
6060
child++;
6161
}
62-
if (Initializer != null)
62+
if (!(Initializer is null))
6363
{
6464
ArrayInitializer.Create(new ExpressionNodeInfo(cx, Initializer, this, -1));
6565
}
@@ -73,7 +73,7 @@ class NormalArrayCreation : ExplicitArrayCreation<ArrayCreationExpressionSyntax>
7373
{
7474
private NormalArrayCreation(ExpressionNodeInfo info) : base(info) { }
7575

76-
public override ArrayTypeSyntax TypeSyntax => Syntax.Type;
76+
protected override ArrayTypeSyntax TypeSyntax => Syntax.Type;
7777

7878
public override InitializerExpressionSyntax Initializer => Syntax.Initializer;
7979

@@ -84,7 +84,7 @@ class StackAllocArrayCreation : ExplicitArrayCreation<StackAllocArrayCreationExp
8484
{
8585
StackAllocArrayCreation(ExpressionNodeInfo info) : base(info) { }
8686

87-
public override ArrayTypeSyntax TypeSyntax => Syntax.Type as ArrayTypeSyntax;
87+
protected override ArrayTypeSyntax TypeSyntax => Syntax.Type as ArrayTypeSyntax;
8888

8989
public override InitializerExpressionSyntax Initializer => Syntax.Initializer;
9090

0 commit comments

Comments
 (0)