rspec/rules/S1700/java/rule.adoc

36 lines
608 B
Plaintext
Raw Normal View History

== Why is this an issue?
2020-06-30 12:47:33 +02:00
include::../description.adoc[]
include::../noncompliant.adoc[]
include::../compliant.adoc[]
=== Exceptions
2020-06-30 12:47:33 +02:00
When the type of the field is the containing class and that field is static, no issue is raised to allow singletons named like the type.
2021-02-02 15:02:10 +01:00
2020-06-30 12:47:33 +02:00
----
public class Foo {
...
private static Foo foo;
public Foo getInstance() {
if(foo==null) {
foo = new Foo();
}
return foo;
}
...
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
endif::env-github,rspecator-view[]