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 26718 - Prevent traversion out of ProjectObject.getContext()
Summary: Prevent traversion out of ProjectObject.getContext()
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-22 19:42 UTC by Vitezslav Stejskal
Modified: 2003-12-11 14:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vitezslav Stejskal 2002-08-22 19:42:54 UTC
(1)
  The more interesting one is that while projectObject.getContext().bind()
  will write to the area specific to that projectObject,
  (Context)projectObject.getContext().lookup(subcontextName).bind() will
  bind the setting object to whatever of the merged Contexts from parent
  Organizers, that defined the subcontext rather than to the
  projectObject-specific context.

(2)
  It's worth at least documenting that one should avoid calling setObject
  on Binding returned from the ProjectObject's settings Context. If used,
  it will overwrite that particular definition of the setting, possibly
  bound to the context of a parent Organizer, rather than write to the
  ProjectObject's own context, hiding the former definition.
Comment 1 Vitezslav Stejskal 2002-12-05 17:30:23 UTC
The #1 is fixed already, the Context returned from
ProjectMember.getContext doesn't allow to traverse outside of it when
using lookup method.

The #2 is still pending and seems to be serious defect.
Comment 2 Vitezslav Stejskal 2002-12-05 23:26:02 UTC
The ProxyContext.list* methods return correct enumerations now. They
work following way:

A. The list*("") provides 'flat list' of bindings from all contexts in
the stack, but each binding is listed only once. It means that binding
from lower layer is hidden by the binding from the highest layer
containing the bining

B. The list*("someName") provides the 'deep list' of bindings across
all layers containing the bining, each element of the list has empty name.

All elemets in both cases don't allow modifications, that means the
set* methods will fail with UOE.
Comment 3 Jan Becicka 2003-08-19 15:52:15 UTC
Verified
Comment 4 Jan Becicka 2003-11-25 14:21:49 UTC
As described in
http://www.netbeans.org/servlets/ReadMsg?msgId=619519&listName=nbdiscuss the
current work on projects prototype has been stopped.

Marking issue as CLOSED.