Entity-Beans with finalize Method

The aim of this query is to point out violations of the following rule: an entity-bean class must not define the finalize method.

Pre-packaged Query

Query name="Semmle/StyleChecks/J2EE/Entity-Bean/An entity-bean class must not define the finalize method"

Reports all Entity-Bean types that define a finalize method with no arguments and a void return type.

from EntityBean ebean, Method m
where m.getDeclaringType() = ebean and
m.hasName("finalize") and
m.hasNoParams() and m.getType().hasName("void") select m, ebean.toString() + " entity-bean class" + " must not define the finalize method"

References

Enterprise JavaBeans 2.1 - Specification, section 10.6.2 and 12.2.2

Digg!Reddit!Del.icio.us!Facebook!Slashdot!Technorati!StumbleUpon!Ma.gnolia!

Comments
Only registered users can write comments!
 
< Prev   Next >