Bug 200510 - After refactoring refactoring window keeps floating around
After refactoring refactoring window keeps floating around
Status: REOPENED
Product: php
Classification: Unclassified
Component: Refactoring
8.0.2
Other Linux
: P3 with 10 votes (vote)
: 8.2
Assigned To: Tomas Mysik
issues@php
: RANDOM
: 204324 250183 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-29 10:40 UTC by schkovich
Modified: 2017-09-29 09:45 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Remains of refactoring window floating around (11.86 KB, image/png)
2011-07-29 10:41 UTC, schkovich
Details
new/old PHP Class (336 bytes, application/x-php)
2011-09-27 16:08 UTC, schkovich
Details
one more screenshot (12.92 KB, image/png)
2011-09-27 16:09 UTC, schkovich
Details
Sample code (712 bytes, application/x-php)
2013-03-29 10:49 UTC, hlupec
Details
logs (42.03 KB, application/octet-stream)
2017-09-29 09:24 UTC, sm_ef_user
Details

Note You need to log in before you can comment on or make changes to this bug.
Description schkovich 2011-07-29 10:40:44 UTC
Product Version = NetBeans IDE Dev (Build 201107280600)
Operating System = Linux version 2.6.38-10-generic running on amd64
Java; VM; Vendor = 1.7.0
Runtime = Java HotSpot(TM) 64-Bit Server VM 21.0-b17

After refactoring action refactoring window is not destroyed completely and base window object (without any elements) keeps floating around. This window can't be closed.
Comment 1 schkovich 2011-07-29 10:41:52 UTC
Created attachment 109692 [details]
Remains of refactoring window floating around
Comment 2 morrison_levi 2011-09-21 20:28:33 UTC
I see this bug every day at work.  It doesn't happen every time I refactor, but it does happen often.
Comment 3 Petr Pisl 2011-09-27 13:02:15 UTC
Guys, do you have any reproducible case? It can be problem in refactoring infrastructure, but before I reassign this issue them, it would be better to have reproducible test case.

I have played with it today a little bit, but I wasn't successful.
Comment 4 morrison_levi 2011-09-27 14:10:26 UTC
Currently I'm at a station that is running 6.9.  The station I frequently encounter the situation on is running Ubuntu, I'm not sure if that helps.  I'll try to isolate a case, but it happens so often on my setup that I'm not sure what is the problem.
Comment 5 schkovich 2011-09-27 16:01:55 UTC
Steps to reproduce:

* Create newPHPClass
* Define constant HIP_HOP = 'poh_pih'
* Define public static method get returning newPHPClass::HIP_HOP
* Save
* Right click on the class name and select Refactor > Rename
* Rename class to oldPHPClass
* Review changes
* Click Refactor

Expected: All instances of newPHPClass are renamed to oldPHPClass, review window is closed.

Actual: All instances of newPHPClass are renamed to oldPHPClass, review window is closed but small Refactoring window remains floating around. See attached images.
Comment 6 schkovich 2011-09-27 16:08:16 UTC
Created attachment 111250 [details]
new/old PHP Class
Comment 7 schkovich 2011-09-27 16:09:03 UTC
Created attachment 111251 [details]
one more screenshot
Comment 8 gedrox 2011-10-13 10:02:28 UTC
The problem is actual for NetBeans 7.0.1 as well.

OS Ubuntu 11.04
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode).
Comment 9 Elusive 2011-10-24 08:00:52 UTC
This is still present in 7.1 beta.
Comment 10 zuernbernhard 2011-10-26 12:11:46 UTC
Same Problem here with netbeans 7 on ubuntu oneiric 64bit

this issu always appears when i attempt to use refactoring at least 2 times. when i do one refactoring (e.g. renaming a class) close netbeans then start netbeans and do the next refactoring, everything seems to be ok ..
Comment 11 BullfrogBlues 2012-02-08 00:34:17 UTC
+1

This is still an issue in 7.1.


This is such an awful bug that sometimes, if I know for sure that the refactoring is isolated to one file (though I've been bitten by this), I will manually do the refactoring rather than use netbeans refactoring feature i.e. I will do a search and replace, because if I use the refactoring feature (except inline refactoring, which works fine) I know that there is a 1 in 2 chance I will be left with floating window and will eventually need to restart netbeans. 


Netbeans will eventually crash, hang and do all kinds of potentially disastrous things when enough of those floating windows are left hanging about.
Comment 12 BullfrogBlues 2012-02-09 10:10:42 UTC
*** Bug 204324 has been marked as a duplicate of this bug. ***
Comment 13 schkovich 2012-02-09 13:39:34 UTC
I was not able to reproduce the problem in the last development build:
Product Version: NetBeans IDE Dev (Build 201202080400)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Linux version 3.0.0-15-generic running on amd64; UTF-8; en_US (nb)

If anyone else can confirm that the problem is not present anymore in the development builds we can close the ticket. :)
Comment 14 flock3 2012-03-26 10:03:09 UTC
This bug still exists however cannot reliably reproduce. 

I will attempt to find a reliable reproduction method.
Comment 15 Ondrej Brejla 2012-03-28 12:20:55 UTC
Waiting for reproducible cases, or for more info. I'm not able to reproduce that.
Comment 16 r.mezhuev 2012-10-20 10:20:37 UTC
Confirm that bug on Ubuntu 11.04 with NetBeans 7.2. Sometime (70% of cases) refactor just freezes - shows blank windows (which is impossible to close) and actualy do just partial rename of variables.
Comment 17 hlupec 2013-03-29 10:49:23 UTC
Created attachment 133206 [details]
Sample code

There is an occurrence of this bug when I try to refactor property 'group' to 'ownerId' in this sample code. It's going well sometimes, so it must to be tried for several times.

Product Version: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.6.0_26; Java HotSpot(TM) 64-Bit Server VM 20.1-b02
Runtime: Java(TM) SE Runtime Environment 1.6.0_26-b03
System: Linux version 2.6.38-15-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 18 Martin Kanak 2013-03-29 11:17:36 UTC
Reproduced in dev build. I try the test case from schkovich:

* Create newPHPClass
* Define constant HIP_HOP = 'poh_pih'
* Define public static method get returning newPHPClass::HIP_HOP
* Save
* Right click on the class name and select Refactor > Rename
* Rename class to oldPHPClass
* Review changes
* Click Refactor

Product Version: NetBeans IDE Dev (Build 201303282300)
Java: 1.7.0_17; Java HotSpot(TM) Client VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b02
System: Linux version 3.5.0-26-generic running on i386; UTF-8; en_US (nb)
Comment 19 Ondrej Brejla 2013-04-04 09:05:27 UTC
I just tried it many many times for both cases, but can't reproduce that :(
Comment 20 Vladimir Riha 2013-04-04 09:16:15 UTC
It is annoyingly random :) I tried it in 7.3 with sample TodoList app. I refactored renamed Flash (from usage) and then TodoSearchCriteria (from declaration) and after a lot of attempts (~15-20), it happened.
Comment 21 BullfrogBlues 2013-04-04 12:19:33 UTC
Hi guys, I'm reproducing this fairly consistently with steps very similar to schkovich's and Kanak's. I'm trying to to narrow it down to something specific.

1. Ensure that the project name has Uppercase, Lowercase and a Digit. e.g. Tiger7, Monkey7 ( this seems top make a huge difference in how often I caan reproduce)

2. There is one additional step after schkovich's and Kanak's steps: Refactor > Rename to "oldPHPClass" -> "old2PHPClass".

TEST CASE
---------

* Create newPHPClass
  - Right click "Source Files" in Pprojects window
  - New > PHP Class > (leave defaults, file name should be "newPHPClass")
  - Finish
* Define constant HIP_HOP = 'poh_pih'
* Define public static method get returning newPHPClass::HIP_HOP

  You should have:

  -- SNIP --
  <?php

  /**
   * Maybe some comment here
   */

  define('HIP_HOP', 'poh_pih');

  class newPHPClass
  {
      public static function HIP_HOP()
      {

      }
  }

  -- SNIP ---

* Save
* Right click on the class name and select Refactor > Rename (Ctrl+R)
* Rename class to oldPHPClass (fig.a)
* Click "Preview" (Alt+P)
* Click "Do Refactoring" (Alt+R)

--- ADDITIONAL STEP ---

* Refactor > Rename class to old2PHPClass

NOTES
-----

- For the refactoring part, try *not* using the mouse at all, instead use shortcuts:
  
  Use these instead:

  - Ctrl+R to Refactor Rename
  - Alt+P to Preview
  - Alt+R to Do Refactoring
Comment 22 LexLythius 2013-04-24 01:01:00 UTC
+1

Product Version: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Linux version 3.2.0-40-generic running on amd64; UTF-8; en_US (nb)
Distro: Ubuntu 12.04.2

Maybe this is related to this bug?
https://netbeans.org/bugzilla/show_bug.cgi?id=213202
Comment 23 Ondrej Brejla 2013-06-12 12:05:51 UTC
Still can't reproduce that...will test it again later :(
Comment 24 limuhob 2013-07-12 09:46:07 UTC
I can reproduced it very often too. But I have a funny workaround. I changed the refactoring preview window to float and after "do refactoring" command, there is an exception and the annoying refactoring empty window doesn't appear ;-)
Comment 25 Ondrej Brejla 2013-07-15 07:22:07 UTC
What exception, can you attach it here? And your IDE log? Thanks a lot!
Comment 26 limuhob 2013-07-16 09:40:20 UTC
(In reply to comment #25)
> What exception, can you attach it here? And your IDE log? Thanks a lot!


No problem. I'm a little confused with netbeans bugzila but it is: Issue #232779 and Issue #214312. My netbeans's exception reporter has this information:

Submit Issue  
680804 214312 StackOverflowError at java.util.Arrays.copyOf
681298 232779 StackOverflowError at java.util.Arrays.copyOf
Comment 27 Ondrej Brejla 2013-07-16 09:45:09 UTC
Thanks. Ok, so if it's connected to this issue, then it's not a php bug...but it's a side effect of swing bug. We will see...
Comment 28 Ondrej Brejla 2014-07-17 12:29:25 UTC
Probably related to and fixed in issue #243067
Comment 29 Ondrej Brejla 2014-07-17 12:32:26 UTC
Closing as fixed in the dev build.
Comment 30 LexLythius 2014-08-14 13:59:46 UTC
Unfortunately, this still happens in 8.0, now tested on Ubuntu 14.04.

I don't get the Exception noted in https://netbeans.org/bugzilla/show_bug.cgi?id=200510#c24 when explicitly making the window float.

But refactoring actually *creates* an empty floating window about the same moment it closed the *docked* refactoring one. And the floated window stays put, uncloseable.

Product Version: NetBeans IDE 8.0 (Build 201403101706)
Updates: NetBeans IDE is updated to version NetBeans 8.0 Patch 2
Java: 1.7.0_65; Java HotSpot(TM) 64-Bit Server VM 24.65-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_65-b17
System: Linux version 3.13.0-32-generic running on amd64; UTF-8; en_US (nb)
User directory: /home/lisandro/.netbeans/8.0
Cache directory: /home/lisandro/.cache/netbeans/8.0

Distro: Ubuntu 14.04.1 LTS

Any way I can provide more information?
Comment 31 Ondrej Brejla 2014-08-14 14:01:33 UTC
As you can see in issue #243067, target milestone is 8.0.1. Not 8.0...wait for new version.
Comment 32 LexLythius 2014-08-14 14:21:14 UTC
(In reply to Ondrej Brejla from comment #31)
> As you can see in issue #243067, target milestone is 8.0.1. Not 8.0...wait
> for new version.

Sorry about that. I'll wait till next version comes up.

I figured this was about a race condition between fast refactoring completion in background thread and slow window opening in UI thread. Was that the case?
Comment 33 s4muel 2015-06-24 07:09:39 UTC
hello everyone, this is still present in 8.0.2. it just happened. i was refactoring (renaming) the method. just two occurrences (method declaration and one usage, in the same file)

Product Version: NetBeans IDE 8.0.2 (Build 201408251540)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 2
Java: 1.7.0_79; OpenJDK 64-Bit Server VM 24.79-b02
Runtime: OpenJDK Runtime Environment 1.7.0_79-b14
System: Linux version 3.16.0-4-amd64 running on amd64; UTF-8; en_US (nb)
Comment 34 FiftyStars 2015-08-21 22:53:00 UTC
same on 8.1
Comment 35 victork 2016-02-09 10:44:15 UTC
I have this bug as well on CentOS 5. Didn't happen before on Windows but happens on Linux(At least our old CentOS 5). Don't know if this is related to old cairo/pixmap/X libs on the distribution but see that ppl with fresh dists having the same so it's probably Java UI/Linux related bug.
It happens for about 60% chance rate.

Product Version         = NetBeans IDE Dev (Build 20160131-9fcb8679cb47) (#9fcb8679cb47)
  Operating System        = Linux version 2.6.18-406.el5 running on amd64
  Java; VM; Vendor        = 1.8.0_72; Java HotSpot(TM) 64-Bit Server VM 25.72-b15; Oracle Corporation
  Runtime                 = Java(TM) SE Runtime Environment 1.8.0_72-b15
  Java Home               = /usr/java/jdk1.8.0_72/jre
  System Locale; Encoding = en_US (nb); UTF-8
Comment 36 Tomas Mysik 2016-06-10 08:56:10 UTC
I cannot reproduce it in the current dev build. However, if anyone of you can, please provide _exact_ steps to reproduce (ideally provide a code sample and exact steps what needs to be done). Also, once this problem happens, please attach the IDE log file [1], it can contain some related exception.

Thanks.
[1] http://wiki.netbeans.org/FaqLogMessagesFile

Product Version: NetBeans IDE Dev (Build 20160610-49331e2a0591)
Java: 1.8.0_91; Java HotSpot(TM) 64-Bit Server VM 25.91-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_91-b14
System: Linux version 4.2.0-38-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 37 Tomas Mysik 2016-06-10 08:57:10 UTC
*** Bug 250183 has been marked as a duplicate of this bug. ***
Comment 38 Tomas Mysik 2016-06-10 09:40:57 UTC
Also please attach a thread dump [1] taken after this problem happens to you again.

Thanks.
[1] http://wiki.netbeans.org/GenerateThreadDump
Comment 39 sm_ef_user 2017-09-29 09:24:13 UTC
Created attachment 165208 [details]
logs

> provide _exact_ steps to reproduce
Seems it absolutely random. I've just did about 15-20 refactoring before it happens (without any other actions). Sometimes it happens more frequently...

But this bug is quite reproducible.

I didn't see any new messages in log after this bug... Thread dump included.
Comment 40 sm_ef_user 2017-09-29 09:45:40 UTC
I've recorded a video with reproducing the bug:
https://youtu.be/SNa1Bx4gVwM


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo