rspec/rules/S3546/java/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

60 lines
1.9 KiB
Plaintext

== Why is this an issue?
Leaking resources in an application is never a good idea, as it can lead to memory issues, and even the crash of the application. This rule template allows you to specify which constructions open a resource and how it is closed in order to raise issue within a method scope when custom resources are leaked.
== Resources
=== Related rules
* S2095 - Resources should be closed
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Close this "xxx".
=== Parameters
.constructor
****
the fully-qualified name of a constructor that creates an open resource. An optional signature may be specified after the class name. E.G. "org.assoc.res.MyResource" or "org.assoc.res.MySpecialResource(java.lang.String, int)"
****
.factoryMethod
****
the fully-qualified name of a factory method that returns an open resource, with or without a parameter list. E.G. "org.assoc.res.ResourceFactory#create" or "org.assoc.res.SpecialResourceFactory #create(java.lang.String, int)"
****
.openingMethod
****
the fully-qualified name of a method that opens an existing resource, with or without a parameter list. E.G. "org.assoc.res.ResourceFactory#create" or "org.assoc.res.SpecialResourceFactory #create(java.lang.String, int)"
****
.closingMethod
****
the fully-qualified name of the method which closes the open resource, with or without a parameter list. E.G. "org.assoc.res.MyResource#closeMe" or "org.assoc.res.MySpecialResource#closeMe(java.lang.String, int)"
****
'''
== Comments And Links
(visible only on this page)
=== relates to: S2095
=== on 1 Mar 2016, 18:36:07 Ann Campbell wrote:
\[~didier.besset] I've added the parameter we discussed and made some additional changes to the param descriptions.
=== on 12 Jul 2016, 20:12:17 Ann Campbell wrote:
FYI [~nicolas.peru] I'm unassigning this from Didier
endif::env-github,rspecator-view[]