Review Request: JDK-8205623: Replace use of Class::getPackage with Class::getPackageName

Alan Bateman Alan.Bateman at oracle.com
Mon Jun 25 19:38:40 UTC 2018


On 25/06/2018 19:46, mandy chung wrote:
> This patch replaces the use of Class::getPackage with 
> Class::getPackageName in jdk.internal.reflect.ReflectionFactory, 
> sun.util.resources.BreakIteratorResourceBundle, and 
> javax.xml.catalog.CatalogMessages.  Class::getPackageName avoids the 
> overhead of constructing Package objects.
>
> http://cr.openjdk.java.net/~mchung/jdk11/webrevs/8205623/webrev.00/
>
> ReflectionFactory::packageEquals does not specify if the Class object 
> is an array class.  In the current implementation it returns true even 
> if the input parameters are both array classes but in two different 
> runtime package.  I added an assert instead of retaining the current 
> behavior.
BreakIteratorResourceBundler and CatalogMessages look okay.

For ReflectionFactory.packageEquals then it might be cleaner to put the 
assert first but what you have is okay too.

-Alan


More information about the core-libs-dev mailing list