Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 466750

Summary: [quick fix] Change method drops varargs for no good reason
Product: [Eclipse Project] JDT Reporter: Andreas Sewe <sewe>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: noopur_gupta
Version: 3.8.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
Screenshot illustrating the situation none

Description Andreas Sewe CLA 2015-05-07 11:27:18 EDT
Created attachment 253303 [details]
Screenshot illustrating the situation

This occurs with Mars M5 & M6 (haven't tested M7 yet -- sorry). Using a quick fix in the snippet below

    public static void foo(int x, int... ys) {
        int i = x + ys.length;
    }

    public static void bar() {
        foo(true, 2); // Trigger quick fix here
    }

suggests changing the signature of foo(int, int...) to foo(boolean, int), even though nothing is wrong with the second argument (the number 2). In particular, applying the quickfix even breaks the use of ys.length in foo's body.
Comment 1 Noopur Gupta CLA 2015-05-08 04:29:17 EDT
Reproducible in Eclipse 3.8.1 also.
Comment 2 Eclipse Genie CLA 2020-04-28 19:12:42 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.