Skip to content

Commit 8df7670

Browse files
authored
[docs] Nullable annotations (open-telemetry#5900)
1 parent f3cd0e7 commit 8df7670

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

docs/logs/redaction/MyRedactionProcessor.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,33 @@ public override void OnEnd(LogRecord logRecord)
1515
}
1616
}
1717

18-
internal sealed class MyClassWithRedactionEnumerator : IReadOnlyList<KeyValuePair<string, object>>
18+
internal sealed class MyClassWithRedactionEnumerator : IReadOnlyList<KeyValuePair<string, object?>>
1919
{
20-
private readonly IReadOnlyList<KeyValuePair<string, object>> state;
20+
private readonly IReadOnlyList<KeyValuePair<string, object?>> state;
2121

22-
public MyClassWithRedactionEnumerator(IReadOnlyList<KeyValuePair<string, object>> state)
22+
public MyClassWithRedactionEnumerator(IReadOnlyList<KeyValuePair<string, object?>> state)
2323
{
2424
this.state = state;
2525
}
2626

2727
public int Count => this.state.Count;
2828

29-
public KeyValuePair<string, object> this[int index]
29+
public KeyValuePair<string, object?> this[int index]
3030
{
3131
get
3232
{
3333
var item = this.state[index];
3434
var entryVal = item.Value?.ToString();
3535
if (entryVal != null && entryVal.Contains("<secret>"))
3636
{
37-
return new KeyValuePair<string, object>(item.Key, "newRedactedValueHere");
37+
return new KeyValuePair<string, object?>(item.Key, "newRedactedValueHere");
3838
}
3939

4040
return item;
4141
}
4242
}
4343

44-
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
44+
public IEnumerator<KeyValuePair<string, object?>> GetEnumerator()
4545
{
4646
for (var i = 0; i < this.Count; i++)
4747
{

docs/logs/redaction/redaction.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<!-- this is temporary. will remove in future PR. -->
4-
<Nullable>disable</Nullable>
5-
</PropertyGroup>
62
<ItemGroup>
73
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
84
</ItemGroup>

docs/trace/customizing-the-sdk/customizing-the-sdk.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<!-- this is temporary. will remove in future PR. -->
4-
<Nullable>disable</Nullable>
5-
</PropertyGroup>
62
<ItemGroup>
73
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
84
</ItemGroup>

0 commit comments

Comments
 (0)