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 250434 - Keyword "new" refactored together with function name
Summary: Keyword "new" refactored together with function name
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-15 15:27 UTC by Vladimir Riha
Modified: 2015-04-26 07:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2015-02-15 15:27:23 UTC
Please try following in JS file:


angular.module("tripPlanner.tripDay")
        .controller("tp.tripDay.TripDayFormCtrl", ["$scope", "tp.trip.TripModel", 
            function TripDayFormCtrl($scope, TripModel, TripHandler) { // lineA
                $scope.trip = trip ? trip : new TripModel("km");  // line B
            }])


if you:
 - click on "TripModel" on lineA => entire "new TripModel("km")" will be marked as occurrence and if you press Ctrl+R, the "new" will be refactored renamed but to some weird name, e.g. if I rename it to "tamto", the line would look like

    $scope.trip = trip ? trip : tamtotamto("km");

 - if you click on TripModel on lineB => it again highlights the "new" but if you press Ctrl+R, it works fine this time.


Thank you




Product Version: NetBeans IDE Dev (Build web-main-1936-on-20150215)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.13.0-43-generic running on amd64; UTF-8; en_US (nb)
Comment 1 Petr Pisl 2015-04-17 08:57:13 UTC
To reproduce this issue is important that the assignment has to be done for parameter like this:

function TripDayFormCtrl($scope, TripModel, TripHandler) {
     TripHandler.trip =trip ? trip : new TripModel("km");
}
Comment 2 Petr Pisl 2015-04-17 09:57:39 UTC
Fixed in web-main.
Comment 3 Quality Engineering 2015-04-20 11:57:45 UTC
Integrated into 'main-silver', will be available in build *201504201004* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/008e6e3a0eb6
User: Petr Pisl <ppisl@netbeans.org>
Log: #250434 - Keyword new refactored together with function name
Comment 4 Vladimir Riha 2015-04-26 07:28:16 UTC
Verified, thank you

Product Version: NetBeans IDE Dev (Build 201504240001)
Java: 1.8.0_40; Java HotSpot(TM) Client VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)