rspec/rules/S2657/java/rule.adoc

35 lines
728 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
According to the EJB specification, EJB's:
____
...must not attempt to create a class loader; obtain the current class loader; set the context class loader...
____
This rule raises an issue each time an EJB obtains a class loader.
=== 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
----
ClassLoader loader = this.getClass().getClassLoader(); // Noncompliant
ClassLoader loader = new MyClassLoader(); // Noncompliant
----
== Resources
2021-04-28 16:49:39 +02:00
* https://cwe.mitre.org/data/definitions/578[MITRE, CWE-578] - EJB Bad Practices: Use of Class Loader
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
endif::env-github,rspecator-view[]