javaintellij-ideainspectioncode-inspection

IntelliJ IDEA: What is 'Unnecessary local variable' inspection name?


I want to run certain inspection on Java project. I see this inspection working in real-time in edit window. But when I use "Analyze -> Run Inspection By Name" I can't find this inspection. Actually there is one with the same name but it's for JavaScript(tried it though, not working, as expected). Can anyone tell me exact name of inspection I need or teach me how to figure it out?

Here's code sample:

private Integer getInteger(){
    //x on the line below will be highlighted by inspection saying
    // "Local variable 'x' is redundant more... (Ctrl+F1)"
    Integer x = 5;
    return x;
}

Update: I managed to launch needed inspection using workaround. I created test case like above, then pressed Alt+Enter on highlighted region then right arrow key and selected "Run inspection on".enter image description here This is working, but still leaves unclear how to run same inspection via "Analyze -> Run Inspection By Name"


Solution

  • This was caused by a bug, which was fixed in IntelliJ IDEA 14.