You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Michael Gentry <bl...@gmail.com> on 2008/10/21 17:12:20 UTC

static final classes?

I was doing a little cleanup under org.apache.cayenne.cache and
FindBugs was issuing warnings about the final inner classes at the
bottom of MapQueryCache.java (CacheEntry) and OSQueryCache.java
(OSCacheAdministrator).  Should these be declared as "final static
class" instead of "final class"?

Thanks!

Re: static final classes?

Posted by Michael Gentry <bl...@gmail.com>.
I'm OK with that, too.  I'll make the updates soonish.

Thanks!


On Tue, Oct 21, 2008 at 12:20 PM, Andrus Adamchik
<an...@objectstyle.org> wrote:
>
> On Oct 21, 2008, at 11:31 AM, mgentry@apache.org wrote:
>
>> -    public List get(QueryMetadata metadata) {
>> +    public List<?> get(QueryMetadata metadata) {
>>        String key = metadata.getCacheKey();
>>        if (key == null) {
>>            return null;
>
>
> Michael,
>
> you may check this discussion on why returning List<?> from a method is a
> bad idea:
>
> http://markmail.org/message/ts4zjelowa55nfgg
> http://markmail.org/message/cp63by2swbdnfp7v
>
> I suggest @SuppressWarnings("unchecked") instead.
>
> Thanks,
> Andrus
>
>
> On Oct 21, 2008, at 11:12 AM, Michael Gentry wrote:
>
>> I was doing a little cleanup under org.apache.cayenne.cache and
>> FindBugs was issuing warnings about the final inner classes at the
>> bottom of MapQueryCache.java (CacheEntry) and OSQueryCache.java
>> (OSCacheAdministrator).  Should these be declared as "final static
>> class" instead of "final class"?
>>
>> Thanks!
>>
>
>

Re: static final classes?

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Oct 21, 2008, at 11:31 AM, mgentry@apache.org wrote:

> -    public List get(QueryMetadata metadata) {
> +    public List<?> get(QueryMetadata metadata) {
>         String key = metadata.getCacheKey();
>         if (key == null) {
>             return null;


Michael,

you may check this discussion on why returning List<?> from a method  
is a bad idea:

http://markmail.org/message/ts4zjelowa55nfgg
http://markmail.org/message/cp63by2swbdnfp7v

I suggest @SuppressWarnings("unchecked") instead.

Thanks,
Andrus


On Oct 21, 2008, at 11:12 AM, Michael Gentry wrote:

> I was doing a little cleanup under org.apache.cayenne.cache and
> FindBugs was issuing warnings about the final inner classes at the
> bottom of MapQueryCache.java (CacheEntry) and OSQueryCache.java
> (OSCacheAdministrator).  Should these be declared as "final static
> class" instead of "final class"?
>
> Thanks!
>


Re: static final classes?

Posted by Andrus Adamchik <an...@objectstyle.org>.
Doesn't matter to me either way.

On Oct 21, 2008, at 11:12 AM, Michael Gentry wrote:

> I was doing a little cleanup under org.apache.cayenne.cache and
> FindBugs was issuing warnings about the final inner classes at the
> bottom of MapQueryCache.java (CacheEntry) and OSQueryCache.java
> (OSCacheAdministrator).  Should these be declared as "final static
> class" instead of "final class"?
>
> Thanks!
>