final ResourceMethod rm,
final ResourceMethodMap rmm) {
final List<ResourceMethod> rml = rmm.get(rm.getHttpMethod());
if (rml != null) {
boolean conflict = false;
ResourceMethod erm = null;
for (int i = 0; i < rml.size() && !conflict; i++) {
erm = rml.get(i);
conflict = MediaTypes.intersects(rm.getConsumes(), erm.getConsumes())
&& MediaTypes.intersects(rm.getProduces(), erm.getProduces());
}
if (conflict) {
if (rm.getAbstractResourceMethod().hasEntity()) {
Errors.error(String.format("Consuming media type conflict. " +
"The resource methods %s and %s can consume the same media type",
rm.getAbstractResourceMethod().getMethod(), erm.getAbstractResourceMethod().getMethod()));
} else {
Errors.error(String.format("Producing media type conflict. " +
"The resource methods %s and %s can produce the same media type",
rm.getAbstractResourceMethod().getMethod(), erm.getAbstractResourceMethod().getMethod()));
}
}
if (conflict)
return false;