Enterprise Java Bean class modifiers test. The class must not be final.
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
Class c = loadEjbClass(descriptor, result);
if (c!=null) {
boolean isFinal = false;
int modifiers = c.getModifiers();
if (Modifier.isFinal(modifiers)) {
isFinal = true;
}
if (!isFinal) {
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.passed(smh.getLocalString
(getClass().getName() + ".passed",
"[ {0} ] properly declares non-final class modifier.",
new Object[] {descriptor.getEjbClassName()}));
} else if (isFinal) {
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed(smh.getLocalString
(getClass().getName() + ".failed",
"Error: Ejb Class [ {0} ] was found, but was declared as final. The class [ {1} ] must not be defined as final.",
new Object[] {descriptor.getEjbClassName(),descriptor.getEjbClassName()}));
}
}
return result;