rspec/rules/S3998/vbnet/rule.adoc

51 lines
752 B
Plaintext
Raw Normal View History

2021-01-23 04:07:47 +00:00
include::../description.adoc[]
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,vbnet]
2021-01-23 04:07:47 +00:00
----
Public Class Sample
Private myString As String = "foo"
Public Sub Go()
SyncLock myString ' Noncompliant
End SyncLock
End Sub
End Class
----
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,vbnet]
2021-01-23 04:07:47 +00:00
----
Public Class Sample
Private Shared ReadOnly fLock As New Object
Public Sub Go()
SyncLock fLock
End SyncLock
End Sub
End Class
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]