Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4236

Extra ";" is added in template where it's not needed

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.7.2
    • Fix Version/s: None
    • Component/s: Groovlet / GSP
    • Labels:
      None

      Description

      The following Groovy code:

      <properties>
          <hudson.model.ParametersDefinitionProperty>
              <parameterDefinitions>
      <%
          job.parameters().each
          {
              Parameter p ->
      
              switch ( p.type )
              {
                  case ParameterType.bool:
      %>
                  <hudson.model.BooleanParameterDefinition>
                  </hudson.model.BooleanParameterDefinition>
      <%
                       break
              }
          }
      %>
              </parameterDefinitions>
          </hudson.model.ParametersDefinitionProperty>
      </properties>
      

      created the following template

      out.print("<properties>\n");
      out.print("    <hudson.model.ParametersDefinitionProperty>\n");
      out.print("        <parameterDefinitions>\n");
      out.print("");
          job.parameters().each
          {
              Parameter p ->
      
              switch ( p.type )
              {
                  case ParameterType.bool:
      ;
      out.print("\n");
      out.print("            <hudson.model.BooleanParameterDefinition>\n");
      out.print("            </hudson.model.BooleanParameterDefinition>\n");
      out.print("");
                       break
              }
          }
      ;
      out.print("\n");
      out.print("        </parameterDefinitions>\n");
      out.print("    </hudson.model.ParametersDefinitionProperty>\n");
      out.print("</properties>\n");
      

      Now it fails due to ";" on line 12: unexpected token: ;

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              genie Evgeny Goldin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: