Review request for JDK-4487672 (proxy) Proxy constructor should check for null argument
mike.duigou at oracle.com
Thu May 9 18:16:11 UTC 2013
On May 9 2013, at 10:38 , Mandy Chung wrote:
> On 5/9/13 3:00 AM, Alan Bateman wrote:
>> On 09/05/2013 01:13, Mandy Chung wrote:
>>> Please review the simple change for:
>>> JDK-4487672 (proxy) Proxy constructor should check for null argument
>>> Webrev at:
>> It looks okay to me although technically an incompatible change. I guess it will at least have the NPE caught earlier that it would if the handler were actually used.
> Yes it is technically an incompatible change.
> Existing code that constructs a dynamic proxy instance with null argument doesn't get NPE but instead NPE will bethrown at a later time when a method of the proxy instance is invoked. It's expected that such usage should be very rare as such proxy instance has no use at all.
As we found with 5045147 (TreeMap with null first entry), which is similar in terms of how the null treatment changed, there almost certainly will be people's code who barfs when generating the proxy now throws the NPE.
I'm not saying don't make the change, but there will probably some repercussions.
More information about the core-libs-dev