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 201991 - Allow partial ordering of LookupProviders (@PSP) in project lookup
Summary: Allow partial ordering of LookupProviders (@PSP) in project lookup
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords: API
Depends on:
Blocks: 201893
  Show dependency tree
 
Reported: 2011-09-12 09:01 UTC by Tomas Zezula
Modified: 2011-09-20 12:15 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 Tomas Zezula 2011-09-12 09:01:47 UTC
Currently when clients provide LookupProviders for given project type for different services they need to be ordered (if there is at least one having position). This is strange as there is no ordering among different services. The registration should be enhanced to allow an ordering of services of same time while other services are unordered.
This can be done by extending @ProjectType annotation by:

@interface ProjectType {
            
            String id();            
            int position() default Integer.MAX_VALUE;
            String folder() default null;    //new
        }

and changing AP + Lookup to write (read) the instances from optional folder in which the ordering can be done.
Comment 1 Jesse Glick 2011-09-20 12:15:38 UTC
(In reply to comment #0)
> Currently when clients provide LookupProviders for given project type for
> different services they need to be ordered (if there is at least one having
> position)

No longer true after 3f0476cfb4e2 from bug #201893, of course.

> @interface ProjectType {
>             String id();            
>             int position() default Integer.MAX_VALUE;
>             String folder() default null;    //new
>         }

This would indeed permit the warning suppression in 3f0476cfb4e2 to be backed out, but does not really accomplish anything else - there would be no verification that all services of that type are in the same folder, and so no check whether a given lookup result really has a well-defined order or not. (It would also invite mixing unrelated services into the same folder.) Anyway the folder attribute is rather artificial; other than affecting what the position means, it has no impact on the lookup result, so this would be awkward to explain. The current state is no worse, and is simpler.

Compare the last approach from bug #201893 comment #5; using Projects/$type/Lookup/Services/$xfacename/*.instance would ensure that all @PSP for a given service are completely unordered, or none are. (Does not handle mixes of @PSP and @LP.R for a given service, though @LP.R should be replaced with @PSP whenever possible anyway.) If the layer representation has to be changed, this would be the preferred approach.