| Summary: | Content Assist in Query Editor fails on Complex Nested Queries | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Animesh Kumar <animesh143> | ||||
| Component: | Query2 | Assignee: | Project Inbox <emf.query2-inbox> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | minor | ||||||
| Priority: | P3 | CC: | animesh143, manasa.priya.c | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Animesh Kumar
Created attachment 185981 [details]
Sample Query which was used
Sample Query which was used when it gave an error.
This is actually caused by a bug in org.antlr.runtime.BaseRecognizer.pushFollow(BitSet).The exact issue is, BaseRecognizer.following[99] is null.
/** Push a rule's follow set using our own hardcoded stack */
protected void pushFollow(BitSet fset) {
if ( (_fsp +1)>=following.length ) {
BitSet[] f = new BitSet[following.length*2];
System.arraycopy(following, 0, f, 0, following.length-1);
following = f;
}
following[++_fsp] = fset;
}
The problem is the length parameter of
System.arraycopy. They do not copy the last element of the original array when
growing, and sofollowing[99] is null. When this method is overrided in .ui project's parser, the error no more occurs.
This bug is fixed in xtext version 1.0.2 which will be released in a couple of days, as Query2 uses xtext Version 1.0.1, we will have to wait until it is released to migrate to the 1.0.2 version. Hence I reduce the priority of the bug.
Please find details below.
http://www.eclipse.org/forums/index.php?t=rview&goto=655318#msg_655318
Thanks & Regards,
Manasa
Hi, I have updated the Severity of the bug to minor. (In reply to comment #2) > This is actually caused by a bug in > org.antlr.runtime.BaseRecognizer.pushFollow(BitSet).The exact issue is, > BaseRecognizer.following[99] is null. > > /** Push a rule's follow set using our own hardcoded stack */ > protected void pushFollow(BitSet fset) { > if ( (_fsp +1)>=following.length ) { > BitSet[] f = new BitSet[following.length*2]; > System.arraycopy(following, 0, f, 0, following.length-1); > following = f; > } > following[++_fsp] = fset; > } > > The problem is the length parameter of > System.arraycopy. They do not copy the last element of the original array when > growing, and sofollowing[99] is null. When this method is overrided in .ui > project's parser, the error no more occurs. > > This bug is fixed in xtext version 1.0.2 which will be released in a couple of > days, as Query2 uses xtext Version 1.0.1, we will have to wait until it is > released to migrate to the 1.0.2 version. Hence I reduce the priority of the > bug. > > Please find details below. > http://www.eclipse.org/forums/index.php?t=rview&goto=655318#msg_655318 > > Thanks & Regards, > Manasa Issue has been tested with the xtext 1.0.2 updated IDE. NPE no more reproducible with latest content. Please close the bug. |