users@jersey.java.net

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

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Tue, 12 Jan 2010 13:57:15 +0100

not with Feed, but with the Advertisement collection: (* ok, the feed
is created from the same dataset, but this is another topic...)

The Jersey interface that exposes the Advertisements as JSONP (line 62):

http://kenai.com/projects/puj/sources/arena/content/arena-http/src/main/java/com/kenai/puj/arena/http/PujAdvertisementResource.java

For this class, findbugs emits a low priority warning about the

new GenericEntity<Collection>(...) { } <<< this is the warning reason

ndoz <Paul.Sandoz_at_sun.com> wrote:
>
> On Jan 12, 2010, at 1:39 PM, Felipe Gaucho wrote:
>
>> Because you create an inner class GenericEmtity...
>>
>
> How is that code snippet related to "com.kenai.puj.arena.model.atom.Feed" ?
>
> Paul.
>
>
>> I am not saying findbugs is right, just looking for a workaround...
>>
>
>> On 12.01.2010, at 13:31, Paul Sandoz <Paul.Sandoz_at_Sun.COM> wrote:
>>
>>>
>>> On Jan 11, 2010, at 6:26 PM, Felipe Gaścho wrote:
>>>
>>>> here it is, the findbugs low priority bad practice warning:
>>>>
>>>> File: Feed.java, Line: -1, Type: SE_BAD_FIELD, Priority: Low,
>>>> Category: BAD_PRACTICE
>>>>
>>>> Class com.kenai.puj.arena.model.atom.Feed defines non-transient
>>>> non-serializable instance field entries
>>>>
>>>> This Serializable class defines a non-primitive instance field which
>>>> is neither transient, Serializable, or java.lang.Object, and does not
>>>> appear to implement the Externalizable interface or the readObject()
>>>> and writeObject() methods.  Objects of this class will not be
>>>> deserialized correctly if a non-Serializable object is stored in this
>>>> field.
>>>>
>>>
>>> How is the above related to the following?
>>>
>>> return new JSONWithPadding(
>>>      new GenericEntity<Collection<PujAdvertisementEntity>>(adsFacade
>>>              .getAdvertisement(competition, role, max)) {
>>>      }, callback);
>>>
>>> I cannot see any connection.
>>>
>>> Paul.
>>>
>>>>
>>>>
>>>> 2010/1/11 Felipe Gaścho <fgaucho_at_gmail.com>:
>>>>>>
>>>>>> What errors are being reported?
>>>>>
>>>>> somehow my Hudson is not showing the findbugs details outside my
>>>>> machine :(
>>>>>
>>>>> so in the evening I can send some issues details.....
>>>>>
>>>>>
>>>>>>> question: is there any way of doing that without this anonymous inner
>>>>>>> class ?
>>>>>>>
>>>>>>
>>>>>> Yes, define a non-anonymous static class.
>>>>>
>>>>> ok.......
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> ------------------------------------------
>>>> Felipe Gaścho
>>>> 10+ Java Programmer
>>>> CEJUG Senior Advisor
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>



-- 
------------------------------------------
   Felipe Gaścho
   10+ Java Programmer
   CEJUG Senior Advisor