Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-981

Whitespace and line endings in script elements are not preserved - fix?

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • jBPM 3.2.2
    • jBPM 3.2.0
    • Runtime Engine
    • None

      The current Script implementation collapses script whitespace and eliminates line-endings in scripts - even when within a !CDATA. I believe this is often bad and never good, apart from trivial optimization.

      Line-ending preservation is necessary for use of // comments.

      Whitespace and line-ending preservation are useful for script compiler error messages that call out a line and column position of the error.
      These positions are meaningless if space has been collapsed and line-endings removed.

      I happen to be experimenting with using other script languages (especially Groovy) for which line endings are meaningful. You probably don't care about that, though!

      The fix is easy: in Script.read(), replace both occurrences of getTextTrim() with getText().

            tom.baeyens Tom Baeyens (Inactive)
            estaub Edward Staub (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: