Bug 219320 - too many lookup mergers for action provider
too many lookup mergers for action provider
Status: RESOLVED FIXED
Product: groovy
Classification: Unclassified
Component: Code
7.3
PC Windows 7
: P3 (vote)
: 7.3
Assigned To: Martin Janicek
issues@groovy
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-02 09:44 UTC by Milos Kleint
Modified: 2012-10-16 02:02 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Kleint 2012-10-02 09:44:15 UTC
from log of issue 219101. Apparently groovy attempts to insert additional lookup merger for ActionProvider while there already is one.


WARNING [org.netbeans.spi.project.support.DelegatingLookupImpl]: Two LookupMerger instances for interface org.netbeans.spi.project.ActionProvider among [org.netbeans.spi.java.project.support.ClassPathProviderMerger@388f7a58, org.netbeans.spi.project.ui.support.UILookupMergerSupport$OpenMerger@53a9446a, org.netbeans.spi.project.ui.support.UILookupMergerSupport$PrivilegedMerger@dcab60f, org.netbeans.spi.project.ui.support.UILookupMergerSupport$RecommendedMerger@777699db, org.netbeans.spi.project.support.LookupProviderSupport$SourcesMerger@b6f3623, org.netbeans.spi.java.project.support.LookupMergerSupport$SFBLookupMerger@324b39b2, org.netbeans.spi.java.project.support.LookupMergerSupport$JFBLookupMerger@68b8eee9, org.netbeans.spi.project.support.LookupProviderSupport$ActionProviderMerger@454d38b5, org.netbeans.modules.whitelist.WhiteListQueryMerger@50c6169e, org.netbeans.modules.groovy.support.LookupMergerSupport$ActionProviderMerger@46dc5cfe] in Projects/org-netbeans-modules-java-j2seproject/Lookup. Only first one will be used
Comment 1 Martin Janicek 2012-10-04 08:04:23 UTC
Milosi, what's the correct solution? Should I just remove my LookupMerger? Or how do I find whether there is already registered merger for a certain type of project?
Comment 2 Milos Kleint 2012-10-04 13:04:02 UTC
well, typically the project type owner should primarily register mergers. In what way is your lookup merger for action provider different from the default one?
Comment 3 Martin Janicek 2012-10-04 13:38:38 UTC
It is actually almost the same as the original one, I just didn't know it is already registered in a different module.
I'm going to check whether each necessary project type has registered one merger somewhere and if so, I'll remove LookupMerger from groovy support.
Comment 4 Martin Janicek 2012-10-08 08:17:08 UTC
I've removed groovy lookup merger for Java SE projects in: web-main b26f30e33a23

..I didn't remove it completely because it looks as there is no other lookup merger registered for Java Web and Java EJB projects.. maybe we should move the merger to the project modules (web.project, j2ee.ejbjarproject) but to be honest I don't have strong opinion about that.. CCing to David to let him decide ;)
Comment 5 David Konecny 2012-10-08 22:22:20 UTC
Looks like web/ee projects had no need yet for merger of ActionProvider instances. Feel free to enhance web/ee project types with it if you need it. Thanks.
Comment 6 Quality Engineering 2012-10-09 02:04:15 UTC
Integrated into 'main-golden', will be available in build *201210090002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b26f30e33a23
User: Martin Janicek <mjanicek@netbeans.org>
Log: #219320 - too many lookup mergers for action provider
Comment 7 Martin Janicek 2012-10-09 07:18:04 UTC
(In reply to comment #5)
> Looks like web/ee projects had no need yet for merger of ActionProvider
> instances. Feel free to enhance web/ee project types with it if you need it.
> Thanks.

I've already done that. The question is just whether it should be moved to the web.project and j2ee.ejbjarproject modules.
Comment 8 Milos Kleint 2012-10-09 07:21:27 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > Looks like web/ee projects had no need yet for merger of ActionProvider
> > instances. Feel free to enhance web/ee project types with it if you need it.
> > Thanks.
> 
> I've already done that. The question is just whether it should be moved to the
> web.project and j2ee.ejbjarproject modules.

to me, that would sound like a good pattern to follow
Comment 9 David Konecny 2012-10-09 13:54:13 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > Looks like web/ee projects had no need yet for merger of ActionProvider
> > instances. Feel free to enhance web/ee project types with it if you need it.
> > Thanks.
> 
> I've already done that. The question is just whether it should be moved to the
> web.project and j2ee.ejbjarproject modules.

Definitely. I just had a look at the changeset attached to this issue - yes the registration of lookup merger should be moved from groovy directly to web/ejb project types. Thanks.
Comment 10 Martin Janicek 2012-10-10 11:56:07 UTC
Thanks guys. I've moved LookupMerger from groovy.support to web.project and j2ee.ejbjarproject in: web-main #c333ab48fd0d

..both modules now contains almost the same copy of the merger, but I didn't find any general abstract class to avoid code duplicity (maybe LookupProviderSupport can be used for that purpose, but not sure how to register it's createActionProviderMerger() factory method --> feel free to update the code David)
Comment 11 David Konecny 2012-10-14 21:48:15 UTC
(In reply to comment #10)
> ..both modules now contains almost the same copy of the merger, but I didn't
> find any general abstract class to avoid code duplicity

I just had a look and found org.netbeans.spi.project.support.LookupProviderSupport.createActionProviderMerger(). Do you mind changing the code to use that one instead of two new classes? Thanks.
Comment 12 Martin Janicek 2012-10-15 09:16:36 UTC
Done in: web-main #378378bc8b04
Comment 13 David Konecny 2012-10-15 18:40:53 UTC
Thanks Martin.
Comment 14 Quality Engineering 2012-10-16 02:02:25 UTC
Integrated into 'main-golden', will be available in build *201210160002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/378378bc8b04
User: Martin Janicek <mjanicek@netbeans.org>
Log: #219320 correction: Using LookupProviderSupport instead of two new LookupMerger classes


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo