users@jersey.java.net

GenericEntity could be refactored into a named _static_ inner class

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Sat, 9 Jan 2010 20:47:06 +0100

I have a set of methods with return type of JSONWithPadding ..


it works, actually it is a fantastic feature of Jersey..

the problem is, this methods are driven Findbugs crazy because of the
inner class used to create the response in case of collections,
example:

return new JSONWithPadding(
                new GenericEntity<Collection<PujAdvertisementEntity>>(adsFacade
                                .getAdvertisement(competition, role, max)) {
                }, callback);

question: is there any way of doing that without this anonymous inner class ?