Modify rule S2225: Add VB.NET (#1062)

This commit is contained in:
Corniel Nobel 2022-10-18 12:11:58 +02:00 committed by GitHub
parent 1798aee443
commit d97e324e11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,3 @@
{
"title": "\"ToString()\" method should not return Nothing"
}

View File

@ -0,0 +1,36 @@
Calling `ToString()` on an object should always return a string. Returning `Nothing` instead contravenes the method's implicit contract.
== Noncompliant Code Example
[source,vbnet]
----
Public Overrides Function ToString() As String
Return Nothing
End Function
----
== Compliant Solution
[source,vbnet]
----
Public Overrides Function ToString() As String
Return ""
End Function
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]