throw new DeploymentUnitProcessingException("Failed to get method '" + methodName + "' from class '" + owningClass + "'", e);
}
final Resource resource = method.getAnnotation(Resource.class);
if (resource != null) {
final String contextNameSuffix = methodName.substring(3, 4).toLowerCase() + methodName.substring(4);
final Class<?> injectionType = resource.type().equals(Object.class) ? method.getReturnType() : resource.type();
final String localContextName = resource.name().isEmpty() ? contextNameSuffix : resource.name();
return new ResourceConfiguration(methodName, method, ResourceConfiguration.TargetType.METHOD, injectionType, localContextName, getTargetContextName(resource, contextNameSuffix, injectionType));
}
return null;
}