Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 441547

Summary: Manifest tokenizer does not parse trailing whitespace after quoted string literals
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: DeploymentAssignee: Maciej Bendkowski <maciej.bendkowski>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: maciej.bendkowski
Version: 6.0   
Target Milestone: 7.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
problematic YAML none

Description Mark Macdonald CLA 2014-08-11 17:00:17 EDT
Created attachment 245900 [details]
problematic YAML

1. Drop the attached file into the unit tests folder: bundles/org.eclipse.orion.server.tests/testData/manifestTest/correct/
2. Run the ManifestParserTest. I expected the test file to parse cleanly, but it fails:

> org.eclipse.orion.server.cf.manifest.v2.TokenizerException: Unexpected token around line 6.
>	at org.eclipse.orion.server.cf.manifest.v2.utils.ManifestTokenizer.getNextToken(ManifestTokenizer.java:89)

This also means you cannot use the Orion CF tools on an application that has a similar manifest (which is important for the Node.js debug stuff I am doing).
Comment 1 Mark Macdonald CLA 2014-08-11 17:04:47 EDT
The parser seems to be getting confused by the 2 sets of double quotes inside line #6
> node_modules/.bin/foo --foo "bar" --baz "" -- fizz buzz
                              ^^^^^^^^^^^^^^
Comment 2 Maciej Bendkowski CLA 2014-08-12 03:39:41 EDT
(In reply to Mark Macdonald from comment #0) 
> This also means you cannot use the Orion CF tools on an application that has
> a similar manifest (which is important for the Node.js debug stuff I am
> doing).

A quick fix to get the attached manifest working is to surround the custom command with quotation marks to indicate a string literal, i.e.

command: "node_modules/.bin/foo --foo "bar" --baz "" -- fizz buzz"

Most probably there's a problem with the accepted string literal format. Investigating.
Comment 3 Maciej Bendkowski CLA 2014-08-12 04:28:53 EDT
Fixed with: http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=97e9f3c210b396fe7f359fb625866b997845cfad

In case of a quoted string literal "" the trailing whitespace before -- was not included in the token. As no token may start with a whitespace except the indentation, the -- literal could not be parsed. Mark, I've included your test case in the manifest test suite - thanks for pointing this out.