Bug 90266 - [select] Code select returns null when there's a string including a slash on same line
Summary: [select] Code select returns null when there's a string including a slash on ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-05 06:34 EDT by Frederic Fusier CLA
Modified: 2005-05-12 06:21 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.