// initialize the result object
Result result = getInitializedResult();
addWarningDetails(result,
getVerifierContext().getComponentNameConstructor());
result.setStatus(Result.PASSED); //default status is PASSED
Set<EjbReferenceDescriptor> s = descriptor.getEjbReferenceDescriptors();
if (s == null) return result;
for(EjbReferenceDescriptor ejbRefDesc : s) {
EjbDescriptor ejbDescriptor = ejbRefDesc.getEjbDescriptor();
if (ejbDescriptor instanceof EjbSessionDescriptor) { // instaceof returns false if ejbDescriptor=null.
String stateType = ((EjbSessionDescriptor)ejbDescriptor).getSessionType();
if(EjbSessionDescriptor.STATEFUL.equals(stateType)) {
Set<InjectionTarget> injectionTargets = ejbRefDesc.getInjectionTargets();
if(injectionTargets != null) {
for(InjectionTarget it : injectionTargets) {
String itClassName = it.getClassName();
result.warning(smh.getLocalString(className + ".warning",
"Found a stateful session bean [ {0} ] injected into [ {1} ].",
new Object[]{ejbDescriptor.getEjbClassName(), itClassName}));
}
}
}
}
}
return result;