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 178649

Summary: Attribute in the 'for' loop is not refactored
Product: javafx Reporter: Alexandr Scherbatiy <sunflower>
Component: UnsupportedAssignee: J Bachorik <yardus>
Severity: normal CC: sustaining
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 173077    
Attachments: screenshot of IDE after Refactoring > Rename on contacts in "list.contacts"
The result of rename refactoring on the provided source
Refactoring result screenshot
IDE log file with the exception stack trace

Description Alexandr Scherbatiy 2009-12-15 04:50:45 UTC
NetBeans-JavaFX-Soma:  #66

  Product Version         = NetBeans IDE 6.8 RC1 (Build 200911252200)
  Operating System        = Windows XP version 5.1 running on x86
  Java; VM; Vendor        = 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02; Sun
Microsystems Inc.

Steps to reproduce:

- Copy the code to the editor:
class ContactList{
    public var contacts: Contact[];

class Contact{}

var list = ContactList{};

for(contact in list.contacts){

- Select the 'contacts' attribute in the 'list.contacts' expression:
  'for(contact in list.contacts){'
 and rename it to 'contacts2'

The 'contacts' attribute is not refactored.
Comment 1 J Bachorik 2009-12-15 05:03:31 UTC
This is weird. It seems as if the IDE you are using is rather outdated. Please, make sure that the build contains changeset
When I try to reproduce the problem on the trunk build everything works as expected.
Comment 2 Lukas Hasik 2009-12-15 08:54:59 UTC
Created attachment 92616 [details]
screenshot of IDE after Refactoring > Rename on contacts in "list.contacts"

I can reproduce it with Product Version: NetBeans IDE Dev (Build javafx-main-118-on-091215) from http://smetiste/builds/netbeans/6.8/fixes/2009-12-14_18-00-34/zip/
Comment 3 J Bachorik 2009-12-15 13:53:52 UTC
Obviously this is not fixed in the 6.8 branch. It is fixed in trunk by
Comment 4 Alexandr Scherbatiy 2009-12-16 04:19:02 UTC
I use the NetBeans-JavaFX-Soma Build #67 (Dec 16, 2009 12:00:35 AM) 

It uses JavaFX plugin sources from the trunk.

The issue is reproduced on this build.
Comment 5 J Bachorik 2009-12-16 04:36:01 UTC
I don't know what is going on with building the IDE with JavaFX plugin but if you use to verify this issue you will see that it is fixed.
I hope somebody will point out a reference source for the trunk binaries - and it should be the one that builds reliably. This reopening and closing of the issue is just a waste of time for all involved parties :(
Comment 6 J Bachorik 2009-12-16 04:36:46 UTC
Created attachment 92659 [details]
The result of rename refactoring on the provided source
Comment 7 Alexandr Scherbatiy 2009-12-16 05:18:44 UTC

The issue is reproduced in the NetBeans IDE Dev 
(Build javafx-main-120-on-091215) from:

There is the exception in the IDE log file:

WARNING [org.netbeans.api.javafx.source.JavaFXSource]: ParserManager.parse called in AWT event thread by: org.netbeans.modules.javafx.refactoring.impl.RefactoringActionsProvider$
WARNING [org.netbeans.api.javafx.source.JavaFXSource]:   - thread dump follows:
WARNING [org.netbeans.modules.parsing.impl.TaskProcessor]: ParserManager.parse called in AWT event thread by: org.netbeans.api.javafx.source.JavaFXSource.runUserActionTask(
java.lang.Exception: Stack trace
	at java.lang.Thread.dumpStack(
	at org.netbeans.api.javafx.source.JavaFXSource.runUserActionTask(
	at org.netbeans.modules.javafx.refactoring.impl.RefactoringActionsProvider$
	at org.netbeans.modules.javafx.refactoring.impl.javafxc.SourceUtils.invokeAfterScanFinished(
	at org.netbeans.modules.javafx.refactoring.impl.RefactoringActionsProvider.doRename(
	at org.netbeans.modules.refactoring.api.impl.ActionsImplementationFactory.doRename(
	at org.netbeans.modules.refactoring.spi.impl.RenameAction.performAction(
	at org.netbeans.modules.refactoring.spi.impl.RefactoringGlobalAction.performAction(
	at org.openide.util.actions.NodeAction.performAction(
	at org.openide.util.actions.CallableSystemAction$
	at org.netbeans.modules.openide.util.ActionsBridge.implPerformAction(
	at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(
	at org.openide.util.actions.CallableSystemAction.actionPerformed(
	at org.openide.util.actions.NodeAction.actionPerformed(
	at javax.swing.AbstractButton.fireActionPerformed(
	at javax.swing.AbstractButton$Handler.actionPerformed(
	at javax.swing.DefaultButtonModel.fireActionPerformed(
	at javax.swing.DefaultButtonModel.setPressed(
	at javax.swing.AbstractButton.doClick(
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(
	at java.awt.Component.processMouseEvent(
	at javax.swing.JComponent.processMouseEvent(
	at java.awt.Component.processEvent(
	at java.awt.Container.processEvent(
	at java.awt.Component.dispatchEventImpl(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.LightweightDispatcher.retargetMouseEvent(
	at java.awt.LightweightDispatcher.processMouseEvent(
	at java.awt.LightweightDispatcher.dispatchEvent(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Window.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.EventQueue.dispatchEvent(
	at org.netbeans.core.TimableEventQueue.dispatchEvent(
	at java.awt.EventDispatchThread.pumpOneEventForFilters(
	at java.awt.EventDispatchThread.pumpEventsForFilter(
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.awt.EventDispatchThread.pumpEvents(
	at java.awt.EventDispatchThread.pumpEvents(
Comment 8 Alexandr Scherbatiy 2009-12-16 05:20:23 UTC
Created attachment 92663 [details]
Refactoring result screenshot
Comment 9 Alexandr Scherbatiy 2009-12-16 05:22:05 UTC
Created attachment 92664 [details]
IDE log file with the exception stack trace
Comment 10 Alexandr Scherbatiy 2009-12-16 05:39:20 UTC
I used the clean userdir.
Comment 11 J Bachorik 2009-12-16 06:56:16 UTC
Ok. It seems that the trigger is selecting the whole token or putting the cursor after the last char of the token (like "for(contact in list.contacts|){").
If you place the cursor anywhere inside the token the refactoring works fine.
Comment 12 Alexandr Scherbatiy 2009-12-16 07:04:27 UTC
Yes, I use mouse-double click to select the attribute.

I tried to place a cursor inside the token and it works.
Comment 13 J Bachorik 2010-01-04 05:38:48 UTC
fixed in
Comment 14 Alexandr Scherbatiy 2010-01-12 07:15:43 UTC
verified in NetBeans-JavaFX-Soma: #93
Comment 15 rbalada 2010-01-27 06:56:45 UTC
The changeset has been ported into release68_fixes branch as

Please verify in next NB 6.8 fixes build
Comment 16 Alexandr Scherbatiy 2010-01-28 04:06:57 UTC
Verified in NB 6.8 Patch1 2010-01-28_00-36-51