[nbdev] Re: idiom I encountered

  • From: netbeans enthusiast < >
  • To:
  • Subject: [nbdev] Re: idiom I encountered
  • Date: Fri, 4 Jan 2013 16:28:01 -0500


Arrrg sent the wrong email... here's what I meant to send...


On Fri, Jan 4, 2013 at 3:25 PM, netbeans enthusiast < " target="_blank"> > wrote:
In the NB source I encountered this idiom:

 Collection<? extends GuiUtilsProvider> providers = Lookup.getDefault().lookupAll(GuiUtilsProvider.class);
        for (GuiUtilsProvider provider : providers) {
            classToTest = provider.getMessageFor(classToTestKey);
            classname = provider.getMessageFor("LBL_ClassName");   //NOI18N
            location = provider.getMessageFor("LBL_Location");   //NOI18N
            framework = provider.getMessageFor("LBL_Framework");   //NOI18N
            break;
        }

(from CommonTestsCfgOfCreate)

OK so the way I read this is something like this:

"get one or more things which are (or extend) GuiUtilsProviders and retrieve from them these (String) messages and once you've done this once, stop (break) and ignore whatever other GuiUtilProviders may have been retrieved from lookupAll()."

So this code could have as well utilized the ability of the Lookup to retrieve only the first result. It just didn't for no particular reason.

Is that correct?





[nbdev] Re: idiom I encountered

netbeans enthusiast 01/04/2013

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close