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 105005 - Add method SearchInfoFactory.createCompoundSearchInfo(SearchInfo[])
Summary: Add method SearchInfoFactory.createCompoundSearchInfo(SearchInfo[])
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marian Petras
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2007-05-29 10:45 UTC by Marian Petras
Modified: 2007-06-10 20:06 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
diff of apichanges.xml (1.42 KB, patch)
2007-05-29 10:49 UTC, Marian Petras
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Petras 2007-05-29 10:45:11 UTC
Compound SearchInfo is a proxy SearchInfo that delegates to other SearchInfo
objects (it is analogous to ProxyLookup). It combines the delegates such that:
  - its method canSearch() returns true if and only if at least one
    of the delegate's canSearch() returns true
  - its method objectsToSearch() chains iterators of the delegates,
    skipping those delegates whose canSearch() method returns false

I need the functionality in modules "Utilities" and "Utilities/Projects" for
implementation of redesigned Search/Search&Replace dialogs.

The target milestone is 6.0 M10.

The functionality has been part of the OpenideX module since the SearchInfo
interfaces has been introduced, it just has not been public. The planned change
just makes it available through a public factory method, i.e. it adds one public
static API method

    public static SearchInfo createCompoundSearchInfo(SearchInfo[] delegates)

to class SearchInfoFactory. I expect no impact of the change except that the
method (and thus the functionality) becomes available.
Comment 1 Marian Petras 2007-05-29 10:49:05 UTC
Created attachment 42882 [details]
diff of apichanges.xml
Comment 2 Jesse Glick 2007-05-30 17:59:26 UTC
Consider using varargs (i.e. SearchInfo...) if there is some reasonable chance
someone would want to call the method with a statically fixed number of
SearchInfo parameters. Consistent with ProxyLookup and many other calls.
Comment 3 Marian Petras 2007-05-31 16:49:53 UTC
Yes, it is possible somebody could use it. I will change it to varargs.
Comment 4 Marian Petras 2007-06-07 15:08:08 UTC
The OpenideX module is still Java 1.4-based. I am not sure it is worth switching
to 1.5 just to use var-args in one method, especially that I do not see any
real-life need for it.
Comment 5 Jaroslav Tulach 2007-06-07 15:27:17 UTC
openidex depends on openide/util (at least) and that requires 1.5, so feel 
free to switch to 1.5 - probably also generify all the other methods and 
classes there...
Comment 6 Marian Petras 2007-06-10 18:39:34 UTC
The current version of openidex did not depend on a version of Utilities API
requiring JDK 1.5 (it could work with org.openide.util 6.2 which does not
require JDK 1.5).

Anyway, I switched it to JDK 1.5 so I can use the var-arg parameter. Is it OK to
commit the change?
Comment 7 Jesse Glick 2007-06-10 18:49:17 UTC
Yes please, the more modules we have on JDK 5 the better (IMO).
Comment 8 Marian Petras 2007-06-10 20:05:56 UTC
Committed to CVS (into trunk).

Modified files:
   openidex/manifest.mf   (1.42)
   openidex/api/apichanges.xml   (1.8)
   openidex/src/org/openidex/search/SearchInfoFactory.java   (1.6)

Diffs:
http://openidex.netbeans.org/source/browse/openidex/manifest.mf?r1=1.41&r2=1.42&diff_format=u
http://openidex.netbeans.org/source/browse/openidex/api/apichanges.xml?r1=1.7&r2=1.8&diff_format=u
http://openidex.netbeans.org/source/browse/openidex/src/org/openidex/search/SearchInfoFactory.java?r1=1.5&r2=1.6&diff_format=u