EJB Component Static Fields' Modifiers

This query determines all fields of EJB components that have incorrect modifiers.

Pre-packaged Query

Query name="Semmle/StyleChecks/J2EE/EJB Component/All static fields of an EJB Component must also be final"

Reports, for all EJB Component types, the static fields that are not declared as final.

from EnterpriseBean ebean, Field f
where ebean.getAField() = f and
      f.hasModifier("static") and
      not(f.hasModifier("final"))
select f, f.toString() + " EJB Component must declare"
                       + " all static fields as final"

References

Sanjay Mahapatra. Programming restrictions on EJB. September 25, 2000.

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

Comments
Only registered users can write comments!
 
< Prev