82 lines
1.5 KiB
Plaintext
82 lines
1.5 KiB
Plaintext
== Why is this an issue?
|
|
|
|
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
|
|
|
|
[source,vbnet]
|
|
----
|
|
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
|
|
|
|
[source,vbnet]
|
|
----
|
|
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
|
|
----
|
|
|
|
|
|
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[]
|