private MediaType checkFinalContentType(MediaType mt, List<WriterInterceptor> writers) {
if (mt.isWildcardType() || mt.isWildcardSubtype()) {
int mbwIndex = writers.size() == 1 ? 0 : writers.size() - 1;
MessageBodyWriter<Object> writer = ((WriterInterceptorMBW)writers.get(mbwIndex)).getMBW();
Produces pm = writer.getClass().getAnnotation(Produces.class);
if (pm != null) {
List<MediaType> sorted =
JAXRSUtils.sortMediaTypes(JAXRSUtils.getMediaTypes(pm.value()), JAXRSUtils.MEDIA_TYPE_QS_PARAM);
mt = JAXRSUtils.intersectMimeTypes(sorted, mt).get(0);
if (mt.isWildcardType() || mt.isWildcardSubtype()) {
return MediaType.APPLICATION_OCTET_STREAM_TYPE;
}
} else {