Uploaded image for project: 'Appcelerator Studio'
  1. Appcelerator Studio
  2. TISTUD-8602

Alloy: Unexpected behavior when creating a controller with quotes in the string

    Details

    • Type: Bug
    • Status: Open
    • Priority: None
    • Resolution: Unresolved
    • Affects Version/s: Release 4.8.0
    • Fix Version/s: None
    • Component/s: Alloy
    • Labels:
    • Environment:

      OS: Microsoft Windows 10 Pro 10.0.14393
      Appc core: 6.0.0-54
      Appc NPM: 4.2.8-7
      Ti SDK: 5.5.0.GA
      Appc Studio: 4.8.0.201609232005

      Description

      Description

      When creating a alloy resource with a name like test"/my-controller on Windows the name of the generated file is like so my-controller --no-colors --no-progress-bars --no-prompt --no-banner --prompt-type socket-bundle --prompt-port 50500.js. It is only the Alloy items that allow a user to enter a special character, all other options that run the appc CLI do not allow ". On mac the file file is created as expected i.e my-controller.js in the folder test", but both platforms throw the following error

      !ENTRY com.aptana.js.core 2 0 2016-09-27 14:39:16.444
      !MESSAGE (Build 4.8.0.201609232005) [WARNING]  Bad type name being set, something is going haywire: 'My-controller --no-colors --no-progress-bars --no-prompt --no-banner --prompt-type socket-bundle --prompt-port 50500Controller'
      !STACK 0
      java.lang.IllegalArgumentException: Bad type name being set, something is going haywire: 'My-controller --no-colors --no-progress-bars --no-prompt --no-banner --prompt-type socket-bundle --prompt-port 50500Controller'
      	at com.aptana.js.core.inferencing.JSTypeUtil.validateTypeName(JSTypeUtil.java:495)
      	at com.aptana.js.core.model.ReturnTypeElement.setType(ReturnTypeElement.java:123)
      	at com.aptana.js.core.model.PropertyElement.addType(PropertyElement.java:121)
      	at com.appcelerator.titanium.alloy.internal.core.build.ViewIndexingParticipant.ensureControllerTypeExists(ViewIndexingParticipant.java:118)
      	at com.appcelerator.titanium.alloy.internal.core.build.ViewIndexingParticipant.index(ViewIndexingParticipant.java:75)
      	at com.aptana.core.internal.build.IndexBuildParticipant.buildFile(IndexBuildParticipant.java:132)
      	at com.aptana.core.internal.build.LazyBuildParticipant.buildFile(LazyBuildParticipant.java:72)
      	at com.aptana.core.build.UnifiedBuilder.buildFile(UnifiedBuilder.java:614)
      	at com.aptana.core.build.UnifiedBuilder.doBuildFiles(UnifiedBuilder.java:525)
      	at com.aptana.core.build.UnifiedBuilder.buildFiles(UnifiedBuilder.java:497)
      	at com.aptana.core.build.UnifiedBuilder.incrementalBuild(UnifiedBuilder.java:263)
      	at com.aptana.core.build.UnifiedBuilder.build(UnifiedBuilder.java:197)
      	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
      	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
      	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
      	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
      	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
      	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
      	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
      	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
      	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
      	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
      

      Steps to reproduce
      1. Right click in an alloy project and select New->Alloy Controller
      2. Enter a name like "doublequote
      Actual result

      The file created will be called doublequote--no-colors --no-progress-bars --no-prompt --no-banner --prompt-type socket-bundle --prompt-port 50500.js, the error above will be show in the logs

      Expected result

      No error should be in the logs, Studio should handle the quote

        Attachments

          Activity

            People

            • Assignee:
              kkolipaka Kondal Kolipaka (Inactive)
              Reporter:
              eharris Ewan Harris
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: