rspec/rules/S2230/java/rule.adoc

34 lines
889 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Marking a non-public method ``++@Transactional++`` is both useless and misleading because Spring doesn't "see" non-``++public++`` methods, and so makes no provision for their proper invocation. Nor does Spring make provision for the methods invoked by the method it called.
Therefore marking a ``++private++`` method, for instance, ``++@Transactional++`` can only result in a runtime error or exception if the method is actually written to be ``++@Transactional++``.
=== 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
----
@Transactional // Noncompliant
private void doTheThing(ArgClass arg) {
// ...
}
----
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[]