review of 7117249: java.util warnings patches from LJC/Mike Barker

Alan Bateman Alan.Bateman at oracle.com
Mon Dec 5 11:48:51 UTC 2011


On 04/12/2011 08:56, Michael Barker wrote:
> Hi,
>
>> scan of the webrev. There are still a couple of raw type warnings in JarFile
>> and several more in other classes in these packages so it's possible you
>> don't have everything (I wasn't following that thread closely on jdk8-dev).
> Question on a rawtypes fix.  In one case there is method defined as:
>
> public List<?>  getManifestDigests() {
>      if (jv != null) {
>          return jv.getManifestDigests();
>      }
>      return new ArrayList();
> }
>
> There is a rawtypes warning on the "new ArrayList()".  I can put a
> specific type as the return value should match
> "jv.getManifestDigests()", which is public so shouldn't be changed.  I
> can define it as "new ArrayList<Object>()" or add
> "@SuppressWarnings("rawtypes") // Need raw type to match public
> signature definition".  Which would be the preferred approach?
>
> Mike.
I suspect you just need to pull the latest changes because as part of 
7116722 [1], Chris has fixed JarVerifier's getManifestDigests to return 
List<Object>. This should mean that JarFile.getManfiestDigest can be 
changed to:

     List<Object> getManifestDigests() {
         ensureInitialization();
         if (jv != null) {
             return jv.getManifestDigests();
         }
         return new ArrayList<Object>();
     }

-Alan.

[1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/3b8186aee592



More information about the core-libs-dev mailing list