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 20550 - Lightweight and better lookup implementation
Summary: Lightweight and better lookup implementation
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Lookup (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: David Strupl
URL:
Keywords:
Depends on: 32203
Blocks:
  Show dependency tree
 
Reported: 2002-02-14 15:17 UTC by Jaroslav Tulach
Modified: 2008-12-22 20:51 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2002-02-14 15:17:57 UTC
In long term we want to move from Node.Cookie getCookie methods and replace them
by universal Lookup. Something like that has already been done in Looks and
Actions APIs.

During the usage I have realized that it is relatively hard to create a lookup
instance. Especially for simple case like immutable lookup of single existing
object(s). One can use 

InstanceContent ic = new InstanceContent ();
ic.add (singleton);
return new AbstractLookup (ic);

but the code is long and the memory representation of such object is overkilling
the actual need (because the lookup will never change).

That is why I suggest to create factory methods:

public static Lookup singleton (Object objectToLookup);
public static Lookup fixed (Object[] objectsToLookup);
public static Lookup fixed (Object[] keys, InstanceContent.Convertor convertor);

Or something like this with memory representation as small as possible.
Comment 1 Jaroslav Tulach 2002-02-20 16:53:13 UTC
Why wait? The sooner implemented the more people will use it. What
about 3.4 P4?
Comment 2 David Strupl 2002-02-20 16:55:31 UTC
It does not mean I cannot work on it now. Smaller commitment ;-)
Comment 3 David Strupl 2002-05-28 16:27:10 UTC
Added to release 3.4.
Comment 4 Jaroslav Tulach 2003-07-14 15:26:20 UTC
Lookups is there. It might be even lighter, but it there.