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 236276 - Rename project w/directory: Source & Test Packages do not show in Project Window
Summary: Rename project w/directory: Source & Test Packages do not show in Project Window
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-23 16:14 UTC by MackSix
Modified: 2013-11-22 08:54 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2013-09-23 16:14:26 UTC
1. Right click on Maven Java Project and choose Rename.
2. Change the project name and the folder name and click OK.

Result: Source Packages and Test Packages do not show. Project will not run because no Main file is found.

Workaround: Clean & Build or Restart NetBeans.

Product Version: NetBeans IDE 7.4 RC1 (Build 201309162201)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b50
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b108
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Milos Kleint 2013-09-25 08:10:03 UTC
caused by reworked NbMavenProjectImpl.Updater which keeps on listening on old project location.
Comment 2 Milos Kleint 2013-09-25 08:37:46 UTC
(In reply to Milos Kleint from comment #1)
> caused by reworked NbMavenProjectImpl.Updater which keeps on listening on
> old project location.

hmm.. not as easy. there's some timing interplay when the old project stumbles on top of the new one and events get fired too early (before the entire project structure gets moved)
Comment 3 Milos Kleint 2013-09-26 17:31:23 UTC
http://hg.netbeans.org/core-main/rev/2369020e577b
http://hg.netbeans.org/core-main/rev/dcdca81ee40b

avoid using FileObject in MavenProject caches and Project equals/hashcode

and reset cache in SimpleFileOwnerQueryImplementation to prevent the old invalid project piggybacking back into usage after being discarded by the ProjectManager


both changes appear to fix the problem for me.
Comment 4 Quality Engineering 2013-09-27 02:10:59 UTC
Integrated into 'main-silver', will be available in build *201309270002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/dcdca81ee40b
User: Milos Kleint <mkleint@netbeans.org>
Log: #236276 have all caches based on File not FileObject, same directory renamed FileObjects change path and wreak havoc in caches, also avoid FileObject in project's equals/hashcode methods
Comment 5 Tomas Danek 2013-11-06 13:33:47 UTC
verified in 
Product Version: NetBeans IDE Dev (Build 201311040001)
Updates: Updates available
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/dev
Cache directory: /Users/tomas/Library/Caches/NetBeans/dev
Comment 7 Tomas Danek 2013-11-22 08:54:57 UTC
verified in patch1

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 1
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/7.4
Cache directory: /Users/tomas/Library/Caches/NetBeans/7.4