//get the mappedName if there is one
String mappedName = (resource.mappedName()!=null && !resource.mappedName().trim().equals("")?resource.mappedName():null);
Class type = m.getParameterTypes()[0];
//get other parts that can be specified in @Resource
Resource.AuthenticationType auth = resource.authenticationType();
boolean shareable = resource.shareable();
//if @Resource specifies a type, check it is compatible with setter param
if ((resource.type() != null)
&&
!resource.type().equals(Object.class)