Error parsing the last line of script
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.
Fixed all the issues. PR submitted. Please merge. Thanks :)
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?
Ok. I will make the changes and update it. Thanks.