rspec/rules/S1700/java/rule.adoc

43 lines
899 B
Plaintext

== Why is this an issue?
include::../description.adoc[]
include::../noncompliant.adoc[]
include::../compliant.adoc[]
=== Exceptions
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.
----
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[]
'''
== Comments And Links
(visible only on this page)
=== on 21 Nov 2024, 16:48:00 Alban Auzeill wrote:
[test-code-support-investigation-for-java] Decision for scope: Keep 'Main'. This affects a lot code used as test source, like class Foo with method foo. It could be annoying for users.
endif::env-github,rspecator-view[]