From 3dfe0af4203ed261359acddc18062ff90a492d63 Mon Sep 17 00:00:00 2001 From: Jens Geyer Date: Wed, 24 Apr 2024 23:54:45 +0200 Subject: [PATCH] THRIFT-5780 Prevent certain warnings related to net8 Client: netstd Patch: Jens Geyer This closes #2965 --- compiler/cpp/src/thrift/generate/t_netstd_generator.cc | 2 ++ lib/netstd/Thrift/Transport/Client/THttpTransport.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/compiler/cpp/src/thrift/generate/t_netstd_generator.cc b/compiler/cpp/src/thrift/generate/t_netstd_generator.cc index 6e464549784..c16a0694c0b 100644 --- a/compiler/cpp/src/thrift/generate/t_netstd_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_netstd_generator.cc @@ -2019,6 +2019,8 @@ void t_netstd_generator::generate_deprecation_attribute(ostream& out, t_function // empty annotation values end up with "1" somewhere, ignore these as well if ((iter->second.back().length() > 0) && (iter->second.back() != "1")) { out << "(" << make_csharp_string_literal(iter->second.back()) << ")"; + } else { + out << "(" << make_csharp_string_literal("This code is deprecated.") << ")"; // generic message to prevent CA1041 } out << "]" << '\n'; } diff --git a/lib/netstd/Thrift/Transport/Client/THttpTransport.cs b/lib/netstd/Thrift/Transport/Client/THttpTransport.cs index 1ab1caf729c..e724665fecd 100644 --- a/lib/netstd/Thrift/Transport/Client/THttpTransport.cs +++ b/lib/netstd/Thrift/Transport/Client/THttpTransport.cs @@ -25,6 +25,8 @@ using System.Threading; using System.Threading.Tasks; +#pragma warning disable IDE0079 // unneeded suppression -> all except net8 +#pragma warning disable IDE0301 // simplify collection init -> net8 only namespace Thrift.Transport.Client {