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 36154 - do not verify fo.getAttributes for each name by call fo.getAttribute != null
Summary: do not verify fo.getAttributes for each name by call fo.getAttribute != null
Status: RESOLVED WONTFIX
Alias: None
Product: contrib
Classification: Unclassified
Component: Registry (show other bugs)
Version: 3.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Jiri Skrivanek
URL:
Keywords: PERFORMANCE
Depends on: 16761
Blocks:
  Show dependency tree
 
Reported: 2003-09-17 08:52 UTC by rmatous
Modified: 2008-12-22 13:52 UTC (History)
1 user (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rmatous 2003-09-17 08:52:21 UTC
Binding event is fired BindingEvent:
[bindingName=tmBinding, type=3] [context=Context:
[absoluteName=/testSimpleBindingEvents/TMA], but
there is not true: (event.getObject ("tmBinding",
null) != null).

See stacktrace [snipped]:
org.netbeans.core.registry.ContextImpl.fireBindingEvent(ContextImpl.java:298)
org.netbeans.core.registry.Listener.fireContextEvent(Listener.java:185)
org.netbeans.core.registry.Listener.fireContextEvent(Listener.java:169)
org.netbeans.core.registry.Listener.fileAttributeChanged(Listener.java:74)
Comment 1 rmatous 2003-09-17 08:55:23 UTC
There is obvious, that as soon as event is fired, then Context
(evt.getSource or evt.getContext) must be in consistent status, which
means that added or modified suncontext, binding or attribute must be
reachable and on the other hand removed suncontext, binding or
attribute can't be reachable.
Comment 2 David Konecny 2003-09-17 09:59:42 UTC
Radek, I modified method bindingChanged() in
openide/registry/test/src/org.netbeans.api.registry.EventsTest.Listener
class to report event and value of binding:

System.err.println("event="+evt);
System.err.println("bnd="+evt.getContext().getObject(evt.getBindingName(),
null));

But everything looks OK. The values are available. Could you please
compare the test with your case and tell me what is the difference?
Comment 3 rmatous 2003-09-17 12:46:01 UTC
Sorry, the problem in reality is, that following assert is not satisfied:
if (evt.getContext().getObject ("bName", null) == null) {
 assertFalse (evt.getContext().getBindingName ().contains ("bName"));
}

This problem its origin in #16761, where method getAttributes returns
also deleted attributes. But I've decided to fix it in Context impl.
and verify in Context code if attribute has non-null value, which will
definitely cause performance problems. 

So, added PERFORMANCE keyword and changed summary:

REGISTRY: don't verify fo.getAttributes for each name by call
fo.getAttribute != null 

partcicularly in: getAttributeNames, getBindingNames 





Comment 4 rmatous 2003-09-17 13:04:48 UTC
Verification added, getAttributes filtered - commited into trunk:

/cvs/core/registry/src/org/netbeans/core/registry/ContextImpl.java,v 
new revision: 1.13; previous revision: 1.12

/cvs/core/registry/src/org/netbeans/core/registry/olddsimpl/ObjectBindings.
new revision: 1.4; previous revision: 1.3
Comment 5 David Konecny 2004-11-01 14:47:38 UTC
Is this fixed or not?
Comment 6 Antonin Nebuzelsky 2008-04-15 17:17:08 UTC
Reassigning to new module owner jskrivanek.
Comment 7 David Konecny 2008-04-15 22:17:28 UTC
Registry module is obsolete.