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 84668 - Unnecessary events fired from MDR on project opening
Summary: Unnecessary events fired from MDR on project opening
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 84806
  Show dependency tree
 
Reported: 2006-09-12 09:59 UTC by Martin Adamek
Modified: 2007-09-26 09:14 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed fix (1.28 KB, application/octet-stream)
2006-09-19 16:47 UTC, Tomas Hurka
Details
patch for release55 (1.05 KB, patch)
2006-09-20 15:07 UTC, Daniel Prusa
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Adamek 2006-09-12 09:59:34 UTC
There are many MDR events fired on project opening where event.getOldElement()
and event.getNewElement() are equal. It had huge performance effect on
annotation listeners in 5.5 release. I will ask Tomas to add more details to
this issue.
Comment 1 Martin Adamek 2006-09-12 10:00:12 UTC
Tomasi, can you please describe what exactly is the problem?
Comment 2 Tomas Hurka 2006-09-14 11:34:42 UTC
In some cases JavaClassImpl.internalSetName(String name) is called with the FQN name, which is same as 
the name of the JavaClass itself. Setting the name to itself does nothing except if fires MDR event change. 
Eliminating this events can improve performance of whole Java Model infrastructure. Note that j2ee 
modules already eliminates this events by checking old and new values of event. Adding this check 
significantly improved opening of j2ee projects.   
Comment 3 Tomas Hurka 2006-09-19 16:47:20 UTC
Created attachment 34168 [details]
proposed fix
Comment 4 Tomas Hurka 2006-09-20 08:38:21 UTC
Fixed in trunk.
Checking in JavaClassImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/JavaClassImpl.java,v  <--  
JavaClassImpl.java
new revision: 1.73; previous revision: 1.72
done
Comment 5 Tomas Hurka 2006-09-20 11:15:31 UTC
Fix improved after review from Dan P.
Checking in JavaClassImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/JavaClassImpl.java,v  <--  
JavaClassImpl.java
new revision: 1.74; previous revision: 1.73
done
Comment 6 Daniel Prusa 2006-09-20 14:58:52 UTC
proposed fix is correct and safe, merged into release55_dev

/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/JavaClassImpl.java,v
 <--  JavaClassImpl.java
new revision: 1.62.2.4.2.2.14.1; previous revision: 1.62.2.4.2.2
Comment 7 Daniel Prusa 2006-09-20 15:07:24 UTC
Created attachment 34239 [details]
patch for release55
Comment 8 Jesse Glick 2006-09-20 23:44:34 UTC
Perhaps this was the cause of issue #84806: MainClassUpdater in j2seproject was
being told that the main class had been renamed when it had not.
Comment 9 Jiri Prox 2006-09-21 15:34:04 UTC
verified in release55_dev, can be merged to NB 5.5 
Comment 10 Daniel Prusa 2006-09-21 16:32:20 UTC
Fixed merged into release55.

/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/JavaClassImpl.java
new revision: 1.62.2.4.2.3; previous revision: 1.62.2.4.2.2
Comment 11 Tomas Hurka 2006-09-21 16:48:09 UTC
Yes, this issue can cause the issue #84806.
Comment 12 Jiri Prox 2006-09-26 09:39:05 UTC
verified in 5.5
Comment 13 Quality Engineering 2007-09-20 10:50:37 UTC
Reorganization of java component