Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 176212 - [hyperlinking] Bug hyperlink is getting 1 extra character
Summary: [hyperlinking] Bug hyperlink is getting 1 extra character
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Frank Becker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 176213 (view as bug list)
Depends on: 229014
Blocks:
  Show dependency tree
 
Reported: 2007-03-02 13:13 EST by Willian Mitsuda CLA
Modified: 2008-06-10 01:41 EDT (History)
4 users (show)

See Also:


Attachments
patch (1.17 KB, patch)
2008-05-01 17:02 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (1.54 KB, application/octet-stream)
2008-05-01 17:02 EDT, Frank Becker CLA
no flags Details
updated patch (983 bytes, patch)
2008-05-19 15:36 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (1.85 KB, application/octet-stream)
2008-05-19 15:36 EDT, Frank Becker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Willian Mitsuda CLA 2007-03-02 13:13:48 EST
Move your mouse pointer over the "W" letter on this hyperlink: bug#1234W.

It is activating the hyperlink, so the detector is getting 1 extra character.
Comment 1 Robert Elves CLA 2007-03-02 14:19:24 EST
*** Bug 176213 has been marked as a duplicate of this bug. ***
Comment 2 Robert Elves CLA 2007-03-02 14:32:19 EST
Strange... we're returning the correct region but as you say the link is activating over the trailing character. 
Comment 3 Willian Mitsuda CLA 2007-10-30 18:26:11 EDT
Actually, it seems to be a platform bug.

I can reproduce it with a normal Java class hyperlink: Ctrl+hover mouse over any class name and you will get a hyperlink. If you hover over the next character, the hyperlink disappears, but you still get a "hand" mouse cursor and you can click the leading character to open the link.

I'll move this bug to Platform/Text for comments.
Comment 4 Willian Mitsuda CLA 2007-10-30 18:28:22 EDT
It seems I don't have permissions to change the assignee back to platform-text inbox. Rob, can you do it?
Comment 5 Dani Megert CLA 2007-10-31 04:01:24 EDT
Works for me using Eclipse SDK R3.3 and I20071030-0010 (next time please provide the build ID).

Maybe the bug detector interferes here and takes the hyperlink down. Please try whether you can reproduce in plain Eclipse SDK. If yes, reopen with more detailed steps. If not, make a small plug-in that only contributes your bug hyperlink detector and see whether this exhibits the bug. If so, attach the plug-in here and reopen the bug.
Comment 6 Willian Mitsuda CLA 2007-10-31 11:02:20 EDT
Daniel, I can reproduce in a plain 3.3.1 SDK, Windows Vista, sun jdk 1.6.0_03.

It is very easy to reproduce. Create the following class:

public class Test {
	
	private String test;

}

Hold Ctrl and move the mouse over the whitespace between "String" and "test". It helps if you increase the font size to 14 or bigger.

Note that the cursor is changed to "hand", although it is not a hyperlink, neither there is a hyperlink font decoration.

If you Ctrl+click the white space, it will open the String class.

That is a hyperlink detector contributed by JDT. I can reproduce it with Mylyn (the original bug) task hyperlinks, URL hyperlinks, and JDT/Debug "Step Into" hyperlinks.
Comment 7 Dani Megert CLA 2007-10-31 11:15:37 EDT
See it now.
Comment 8 Dani Megert CLA 2007-11-23 09:07:33 EST
While you're right that there's also a bug when using Java element hyperlink you are wrong that it is in the framework. The bug was in our Java element hyperlink detector (fixed in HEAD) and there's probably a bug in yours as well.
Comment 9 Mik Kersten CLA 2007-11-23 16:26:10 EST
Daniel: thanks for the pointer.

Willian: since you've done the hard work on this I'll reassign to you for further investigation.  If you want to pass on this bounce it back to Inbox.
Comment 10 Frank Becker CLA 2008-05-01 17:02:01 EDT
Created attachment 98377 [details]
patch

I found a way to fix this.

I think that this was a problem with is 0 the first index or is this 1.
Comment 11 Frank Becker CLA 2008-05-01 17:02:05 EDT
Created attachment 98378 [details]
mylyn/context/zip
Comment 12 Mik Kersten CLA 2008-05-05 01:17:12 EDT
Rob: please review.  Fyi, I can't reproduce on Mylyn 2.3.x with the case in the description.
Comment 13 Willian Mitsuda CLA 2008-05-18 19:27:13 EDT
Reassigning to you Frank.

 (In reply to comment #12)
> Rob: please review.  Fyi, I can't reproduce on Mylyn 2.3.x with the case in the
> description.

I can still reproduce with Eclipse 3.4 M7 + Mylyn 2.3.2.
Comment 14 Frank Becker CLA 2008-05-19 15:36:25 EDT
Created attachment 100962 [details]
updated patch

I double check this and think that it is fixed with this patch.

What now work is:

If you have the text"Ubug#1Vbug#2W" only if the cursor is over the "bug#1" or "bug#2" changes to the hyperlink presentation.

If you put the cursor over "W" you no longer get "bug#2".
Same for "V" and "bug#1". 

This test was with 3.4M7 and Mylyn from head.
Comment 15 Frank Becker CLA 2008-05-19 15:36:27 EDT
Created attachment 100963 [details]
mylyn/context/zip
Comment 16 Steffen Pingel CLA 2008-06-10 01:41:36 EDT
Awesome! Patch applied. Thanks for fixing and debugging this Frank.