From f41eaf1b07a6ebf77f1f60fb41a1d6cbc558bd56 Mon Sep 17 00:00:00 2001 From: Thibaud Desodt Date: Tue, 17 Oct 2017 20:58:23 +0200 Subject: [PATCH] Added comments to ignore remaining warnings --- src/Serilog/Capturing/PropertyValueConverter.cs | 1 + src/Serilog/Context/LogContext.cs | 2 ++ src/Serilog/Core/Pipeline/MessageTemplateCache.cs | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/Serilog/Capturing/PropertyValueConverter.cs b/src/Serilog/Capturing/PropertyValueConverter.cs index d244271c9..3744b50e8 100644 --- a/src/Serilog/Capturing/PropertyValueConverter.cs +++ b/src/Serilog/Capturing/PropertyValueConverter.cs @@ -247,6 +247,7 @@ bool TryConvertValueTuple(object value, Destructuring destructuring, Type valueT definition == typeof(ValueTuple<,,,,>) || definition == typeof(ValueTuple<,,,,,>) || definition == typeof(ValueTuple<,,,,,,>)) #else + // ReSharper disable once PossibleNullReferenceException var defn = definition.FullName; if (defn == "System.ValueTuple`1" || defn == "System.ValueTuple`2" || defn == "System.ValueTuple`3" || defn == "System.ValueTuple`4" || diff --git a/src/Serilog/Context/LogContext.cs b/src/Serilog/Context/LogContext.cs index 7baaa9038..1be79e705 100644 --- a/src/Serilog/Context/LogContext.cs +++ b/src/Serilog/Context/LogContext.cs @@ -254,6 +254,8 @@ public DisposableObjectHandle(object o) : base(o) public override object InitializeLifetimeService() { var lease = (ILease)base.InitializeLifetimeService(); + // ReSharper disable once PossibleNullReferenceException + // not 100% sure this will never occur ... lease.Register(LifeTimeSponsor); return lease; } diff --git a/src/Serilog/Core/Pipeline/MessageTemplateCache.cs b/src/Serilog/Core/Pipeline/MessageTemplateCache.cs index 459a224a5..225ce0e73 100644 --- a/src/Serilog/Core/Pipeline/MessageTemplateCache.cs +++ b/src/Serilog/Core/Pipeline/MessageTemplateCache.cs @@ -51,6 +51,8 @@ public MessageTemplate Parse(string messageTemplate) return _innerParser.Parse(messageTemplate); #if HASHTABLE + // ReSharper disable once InconsistentlySynchronizedField + // ignored warning because this is by design var result = (MessageTemplate)_templates[messageTemplate]; if (result != null) return result;