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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
<!DOCTYPE project>
<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="testDir" value="test" />
+1350 −1156

File changed.

Preview size limit exceeded, changes collapsed.

+572 −584

File changed.

Preview size limit exceeded, changes collapsed.

+6 −3
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
* printed else it will be the message "Correct syntax".
*
*  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;
* @see ADQLQueryFactory
*
* @author Gr&eacute;gory Mantelet (CDS;ARI)
* @version 1.5 (03/2019)
* @version 1.5-1 (07/2019)
*/
public class ADQLParser {
	
@@ -644,6 +644,9 @@ public class ADQLParser {
				/* same line, just get the space characters between the last
				 * token and the one to append: */
				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)));
					lastCol = token.endColumn + 1;
				}