rspec/rules/S2657/java/rule.adoc

20 lines
521 B
Plaintext
Raw Normal View History

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
----
ClassLoader loader = this.getClass().getClassLoader(); // Noncompliant
ClassLoader loader = new MyClassLoader(); // Noncompliant
----
== See
* http://cwe.mitre.org/data/definitions/578.html[MITRE, CWE-578] - EJB Bad Practices: Use of Class Loader