This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 267260 - Bad "Invalid selection" error on Introduce Local Variable refactor
Summary: Bad "Invalid selection" error on Introduce Local Variable refactor
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.2
Hardware: PC Linux
: P4 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-22 19:57 UTC by mclaborn
Modified: 2016-07-27 21:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (65.14 KB, text/plain)
2016-07-22 19:57 UTC, mclaborn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mclaborn 2016-07-22 19:57:14 UTC
Product Version = NetBeans IDE Dev (Build 201607210002)
Operating System = Linux version 4.4.0-31-generic running on amd64
Java; VM; Vendor = 1.8.0_102
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.102-b14

Reproducibility: Happens every time

See code snippet below. 
Highlight the phrase "l_row.optDouble("price") * -1.0"
Invoice Refactor -> Introduce -> Variable

Get an error "Invalid Selection".

  private void fred() {
    JSONWrapper2 l_row = null;
    double l_subtotal = l_row.optDouble("credit") * l_row.optDouble("price") * -1.0;
  }

That should be a valid refactor scenario.
Comment 1 mclaborn 2016-07-22 19:57:16 UTC
Created attachment 161391 [details]
IDE log