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 228094 - Refactoring: only usages are changed, #define in header from the refactoring was called, remains unchanged
Summary: Refactoring: only usages are changed, #define in header from the refactoring ...
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.4
Hardware: All All
: P1 normal (vote)
Assignee: Egor Ushakov
URL:
Keywords: 7.4_HR_FIX, REGRESSION
Depends on:
Blocks:
 
Reported: 2013-03-29 16:50 UTC by mariusz_m
Modified: 2013-11-11 20:13 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (53.88 KB, text/plain)
2013-03-29 16:50 UTC, mariusz_m
Details
var/log/messages (70.95 KB, application/octet-stream)
2013-04-05 15:28 UTC, mariusz_m
Details
screenshoot (8.78 MB, application/octet-stream)
2013-09-25 12:36 UTC, mariusz_m
Details
code diagnostic dump (731.53 KB, application/x-zip)
2013-09-25 12:37 UTC, mariusz_m
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mariusz_m 2013-03-29 16:50:23 UTC
Product Version = NetBeans IDE 7.3 (Build 201302132200)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_24
Runtime = Java HotSpot(TM) Client VM 19.1-b02

As in summary, refer to NB C++ 7.3 (clean) as well 7.3 with latest updates installed
Comment 1 mariusz_m 2013-03-29 16:50:31 UTC
Created attachment 133218 [details]
IDE log
Comment 2 Vladimir Voskresensky 2013-04-04 08:39:37 UTC
mariusz_m,

Could you, please, provide more details (ideally steps or test case to reproduce)
Comment 3 mariusz_m 2013-04-04 15:41:27 UTC
Ok,
First, this bug appeared first on 7.3, it newer happened in 7.2
Second - I have no idea how to ideally reproduce, but the steps are as follows:
- you have some variable int MyCounter defined in program.cpp
- in program.h variable is defined as extern int MyCounter
- this variable is used in a few other files
- now, open program.h, set cursor over MyCounter and press Ctrl+R to show refactoring dialog
- enter a new name, lets say, EventCounter, and click Refactor
- it looks like nothing happened, the variable name is still MyCounter, but if you looks into program.cpp you can see that variable rename was made

This is not a rule - most time it works as expected, but if broken once, I have to restart NB to make it working again.

A few days ago I did an update from help->Check for updates, so maybe it is already fixed. I will let you know if it happen again
Comment 4 mariusz_m 2013-04-05 15:28:34 UTC
Created attachment 133336 [details]
var/log/messages
Comment 5 mariusz_m 2013-04-05 15:29:12 UTC
Module C/C++ Refactoring threw java.lang.IllegalArgumentException: Unit: D:/Dokumenty/Projekty/EGOL/eGOL/Source/N/ FileIndex: 923 CacheSize: 780 Thread=OpenIDE-request-processor-14. Please report a bug against C/C++ Refactoring module and attach your var/log/messages.log.
Comment 6 mariusz_m 2013-04-05 15:32:05 UTC
What I observe is that 'Find occurrences' is not working (always find nothing until NB restart). Maybe this is connected to refactoring module?
Comment 7 mariusz_m 2013-04-13 16:50:24 UTC
I'm still working on my project in NB, and these are my observations:
- refactoring is made local if the variable is local to some function, and renaming is done 'in place' (this mean I change selected name in the main editor), or global, and then Rename dialog box is showing
- when I want do a local variable rename, and the file is unchanged, NB enter in place rename mode
- when I want do a local variable rename, and the file is changed and NOT SAVED, then, sometimes (lets say 30%), NB enter global rename mode - is such a situations, when I type new name and click rename, nothing is changed.
If I cancel this dialog box and press Ctr+R again, NB enter to in place rename mode and everything works fine.

The issue when NB functions are not working correctly on unsaved files is probably connected to #224011
Comment 8 mariusz_m 2013-09-25 12:36:08 UTC
Created attachment 140464 [details]
screenshoot
Comment 9 mariusz_m 2013-09-25 12:37:36 UTC
Created attachment 140465 [details]
code diagnostic dump
Comment 10 mariusz_m 2013-09-25 12:43:32 UTC
Product Version = NetBeans IDE 7.4 RC1 (Build 201309162201)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.7.0_11
Runtime = Java HotSpot(TM) Client VM 23.6-b04

This issue is still not fixed.
Take a look at the video capture and the full code model dump.
Comment 11 Egor Ushakov 2013-09-25 16:03:56 UTC
This is a regression after text index introduction,
simple test case:
- #define AAA 1
- and no usage anywhere
- find usages on this AAA gives 0 results
Comment 12 Egor Ushakov 2013-09-25 16:41:36 UTC
fixed in 3ef6b6882a29
Comment 13 Vladimir Voskresensky 2013-09-25 17:06:39 UTC
reviewed: fix is correct and safe
Comment 14 Egor Ushakov 2013-09-25 17:16:34 UTC
fix in cnd-main: http://hg.netbeans.org/cnd-main/rev/1a9cbd24f3d4
Comment 15 Alexander Pepin 2013-09-25 17:29:15 UTC
Both testcases verified in dev cnd build.
Please push the fix into release branch.
Comment 16 Egor Ushakov 2013-09-25 17:32:03 UTC
integrated into release74:
http://hg.netbeans.org/releases/rev/fa288ee4a9e4
Comment 17 Quality Engineering 2013-11-11 20:13:22 UTC
Integrated into 'releases/release74', will be available in build *201311111738* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/b8df46d1b0a5
User: Egor Ushakov <gorrus@netbeans.org>
Log: test for Bug 228094 - Refactoring: only usages are changed, #define in header from the refactoring was called, remains unchanged
(transplanted from b54ac7a57e5bddc3967c3a14b76942f62dcede4b)