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.
http://silveiraneto.net/downloads/netbeans_bug_c_renaming_refactoring.ogg I was recording a screencast about C/C++ live renaming refactoring (Ctrl+R) and instead of that I recorded a bug. This feature usually works, but two times this happened with me. Unfortunately, I don't know how to reproduce this bug but I guess that this video can help. I was using NB 6.5 rc2.
How to view the video? My browser does not understand it.
I see such video in MPlayer (http://www.mplayerhq.hu/design7/dload.html)
What is your OS? Could you send me your file. I created the file with your content on Linux: #include <malloc.h> typedef struct _Matrix { int size; float M[][]; } Matrix; Matrix* new_matrix(int size) { int i, j; Matrix* mymatrix = (Matrix*) calloc(sizeof(Matrix), 1); mymatrix->size = size; mymatrix->M = calloc(sizeof(float*), mymatrix->size); for(i = 0; i < mymatrix-size; i++) { mymatrix->M[i] = calloc(sizeof(float), mymatrix->size+1); for(j=0; j < mymatrix->size + 1; j++) { mymatrix->M[i][j]=0; } } return mymatrix; } but it works OK I think, could be something with line feed if you are on Windows... Thanks, Vladimir.
Sources: http://code.google.com/p/clustersystemsolver/source/browse/trunk/Matrix.c http://code.google.com/p/clustersystemsolver/source/browse/trunk/Matrix.h No, I'm using Linux too. I had performed the code refactoring in C code before without errors, even refactoring more 'hard' than this one, like change a field of a struct and it worked. But, as I said, that was the second time I got this bug.
Hm... I checked out source project and was unable to reproduce... Is it reproducible with mymatrix variable each time or randomly?
Try this. 1) Open the matrix.c file and preform a renaming refactoring using Ctrl+R on the newmatrix variable. 2) Open the matrix.h file and play a little bit with the entities in the Navigation tab. 3) Back to matrix.c try find (Ctrl+F) the newmatrix variable. 4) Perform the renaming refactoring again.
Couldn't reproduce 100% with your scenario :-( But I've seen the problem once after Undo actions!
I got it 100%! Just press Ctrl-R twice and start typing => your problem If press Cltr-R a lot and start typing => exception SEVERE: End offset of removed text 296 > getLength()=295 javax.swing.text.BadLocationException: End offset of removed text 296 > getLength()=295 at org.netbeans.editor.BaseDocument.remove(BaseDocument.java:876) [catch] at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:157) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at org.netbeans.modules.cnd.refactoring.actions.SyncDocumentRegion.sync(SyncDocumentRegion.java:155) at org.netbeans.modules.cnd.refactoring.actions.InstantRenamePerformer.insertUpdate(InstantRenamePerformer.java:243) at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:802) at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:655) at javax.swing.text.JTextComponent.replaceSelection(JTextComponent.java:1351) at javax.swing.JEditorPane.replaceSelection(JEditorPane.java:1202) at org.netbeans.editor.BaseKit$DefaultKeyTypedAction.replaceSelection(BaseKit.java:1177) at org.netbeans.editor.BaseKit$DefaultKeyTypedAction$1.run(BaseKit.java:1102) at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:324) at org.netbeans.editor.BaseKit$DefaultKeyTypedAction.actionPerformed(BaseKit.java:1084) at org.netbeans.editor.ext.ExtKit$ExtDefaultKeyTypedAction.actionPerformed(ExtKit.java:1014) at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:297) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1636) at javax.swing.JComponent.processKeyBinding(JComponent.java:2849) at javax.swing.JComponent.processKeyBindings(JComponent.java:2884) at javax.swing.JComponent.processKeyEvent(JComponent.java:2812) at java.awt.Component.processEvent(Component.java:5818) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4413) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4243) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:697) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:962) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:834) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:661) at java.awt.Component.dispatchEventImpl(Component.java:4285) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Window.dispatchEventImpl(Window.java:2440) at java.awt.Component.dispatchEvent(Component.java:4243) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
fixed: http://hg.netbeans.org/main?cmd=changeset;node=6622fb2fcf5c
would like to see in in Patch1
Integrated into 'main-golden', will be available in build *200811091401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/6622fb2fcf5c User: Vladimir Voskresensky <vv159170@netbeans.org> Log: fixed IZ#152775: Instant Renaming refactoring in C goes wrong
verified in build 200811200201
The fix was ported into release65_repository. http://hg.netbeans.org/release65_fixes/rev/ccbb2ac2d4f9
verified in nb6.5 with patch1
The bug is corrected in NetBeans 6.5 final. I tried, is working just fine. =) Thank you guys.
*** Issue 157302 has been marked as a duplicate of this issue. ***
Notice that a number of new reports for 7.0 and 7.0.1 are coming in and being classified as duplicates of this bug.
(In reply to comment #17) > Notice that a number of new reports for 7.0 and 7.0.1 are coming in and being > classified as duplicates of this bug. Where can I have a look at such reports about 7.0 && 7.0.1? Have you updated your IDE in update center today? Could you provide steps to reproduce, please? Thanks, Vladimir.
(In reply to comment #18) > (In reply to comment #17) > > Notice that a number of new reports for 7.0 and 7.0.1 are coming in and being > > classified as duplicates of this bug. > Where can I have a look at such reports about 7.0 && 7.0.1? http://statistics.netbeans.org/exceptions/detail.do?id=119626
(In reply to comment #19) > > Where can I have a look at such reports about 7.0 && 7.0.1? > http://statistics.netbeans.org/exceptions/detail.do?id=119626 Thanks! What about steps to reproduce?
Could someone, please, give me reproducible test case or any other hints how to get exception
fixed http://hg.netbeans.org/cnd-main/rev/98261df35116
extra fix http://hg.netbeans.org/cnd-main/rev/877112b61f2d
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/98261df35116 User: Vladimir Voskresensky <vv159170@netbeans.org> Log: fixed #152775 - Instant Renaming refactoring in C goes wrong - handle issues with main region