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 - Non-scalable and inconvenient way to listen on the validity of jar contents
Summary: Non-scalable and inconvenient way to listen on the validity of jar contents
Status: CLOSED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: jarpackager (show other bugs)
Version: -FFJ-
Hardware: All All
: P3 blocker (vote)
Assignee: issues@obsolete
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-14 11:30 UTC by Petr Jiricka
Modified: 2003-07-01 10:02 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The proposed patch for the problem. (1.88 KB, patch)
2002-03-14 13:30 UTC, Petr Jiricka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.