rspec/rules/S3057/java/rule.adoc

38 lines
706 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
A serialVersionUID field is required in a ``++Serializable++`` class. In a non-``++Serializable++``, it's just confusing.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,java]
2021-04-28 16:49:39 +02:00
----
public class MyClass {
private static final long serialVersionUID = -1L; // Noncompliant
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove this serialVersionUID.
'''
== Comments And Links
(visible only on this page)
=== on 12 Jun 2015, 15:16:42 Ann Campbell wrote:
CodePro: Non-serializable Class Declares serialVersionUID
=== on 15 Jun 2015, 20:21:46 Nicolas Peru wrote:
Looks good
endif::env-github,rspecator-view[]