users@jersey.java.net

Re: [Jersey] GenericEntity could be refactored into a named _static_ inner class

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 11 Jan 2010 10:28:08 +0100

On Jan 9, 2010, at 8:47 PM, Felipe Gaścho wrote:

> 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

What errors are being reported?


> 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 ?
>

Yes, define a non-anonymous static class.

Paul.