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 177110

Summary: Empty packages created in the Projects view
Product: java Reporter: Petr Dvorak <joshis>
Component: ProjectAssignee: Milan Kubec <mkubec>
Status: VERIFIED FIXED    
Severity: normal CC: jglick, mkubec, tzezula
Priority: P1 Keywords: THREAD
Version: 6.x   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 175997    
Attachments: PVC diff

Description Petr Dvorak 2009-11-18 09:14:12 UTC
Product Version: NetBeans IDE Dev (Build 200911171401)
Java: 1.5.0_20; Java HotSpot(TM) Client VM 1.5.0_20-141
System: Mac OS X version 10.5.8 running on i386; MacRoman; en_US (nb)

1. Create a new Java application (for example...)
2. Right-click Source Packages node
3. Invoke New>Java Class
4. Fill in NewClass in the class name and "a.b.c" in the package name
5. Confirm the dialog
-> projects view displays:

Source Packages
+- a
+- a.b
+- a.b.c
  +- NewClass.java

-> expected:
Source Packages
+- a.b.c
  +- NewClass.java
Comment 1 Tomas Zezula 2009-11-19 02:10:17 UTC
Caused by Milan's changeset 03e06da26d49.
Rollback the change for 6.8 should be the best solution.
Reassigning to Milan.
Comment 2 Milan Kubec 2009-11-19 02:49:57 UTC
Fixed. (Rollbacked fix of issue #175997).

http://hg.netbeans.org/core-main/rev/8497a06e01fd
Comment 3 Tomas Zezula 2009-11-19 05:20:56 UTC
I've spent some time to debug this problem.
The problem among lots of others problems in package view (races and 2-3 threads per handling single fs change) is when several event comes from AWT-Event thread.
In this case the nodes are not created as the refreshKeysAsync defers nodes creation to the end of AWT event queue. But the cleanEmptyKeys requires the nodes, the intermediate nodes are not removed.
I've rewritten the cleanEmptyKeys to work even when the nodes are not yet created. I will attach a patch, not for 6.8 as it may be dangerous. I will also remove the RequestProcessor as it is useless and fix racecondition in cleanEmptyKeys() and findNonExcludedPackages() - non included in the patch.
Comment 4 Tomas Zezula 2009-11-19 05:32:14 UTC
Created attachment 91331 [details]
PVC diff
Comment 5 Jiri Prox 2009-11-19 05:44:37 UTC
rollback verified
Comment 6 Quality Engineering 2009-11-19 15:03:49 UTC
Integrated into 'main-golden', will be available in build *200911191401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8497a06e01fd
User: Milan Kubec <mkubec@netbeans.org>
Log: #177110: empty packages visible in Projects view; rollback of #175997 fix