Bug 90266

Summary: [select] Code select returns null when there's a string including a slash on same line
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Frederic Fusier CLA 2005-04-05 06:34:16 EDT
Using 3.1 M6.

Consider following test case:
public class Test {
	int test;
	void foo() {
		System.out.println("String with / (slash)"+ test);
	}
}

In println(...) method argument, put caret in "test" and hit F3, you get error
message in status bar: "Current text selection does not resolve to a Java
element" although it does!
Comment 1 Frederic Fusier CLA 2005-04-05 06:37:38 EDT
Workaround is to select entirely and then it works.

This issue comes from change for selection in Javadoc. checkSelection method of
SelectionEngine has been modified to stop reverting when encountered a '/'.

In this case this is not correct as slash is inside a string...
Comment 2 Frederic Fusier CLA 2005-04-10 17:20:10 EDT
Fixed and released in HEAD.

Also fix case when there's a '/' on same line. That means that following failing
test case will be also fixed:
public class Test {
  int test;
  void foo() {
    System.out.println("Line including char with slash"+ '/' + test);
  }
}



[jdt-core-internal]
Test case added in SelectionJavaModelTests
Comment 3 Maxime Daniel CLA 2005-05-12 06:17:09 EDT
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.