Bug 563782 - [code mining] Opening bracket of invalid expression is displayed in error message line
Summary: [code mining] Opening bracket of invalid expression is displayed in error mes...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.14   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-01 02:39 EDT by Rob Griffin CLA
Modified: 2023-05-20 16:33 EDT (History)
2 users (show)

See Also:


Attachments
Screen shot of display issue (19.53 KB, image/jpeg)
2020-06-01 02:39 EDT, Rob Griffin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Griffin CLA 2020-06-01 02:39:59 EDT
Created attachment 283109 [details]
Screen shot of display issue

When I enter this invalid code the opening bracket after the call to defaultIfNull is displayed on the line above the line containing the call. See the attached screen shot. It is hard to see but the opening bracket, which is cyan in color,  is displayed under the > in the error message. It is definitely not on that line because that line is a virtual line inserted by Eclipse to show the error message.    If I insert an x between defaultIfNull and the ( character then the ( is displayed on the correct line. Deleting the x makes that ( show in the error message line again.   

    public void test() 
    {
        Stream.of(1, 2, 3).mapToDouble(x -> { return defaultIfNull(x, 0.0); }).sum();
    }
    
    public <T> T defaultIfNull(T val, T def)
    {
        if (val == null)
            return def;
        
        return val;
    }
Comment 1 Jeff Johnston CLA 2021-05-27 18:26:29 EDT
This does not occur with 4.20 M3 on Linux.  Will try to get access to Windows 10 box as the one I usually use is no longer on at work.  If this no longer occurs with the latest 2021-03 4.19 release, feel free to chime in.
Comment 2 Eclipse Genie CLA 2023-05-20 16:33:19 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.