ScriptRunner icon indicating copy to clipboard operation
ScriptRunner copied to clipboard

Error parsing the last line of script

Open Blacky001 opened this issue 8 years ago • 3 comments

There are some scenarios for which ScriptRunner throws error: 1.Script ends with more than 1 newlines in the end "... <\n> <\n>" 2.Script ends with multiple spaces "... <spaces>" 3.Last line begins with a "--" "... -- this is a comment" 4.Last line begins with "//" "... // this is something" 5.last line matches the delimiter pattern, e.g. "DELIMITER $$" "... DELIMITER $$" 6. last line contains a comment "call sampledb.fixSchoolCourseData(); -- this is a comment"

In all the cases, the following error is thrown: "Error executing '' (line xxx): Can not issue empty query." xxx=line number

Also, in line 153, no need to initialize String trimmedLine in every loop.

I'm working on it.

Blacky001 avatar Dec 07 '17 12:12 Blacky001

Fixed all the issues. PR submitted. Please merge. Thanks :)

Blacky001 avatar Dec 07 '17 12:12 Blacky001

Looks good, but don't comment the annotations. If you feel they're useless, remove the line. I don't have any use for this script right now so I'm just going to trust you they're useless. Also, could you switch tabs to 4 spaces?

BenoitDuffez avatar Dec 08 '17 14:12 BenoitDuffez

Ok. I will make the changes and update it. Thanks.

Blacky001 avatar Dec 11 '17 02:12 Blacky001