Bug 87042

Summary: Passing null as first vararg makes parameter null (3.1M4)
Product: [Eclipse Project] JDT Reporter: Joe Thurbon <joe_thurbon>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eric
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Pass null when its the only argument none

Description Joe Thurbon CLA 2005-03-02 21:30:37 EST
The following method

boolean f(Object ... args) {
  return args == null;
}

should return false for a call f(null, null) but it does not.

In general, passing null as the first vararg makes the argument array within a
vararg method null, rather than an array whose first element is null.
Comment 1 Michael Fraenkel CLA 2005-03-03 10:56:02 EST
Created attachment 18440 [details]
Pass null when its the only argument

This checks the number of arguments passed to the vararg portion of the call to
determine if it should be null or an array of elements which contain null.
Comment 2 Olivier Thomann CLA 2005-03-06 09:46:07 EST
Fixed and released in HEAD.
Thanks for the patch. I prefer to rewrite a big the arguments generation. To
make it easier to read.
Comment 3 Olivier Thomann CLA 2005-03-21 10:10:11 EST
*** Bug 88581 has been marked as a duplicate of this bug. ***
Comment 4 Olivier Thomann CLA 2005-03-30 23:19:38 EST
Verified in 20050330-0500