Bug 549088 - [syntax coloring] Auto(un)boxed expressions not working with methods in ternary operator
Summary: [syntax coloring] Auto(un)boxed expressions not working with methods in terna...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.10   Edit
Hardware: PC Windows 10
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-09 05:19 EDT by Martin Fabricius CLA
Modified: 2023-06-23 11:59 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Fabricius CLA 2019-07-09 05:19:49 EDT
Syntax coloring of Auto(un)boxed values has some issues with the ternary operator. Consider the following cases: (t() is just a boolean function to get the compiler to not ignore the else case)

void autoBoxing() {
    Long l = t() ? 20L : 0L; // working as inteded, both marked
}
-------------------------
void autoBoxing() {
    long l = t() ? getLong() : 0L; // working as inteded, getLong() is marked
}
private Long getLong() {
    return Long.valueOf(0L);
}
-------------------------
void autoBoxing() {
    long l = t() ? getLong() : getLong(); // NOT working, nothing marked
}
private Long getLong() {
    return Long.valueOf(0L);
}
-------------------------
void autoBoxing() {
    Long l = t() ? getLong() : 0L; // NOT working, only 0L marked
}
private long getLong() {
    return 0L;
}
-------------------------
void autoBoxing() {
    Long l = t() ? getLong() : getLong(); // NOT working, nothing marked
}
private long getLong() {
    return 0L;
}

The problem with all these cases is that "INVOKEVIRTUAL Long.longValue() : long" does not come immediately after the long getter/loader but in another bytecode branch after a "GOTO" with a "FRAME SAME1 long" in between.
Comment 1 Eclipse Genie CLA 2021-07-02 16:58:17 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.
Comment 2 Eclipse Genie CLA 2023-06-23 11:59:31 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.