Bug 445392 - [extract local] Shows wrong message about compile errors when selection contains warning
Summary: [extract local] Shows wrong message about compile errors when selection conta...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: bugday
Depends on:
Blocks:
 
Reported: 2014-09-29 14:46 EDT by Markus Keller CLA
Modified: 2020-02-24 17:56 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2014-09-29 14:46:36 EDT
public class TestExtractLocalVariable {
    void foo() {
        int lonely = -1; // select whole line, try Extract Local Variable
    }
}

Ensure the problem for "Value of local variable is not used" is set to Warning or Error and then try to extract the line indicated above.

=> Error message talks about "compilation errors", which doesn't make sense.

The problem is the ASTNodes#getMessages(ASTNode, int) method, which rarely ever makes sense. We should at least use ASTNodes#getProblems(.., ERROR), or even better, a new severity FATAL_ERROR that only finds real errors and not problems that the user promoted to error (see JavaCore#getOptionForConfigurableSeverity()).
Comment 1 Eclipse Genie CLA 2020-02-24 17:56:24 EST
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.