Invalid ejbHome% Definitions in Entity-Beans |
This query determines all the ejbHome% methods of an entity-bean that do not follow the specification rules.
Pre-packaged Query
Query name="Semmle/StyleChecks/J2EE/Entity-Bean/Check ejbHome%(..) methods' definition"
Reports all Entity-Bean types that contain ejbHome%(..) methods that are not public, or that are static or that throw an exception of type java.rmi.RemoteException.
from EntityBean ebean, Method m
where m.getName().matches("ejbHome%") and
ebean.inherits(m) and
(not(m.hasModifier("public")) or
m.hasModifier("static") or
m.getAnException().getType().hasQualifiedName("java.rmi","RemoteException"))
select m, m.toString() + " must be public, not static"
+ " and not throw an exception of type"
+ " java.rmi.RemoteException"
References
Enterprise JavaBeans 2.1 - Specification, section 10.6.6 and 12.6.6
|