Bug 207572 - [select] codeselect not available if unterminated string literal
Summary: [select] codeselect not available if unterminated string literal
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-26 09:12 EDT by Philipe Mulet CLA
Modified: 2007-12-11 05:17 EST (History)
2 users (show)

See Also:


Attachments
Proposed patch (4.53 KB, patch)
2007-10-26 18:12 EDT, Philipe Mulet CLA
no flags Details | Diff
Better patch (5.86 KB, patch)
2007-11-05 09:27 EST, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2007-10-26 09:12:07 EDT
Build 3.4M2

In following code, codeselect doesn't work on any of the type references, due to scanner issue on string literal.

public class X {
	Object o;
	
	String foo() {
		return "aaa
	}
}
Comment 1 Philipe Mulet CLA 2007-10-26 09:13:17 EDT
Note: codeassist seems to perform fine in same code
Comment 2 Philipe Mulet CLA 2007-10-26 18:12:09 EDT
Created attachment 81310 [details]
Proposed patch

Avoid tokenizing until end of entire file (and thus be sensitive to invalid input later on).

I suspect performance should improve slightly as well, since no need to tokenize the file.
Comment 3 David Audel CLA 2007-11-05 09:27:18 EST
Created attachment 82093 [details]
Better patch

Patch proposed in comment 2 is good. I improved this patch and added a regression test.
Comment 4 David Audel CLA 2007-11-05 09:29:44 EST
Released for 3.4M4.

Test added
  ResolveTests#testSelectOnCursor2()
Comment 5 Eric Jodet CLA 2007-12-11 05:17:46 EST
Verified for 3.4 M4 using build I20071210-1800