No Valid ejbCreate Definitions in Session-Beans |
This query determines all the stateless session-beans that do not define a valid ejbCreate() method.
Pre-packaged Query
Query name="Semmle/StyleChecks/J2EE/Session-Bean/Stateless Session-Bean/A session-bean must have a valid ejbCreate() method definition"
Reports all stateless Session-Bean types that do not contain one ejbCreate() method that is public, not final and not static, takes no parameters and has return type void.
from SessionBean sbean
where not exists(Method m | m.getName().matches("ejbCreate") and sbean.inherits(m) and m.hasModifier("public") and not(m.hasModifier("final")) and not(m.hasModifier("static")) and
m.hasNoParams() and m.getType().hasName("void"))
select sbean, sbean.toString() + " session-bean must define an ejbCreate()"
+ " method that is public, not final, not static,"
+ " takes no parameters and has return type void"
References
Enterprise JavaBeans 2.1 - Specification, section 7.11.3
|