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.
The error occurred when I refactor copied a java source file from one package to another. It appears that there are two errors: 1) that the java file's class name and package statement etc. was not updated when it was refactor copied, and 2) that the copied file cannot be parsed. The project files on computer 1 were stored on a network drive, which is possibly a factor in this. When I load the project on a different computer 2, locally, then there are no exceptions in the ide log, but the build fails with the messages class OrganisationEditPage is public, should be declared in a file named OrganisationEditPage.java OrganisationEditPage.java:[40,8] duplicate class: anon.web.pages.OrganisationEditPage The message in the log asks for 7.4\var\log\OrgEditPage_6.dump but this file does not exist. Other dump files do exist however. I think this is a serious issue because refactor copy has been implemented for some time and it should not fail with this type of error.
I can reproduce a refactor copy error on computer 2 with a freshly patched 7.4 IDE as follows: 1) Delete the failed source file mixed.org.web.pages.OrgEditPage. The project is now error free after scanning because nothing has been copied yet. 2) Again refactor copy from anon.web.pages.OrganisationEditPage.java to package mixed.org.web.pages, renaming it OrgEditPage 3) Edit the new OrgEditPage.java and inspect line 157 Expected result: Organisation organisation = OrgEditPage.OrganisationForm.this.getModelObject(); Actual result: Organisation organisation = OrganisationEditPage.OrganisationForm.this.getModelObject(); The refactoring process should respect the "this" keyword for the inner class. OrganisationEditPage.OrganisationForm.this refers to a class within the new file (this) and therefore OrganisationEditPage should have been renamed to OrgEditPage.
Created attachment 142928 [details] Project in zip file The project contains the erroneous file in the target package mixed.org.web.pages
I was not able to reproduce the problem (1). Probably because of (1), the OrgEditPage refactored (and zipped in the attachment) does not contain inner classes (OrganizationForm etc). I could not reproduce this defect neither. Should you come out with a semi-reliable way how to reproduce the above, please do open a new defect. Passing the rest to refactoring support for further evaluation; even in my environment, the reference OrganisationEditPage.OrganisationForm.this.getModelObject() was not refactored to OrgEditPage.OrganisationForm.this.getModelObject() or OrganisationForm.this.getModelObject(). Degrading to P2, as it breaks the code, but is not that fatal.
changeset : ccccbe2d7ace author : Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> date : Mon Dec 09 11:40:39 CET 2013 summary : #239213 - Parsing Error after Refactor Copy
*** Bug 236371 has been marked as a duplicate of this bug. ***
*** Bug 238829 has been marked as a duplicate of this bug. ***
*** Bug 238552 has been marked as a duplicate of this bug. ***
Integrated into 'main-silver', will be available in build *201312120002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/ccccbe2d7ace User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: #239213 - Parsing Error after Refactor Copy