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

Declaring an <mx:Binding/> with an Array source ([]) doesn't work with Flex 4 compiler

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Adobe Flex SDK 4.0 (Release)
    • Component/s: Data Binding
    • Labels:
      None
    • Environment:
      Affected OS(s): Windows
      Affected OS(s): Windows 7
      Language Found: English

      Description

      Steps to reproduce:
      1. Declare an mx:Binding with an inline declared Array source.

      compile with either Flash Builder 4 or Ant using:
      Flex 4.0 SDK
      Flex 3 compatability = false
      Flex build path = MX + Spark
      Theme = Halo

      Actual Results:

      Compiler reports an error:
      either
      1037 Packages cannot be nested.
      or (after cleaning)
      An internal build error has occurred.

      Looking at the log file the error is

      !ENTRY com.adobe.flexbuilder.project 4 43 2010-05-14 10:47:23.769
      !MESSAGE Uncaught exception in compiler
      !STACK 0
      java.lang.ClassCastException: macromedia.asc.parser.MetaDataNode cannot be cast to macromedia.asc.parser.ExpressionStatementNode
      at flex2.compiler.mxml.ImplementationGenerator.generateSourceFunction(ImplementationGenerator.java:2437)
      at flex2.compiler.mxml.ImplementationGenerator.generateBinding(ImplementationGenerator.java:575)
      at flex2.compiler.mxml.ImplementationGenerator.generateBindingsSetupFunction(ImplementationGenerator.java:863)
      at flex2.compiler.mxml.ImplementationGenerator.generateBindingsSetup(ImplementationGenerator.java:812)
      at flex2.compiler.mxml.ImplementationGenerator.generateInitializerSupportDefs(ImplementationGenerator.java:1878)
      at flex2.compiler.mxml.ImplementationGenerator.generateClassDefinition(ImplementationGenerator.java:1044)
      at flex2.compiler.mxml.ImplementationGenerator.<init>(ImplementationGenerator.java:206)
      at flex2.compiler.mxml.ImplementationCompiler.generateImplementationAST(ImplementationCompiler.java:499)
      at flex2.compiler.mxml.ImplementationCompiler.parse1(ImplementationCompiler.java:197)
      at flex2.compiler.mxml.MxmlCompiler.parse1(MxmlCompiler.java:168)
      at flex2.compiler.CompilerAPI.parse1(CompilerAPI.java:2859)
      at flex2.compiler.CompilerAPI.parse1(CompilerAPI.java:2812)
      at flex2.compiler.CompilerAPI.batch2(CompilerAPI.java:446)
      at flex2.compiler.CompilerAPI.batch(CompilerAPI.java:1274)
      at flex2.compiler.CompilerAPI.compile(CompilerAPI.java:1496)
      at flex2.tools.oem.Application.compile(Application.java:1188)
      at flex2.tools.oem.Application.recompile(Application.java:1133)
      at flex2.tools.oem.Application.compile(Application.java:819)
      at flex2.tools.flexbuilder.BuilderApplication.compile(BuilderApplication.java:344)
      at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder$MyBuilder.mybuild(ASApplicationBuilder.java:276)
      at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder.build(ASApplicationBuilder.java:127)
      at com.adobe.flexbuilder.multisdk.compiler.internal.ASBuilder.build(ASBuilder.java:190)
      at com.adobe.flexbuilder.multisdk.compiler.internal.ASItemBuilder.build(ASItemBuilder.java:74)
      at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.buildItem(FlexProjectBuilder.java:480)
      at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.build(FlexProjectBuilder.java:306)
      at com.adobe.flexbuilder.project.compiler.internal.FlexIncrementalBuilder.build(FlexIncrementalBuilder.java:157)
      at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
      at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
      at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
      at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:218)
      at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:360)
      at org.eclipse.core.internal.resources.Project$1.run(Project.java:523)
      at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
      at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1782)
      at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:502)
      at org.eclipse.core.internal.resources.Project.build(Project.java:94)
      at org.eclipse.ui.actions.BuildAction.invokeOperation(BuildAction.java:221)
      at org.eclipse.ui.actions.WorkspaceAction.execute(WorkspaceAction.java:162)
      at org.eclipse.ui.actions.WorkspaceAction$2.runInWorkspace(WorkspaceAction.java:483)
      at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

      Expected Results:

      The code should compile with no errors as it did with Flex 3.1.0.2710

      Workaround (if any):

      either
      wrap the inline Array with an ArrayCollection in the Binding declaration (although code hinting/automatic imports don't work).
      or
      declare the Array in a script block

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: