72 lines
1.4 KiB
Plaintext
72 lines
1.4 KiB
Plaintext
The name of a parameter in an externally visible. This rule raises an issue when method override does not match the name of the parameter in the base declaration of the method, or the name of the parameter in the interface declaration of the method.
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
Public MustInherit Class Base
|
|
|
|
Public MustOverride Sub DoSomething(Name As String)
|
|
|
|
End Class
|
|
|
|
Public Interface IContract
|
|
|
|
Sub Add(Count As Integer)
|
|
|
|
End Interface
|
|
|
|
Public Class Handler
|
|
Inherits Base
|
|
Implements IContract
|
|
|
|
Public Overrides Sub DoSomething(Description As String) 'Noncompliant, parameter name should be "Name"
|
|
' ...
|
|
End Sub
|
|
|
|
Public Sub Add(Difference As Integer) Implements IContract.Add 'Noncompliant, parameter name should be "Count"
|
|
' ...
|
|
End Sub
|
|
|
|
End Class
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
Public MustInherit Class Base
|
|
|
|
Public MustOverride Sub DoSomething(Name As String)
|
|
|
|
End Class
|
|
|
|
Public Interface IContract
|
|
|
|
Sub Add(Count As Integer)
|
|
|
|
End Interface
|
|
|
|
Public Class Handler
|
|
Inherits Base
|
|
Implements IContract
|
|
|
|
Public Overrides Sub DoSomething(Name As String)
|
|
' ...
|
|
End Sub
|
|
|
|
Public Sub Add(Count As Integer) Implements IContract.Add
|
|
' ...
|
|
End Sub
|
|
|
|
End Class
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|