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 205638 - Copying a file to the same package intermittently does not complete
Summary: Copying a file to the same package intermittently does not complete
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
: 209429 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-29 09:38 UTC by mienamoo
Modified: 2015-03-09 10:13 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log file (46.79 KB, application/octet-stream)
2012-02-27 08:39 UTC, mienamoo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mienamoo 2011-11-29 09:38:12 UTC
NetBeans IDE 7.1 RC1 (Build 201111242103)
JDK 7 build 147

Making a copy of a class in the same package as the original (and refactoring) sometimes does not complete. I am able to replicate the issue, but the cause seems very vague. So I am providing as much information as possible in the hope that it will narrow it down somewhat.

1. I had a number of NetBeans platform modules open. All of the modules are version controlled using SVN.
2. Ctrl+drag a class in a unit test package of one of the modules to make a copy.
3. Click refactor.
4. The process seems to never complete, so I cancelled it.
5. Then I switched to another project group, to see whether I can reproduce the issue. In the newly opened project group, I had a few non-version controlled suites and modules.
6. The same thing happened for a class in a source package of one of the modules and I cancelled again.
7. Then I switched back and forth between the project groups and at some point got the following error message:

Cannot rename file TestClass1111_1.java in C:/Users/user/Documents/NetBeansProjects/Suite/Hallo/src/a to TestClass11111.java.

8. The class did exist, with the file contents (class name) and the file name not corresponding.
Comment 1 Jan Becicka 2012-02-24 14:45:27 UTC
please attach messages.log
Comment 2 mienamoo 2012-02-27 08:39:35 UTC
Created attachment 116117 [details]
IDE log file
Comment 3 mienamoo 2012-02-27 08:40:23 UTC
(In reply to comment #1)
> please attach messages.log

I am now running 7.1.1, after the update test that we did last week. And I was luckily able to replicate the problem quite easily. Log attached as requested. :)

In this case I created a new suite with one new module in it containing a single class. And restarted the IDE so that the log contains only the relevant stuff. I tried to copy the class, and the process didn't complete. While I was waiting, lines 503 to 533 got logged. 

So I cancelled and tried again. And then the rest of the lines got logged. The second time it did complete, but I ended up with two classes. A file called NewClass_1.java containing a class named NewClass1 (note the discrepancy!) and another called NewClass_2.java (correct class name).
Comment 4 Ralph Ruijs 2012-03-12 10:25:05 UTC
*** Bug 209429 has been marked as a duplicate of this bug. ***
Comment 5 Jan Becicka 2012-04-17 09:49:17 UTC
probably windows specific.
Comment 6 mienamoo 2012-04-17 10:03:31 UTC
Could indeed be.

Today I have seen al kinds of weird behaviour and exceptions with the refactoring, but only after running the IDE (build 201204150400) for a few hours. I am starting to think that these things happen when the heap is getting full. I haven't been able to reproduce the exceptions since restarting the IDE. :)
Comment 7 Ralph Ruijs 2015-03-09 10:13:41 UTC
Unable to reproduce and last occurred in 7.2. Resolving as worksforme.