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.
Product Version = NetBeans IDE 7.1 (Build 201112051121) Operating System = Windows 7 version 6.1 running on amd64 Java; VM; Vendor = 1.7.0_02 Runtime = Java HotSpot(TM) 64-Bit Server VM 22.0-b10 according to http://wiki.netbeans.org/NewAndNoteworthyNB71#Inline in calculatePrice the assignement of basePrice should be removed and all other occurenced should be replaced by "getBasePrice" double BASEPRICE = 2000; public double calculatePrice() { double basePrice = getBasePrice(); if (basePrice > 1000) { return basePrice * 0.95; }else{ return basePrice * 0.98; // mark this line and choose refactoring -> inline } } private double getBasePrice() { return BASEPRICE; } But, NB alerts, a method with multiple return statements cannot be refactored by inline
Selecting a whole line in the method (I think this is what you meant with mark) and then choose Inline, will start the Inline Method Refactoring for calculatePrice(). To inline the temporary variable basePrice; place the cursor on the variable name or select the variable name and choose Refactor->Inline... I changed the bug to improve the selection, as selecting the whole variable declaration statement, incorrectly starts Inline Method. Thanks for the report.
Changeset: f07629ac63a5 Author: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Date: 2012-04-11 14:30 Message: Issue #207090 - [Inline] Improve selection
Integrated into 'main-golden', will be available in build *201204130400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f07629ac63a5 User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: Issue #207090 - [Inline] Improve selection