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 118749

Summary: Usage of logger is costly and can cause IDE hang on project opening
Product: java Reporter: Nam Nguyen <nnguyen>
Component: SourceAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P1    
Version: 6.x   
Hardware: Sun   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:
Attachments: hang on reopen we project

Description Nam Nguyen 2007-10-12 18:18:53 UTC
- start with *fresh* user dir using development build
- create web project
- create entities from sample database selecting all tables, make sure you also create a Persistence Unit for the sample
database.
- download 'REST Web Services' plugin from Update Center
- Right click on entities classes package and do new 'RESTful Web Services from Entity Classes', select all entities.
- Close the web project
- Reopen the web project.

Some times the IDE hang.  This happen to many people, and for me its more than one time.
Thread dump is attached.
Comment 1 Nam Nguyen 2007-10-12 18:21:47 UTC
Created attachment 50846 [details]
hang on reopen we project
Comment 2 Nam Nguyen 2007-10-12 18:28:58 UTC
From the dump, I note that SourceForBinaryQueryImpl.findSourceRoots is blocked by
GlobalSourcePath$SourcePathImplementation.firePropertyChange().

I note the usage of Logger on RepositoryUpdater.java:267 calling of toString() is too costly.  Even in normal
Logger.Level run, the argument to the log() call are evaluated first, causing unecessary performance lost and potential
threading contention.
Comment 3 Jan Becicka 2007-10-12 18:59:45 UTC
toString() called only if  (LOGGER.isLoggable(Level.FINER))

Checking in RepositoryUpdater.java;
/cvs/java/source/src/org/netbeans/modules/java/source/usages/RepositoryUpdater.java,v  <--  RepositoryUpdater.java
new revision: 1.97; previous revision: 1.96
done