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

Bug 513512

Summary: [1.8] Inline method inside a lambda method incorrectly places local variables before the lambda body
Product: [Eclipse Project] JDT Reporter: Eugene Ryazanov <katzyn>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: noopur_gupta
Version: 4.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Eugene Ryazanov CLA 2017-03-10 22:14:25 EST
Inlining of min() method in the following sample produces incorrect code.

public class T {
    static {
        a(t -> min(t - 1, 0));
    }

    static void a(LongUnaryOperator a) {
    }

    static long min(long a, long b) {
        return a <= b ? a : b;
    }
}

Actual result:

    static {
        long a1 = t - 1;
        a(t -> (a1 <= (long) 0 ? a1 : 0));
    }

Expected result:

    static {
        a(t -> {
            long a1 = t - 1;
            return (a1 <= (long) 0 ? a1 : 0);
        });
    }
Comment 1 Eclipse Genie CLA 2019-09-10 07:09:54 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.

If you have further information on the current state of the bug, please add it. 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.