Skip to content
Snippets Groups Projects
Commit f83a6b75 authored by Grégory Mantelet's avatar Grégory Mantelet
Browse files

[ADQL] Fix the quick fix option ; `StringIndexOutOfBoundsException` was thrown

when ending the query with an EOF.
parent f4ffbf1d
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!DOCTYPE project> <!DOCTYPE project>
<project name="adql" basedir="." default="buildLib"> <project name="adql" basedir="." default="buildLib">
<property name="version" value="1.5" /> <property name="version" value="1.5-1" />
<property name="srcDir" value="src" /> <property name="srcDir" value="src" />
<property name="testDir" value="test" /> <property name="testDir" value="test" />
......
This diff is collapsed.
This diff is collapsed.
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* printed else it will be the message "Correct syntax". * printed else it will be the message "Correct syntax".
* *
* Author: Gr&eacute;gory Mantelet (CDS;ARI) * Author: Gr&eacute;gory Mantelet (CDS;ARI)
* Version: 1.5 (03/2019) * Version: 1.5-1 (07/2019)
*/ */
/* ########### */ /* ########### */
...@@ -119,7 +119,7 @@ import adql.translator.TranslationException; ...@@ -119,7 +119,7 @@ import adql.translator.TranslationException;
* @see ADQLQueryFactory * @see ADQLQueryFactory
* *
* @author Gr&eacute;gory Mantelet (CDS;ARI) * @author Gr&eacute;gory Mantelet (CDS;ARI)
* @version 1.5 (03/2019) * @version 1.5-1 (07/2019)
*/ */
public class ADQLParser { public class ADQLParser {
...@@ -644,6 +644,9 @@ public class ADQLParser { ...@@ -644,6 +644,9 @@ public class ADQLParser {
/* same line, just get the space characters between the last /* same line, just get the space characters between the last
* token and the one to append: */ * token and the one to append: */
if (lastLine == token.beginLine){ if (lastLine == token.beginLine){
if (token.kind == ADQLParserConstants.EOF)
suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1));
else
suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - (isEnd(token) ? 0 : 1))); suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - (isEnd(token) ? 0 : 1)));
lastCol = token.endColumn + 1; lastCol = token.endColumn + 1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment