rspec/rules/S1144/scala/rule.adoc

46 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2023-10-20 15:29:34 +02:00
:operationName: method
:visibility: private
include::../why.adoc[]
=== Code examples
=== Noncompliant code example
[source,scala,diff-id=1,diff-type=noncompliant]
----
class Foo extends Serializable {
private def unusedMethod(): Unit = {...} // Noncompliant
private def writeObject(s: ObjectOutputStream): Unit = {...} // Compliant, relates to the serialization mechanism
private def readObject(s: ObjectInputStream): Unit = {...} // Compliant, relates to the serialization mechanism
}
----
=== Compliant solution
[source,scala,diff-id=1,diff-type=compliant]
----
class Foo extends Serializable {
private def writeObject(s: ObjectOutputStream): Unit = {...} // Compliant, relates to the serialization mechanism
private def readObject(s: ObjectInputStream): Unit = {...} // Compliant, relates to the serialization mechanism
}
----
include::../exceptions-jvm.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[]