From 694d62f57d45d6b04f1c7b400bb164b9bd3876af Mon Sep 17 00:00:00 2001 From: Zsolt Kolbay Date: Thu, 9 Feb 2023 07:49:20 +0100 Subject: [PATCH] Update rule message and VB.NET sample code --- rules/S2166/csharp/message.adoc | 4 ++++ rules/S2166/csharp/rule.adoc | 2 +- rules/S2166/vbnet/message.adoc | 4 ++++ rules/S2166/vbnet/rule.adoc | 6 +++--- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 rules/S2166/csharp/message.adoc create mode 100644 rules/S2166/vbnet/message.adoc diff --git a/rules/S2166/csharp/message.adoc b/rules/S2166/csharp/message.adoc new file mode 100644 index 00000000000..446d8872d8d --- /dev/null +++ b/rules/S2166/csharp/message.adoc @@ -0,0 +1,4 @@ +=== Message + +Rename this class to remove "Exception" or correct its inheritance. + diff --git a/rules/S2166/csharp/rule.adoc b/rules/S2166/csharp/rule.adoc index 04c3f0729a4..7f036aeb021 100644 --- a/rules/S2166/csharp/rule.adoc +++ b/rules/S2166/csharp/rule.adoc @@ -48,7 +48,7 @@ ifdef::env-github,rspecator-view[] == Implementation Specification (visible only on this page) -include::../message.adoc[] +include::message.adoc[] ''' == Comments And Links diff --git a/rules/S2166/vbnet/message.adoc b/rules/S2166/vbnet/message.adoc new file mode 100644 index 00000000000..446d8872d8d --- /dev/null +++ b/rules/S2166/vbnet/message.adoc @@ -0,0 +1,4 @@ +=== Message + +Rename this class to remove "Exception" or correct its inheritance. + diff --git a/rules/S2166/vbnet/rule.adoc b/rules/S2166/vbnet/rule.adoc index 72e3ed4d1dd..b49de9b8abf 100644 --- a/rules/S2166/vbnet/rule.adoc +++ b/rules/S2166/vbnet/rule.adoc @@ -12,7 +12,7 @@ Public Class FruitException ' Noncompliant - this has nothing to do with Excepti End Class Public Class CarException ' Noncompliant - does not derive from any Exception-based class - Public Sub New(ByVal message As String, ByVal inner As Exception) + Public Sub New(message As String, inner As Exception) ' ... End Sub End Class @@ -30,7 +30,7 @@ Public Class FruitSport ' Compliant - class name does not end with 'Exception' End Class Public Class CarException Inherits Exception ' Compliant - correctly extends System.Exception - Public Sub New(ByVal message As String, ByVal inner As Exception) + Public Sub New(message As String, inner As Exception) MyBase.New(message, inner) ' ... End Sub @@ -44,7 +44,7 @@ ifdef::env-github,rspecator-view[] == Implementation Specification (visible only on this page) -include::../message.adoc[] +include::message.adoc[] ''' == Comments And Links