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 21586

Summary: Non-scalable and inconvenient way to listen on the validity of jar contents
Product: obsolete Reporter: Petr Jiricka <pjiricka>
Component: jarpackagerAssignee: issues@obsolete <issues>
Status: CLOSED FIXED    
Severity: blocker CC: jchalupa, rbrinkley
Priority: P3    
Version: -FFJ-   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: The proposed patch for the problem.

Description Petr Jiricka 2002-03-14 11:30:49 UTC
If another module wants to listen on the changes of property 
JarDataObject.VALID_PROP, it will typically use the following code

PropertyChangeEvent evt = ...
if (JarDataObject.VALID_PROP.equals(evt.getPropertyName())) {
   JarDataObject jarDO = (JarDataObject)evt.getSource();
   if (jarDO.allValid()) {
      ...
   }
}

However, there are two problems:
1) JarDataObject.VALID_PROP is not public, it should be public
2) jarDO.allValid() is called twice (it was running when the property change 
was fired, and it is called again in the listener), which is inefficient and 
non-scalable. There should be a method which returns the validity of the jarDO 
without recomputing it.

This issue blocks BugTraq issue 4467437.
Comment 1 Petr Jiricka 2002-03-14 13:30:35 UTC
Created attachment 5062 [details]
The proposed patch for the problem.
Comment 2 Petr Jiricka 2002-03-22 12:19:09 UTC
Integrated into trunk and orion_fcs.
Comment 3 Quality Engineering 2003-07-01 09:57:40 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 4 Quality Engineering 2003-07-01 10:01:16 UTC
Resolved for 3.4 or earlier, no new info since then -> closing.
Comment 5 Quality Engineering 2003-07-01 10:02:17 UTC
Resolved for 3.4 or earlier, no new info since then -> closing.