Results 1 to 7 of 7

Thread: Constructor arg of type String, pass in "" blank get an error

  1. #1

    Default Constructor arg of type String, pass in "" blank get an error

    I have a constructor that takes a string. I am intentionally passing blank when I do a:

    <constructor-arg value=""/>

    Spring AS throws this error, rather than passing null or "" to my constructor

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at org.springextensions.actionscript.ioc.factory.xml. parser.support.nodeparsers::KeyValueNodeParser/parse()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parsePropertyValue()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseProperty()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseConstructorArguments()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseObjectDefinition()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseAndRegisterObjectDefinition()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parse()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_doParse()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_loadNextProperties()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_loadNextConfigLocation()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_onLoaderComplete()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

  2. #2
    Join Date
    Oct 2008
    Location
    Belgium
    Posts
    160

    Default

    Hi,

    this was indeed a bug when parsing empty strings as constructor arguments. It is fixed in SVN.

    Thanks for mentioning.

    - Christophe
    Christophe Herreman
    Spring ActionScript Founder
    http://www.herrodius.com

  3. #3

    Default

    Hi Christophe,

    There is a simialar issue with intentionally passing a blank value to a property.

    <object class="Object">
    <property name="label" value="123"/>
    <property name="data" value=""/>
    </object>

    Spring AS throws this error, rather than passing null or "" to the object.

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at org.springextensions.actionscript.ioc.factory.xml. parser.support.nodeparsers::KeyValueNodeParser/parse()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parsePropertyValue()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseProperty()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseProperties()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseObjectDefinition()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseAndRegisterObjectDefinition()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support.nodeparsers::ObjectNodeParser/parse()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parsePropertyValue()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support.nodeparsers::ArrayNodeParser/parse()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parsePropertyValue()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseProperty()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseProperties()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseObjectDefinition()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parseAndRegisterObjectDefinition()
    at org.springextensions.actionscript.ioc.factory.xml. parser.support::XMLObjectDefinitionsParser/parse()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_doParse()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_loadNextProperties()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_loadNextConfigLocation()
    at org.springextensions.actionscript.ioc.factory.xml: :XMLObjectFactory/_onLoaderComplete()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

    Thanks for your help,
    nickc

  4. #4
    Join Date
    Oct 2008
    Location
    Belgium
    Posts
    160

    Default

    Hi Nick,

    you can use the <null/> element for that. But perhaps the the parser should be smart enough to intercept this.

    Can you please file a bug in the Jira?

    regards,
    Christophe
    Christophe Herreman
    Spring ActionScript Founder
    http://www.herrodius.com

  5. #5

    Default

    Hi Christophe,

    I logged a bug for the parser to handle the error being thrown.

    Here is the JIRA bug: http://jira.springframework.org/brow...IONSCRIPTAS-49

    Thanks for your prompt response,
    nickc

  6. #6

    Default Is this fix coming out in 0.9?

    Is the fix for this coming out in 0.9? and when will that be released?

  7. #7
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    407

    Default fixed already

    As far as I can see this issue has been resolved (at least that's the status in JIRA as you can see).
    It was fixed before the v0.8 release so it should work in the current version.
    If you still have problems with it, then please create a new issue in JIRA with a description of how to reproduce the problem.

    You can add issues in JIRA here:
    http://jira.springframework.org/brow...ACTIONSCRIPTAS

    cheers,

    Roland

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •