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

Multi-line strings should use System.getProperty("line.separator") for EOL, not \n

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0-JSR-6
    • 1.1-rc-3
    • None
    • None
    • Windows XP SP2
      Java 1.5.0_07

    Description

      Tested in 1.0-JSR-5 and 1.0-JSR-6.

      I have a Groovy Script that creates a DB2 SQL script on Windows XP.

      The SQL script is FTP'd to AIX where it is used to create perform batch modifications of DB2 tables.

      Part of my Groovy script looks like:
      moveFile.write("""update GISD.STORE_APP_PROFILE
      set RELEASE_END_DT = (CURRENT_DATE - 1 DAY),
      MAINT_USER_ID = 'SSA500',
      MAINT_TMS = CURRENT_TIMESTAMP
      where PROFILE_ID in (
      select PROFILE_ID
      from GISD.STORE_APP_PROFILE AP, GISD.APP_RELEASE AR
      where AP.APP_ID = AR.APP_ID
      and (APP_NAME = 'Back Office (static assignment)' or
      APP_NAME = 'Baja Back Office')
      and ((RELEASE_END_DT IS NULL) or
      (RELEASE_END_DT > CURRENT_DATE))
      and APP_URL like '${urlPrefix}${blade}${hostPortSeparator}%');
      """
      )

      The eol characters are not properly translated when FTPing the file because they are %0A (\n) instead of %0D0A (\r\n).

      Multi-line Strings should be processed u

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            mcangus Mike McAngus
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: