Hi Lars,
 
It’s pretty common in the MBS for a method
that returns a collection to return an empty collection (rather than null). 
Certainly it would be good for the interface definition to specify this.  The
bug below appears to have to do with assuming that the option has a superclass.
 I don’t see any reason for changing the current behavior of ITool.getOptions.
 Please respond if you think I misunderstood the problem.
 
Regards,
Leo
 
From:
cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Lars.Kurth@xxxxxxxxxxx
Sent: Tuesday, May 17, 2005 10:09
AM
To: CDT General developers list.
Subject: [cdt-dev]
ITool.getOptions() - what is the expected return value if there are no options
defined
 
 
Hi, 
I
am currently writing some test cases and think I may have discovered a bug, but
am not 100% sure. Tool::getOptions does not currently return null, but a size 0
array when no options are defined. The interface definition is not clear about
the expected return value. As a result of this some instantiations of MBS
grammar lead to an exception being thrown in Tool.getOptions() in some
circumstances (see XML file below, see red lines). This is caused by
"ourOpt.getSuperClass().getId().equals(options[j].getId())" with a
null superclass. Is the expected return value of ITool::getOptions null, when
there are no options? Please confirm. 
I
have a fix, but wanted to double check whether this uses the correct
assumption. 
Regards
--
Lars 
      <tool
           
icon="icons/one.gif" 
           
id="test30_sto.dummy.tool.parent.2" 
           
isAbstract="true" 
           
name="test30_sto Tool2.Parent"/> 
 
    <projectType
 
          id="test30_sto.dummy"
 
          isAbstract="false"
 
          isTest="true"
 
          name="test30_sto"> 
 
       <configuration
 
             id="test30_sto.dummy.config"
 
             name="Configuration for test30_sto"> 
 
          <toolChain
 
                archList="all" 
 
                id="test30_sto.dummy.toolchain"
 
                isAbstract="false" 
 
                name="Toolchain for test30_sto" 
 
                osList="all"> 
 
             <targetPlatform 
 
                   archList="all" 
 
                   id="test30_sto.dummy.platform"
 
                   isAbstract="false" 
 
                   name="Platform for test30_sto"
 
                   osList="all"/> 
 
             <builder 
 
                   buildfileGenerator="org.eclipse.cdt.managedbuilder.makegen.gnu.GnuMakefileGenerator"
 
                   id="test30_sto.dummy.builder"
 
                   isAbstract="false" 
 
                   name="Builder for test30_sto"/> 
 
             <tool 
 
                   id="test30_sto.dummy.tool.1"
 
                   isAbstract="false" 
 
                   name="Tool.1.NoIcon"/> 
 
             <tool 
 
                   icon="icons/one.gif" 
 
                   id="test30_sto.dummy.tool.2"
 
                   isAbstract="false" 
 
                   name="Tool.2.Icon1" 
           
       
 superClass="test30_sto.dummy.tool.parent.2"> 
 
                <optionCategory 
 
                      icon="icons/two.gif" 
 
                      id="test30_sto.dummy.category.2.1"
 
                      name="Category.Tool2.1.Icon2"
 
                      owner="test30_sto.dummy.tool.2"/> 
 
                <option 
 
                      category="test30_sto.dummy.category.2.1"
 
                      id="test30_sto.dummy.option.2.1.1"
 
                      isAbstract="false" 
 
                      name="Option2.1.1.Handler"
 
                      valueHandler="org.eclipse.cdt.managedbuild.core.tests.TestValueHandler"
 
                      valueHandlerExtraArgument="Option2.1.1"/> 
 
                <option 
 
                      category="test30_sto.dummy.category.2.1"
 
                      id="test30_sto.dummy.option.2.1.2"
 
                      isAbstract="false" 
 
                      name="Option2.1.2.NoHandler"/> 
 
                <optionCategory 
 
                      icon="icons/one.gif" 
 
                      id="test30_sto.dummy.category.2.2"
 
                      name="Category.Tool2.2.Icon1"
 
                      owner="test30_sto.dummy.tool.2"/> 
 
                <option 
 
                      category="test30_sto.dummy.category.2.2"
 
                      id="test30_sto.dummy.option.2.2.1"
 
                      isAbstract="false" 
 
                      name="Option2.2.1.NoHandler"/> 
 
                <option 
 
                      category="test30_sto.dummy.category.2.2"
 
                      id="test30_sto.dummy.option.2.2.2"
 
                      isAbstract="false" 
 
                      name="Option2.2.2.Handler"
 
                      valueHandler="org.eclipse.cdt.managedbuild.core.tests.TestValueHandler"
 
                      valueHandlerExtraArgument="Option2.2.2"/> 
 
             </tool> 
 
             <tool 
 
                   icon="icons/two.gif" 
 
                   id="test30_sto.dummy.tool.3"
 
                   isAbstract="false" 
 
                   name="Tool.3.Icon2"> 
 
                <optionCategory 
 
                      icon="icons/one.gif" 
 
                      id="test30_sto.dummy.category.3.1"
 
                      name="Category.Tool3.1.Icon1"
 
                      owner="test30_sto.dummy.tool.3"/> 
 
                <option 
 
                      category="test30_sto.dummy.category.3.1"
 
                      id="test30_sto.dummy.option.3.1.1"
 
                      isAbstract="false" 
 
                      name="Option3.1.1.NoHandler"/> 
 
                <option 
 
                      category="test30_sto.dummy.category.3.1"
 
                      id="test30_sto.dummy.option.3.1.2"
 
                      isAbstract="false" 
 
                      name="Option3.1.2.Handler"
 
                      valueHandler="org.eclipse.cdt.managedbuild.core.tests.TestValueHandler"
 
                      valueHandlerExtraArgument="Option3.1.2"/> 
 
             </tool> 
 
             <optionCategory 
 
                   id="test30_sto.dummy.category.4"
 
                   name="Category.Top.4.NoIcon"/> 
 
             <optionCategory 
 
                   id="test30_sto.dummy.category.5"
 
                   name="Category.Top.5.Icon2"/> 
 
             <optionCategory 
 
                   icon="icons/one.gif" 
 
                   id="test30_sto.dummy.category.6"
 
                   name="Category.Top.6.Icon1"/> 
 
             <option 
 
                   category="test30_sto.dummy.category.4"
 
                   id="test30_sto.dummy.option.4.1"
 
                   isAbstract="false" 
 
                   name="Option4.1.Handler" 
 
                   valueHandler="org.eclipse.cdt.managedbuild.core.tests.TestValueHandler"
 
                   valueHandlerExtraArgument="Option4.1"
 
                   valueType="boolean"/> 
 
             <option 
 
                   category="test30_sto.dummy.category.5"
 
                   id="test30_sto.dummy.option.5.1"
 
                   isAbstract="false" 
 
                   name="Option5.1.NoHandler"
 
                   valueType="boolean"/> 
 
             <option 
 
                   category="test30_sto.dummy.category.6"
 
                   id="test30_sto.dummy.option.6.1"
 
                   isAbstract="false" 
 
                   name="Option6.1.Handler" 
 
                   valueHandler="org.eclipse.cdt.managedbuild.core.tests.TestValueHandler"
 
                   valueHandlerExtraArgument="Option6.1"
 
                   valueType="boolean"/> 
 
          </toolChain>
 
       </configuration>
 
    </projectType>
    
**********************************************************************
Symbian Software Ltd is a company registered in England and Wales with
registered number 4190020 and registered office at 2-6 Boundary Row, Southwark,
London, SE1 8HP, UK. This message is intended only for use by the named
addressee and may contain privileged and/or confidential information. If you
are not the named addressee you should not disseminate, copy or take any action
in reliance on it. If you have received this message in error please notify
postmaster@xxxxxxxxxxx and delete the message and any attachments accompanying
it immediately. Neither Symbian nor any of its subsidiaries accepts liability
for any corruption, interception, amendment, tampering or viruses occurring to
this message in transit or for any message sent by its employees which is not
in compliance with Symbian corporate policy.
**********************************************************************