{"id":327313,"date":"2022-01-10T08:50:46","date_gmt":"2022-01-10T08:50:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=327313"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=327313","title":{"rendered":"<span>\u041e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 .NET 6<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\" class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"0903_NET6_ru\/image1.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/7a6\/522\/913\/7a6522913a700269aad35cfc06f0caa5.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u043b\u0438\u0437 .NET 6 \u0432\u044b\u0448\u0435\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0440\u043e\u043c\u043a\u0438\u043c \u2013 \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u043f\u043e\u0434 \u044d\u0442\u0443 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443, \u0442\u043e \u043d\u0430\u0432\u0440\u044f\u0434 \u043b\u0438 \u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435. \u041c\u044b \u0442\u043e\u0436\u0435 \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0443\u0434\u0430\u0441\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a .NET.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"pro-proverku\">\u041f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443<\/h2>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u044f \u0432\u0437\u044f\u043b \u0438\u0437 \u0432\u0435\u0442\u043a\u0438 \u0440\u0435\u043b\u0438\u0437\u0430 .NET 6 <a href=\"https:\/\/github.com\/dotnet\/runtime\/tree\/v6.0.0\">\u043d\u0430 GitHub<\/a>. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0441\u043e\u0441\u0442\u0430\u0432\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a (\u0442\u043e, \u0447\u0442\u043e \u043b\u0435\u0436\u0438\u0442 \u0432 src\/libraries). \u0421\u0430\u043c \u0440\u0430\u043d\u0442\u0430\u0439\u043c \u043d\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u2013 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437. \ud83d\ude42<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e <a href=\"https:\/\/pvs-studio.com\/ru\/pvs-studio\/\">\u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio<\/a>. \u041a\u0441\u0442\u0430\u0442\u0438, \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, PVS-Studio 7.16 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u0434 .NET 6. \u041e \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0449\u0451 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0432 \u044d\u0442\u043e\u043c \u0440\u0435\u043b\u0438\u0437\u0435, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/0897\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041a \u0441\u043b\u043e\u0432\u0443, \u0441\u0430\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio C#, \u0435\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043e\u0434 Linux \u0438 macOS, \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0434 .NET 6.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443, \u043a\u0440\u043e\u043c\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 .NET 6 \u0432 C# \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0435 \u0437\u0430 \u0433\u043e\u0434 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e: \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b security-\u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438, \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f Visual Studio 2022, \u0441\u0430\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u0442\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043d\u0430 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0432\u044b \u0436\u0435 \u043f\u0440\u0438\u0448\u043b\u0438 \u0441\u044e\u0434\u0430 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e .NET 6, \u0432\u0435\u0440\u043d\u043e? \u0427\u0442\u043e \u0436, \u0442\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0442\u0435\u0440\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>  <\/p>\n<h2 id=\"podozritelnye-mesta\">\u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430<\/h2>\n<p>  <\/p>\n<h3 id=\"raznoe\">\u0420\u0430\u0437\u043d\u043e\u0435<\/h3>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u044f \u0441\u043e\u0431\u0440\u0430\u043b \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0441\u043c\u043e\u0433 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0431\u0449\u0435\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0435\u0439.<\/p>\n<p>  <\/p>\n<p><strong>Issue 1<\/strong><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0447\u0435\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043f\u0440\u043e\u0449\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public enum CompressionLevel {   Optimal,   Fastest,   NoCompression,   SmallestSize }  internal static void GetZipCompressionMethodFromOpcCompressionOption(   CompressionOption compressionOption,   out CompressionLevel compressionLevel) {   switch (compressionOption)   {     case CompressionOption.NotCompressed:       {         compressionLevel = CompressionLevel.NoCompression;       }       break;     case CompressionOption.Normal:       {         compressionLevel = CompressionLevel.Optimal;  \/\/ &lt;=       }       break;     case CompressionOption.Maximum:       {         compressionLevel = CompressionLevel.Optimal;  \/\/ &lt;=       }       break;     case CompressionOption.Fast:       {         compressionLevel = CompressionLevel.Fastest;       }       break;     case CompressionOption.SuperFast:       {         compressionLevel = CompressionLevel.Fastest;       }       break;      \/\/ fall-through is not allowed     default:       {         Debug.Fail(\"Encountered an invalid CompressionOption enum value\");         goto case CompressionOption.NotCompressed;       }   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3139\/\">V3139<\/a> Two or more case-branches perform the same actions. ZipPackage.cs 402<\/p>\n<p>  <\/p>\n<p>\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u0441 <em>CompressionOption<\/em> \u043d\u0430 <em>CompressionLevel<\/em>. \u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0442\u043e, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>CompressionOption.Normal<\/em> \u0438 <em>CompressionOption.Maximum<\/em> \u043c\u0430\u043f\u043f\u044f\u0442\u0441\u044f \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>CompressionLevel.Optimal<\/em>. <\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, <em>CompressionOption.Maximum<\/em> \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c <em>CompressionLevel.SmallestSize<\/em>.<\/p>\n<p>  <\/p>\n<p><strong>Issue 2<\/strong><\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0443\u0435\u043c\u0441\u044f. \u0414\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0442\u0438\u043f <em>System.Text.Json.Nodes.JsonObject<\/em>. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0432\u043e\u0437\u044c\u043c\u0451\u0442\u0435 \u0440\u0435\u043b\u0438\u0437\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e .NET 6 SDK.<\/p>\n<p>  <\/p>\n<p>\u0423 \u0442\u0438\u043f\u0430 <em>JsonObject<\/em> \u0435\u0441\u0442\u044c 2 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u2013 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0446\u0438\u0438, \u0434\u0440\u0443\u0433\u043e\u0439 \u2013 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043e\u043f\u0446\u0438\u0438. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0435\u0433\u043e \u043e\u0442 \u043d\u0438\u0445 \u0436\u0434\u0430\u0442\u044c. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.text.json.nodes.jsonobject.-ctor?view=net-6.0\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0442\u0438\u043f\u0430 <em>JsonObject<\/em>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">static void JsonObject_Test() {   var properties = new Dictionary&lt;String, JsonNode?>();   var options = new JsonNodeOptions()   {     PropertyNameCaseInsensitive = true   };    var jsonObject1 = new JsonObject(options);   var jsonObject2 = new JsonObject(properties, options); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"0903_NET6_ru\/image2.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/dbd\/45e\/57c\/dbd45e57c0434814ce3f92b9b646484f.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 <em>jsonObject1<\/em> \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435, \u0442\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0432 \u043f\u043e\u043b\u0435 <em>_options<\/em> \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>jsonObject2<\/em> \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null,<\/em> \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0427\u0442\u043e \u0436, \u0437\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u044d\u0442\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public sealed partial class JsonObject : JsonNode {   ....   public JsonObject(JsonNodeOptions? options = null) : base(options) { }    public JsonObject(IEnumerable&lt;KeyValuePair&lt;string, JsonNode?>> properties,                      JsonNodeOptions? options = null)   {     foreach (KeyValuePair&lt;string, JsonNode?> node in properties)     {       Add(node.Key, node.Value);     }   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>options<\/em> \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u0437\u0430\u0442\u0435\u0440\u044f\u043b\u0441\u044f \u2013 \u043e\u043d \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0438 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 <em>options<\/em> \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0433\u0434\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal JsonNode(JsonNodeOptions? options = null) {   _options = options; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3117\/\">V3117<\/a> Constructor parameter &#8216;options&#8217; is not used. JsonObject.cs 35<\/p>\n<p>  <\/p>\n<p><strong>Issue 3<\/strong><\/p>\n<p>  <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e \u0437\u0430\u0431\u044b\u0442\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public class ServiceNameCollection : ReadOnlyCollectionBase {   ....   private ServiceNameCollection(IList list, string serviceName)     : this(list, additionalCapacity: 1)   { .... }    private ServiceNameCollection(IList list, IEnumerable serviceNames)     : this(list, additionalCapacity: GetCountOrOne(serviceNames))   { .... }    private ServiceNameCollection(IList list, int additionalCapacity)   {     Debug.Assert(list != null);     Debug.Assert(additionalCapacity >= 0);      foreach (string? item in list)     {       InnerList.Add(item);     }   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3117\/\">V3117<\/a> Constructor parameter &#8216;additionalCapacity&#8217; is not used. ServiceNameCollection.cs 46<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u043e\u0434\u0430, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>additionalCapacity<\/em> \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432 <em>Debug.Assert<\/em>, \u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0437\u0430\u0431\u0430\u0432\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0435\u0431\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f <em>additionalCapacity<\/em>.<\/p>\n<p>  <\/p>\n<p><strong>Issue 4<\/strong><\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u0441\u0442 \u043d\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u0438\u044f (\u0443\u043f\u0441, \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u044b). \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0443\u0433\u0430\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u0440\u043e\u0436\u0438\u043b\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public override void CheckErrors() {   throw new XsltException(SR.Xslt_InvalidXPath,                            new string[] { Expression },                            _baseUri,                            _linePosition,                            _lineNumber,                            null); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0442\u0430\u043a, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 <em>XsltException<\/em>.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal XsltException(string res,                         string?[] args,                         string? sourceUri,                         int lineNumber,                         int linePosition,                         Exception? inner) : base(....) { .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u0440\u043e\u0436\u0438\u043b\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440. \u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0438 \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043d\u044b \u043c\u0435\u0441\u0442\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<ul>\n<li><em>_linePosition<\/em><\/li>\n<li><em>_lineNumber<\/em><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/p>\n<p>  <\/p>\n<ul>\n<li><em>lineNumber<\/em><\/li>\n<li><em>linePosition<\/em><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3066\/\">V3066<\/a> Possible incorrect order of arguments passed to &#8216;XsltException&#8217; constructor: &#8216;_linePosition&#8217; and &#8216;_lineNumber&#8217;. Compiler.cs 1187<\/p>\n<p>  <\/p>\n<p><strong>Issue 5<\/strong><\/p>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0431\u044a\u0451\u043c\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u041d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0442\u0430\u043c \u0437\u0430\u043f\u0440\u044f\u0442\u0430\u043b\u0430\u0441\u044c \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430\u2026 \u041d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u043d\u0430\u0439\u0442\u0438?<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public Parser(Compilation compilation,                in JsonSourceGenerationContext sourceGenerationContext) {   _compilation = compilation;   _sourceGenerationContext = sourceGenerationContext;   _metadataLoadContext = new MetadataLoadContextInternal(_compilation);    _ilistOfTType = _metadataLoadContext.Resolve(     SpecialType.System_Collections_Generic_IList_T);   _icollectionOfTType = _metadataLoadContext.Resolve(     SpecialType.System_Collections_Generic_ICollection_T);   _ienumerableOfTType = _metadataLoadContext.Resolve(     SpecialType.System_Collections_Generic_IEnumerable_T);   _ienumerableType = _metadataLoadContext.Resolve(     SpecialType.System_Collections_IEnumerable);    _listOfTType = _metadataLoadContext.Resolve(typeof(List&lt;>));   _dictionaryType = _metadataLoadContext.Resolve(typeof(Dictionary&lt;,>));   _idictionaryOfTKeyTValueType = _metadataLoadContext.Resolve(     typeof(IDictionary&lt;,>));   _ireadonlyDictionaryType = _metadataLoadContext.Resolve(     typeof(IReadOnlyDictionary&lt;,>));   _isetType = _metadataLoadContext.Resolve(typeof(ISet&lt;>));   _stackOfTType = _metadataLoadContext.Resolve(typeof(Stack&lt;>));   _queueOfTType = _metadataLoadContext.Resolve(typeof(Queue&lt;>));   _concurrentStackType = _metadataLoadContext.Resolve(     typeof(ConcurrentStack&lt;>));   _concurrentQueueType = _metadataLoadContext.Resolve(     typeof(ConcurrentQueue&lt;>));   _idictionaryType = _metadataLoadContext.Resolve(typeof(IDictionary));   _ilistType = _metadataLoadContext.Resolve(typeof(IList));   _stackType = _metadataLoadContext.Resolve(typeof(Stack));   _queueType = _metadataLoadContext.Resolve(typeof(Queue));   _keyValuePair = _metadataLoadContext.Resolve(typeof(KeyValuePair&lt;,>));    _booleanType = _metadataLoadContext.Resolve(SpecialType.System_Boolean);   _charType = _metadataLoadContext.Resolve(SpecialType.System_Char);   _dateTimeType = _metadataLoadContext.Resolve(SpecialType.System_DateTime);   _nullableOfTType = _metadataLoadContext.Resolve(     SpecialType.System_Nullable_T);   _objectType = _metadataLoadContext.Resolve(SpecialType.System_Object);   _stringType = _metadataLoadContext.Resolve(SpecialType.System_String);    _dateTimeOffsetType = _metadataLoadContext.Resolve(typeof(DateTimeOffset));   _byteArrayType = _metadataLoadContext.Resolve(     typeof(byte)).MakeArrayType();   _guidType = _metadataLoadContext.Resolve(typeof(Guid));   _uriType = _metadataLoadContext.Resolve(typeof(Uri));   _versionType = _metadataLoadContext.Resolve(typeof(Version));   _jsonArrayType = _metadataLoadContext.Resolve(JsonArrayFullName);   _jsonElementType = _metadataLoadContext.Resolve(JsonElementFullName);   _jsonNodeType = _metadataLoadContext.Resolve(JsonNodeFullName);   _jsonObjectType = _metadataLoadContext.Resolve(JsonObjectFullName);   _jsonValueType = _metadataLoadContext.Resolve(JsonValueFullName);    \/\/ Unsupported types.   _typeType = _metadataLoadContext.Resolve(typeof(Type));   _serializationInfoType = _metadataLoadContext.Resolve(     typeof(Runtime.Serialization.SerializationInfo));   _intPtrType = _metadataLoadContext.Resolve(typeof(IntPtr));   _uIntPtrType = _metadataLoadContext.Resolve(typeof(UIntPtr));   _iAsyncEnumerableGenericType = _metadataLoadContext.Resolve(     IAsyncEnumerableFullName);   _dateOnlyType = _metadataLoadContext.Resolve(DateOnlyFullName);   _timeOnlyType = _metadataLoadContext.Resolve(TimeOnlyFullName);    _jsonConverterOfTType = _metadataLoadContext.Resolve(     JsonConverterOfTFullName);    PopulateKnownTypes(); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0443 \u0447\u0442\u043e, \u043a\u0430\u043a \u0443\u0441\u043f\u0435\u0445\u0438? \u0410 \u043c\u043e\u0436\u0435\u0442 \u0437\u0434\u0435\u0441\u044c \u0438 \u0432\u043e\u0432\u0441\u0435 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438? <\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3080\/\">V3080<\/a> Possible null dereference of method return value. Consider inspecting: Resolve(&#8230;). JsonSourceGenerator.Parser.cs 203<\/p>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <em>Resolve<\/em> \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>. \u041e\u0431 \u044d\u0442\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0435\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430. \u041e\u0431 \u044d\u0442\u043e\u043c \u0436\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u0438 PVS-Studio, \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>null<\/em>.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public Type? Resolve(Type type) {   Debug.Assert(!type.IsArray,                 \"Resolution logic only capable of handling named types.\");   return Resolve(type.FullName!); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f \u043d\u0438\u0436\u0435, \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 <em>Resolve<\/em>.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public Type? Resolve(string fullyQualifiedMetadataName) {   INamedTypeSymbol? typeSymbol =      _compilation.GetBestTypeByMetadataName(fullyQualifiedMetadataName);   return typeSymbol.AsType(this); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e <em>typeSymbol<\/em> \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u043a\u0430\u043a \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0438\u0439 <em>null<\/em>-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435: <em>INamedTypeSymbol?<\/em>. \u041e\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f \u043d\u0438\u0436\u0435 \u2013 \u0432 \u043c\u0435\u0442\u043e\u0434 <em>AsType<\/em>.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static Type AsType(this ITypeSymbol typeSymbol,                            MetadataLoadContextInternal metadataLoadContext) {   if (typeSymbol == null)   {     return null;   }    return new TypeWrapper(typeSymbol, metadataLoadContext); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u2013 \u043d\u0443\u043b\u0435\u0432\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430, \u0442\u043e \u0438 \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0442\u0438\u043f\u0430 <em>Parser<\/em>. \u0412 \u043d\u0451\u043c \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Resolve<\/em> \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043f\u043e\u043b\u0435. \u041d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u043e\u0441\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 PVS-Studio:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">_byteArrayType = _metadataLoadContext.Resolve(typeof(byte)).MakeArrayType();<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0434\u043b\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Resolve<\/em> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <em>MakeArrayType<\/em>. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0435\u0441\u043b\u0438 <em>Resolve<\/em> \u0432\u0435\u0440\u043d\u0451\u0442 <em>null<\/em>, \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <em>NullReferenceException<\/em>.<\/p>\n<p>  <\/p>\n<p><strong>Issue 6<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public abstract partial class Instrument&lt;T> : Instrument where T : struct {   [ThreadStatic] private KeyValuePair&lt;string, object?>[] ts_tags;   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3079\/\">V3079<\/a> &#8216;ThreadStatic&#8217; attribute is applied to a non-static &#8216;ts_tags&#8217; field and will be ignored Instrument.netfx.cs 20<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.threadstaticattribute?view=net-6.0\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>: <em>Note that in addition to applying the <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.threadstaticattribute?view=net-6.0\">ThreadStaticAttribute<\/a> attribute to a field, you must also define it as a static field (in C#) or a Shared field (in Visual Basic).<\/em><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u043e\u0434\u0430, \u043f\u043e\u043b\u0435 <em>ts_tags<\/em> \u2013 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043d\u043e\u0435. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0435\u0448\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <em>ThreadStatic<\/em> \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430. \u0418\u043b\u0438 \u0436\u0435 \u0437\u0434\u0435\u0441\u044c \u0442\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0447\u0451\u0440\u043d\u0430\u044f \u043c\u0430\u0433\u0438\u044f\u2026 <\/p>\n<p>  <\/p>\n<p><strong>Issue 7<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">private static JsonSourceGenerationOptionsAttribute?  GetSerializerOptions(AttributeSyntax? attributeSyntax) {   ....   foreach (AttributeArgumentSyntax node in attributeArguments)   {     IEnumerable&lt;SyntaxNode> childNodes = node.ChildNodes();     NameEqualsSyntax? propertyNameNode        = childNodes.First() as NameEqualsSyntax;     Debug.Assert(propertyNameNode != null);       SyntaxNode? propertyValueNode = childNodes.ElementAtOrDefault(1);     string propertyValueStr = propertyValueNode.GetLastToken().ValueText;     ....   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3146\/\">V3146<\/a> Possible null dereference of &#8216;propertyValueNode&#8217;. The &#8216;childNodes.ElementAtOrDefault&#8217; can return default null value. JsonSourceGenerator.Parser.cs 560<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <em>childNodes<\/em> \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0432\u0443\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u044b\u0437\u043e\u0432 <em>ElementAtOrDefault<\/em> \u0432\u0435\u0440\u043d\u0451\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>default(SyntaxNode)<\/em> (\u0442\u043e \u0435\u0441\u0442\u044c <em>null<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a <em>SyntaxNode<\/em> \u2013 \u043a\u043b\u0430\u0441\u0441). \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <em>NullReferenceException<\/em>. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u0447\u0442\u043e <em>propertyValueNode<\/em> \u2013 nullable reference type, \u043e\u0434\u043d\u0430\u043a\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043d\u0435\u044f\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 <em>childNodes<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c <em>propertyNameNode<\/em>, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438 <em>propertyValueNode<\/em>. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <em>ElementAt<\/em>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043b\u0438\u0448\u043d\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>  <\/p>\n<p><strong>Issue 8<\/strong><\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u2013 <em>Microsoft.Extensions.FileSystemGlobbing.FilePatternMatch<\/em>. \u041e\u043d\u0430, \u0447\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <em>Equals(Object)<\/em>. <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/microsoft.extensions.filesystemglobbing.filepatternmatch.equals?view=dotnet-plat-ext-6.0\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430<\/a>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"0903_NET6_ru\/image3.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/391\/4de\/0b4\/3914de0b41dc6c7603d9c4eef8f91fa3.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">static void FPM_Test(Object? obj) {   FilePatternMatch fpm = new FilePatternMatch();   var eq = fpm.Equals(obj); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u0435\u0441\u043b\u0438 <em>FPM_Test<\/em> \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <em>null<\/em>? \u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>eq<\/em> \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>false<\/em>? \u041d\u0443, \u043f\u043e\u0447\u0442\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"0903_NET6_ru\/image4.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/532\/0a0\/13d\/5320a013db44aec5319f581e18b55775.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0442\u0438\u043f\u0430, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442 <em>FilePatternMatch<\/em>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u2026 \u041f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"0903_NET6_ru\/image5.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/80d\/a0b\/8a6\/80da0b8a6f9eacbe2ec8190c98722864.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0423\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442? \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <em>Equals<\/em> \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0438 \u043d\u0430 <em>null<\/em>-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043d\u0438 \u043d\u0430 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0442\u0438\u043f\u043e\u0432, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public override bool Equals(object obj) {   return Equals((FilePatternMatch) obj); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3115\/\">V3115<\/a> Passing &#8216;null&#8217; to &#8216;Equals&#8217; method should not result in &#8216;NullReferenceException&#8217;. FilePatternMatch.cs 61<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u0441\u0443\u0434\u0438\u0442\u044c \u043f\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043e\u0431\u0435\u0449\u0430\u043b \u043d\u0430\u043c, \u0447\u0442\u043e <em>Equals(Object)<\/em> \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <em>false<\/em>, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0435 <em>FilePatternMatch<\/em>. \u041d\u043e, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>  <\/p>\n<h3 id=\"dubliruyuschiesya-proverki\">\u0414\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h3>\n<p>  <\/p>\n<p>\u0421 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438 \u0435\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u044d\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u043b\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u043e\u0435. \u0422\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>  <\/p>\n<p><strong>Issue 9<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal DeflateManagedStream(Stream stream,                                ZipArchiveEntry.CompressionMethodValues method,                                long uncompressedSize = -1) {   if (stream == null)     throw new ArgumentNullException(nameof(stream));   if (!stream.CanRead)     throw new ArgumentException(SR.NotSupported_UnreadableStream,                                  nameof(stream));   if (!stream.CanRead)     throw new ArgumentException(SR.NotSupported_UnreadableStream,                                  nameof(stream));    Debug.Assert(method == ZipArchiveEntry.CompressionMethodValues.Deflate64);    _inflater      = new InflaterManaged(         method == ZipArchiveEntry.CompressionMethodValues.Deflate64,          uncompressedSize);    _stream = stream;   _buffer = new byte[DefaultBufferSize]; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3021\/\">V3021<\/a> There are two &#8216;if&#8217; statements with identical conditional expressions. The first &#8216;if&#8217; statement contains method return. This means that the second &#8216;if&#8217; statement is senseless DeflateManagedStream.cs 27<\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u0434\u0451\u0442 \u0440\u044f\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a. \u041d\u043e, \u0432\u043e\u0442 \u043d\u0435\u0437\u0430\u0434\u0430\u0447\u0430, \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0438\u0445 (<em>!stream.CanRead<\/em>) \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 (\u043a\u0430\u043a \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u0442\u0430\u043a \u0438 then-\u0432\u0435\u0442\u0432\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>if<\/em>).<\/p>\n<p>  <\/p>\n<p><strong>Issue 10<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static object? Deserialize(ReadOnlySpan&lt;char> json,                                    Type returnType,                                    JsonSerializerOptions? options = null) {   \/\/ default\/null span is treated as empty   if (returnType == null)   {     throw new ArgumentNullException(nameof(returnType));   }    if (returnType == null)   {     throw new ArgumentNullException(nameof(returnType));   }    JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, returnType);   return ReadFromSpan&lt;object?>(json, jsonTypeInfo)!; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3021\/\">V3021<\/a> There are two &#8216;if&#8217; statements with identical conditional expressions. The first &#8216;if&#8217; statement contains method return. This means that the second &#8216;if&#8217; statement is senseless JsonSerializer.Read.String.cs 163<\/p>\n<p>  <\/p>\n<p>\u0410\u0433\u0430, \u043f\u043e\u0445\u043e\u0436\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043d\u043e \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u041f\u0435\u0440\u0435\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>returnType<\/em> \u043d\u0430 <em>null<\/em>. \u0414\u0435\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435, \u0432\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u044d\u0442\u043e 2 \u0440\u0430\u0437\u0430. <\/p>\n<p>  <\/p>\n<p><strong>Issue 11<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">private void WriteQualifiedNameElement(....) {   bool hasDefault = defaultValue != null &amp;&amp; defaultValue != DBNull.Value;   if (hasDefault)   {     throw Globals.NotSupported(       \"XmlQualifiedName DefaultValue not supported.  Fail in WriteValue()\");   }   ....   if (hasDefault)   {     throw Globals.NotSupported(       \"XmlQualifiedName DefaultValue not supported.  Fail in WriteValue()\");   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3021\/\">V3021<\/a> There are two &#8216;if&#8217; statements with identical conditional expressions. The first &#8216;if&#8217; statement contains method return. This means that the second &#8216;if&#8217; statement is senseless XmlSerializationWriterILGen.cs 102<\/p>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435. \u0415\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u0438 \u043e\u0434\u043d\u0430 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u0439, \u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043e\u043d\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043d\u0446\u0430\u0445 \u043c\u0435\u0442\u043e\u0434\u0430 \u2013 \u043f\u043e\u0447\u0442\u0438 \u0432 20 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u0430\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>hasDefault<\/em> \u0437\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043b\u0438\u0431\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0443\u0436\u0435 \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437, \u043b\u0438\u0431\u043e \u0442\u0430\u043a \u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0432\u043e\u0432\u0441\u0435.<\/p>\n<p>  <\/p>\n<p><strong>Issue 12<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal static bool AutoGenerated(ForeignKeyConstraint fk, bool checkRelation) {   ....    if (fk.ExtendedProperties.Count > 0)     return false;    if (fk.AcceptRejectRule != AcceptRejectRule.None)     return false;   if (fk.DeleteRule != Rule.Cascade)  \/\/ &lt;=     return false;   if (fk.DeleteRule != Rule.Cascade)  \/\/ &lt;=     return false;    if (fk.RelatedColumnsReference.Length != 1)     return false;   return AutoGenerated(fk.RelatedColumnsReference[0]); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;fk.DeleteRule != Rule.Cascade&#8217; is always false. xmlsaver.cs 1708<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u2013 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434?<\/p>\n<p>  <\/p>\n<h3 id=\"propuschennaya-interpolyaciya\">\u041f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0430\u0440\u0443 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439, \u0430 \u0437\u0430\u0442\u0435\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e.<\/p>\n<p>  <\/p>\n<p><strong>Issue 13<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal void SetLimit(int physicalMemoryLimitPercentage) {   if (physicalMemoryLimitPercentage == 0)   {     \/\/ use defaults     return;   }   _pressureHigh = Math.Max(3, physicalMemoryLimitPercentage);   _pressureLow = Math.Max(1, _pressureHigh - 9);   Dbg.Trace($\"MemoryCacheStats\",              \"PhysicalMemoryMonitor.SetLimit:                _pressureHigh={_pressureHigh}, _pressureLow={_pressureLow}\"); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3138\/\">V3138<\/a> String literal contains potential interpolated expression. Consider inspecting: _pressureHigh. PhysicalMemoryMonitor.cs 110<\/p>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0445\u043e\u0442\u0435\u043b\u0438 \u0437\u0430\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044f <em>_pressureHigh<\/em> \u0438 <em>_pressureLow<\/em>. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430. \u0417\u0430\u0442\u043e \u0441\u0438\u043c\u0432\u043e\u043b \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Dbg.Trace<\/em>, \u0433\u0434\u0435 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u0447\u0435\u0433\u043e. \ud83d\ude42<\/p>\n<p>  <\/p>\n<p><strong>Issue 14<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">private void ParseSpecs(string? metricsSpecs) {   ....   string[] specStrings = ....   foreach (string specString in specStrings)   {     if (!MetricSpec.TryParse(specString, out MetricSpec spec))     {       Log.Message(\"Failed to parse metric spec: {specString}\");     }     else     {       Log.Message(\"Parsed metric: {spec}\");       ....     }   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3138\/\">V3138<\/a> String literal contains potential interpolated expression. Consider inspecting: spec. MetricsEventSource.cs 381<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 <em>specString<\/em>. \u0415\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u2013 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u2013 \u0437\u0430\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>spec<\/em>) \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0449\u0451 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043e\u043f\u044f\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c, \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d \u0441\u0438\u043c\u0432\u043e\u043b \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u2013 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <em>specString<\/em> \u0438 <em>spec<\/em> \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0435\u0449\u0430\u043d\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 2019 \u0433\u043e\u0434\u0443 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0656\/\">\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 .NET Core<\/a>. \u0422\u043e\u0433\u0434\u0430 \u0442\u043e\u0436\u0435 \u043d\u0430\u0448\u043b\u0438\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438, \u043d\u043e \u043d\u0435 \u0431\u044b\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0438\u0437-\u0437\u0430 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 &#8216;$&#8217;. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0432 \u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043a\u0430\u043a issue 10 \u0438 issue 11.<\/p>\n<p>  <\/p>\n<p>\u042f \u043e\u0442\u043f\u0438\u0441\u0430\u043b <a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/30599\">\u0431\u0430\u0433-\u0440\u0435\u043f\u043e\u0440\u0442 \u043d\u0430 GitHub<\/a>, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 .NET \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u0435\u0441\u0442\u0430. \u0412 \u0438\u0445 \u0447\u0438\u0441\u043b\u0435 \u2013 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438. <a href=\"https:\/\/github.com\/dotnet\/corefx\/pull\/40322\/commits\/a328cc8bf763d193474fac1870c9e26a9314748a\">\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 pull request<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e \u2013 \u0432 issue-\u0442\u0440\u0435\u043a\u0435\u0440\u0435 Roslyn Analyzers \u0431\u044b\u043b\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u0430 <a href=\"https:\/\/github.com\/dotnet\/roslyn-analyzers\/issues\/2767\">\u0437\u0430\u0434\u0430\u0447\u0430<\/a> \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u043e\u0432\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0430 \u0431\u044b \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043a\u0435\u0439\u0441\u044b.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"0903_NET6_ru\/image6.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/1f1\/93a\/a3f\/1f193aa3fbdcafd91cc0e35122913bac.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0432\u0441\u044f \u044d\u0442\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u044f <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/0659\/\">\u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0430 \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f. \u042f \u0432\u0441\u0451 \u044d\u0442\u043e \u0437\u043d\u0430\u043b \u0438 \u043f\u043e\u043c\u043d\u0438\u043b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u0438\u0432\u0438\u043b\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u043d\u043e\u0432\u044c \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0435\u0439. \u041a\u0430\u043a \u0436\u0435 \u0442\u0430\u043a? \u0412\u0435\u0434\u044c \u0443\u0436\u0435 &#171;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187; \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>  <\/p>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0442\u043e\u0442 issue \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u043e\u0442 15 \u0430\u0432\u0433\u0443\u0441\u0442\u0430 2019 \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c\u2026 \u0447\u0442\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430-\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u0430. \u0412\u043e\u0442 \u0438 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441, \u043e\u0442\u043a\u0443\u0434\u0430 \u0441\u043d\u043e\u0432\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>PVS-Studio \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0440\u0435\u043b\u0438\u0437\u0430 7.03 (25 \u0438\u044e\u043d\u044f 2019) \u2013 \u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c. \ud83d\ude09<\/p>\n<p>  <\/p>\n<h3 id=\"chto-to-menyaetsya-chto-to-ostayotsya\">\u0427\u0442\u043e-\u0442\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e-\u0442\u043e \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0445\u043e\u0434\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043d\u0430\u0442\u044b\u043a\u0430\u043b\u0441\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u043f\u043e\u043a\u0430\u0437\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043c\u043d\u0435 \u0441\u043c\u0443\u0442\u043d\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c\u0438. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044f \u0443\u0436\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0438\u0445 \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437. \u0420\u0430\u0437 \u043e\u043d\u0438 \u0442\u0430\u043a \u0438 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432 \u043a\u043e\u0434\u0435, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0443, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u0438 \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434, \u043f\u043e\u0445\u043e\u0436\u0435, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0431\u0440\u043e\u0441\u0438\u0442\u044c <em>ArgumentOutOfRangeException<\/em>. \u042d\u0442\u043e issue 30 \u0438\u0437 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0656\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/a>.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">private ArrayList? _tables; private DataTable? GetTable(string tableName, string ns) {   if (_tables == null)     return _dataSet!.Tables.GetTable(tableName, ns);    if (_tables.Count == 0)     return (DataTable?)_tables[0];   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432, \u0443\u0436\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, issue 25. \u0412 \u0446\u0438\u043a\u043b\u0435 \u043e\u0431\u0445\u043e\u0434\u044f\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e <em>seq<\/em>, \u043d\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0435\u0451 \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u2013 <em>seq[0]<\/em>. \u042d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442\u2026 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public bool MatchesXmlType(IList&lt;XPathItem> seq, int indexType) {   XmlQueryType typBase = GetXmlType(indexType);    XmlQueryCardinality card = seq.Count switch   {     0 => XmlQueryCardinality.Zero,     1 => XmlQueryCardinality.One,     _ => XmlQueryCardinality.More,   };    if (!(card &lt;= typBase.Cardinality))     return false;    typBase = typBase.Prime;   for (int i = 0; i &lt; seq.Count; i++)   {     if (!CreateXmlType(seq[0]).IsSubtypeOf(typBase)) \/\/ &lt;=       return false;   }    return true; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3102\/\">V3102<\/a> Suspicious access to element of &#8216;seq&#8217; object by a constant index inside a loop. XmlQueryRuntime.cs 729<\/p>\n<p>  <\/p>\n<p>\u041c\u0435\u043d\u044f \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0431\u0438\u0432\u0430\u0435\u0442 \u0441 \u0442\u043e\u043b\u043a\u0443, \u0430 \u0432\u0430\u0441?<\/p>\n<p>  <\/p>\n<p>\u0418\u043b\u0438 \u0432\u043e\u0442 \u0432\u043e\u0437\u044c\u043c\u0451\u043c issue 34.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public bool Remove(out int testPosition, out MaskedTextResultHint resultHint) {   ....   if (lastAssignedPos == INVALID_INDEX)   {     ....     return true; \/\/ nothing to remove.   }   ....    return true; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3009\/\">V3009<\/a> It&#8217;s odd that this method always returns one and the same value of &#8216;true&#8217;. MaskedTextProvider.cs 1531<\/p>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 \u043a\u0430\u043a \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b <em>true<\/em>, \u0442\u0430\u043a \u0438 \u0441\u0435\u0439\u0447\u0430\u0441. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432\u0441\u0451 \u0442\u0430\u043a\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438 <em>false<\/em>: <em>Returns true on success, false otherwise<\/em>. \u0421 <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.componentmodel.maskedtextprovider.remove?view=net-6.0\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439<\/a> \u0442\u0430 \u0436\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0430\u043a\u0436\u0435 \u0431\u044b\u043b \u043e\u043f\u0438\u0441\u0430\u043d \u0435\u0449\u0451 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u044f \u0434\u0430\u0436\u0435 \u0432\u044b\u043d\u0435\u0441\u0443 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b. \u041c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u0435\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0434 \u0441\u0430\u043c\u0438\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u043c \u043a\u043e\u0434\u0430, \u043d\u043e \u0438 \u043d\u0430\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432 \u043d\u0451\u043c \u0444\u0438\u0448\u043a\u043e\u0439 \u2013 nullable reference types.<\/p>\n<p>  <\/p>\n<h3 id=\"i-snova-pro-nullable-reference-types\">\u0418 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e nullable reference types<\/h3>\n<p>  <\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c \u0438 \u0446\u0435\u043b\u043e\u043c, \u044f \u043f\u043e\u043a\u0430 \u0435\u0449\u0451 \u043d\u0435 \u043f\u043e\u043d\u044f\u043b, \u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u043c\u043d\u0435 \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0435 \u0442\u0438\u043f\u044b, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0438\u0435 <em>null<\/em>, \u0438\u043b\u0438 \u043d\u0435\u0442. <\/p>\n<p>  <\/p>\n<p>\u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u2013 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0438\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041e\u0434\u043d\u043e\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u0434\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <em>null<\/em>, \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438\u043c\u0435\u0442\u044c <em>null<\/em>-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0442.\u043f. <\/p>\n<p>  <\/p>\n<p>\u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u2013 \u0432\u0441\u0451 \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u043e\u0432\u0435\u0440\u0438\u0438. \u041d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">static String GetStr() {   return null!; }  static void Main(string[] args) {   String str = GetStr();   Console.WriteLine(str.Length); \/\/ NRE, str - null }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430-\u0434\u0430-\u0434\u0430, \u044d\u0442\u043e \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u043a\u0430, \u043d\u043e \u0432\u0435\u0434\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c! \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0443 \u0432\u0430\u0441 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u2013 \u0438\u0434\u0451\u043c (\u0443\u0441\u043b\u043e\u0432\u043d\u043e) \u043a \u0430\u0432\u0442\u043e\u0440\u0443 <em>GetStr<\/em> \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043c \u0431\u0435\u0441\u0435\u0434\u0443. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 <em>GetStr<\/em> \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442, \u0441\u044e\u0440\u043f\u0440\u0438\u0437 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0442\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043e\u0442 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a \u043d\u0430\u0448\u0435\u0439 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0435\u043c\u0435 \u2013 .NET 6. \u0418 \u0441 \u043d\u0438\u043c \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0437\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0440\u0430\u0437\u0431\u0438\u0442\u044b \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c solution. \u0418 \u044f, \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u0438\u0445, \u043d\u0435 \u0440\u0430\u0437 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u2013 \u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u043b\u0438 nullable context \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435? \u0410 \u0432\u043e\u0442 \u0442\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 <em>null<\/em> \u2013 \u044d\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e \u0438\u043b\u0438 \u043d\u0435\u0442? \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u043e \u043f\u0440\u0438 \u0431\u0435\u0433\u043b\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0432\u0441\u0435\u0445 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u2013 \u0431\u043e\u043b\u044c\u0448\u0435. \u0420\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0448\u0442\u0443\u043a\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 nullable context. \u0412\u0440\u043e\u0434\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>null<\/em>, \u0430 \u0432\u0440\u043e\u0434\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0435\u0441\u0442\u044c. \u0418 \u0432 .NET \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0441\u0442, \u0441\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u044f\u043c\u043e, \u043d\u0435\u043c\u0430\u043b\u043e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">private void ValidateAttributes(XmlElement elementNode) {   ....   XmlSchemaAttribute schemaAttribute      = (_defaultAttributes[i] as XmlSchemaAttribute)!;   attrQName = schemaAttribute.QualifiedName;   Debug.Assert(schemaAttribute != null);   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3095\/\">V3095<\/a> The &#8216;schemaAttribute&#8217; object was used before it was verified against null. Check lines: 438, 439. DocumentSchemaValidator.cs 438<\/p>\n<p>  <\/p>\n<p>\u0421\u0438\u043c\u0432\u043e\u043b &#8216;!&#8217; \u043d\u0430\u043c\u0435\u043a\u0430\u0435\u0442, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 nullable-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c. \u041e\u043a\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>1. \u041f\u043e\u0447\u0435\u043c\u0443 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;as&#8217;, \u0430 \u043d\u0435 \u043f\u0440\u044f\u043c\u043e\u0439 \u043a\u0430\u0441\u0442? \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <em>schemaAttribute<\/em> \u043d\u0435 <em>null<\/em> (\u044f \u0442\u0430\u043a \u0447\u0438\u0442\u0430\u044e \u043d\u0435\u044f\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0441 &#8216;!&#8217;), \u0437\u043d\u0430\u0447\u0438\u0442, <em>_defaultAttributes[i]<\/em> \u0442\u043e\u0447\u043d\u043e \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f <em>XmlSchemaAttribute<\/em>. \u041d\u0443 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u2013 \u043b\u0430\u0434\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>2. \u0415\u0441\u043b\u0438 <em>schemaAttribute<\/em> \u043d\u0435 <em>null<\/em>, \u0437\u0430\u0447\u0435\u043c \u043d\u0438\u0436\u0435 \u0432 <em>Debug.Assert<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 <em>null<\/em>?<\/p>\n<p>  <\/p>\n<p>3. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430 \u0438 <em>schemaAttribute<\/em> \u0432\u0441\u0451 \u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em> (\u0432\u043e\u043f\u0440\u0435\u043a\u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0435 nullable reference types), \u0442\u043e \u0434\u043e <em>Debug.Assert<\/em> \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u0434\u043e\u0439\u0434\u0451\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a <em>schemaAttribute.QualifiedName<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u043b\u0438\u0447\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043a\u0443\u0447\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public Node DeepClone(int count) {   ....   while (originalCurrent != null)   {     originalNodes.Push(originalCurrent);     newNodes.Push(newCurrent);     newCurrent.Left = originalCurrent.Left?.ShallowClone();     originalCurrent = originalCurrent.Left;     newCurrent = newCurrent.Left!;   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, <em>newCurrent.Left<\/em> \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043d\u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>?.<\/em> (<em>originalCurrent.Left?.ShallowClone()<\/em>). \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e, \u0447\u0442\u043e <em>newCurrent.Left<\/em> \u043d\u0435 <em>null<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0438\u0437 .NET 6, \u0440\u0430\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f \u044d\u0442\u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b, \u043f\u043e \u0444\u0430\u043a\u0442\u0443, \u0438 \u043d\u0430\u0447\u0430\u043b \u043f\u0438\u0441\u0430\u0442\u044c. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <em>IStructuralEquatable.Equals(object? other, IEqualityComparer comparer)<\/em> \u0432 \u0442\u0438\u043f\u0435 <em>ImmutableArray&lt;T><\/em>.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal readonly T[]? array; bool IStructuralEquatable.Equals(object? other, IEqualityComparer comparer) {   var self = this;   Array? otherArray = other as Array;   if (otherArray == null)   {     if (other is IImmutableArray theirs)     {       otherArray = theirs.Array;        if (self.array == null &amp;&amp; otherArray == null)       {         return true;       }       else if (self.array == null)       {         return false;       }     }   }    IStructuralEquatable ours = self.array!;   return ours.Equals(otherArray, comparer); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430 \u0432 Visual Studio, \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0443\u0441\u043b\u0443\u0436\u043b\u0438\u0432\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442, \u0447\u0442\u043e <em>ours<\/em> \u043d\u0435 <em>null<\/em>. \u041e\u043d\u043e \u0438 \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u043e\u0434\u0430 \u2013 <em>self.array<\/em> \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d \u043a\u0430\u043a \u043d\u0435 \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0439 <em>null<\/em>-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"0903_NET6_ru\/image7.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/558\/8c6\/b01\/5588c6b01039cb6ff3abee72212101c6.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">IStructuralEquatable immutableArr = default(ImmutableArray&lt;String>); var eq = immutableArr.Equals(null, EqualityComparer&lt;String>.Default);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438 \u0432\u0438\u0434\u0438\u043c <em>NullReferenceException<\/em>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"0903_NET6_ru\/image8.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/14d\/072\/4aa\/14d0724aae3f1e087001cbeea4f97dab.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0423\u0443\u0443\u0443\u043f\u0441. \u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>ours<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 <em>null<\/em>, \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u043e\u0439.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0442\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u041f\u043e\u043b\u0435 <em>array<\/em> \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>immutableArr<\/em> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>.<\/li>\n<li><em>other<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>, \u0437\u043d\u0430\u0447\u0438\u0442 <em>otherArray<\/em> \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>.<\/li>\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>other is ImmutableArray<\/em> \u0434\u0430\u0451\u0442 <em>false<\/em>.<\/li>\n<li>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 <em>ours<\/em> \u043f\u043e\u043b\u0435 <em>self.array<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>.<\/li>\n<li>\u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043c, \u0447\u0442\u043e \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b\/\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0430 \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>default<\/em>. \u041d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c NRE \u043d\u0430 \u0432\u044b\u0437\u043e\u0432\u0435 <em>Equals<\/em> \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e. <\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0435\u043b\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u0432 \u044d\u0442\u043e\u043c. \u0418\u0437 \u043a\u043e\u0434\u0430, \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e <em>ours<\/em> \u043d\u0435 <em>null<\/em>. \u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u0436\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>. \u041b\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0432\u0435\u0440\u0438\u0435 \u043a nullable reference types.<\/p>\n<p>  <\/p>\n<p>PVS-Studio \u0432\u044b\u0434\u0430\u0451\u0442 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3125\/\">V3125<\/a> The &#8216;ours&#8217; object was used after it was verified against null. Check lines: 1144, 1136. ImmutableArray_1.cs 1144<\/p>\n<p>  <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043e\u0431 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u044f \u043f\u0438\u0441\u0430\u043b \u0432 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0656\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> (issue 53). \u0422\u043e\u0433\u0434\u0430, \u043f\u0440\u0430\u0432\u0434\u0430, \u0437\u0434\u0435\u0441\u044c \u0435\u0449\u0451 \u043d\u0435 \u0431\u044b\u043b\u043e nullable-\u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438.<\/p>\n<p>  <\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/strong>. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043a \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u0443 \u043f\u0440\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c\u0438 <em>ImmutableArray&lt;T><\/em> \u0432 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445\/\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b: <em>ThrowNullRefIfNotInitialized<\/em> \u0438 <em>ThrowInvalidOperationIfNotInitialized<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0442 \u043e \u043d\u0435\u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041f\u0440\u0438\u0447\u0451\u043c \u0432 \u044f\u0432\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <em>ThrowInvalidOperationIfNotInitialized<\/em>. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u0443\u0442 \u0445\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c \u2013 \u0430 \u043a\u0430\u043a\u043e\u0439 \u0443 \u0432\u0430\u0441 \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 nullable reference types? \u041d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f? \u0412\u043d\u0435\u0434\u0440\u044f\u043b\u0438 \u043b\u0438 \u043d\u0430 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445? \u0427\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438 \u0431\u044b\u043b\u0438? \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0432\u0430\u0448 \u043e\u043f\u044b\u0442.<\/p>\n<p>  <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u0440\u043e nullable reference types \u0443\u0436\u0435 \u0431\u044b\u043b\u0430 \u043f\u0430\u0440\u0430 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e\u0442 \u043c\u043e\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u0433: <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0631\/\">\u0440\u0430\u0437<\/a>, <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0764\/\">\u0434\u0432\u0430<\/a>. \u0412\u0440\u0435\u043c\u044f \u0438\u0434\u0451\u0442, \u043d\u043e \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u0441\u0451 \u0435\u0449\u0451 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0435\u0449\u0451 \u0440\u0430\u0437 \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 .NET 6 \u0441 \u0440\u0435\u043b\u0438\u0437\u043e\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0432\u0441\u0435\u043c \u0442\u0435\u043c, \u043a\u0442\u043e \u0432\u043d\u043e\u0441\u0438\u0442 \u0432\u043a\u043b\u0430\u0434 \u0432 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0423\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u043d\u0435\u0434\u043e\u0447\u0451\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b, \u0430 \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u0435\u0449\u0451 \u043c\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0442\u0430\u043a\u0436\u0435, \u0447\u0442\u043e \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0435\u0449\u0451 \u0440\u0430\u0437 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u043e \u043f\u043e\u043b\u044c\u0437\u0443 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u2013 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c PVS-Studio \u0438 \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043f\u043e <a href=\"https:\/\/pvs-studio.com\/net6_checking\">\u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 30 \u0434\u043d\u0435\u0439, \u0430 \u043d\u0435 7. \u042d\u0442\u043e \u043b\u0438 \u043d\u0435 \u043f\u043e\u0432\u043e\u0434? \ud83d\ude09<\/p>\n<p>  <\/p>\n<p>\u0418 \u043f\u043e \u0434\u043e\u0431\u0440\u043e\u0439 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 <a href=\"https:\/\/twitter.com\/_SergVasiliev_\">\u043c\u043e\u0439 Twitter<\/a>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Sergey Vasiliev. <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/598165\/\">Errors and suspicious code fragments in .NET 6 sources<\/a>.<\/p>\n<\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/598167\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/598167\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\" class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><img decoding=\"async\" src=\"\/img\/image-loader.svg\" alt=\"0903_NET6_ru\/image1.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/7a6\/522\/913\/7a6522913a700269aad35cfc06f0caa5.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u043b\u0438\u0437 .NET 6 \u0432\u044b\u0448\u0435\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0440\u043e\u043c\u043a\u0438\u043c \u2013 \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u043f\u043e\u0434 \u044d\u0442\u0443 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443, \u0442\u043e \u043d\u0430\u0432\u0440\u044f\u0434 \u043b\u0438 \u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435. \u041c\u044b \u0442\u043e\u0436\u0435 \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0443\u0434\u0430\u0441\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a .NET.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-327313","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=327313"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327313\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=327313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=327313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=327313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}