On 2016-08-16 19:20, Ivan Gerasimov wrote:
ObjectStreamClass:

I wonder if the entire getPackageName is replaceable with
Class.getPackageName()? If so, ditch the method completely and use
Class.getPackageName everywhere. This may complicate backporting to JDK
8 though.

Unfortunately, Class.getPackageName() cannot handle arrays, so I'll leave it as is.

There are a number of utility methods around that could be reused,
e.g., jdk.internal.reflect.Reflection.isSameClassPackage handles both arrays and
primitive types and could replace both packageEquals and getPackageName in
ObjectStreamClass (which already use j.i.r.Reflection for other things). Making
isSameClassPackage in Reflection public should be non-controversial, I hope.

Thanks!

/Claes

Reply via email to