Skip to content

Commit 0129b42

Browse files
committed
C#: Address review comments.
1 parent 7df90f1 commit 0129b42

File tree

26 files changed

+71
-75
lines changed

26 files changed

+71
-75
lines changed

csharp/extractor/Semmle.Extraction.CIL/Entities/Method.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ protected Method(GenericContext gc) : base(gc.cx)
4343
public virtual IList<LocalVariable> LocalVariables => throw new NotImplementedException();
4444
public IList<Parameter> Parameters { get; private set; }
4545

46-
public override void WriteId(TextWriter trapFile) => MakeMethodId(trapFile, DeclaringType, NameLabel);
46+
public override void WriteId(TextWriter trapFile) => WriteMethodId(trapFile, DeclaringType, NameLabel);
4747

4848
public abstract string NameLabel { get; }
4949

50-
internal protected void MakeMethodId(TextWriter trapFile, Type parent, string methodName)
50+
internal protected void WriteMethodId(TextWriter trapFile, Type parent, string methodName)
5151
{
5252
signature.ReturnType.WriteId(trapFile, this);
5353
trapFile.Write(' ');

csharp/extractor/Semmle.Extraction.CIL/Entities/Type.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ public virtual IEnumerable<Type> ThisTypeArguments
131131
}
132132

133133
/// <summary>
134-
/// Gets the assembly identifier of this type.
134+
/// Writes the assembly identifier of this type.
135135
/// </summary>
136136
public abstract void WriteAssemblyPrefix(TextWriter trapFile);
137137

138138
/// <summary>
139-
/// Gets the ID part to be used in a method.
139+
/// Writes the ID part to be used in a method ID.
140140
/// </summary>
141141
/// <param name="inContext">
142142
/// Whether we should output the context prefix of type parameters.

csharp/extractor/Semmle.Extraction.CSharp/Entities/Accessor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ IPropertySymbol PropertySymbol
3434
public override void Populate(TextWriter trapFile)
3535
{
3636
PopulateMethod(trapFile);
37-
ExtractModifiers(trapFile);
38-
ContainingType.ExtractGenerics();
37+
PopulateModifiers(trapFile);
38+
ContainingType.PopulateGenerics();
3939

4040
var prop = PropertySymbol;
4141
if (prop == null)

csharp/extractor/Semmle.Extraction.CSharp/Entities/Constructor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public class Constructor : Method
1717
public override void Populate(TextWriter trapFile)
1818
{
1919
PopulateMethod(trapFile);
20-
ExtractModifiers(trapFile);
21-
ContainingType.ExtractGenerics();
20+
PopulateModifiers(trapFile);
21+
ContainingType.PopulateGenerics();
2222

2323
trapFile.constructors(this, symbol.ContainingType.Name, ContainingType, (Constructor)OriginalDefinition);
2424
trapFile.constructor_location(this, Location);

csharp/extractor/Semmle.Extraction.CSharp/Entities/Destructor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class Destructor : Method
1111
public override void Populate(TextWriter trapFile)
1212
{
1313
PopulateMethod(trapFile);
14-
ExtractModifiers(trapFile);
15-
ContainingType.ExtractGenerics();
14+
PopulateModifiers(trapFile);
15+
ContainingType.PopulateGenerics();
1616

1717
trapFile.destructors(this, string.Format("~{0}", symbol.ContainingType.Name), ContainingType, OriginalDefinition(Context, this, symbol));
1818
trapFile.destructor_location(this, Location);

csharp/extractor/Semmle.Extraction.CSharp/Entities/Event.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public override void WriteId(TextWriter trapFile)
2121

2222
public override void Populate(TextWriter trapFile)
2323
{
24-
ExtractNullability(trapFile, symbol.NullableAnnotation);
24+
PopulateNullability(trapFile, symbol.NullableAnnotation);
2525

2626
var type = Type.Create(Context, symbol.Type);
2727
trapFile.events(this, symbol.GetName(), ContainingType, type.TypeRef, Create(Context, symbol.OriginalDefinition));
@@ -35,7 +35,7 @@ public override void Populate(TextWriter trapFile)
3535
if (!(remover is null))
3636
Method.Create(Context, remover);
3737

38-
ExtractModifiers(trapFile);
38+
PopulateModifiers(trapFile);
3939
BindComments();
4040

4141
var declSyntaxReferences = IsSourceDeclaration

csharp/extractor/Semmle.Extraction.CSharp/Entities/EventAccessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class EventAccessor : Accessor
1616
public override void Populate(TextWriter trapFile)
1717
{
1818
PopulateMethod(trapFile);
19-
ContainingType.ExtractGenerics();
19+
ContainingType.PopulateGenerics();
2020

2121
var @event = EventSymbol;
2222
if (@event == null)

csharp/extractor/Semmle.Extraction.CSharp/Entities/Expression.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected sealed override void Populate(TextWriter trapFile)
5252
if (Info.ExprValue is string value)
5353
trapFile.expr_value(this, value);
5454

55-
Type.Type.ExtractGenerics();
55+
Type.Type.PopulateGenerics();
5656
}
5757

5858
public override Microsoft.CodeAnalysis.Location ReportingLocation => Location.symbol;

csharp/extractor/Semmle.Extraction.CSharp/Entities/Field.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ class Field : CachedSymbol<IFieldSymbol>, IExpressionParentEntity
2727

2828
public override void Populate(TextWriter trapFile)
2929
{
30-
ExtractMetadataHandle(trapFile);
31-
ExtractAttributes();
32-
ContainingType.ExtractGenerics();
33-
ExtractNullability(trapFile, symbol.NullableAnnotation);
30+
PopulateMetadataHandle(trapFile);
31+
PopulateAttributes();
32+
ContainingType.PopulateGenerics();
33+
PopulateNullability(trapFile, symbol.NullableAnnotation);
3434

3535
Field unboundFieldKey = Field.Create(Context, symbol.OriginalDefinition);
3636
trapFile.fields(this, (symbol.IsConst ? 2 : 1), symbol.Name, ContainingType, Type.Type.TypeRef, unboundFieldKey);
3737

38-
ExtractModifiers(trapFile);
38+
PopulateModifiers(trapFile);
3939

4040
if (symbol.IsVolatile)
4141
Modifier.HasModifier(Context, trapFile, this, "volatile");

csharp/extractor/Semmle.Extraction.CSharp/Entities/Indexer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected Indexer(Context cx, IPropertySymbol init)
1414

1515
public override void Populate(TextWriter trapFile)
1616
{
17-
ExtractNullability(trapFile, symbol.NullableAnnotation);
17+
PopulateNullability(trapFile, symbol.NullableAnnotation);
1818

1919
var type = Type.Create(Context, symbol.Type);
2020
trapFile.indexers(this, symbol.GetName(useMetadataName: true), ContainingType, type.TypeRef, OriginalDefinition);
@@ -50,7 +50,7 @@ public override void Populate(TextWriter trapFile)
5050
}
5151
}
5252

53-
ExtractModifiers(trapFile);
53+
PopulateModifiers(trapFile);
5454
BindComments();
5555

5656
var declSyntaxReferences = IsSourceDeclaration

0 commit comments

Comments
 (0)