Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-24767

DateTimeFormatter: getWeekdayNames and getMonthNames cannot throw ArgumentError and typeError for invalid and null parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • Adobe Flex SDK Previous
    • None
    • Spark: Formatters
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Please see the following sample code to reproduce the issue :
      =========================
      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      creationComplete="TestWeekdayname()"
      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
      <fx:Script>
      <![CDATA[
      import flash.globalization.DateTimeFormatter ;
      import spark.formatters.DateTimeFormatter ;

      public var dfgslib:flash.globalization.DateTimeFormatter ;
      public var dtfFormat:spark.formatters.DateTimeFormatter ;

      private var errorStr:String;

      private var gslibErrStr:String;

      public function TestWeekdayname ():void {
      try

      { dfgslib = new flash.globalization.DateTimeFormatter( 'en_US','long', 'long'); //dfgslib.getWeekdayNames("standalone" , "invalid" ) ; dfgslib.getWeekdayNames("standalone" , null ) ; }

      catch(e:Error)

      { gslibErrStr = e.toString(); }

      try

      { dtfFormat = new spark.formatters.DateTimeFormatter( ); //dtfFormat.getWeekdayNames("standalone", "invalid" ) ; dtfFormat.getWeekdayNames("standalone", null ) ; }

      catch(e:Error)

      { errorStr = e.toString(); }

      trace ( "-------- error from gslib -----" ) ;
      trace(gslibErrStr);
      trace ( "-------- error from spark -----" ) ;
      trace(errorStr);
      }
      ]]
      >
      </fx:Script>

      <fx:Declarations>

      </fx:Declarations>
      </s:Application>
      =========================

      For GSLib formatter , it will throw typeError for "null" paramter , and ArgumentError for invalid parameter .
      However , spark formatter cannot thrown error like gslib.

      the same issue also occur for getMonthNames() .

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: