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 48720

Summary: Use of MessageFormat in ActionsUtil is slow
Product: projects Reporter: Jesse Glick <jglick>
Component: Generic InfrastructureAssignee: Petr Hrebejk <phrebejk>
Status: CLOSED FIXED    
Severity: blocker Keywords: PERFORMANCE
Priority: P4    
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 41535    

Description Jesse Glick 2004-09-08 19:25:43 UTC
7.7% of CPU when closing many projects is in
java.text.ChoiceFormat.<init>. This is plain
stupid. Call chain:

CloseProject.actionPerformed
OpenProjectList.close
CloseProject.propertyChange
CloseProject.refresh
ActionsUtil.formatProjectSensitiveName
ActionsUtil.formatName

Problems:

1. Closing many projects at once in OPL.close
would make this automatically faster.

2. CloseProject.refresh is updating the popup name
even though the popup is not currently displayed.
Why? No one cares what the label is until it is shown.

3. ActionsUtil.formatName should somehow let the
project cache a Format object, rather than
creating one fresh each time.
Comment 1 _ rkubacki 2004-09-20 09:17:23 UTC
re 2: this is similar to issue 46343
Comment 2 Jesse Glick 2004-09-20 15:16:18 UTC
Confirmed, #2 is handled by issue #46343.

#1 is also already fixed, I think.

So leaving open for #3.
Comment 3 Petr Hrebejk 2004-09-30 12:06:59 UTC
Cache added

Checking in
projects/projectui/src/org/netbeans/modules/project/ui/actions/ActionsUtil.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/actions/ActionsUtil.java,v
 <--  ActionsUtil.java
new revision: 1.4; previous revision: 1.3
done
Comment 4 Marian Mirilovic 2005-12-20 15:50:35 UTC
This issue was solved long time ago. Because nobody has reopened it neither
added comments, we are verifying/closing it now. 
If you are still able to reproduce the problem, please reopen. Thanks in advance.