Invalid ejbCreate% Definitions in Entity-Beans |
This query determines all the ejbCreate% methods of an entity-bean that do not follow the specification rules.
Pre-packaged Query
Query name="Semmle/StyleChecks/J2EE/Entity-Bean/Check ejbCreate%(..) methods' definition"
Reports all Entity-Bean types that contain ejbCreate%(..) methods that are not public, or that are final or static or that have a return type void.
from EntityBean ebean, Method m
where m.getName().matches("ejbCreate%") and
ebean.inherits(m) and
(not(m.hasModifier("public")) or
m.hasModifier("final") or
m.hasModifier("static") or
m.getType().hasName("void"))
select m, m.toString() + " must be public, not final, not static"
+ " and not have return type void"
References
Enterprise JavaBeans 2.1 - Specification, section 10.6.4 and 12.2.3
|