Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 219336

Summary: [navigation] Default key does not seem to work
Product: [Eclipse Project] Platform Reporter: Peter Larsen <peblpebl>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, martinae
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Configuration Details none

Description Peter Larsen CLA 2008-02-18 13:45:11 EST
Build ID: I20080207-1530

Java hyperlinking (Preference->Editors->Text Editors->Hyperlinking) is odd in my eclipse 3.4M5. 

1) If the default key is set and the java element key is equal to default key, I am hyperlinking without pressing any keys. (but pressing any control keys takes me out of hyperlinking) 

2) If I set another key for java element, I only hyperlink when pressing that key. 

3) If I set another default key, I must press the java element key for hovering. 
 
4) If I press "restore default" it looks like ctrl is set at default key and the key for java element, but when closed and opened again, several link kinds (including java element) are set to empty. (I am assuming meaning default key). This gives behaviour 1).

5) If I set the java element key to the default key, it is shown in the preference also after a close/open. (Then hyperlinking works as expected, so "another" could be removed from 2))

So it seems A) somebody checks for the kind key and forgetting the default key or B) The preference should not remove the key if it is equal to the default key. B) Seems wrong as how else could I no-key when I have a default key.



Peter
Comment 1 Dani Megert CLA 2008-02-19 02:29:27 EST
Sorry, I cannot reproduce this using plain Eclipse SDK I20080207-1530. Maybe you installed a product that messes around with those preferences.

If you can reproduce using plain Eclipse SDK I20080207-1530 please reopen with steps to reproduce.
Comment 2 Dani Megert CLA 2008-02-19 02:31:34 EST
One detail: out of the box some keys are defined to use the default modifier and hence if you change the default you'll see it updates the key in the table below. As soon as you explicitly set the key below in the table to something different from the default it gets decoupled from the default.

The modifier to be used is always the one shown in the table.
Comment 3 Peter Larsen CLA 2008-02-19 05:48:11 EST
Hmm, I downloaded the sdk because I wanted to follow up on another bug,
so no, this is a plain sdk, without third party plugins nor have I have
installed any profiler yet. 

However, I am using the same workspace as the old eclipse I20071101-2000 (3.4.0).

I have tried with a fresh workspace and got the exact same result.


> The modifier to be used is always the one shown in the table.

So you are saying that if the key is shown to be empty, then no modifyer is
needed? So my assumtion in 4) is wrong. Then my bug is that even though I ask
for restoring to default, and is shown the keys, they are not saved (even after pressing apply).

Comment 4 Dani Megert CLA 2008-02-19 05:54:49 EST
>However, I am using the same workspace as the old eclipse I20071101-2000
>(3.4.0).
Prefs are stored in the workspace.

>So you are saying that if the key is shown to be empty, then no modifier is
>needed?
Right, but it needs to be empty in the table. The table is what counts.

As said, if you still see this provide a step-by-step description. Maybe I perform  the steps slightly different than you do.

Also, check the .log for potential errors.
Comment 5 Peter Larsen CLA 2008-02-19 06:16:43 EST

You said 

> Prefs are stored in the workspace.

and ignored:

>> I have tried with a fresh workspace and got the exact same result.

so I assume that using a fresh workspace is not enough to clear prefs, when I
already have used an old workspace. How am I assured to have a clean prefs?


>> So you are saying that if the key is shown to be empty, then no modifier is
>> needed?
> Right, but it needs to be empty in the table. The table is what counts.

Can you clearify "it needs to be empty in the table". As I see/experiencing it should not be empty in the table - it should say ctrl. 


What I did was 

1) tell eclipse to ask for a workspace when starting.
2) close eclipse.
3) Start eclipse.
4) Wrote an non existing path.
5) Created a java project test.
6) Created a package test
7) Created a class Test.
8) wrote

package test;

public class Main {
	private static int foo = 3;
	
	
	public static void main(String args) {
		System.out.println("Test of foo " + foo);		
	}
}

9) Saw that it hyperlinked over foo.
10) Checked hyperlinking diaglog.
11) Saw that there was no modifyer key for java element.
12) Pressed "restore Defaults"
13) Saw that the modifyer key for java element was now cltr
14) pressed apply, and ok.
15) Reopen preferences and saw the java element key was empty.



> Also, check the .log for potential errors.

Ok, where is the .log file?




Peter
Comment 6 Dani Megert CLA 2008-02-19 06:38:16 EST
>so I assume that using a fresh workspace is not enough to clear prefs,
It is. I just wanted to give you that info, as I don't know how much you know.

>Ok, where is the .log file?
<workspace loc>/.metadata (or open the Error Log view).

When I follow your steps using a freshly downloaded Eclipse SDK then I cannot reproduce. Sorry.

1. download http://download.eclipse.org/eclipse/downloads/drops/I20080212-0800/index.php
2. install to a completely new location - DO NOT reuse existing location
3. start using a new workspace location
4. check the preferences: hyperlinking for Java elements uses 'Ctrl' modifier
5. paste the code from comment 5
6. observe: hyperlinking for 'foo' needs 'Ctrl' modifier
Comment 7 Peter Larsen CLA 2008-02-19 07:11:49 EST
I am using 

bash-3.2$ md5sum.exe eclipse-SDK-3.4M5-win32.zip
e227cfe309ce086973ae1c14270448de *eclipse-SDK-3.4M5-win32.zip

I will try download etc. later.


>>Ok, where is the .log file?
><workspace loc>/.metadata (or open the Error Log view).

Hmm, I do not see any .log under the new workspace/.metadata (I found one under the old workspace), but if I Help->About->Configuration Details I get one. Nothing I would assume out of the ordinary. The old log had some errors from the 3.4.0M5: 

!SESSION 2008-02-18 14:06:09.469 -----------------------------------------------
eclipse.buildId=I20080207-1530
java.version=1.6.0-rc
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=da_DK
Command-line arguments:  -os win32 -ws win32 -arch x86

!ENTRY org.eclipse.ui.ide 4 4 2008-02-18 18:27:51.185
!MESSAGE Error accessing marker type

!ENTRY org.eclipse.core.resources 4 376 2008-02-18 18:27:52.420
!MESSAGE Marker id 2614497 not found.

!ENTRY org.eclipse.ui.ide 4 4 2008-02-18 18:27:54.013
!MESSAGE Error accessing marker type

!ENTRY org.eclipse.core.resources 4 376 2008-02-18 18:27:54.013
!MESSAGE Marker id 2614497 not found.

!ENTRY org.eclipse.ui.ide 4 4 2008-02-18 18:27:54.029
!MESSAGE Error accessing marker type

!ENTRY org.eclipse.core.resources 4 376 2008-02-18 18:27:54.029
!MESSAGE Marker id 2614497 not found.

!ENTRY org.eclipse.ui.ide 4 4 2008-02-18 18:27:54.029
!MESSAGE Error accessing marker type

!ENTRY org.eclipse.core.resources 4 376 2008-02-18 18:27:54.045
!MESSAGE Marker id 2614497 not found.

Comment 8 Peter Larsen CLA 2008-02-19 08:47:40 EST
Done:

1. download
http://download.eclipse.org/eclipse/downloads/drops/I20080212-0800/index.php
2. install to a completely new location - DO NOT reuse existing location
3. start using a new workspace location
4. check the preferences: hyperlinking for Java elements uses 'Ctrl' modifier
5. paste the code from comment 5
6. observe: hyperlinking for 'foo' needs 'Ctrl' modifier

Same result, and 4) showed no keys for Ant Element, Java Element, URL. showed
Ctrl + Alt for 2*Java Property key, Strep Into Selection.

Where are these preferences stored?

bash-3.2$ md5sum.exe eclipse-SDK-I20080212-0800-win32.zip
0b3feb7f6ab6f74bc5f246fdf3784cc3 *eclipse-SDK-I20080212-0800-win32.zip


Comment 9 Dani Megert CLA 2008-02-19 08:58:56 EST
>Where are these preferences stored?
In the workspace, unless of course you provide your own preferences using either eclipse.pluginCustomization property or -pluginCustomization command line option.

That's really strange. Did you really take a new workspace?

Can you post your configuration (Help > About Eclipse SDK - press 'Configuration Details')?
Comment 10 Peter Larsen CLA 2008-02-19 09:23:28 EST
Created attachment 90065 [details]
Configuration Details
Comment 11 Peter Larsen CLA 2008-02-19 09:27:49 EST
>> Where are these preferences stored?
>In the workspace, unless of course you provide your own preferences using
> either eclipse.pluginCustomization property or -pluginCustomization command
> line option.

Ok, I meant which file, so I could track what happens on the disk. I do not
think I am useing any customization plugins (and would not how too).


> That's really strange. Did you really take a new workspace?

The only way I know to change the workspace is to write a new path when prompt at eclipse startup. I have created workspacePebl[1-8] today, so yes?


> Can you post your configuration (Help > About Eclipse SDK - press
> 'Configuration Details')?

Done as attachments.
Comment 12 Dani Megert CLA 2008-02-19 10:04:38 EST
>Ok, I meant which file, so I could track what happens on the disk. I do not
>think I am useing any customization plugins (and would not how too).
The defaults are set in the code. Do you eventually have a special keyboard, so that the 'Ctrl' key can't be detected as modifier 1?

What happens if you press the 'Ctrl' key in the preference page? Is it detected/written as 'Ctrl'?

Comment 13 Dani Megert CLA 2008-02-19 10:20:03 EST
Just a wild guess: can you try to install something without space, e.g. c:\eclipse?
Comment 14 Peter Larsen CLA 2008-02-19 10:33:21 EST
> The defaults are set in the code. 

So eclipse will remove all prefs on disk when I restore to default? or will
it write the default to the disk?


> Do you eventually have a special keyboard, so
> that the 'Ctrl' key can't be detected as modifier 1?

Not that I know of it? Danish hp keyboard ku-0133.

> What happens if you press the 'Ctrl' key in the preference page? 

It works. I press the java element, and then need to press the modifyer
detector field and then presses Ctrl.


> Is it detected/written as 'Ctrl'?

Yes. 

A Funny thing here: If - after I change to ctrl from a blank modifyer key - I
immediately press restore, apply, ok, then that key is actually remembered. But
only the last key changed. 


> Just a wild guess: can you try to install something without space, e.g.
> c:\eclipse?

I will try.

Comment 15 Dani Megert CLA 2008-02-19 10:37:38 EST
>So eclipse will remove all prefs on disk when I restore to default? or will
>it write the default to the disk?
If you change them to something other than default it will write them but that is not relevant for the steps you did in comment 8 as this is an out of the box scenario.
Comment 16 Peter Larsen CLA 2008-02-19 10:46:40 EST
> Just a wild guess: can you try to install something without space, e.g.
> c:\eclipse?

Extracted to c:\eclipse and workspace at c:\workspaceTest, no luck.


>>So eclipse will remove all prefs on disk when I restore to default? or will
>>it write the default to the disk?

>If you change them to something other than default it will write them but that
>is not relevant for the steps you did in comment 8 as this is an out of the box
>scenario.

I know. But say I changed some of the settings, closed eclipse, started eclipse, restored defaults, closed eclipse, would the pref on disk (I still dont know where) say ctrl or empty or would the settings have been eraesed?


Comment 17 Dani Megert CLA 2008-02-19 10:48:29 EST
> would the pref on disk (I still
>dont know where) say ctrl or empty or would the settings have been eraesed?
Yes.

Can you eventually try on a different machine or keyboard?
Comment 18 Peter Larsen CLA 2008-02-19 11:45:27 EST
>> would the pref on disk (I still dont know where) say ctrl 
>> or empty or would the settings have been eraesed?
> Yes.

Hmm, was that a yes to 

A) ctrl
B) empty
C) ereased

Which file is the prefs written to?


> Can you eventually try on a different machine or keyboard?

I tried
eclipse-SDK-I20080212-0800-win32.zip
on a different machine with different keyboard, and while another user (too avoid roaming settings etc.) no luck.
Comment 19 Peter Larsen CLA 2008-02-19 11:56:20 EST
> I tried
> eclipse-SDK-I20080212-0800-win32.zip
> on a different machine with different keyboard, and while another user (too
> avoid roaming settings etc.) no luck.

Forgot that I also switched from windows xp professional to a windows xp 64.

Comment 20 Dani Megert CLA 2008-02-19 12:20:51 EST
Only non-defaults are on disk. But as said not relevant for this really strange bug which we have never seen before.
Comment 21 Peter Larsen CLA 2008-02-19 14:31:02 EST
> Only non-defaults are on disk. But as said not relevant for 
> this really strange bug which we have never seen before.

Ok, but just amuse me could you answer both question, please?

Peter
Comment 22 Peter Larsen CLA 2008-02-19 15:41:45 EST
3.4M4 (Version: 3.4.0 Build id: I20071213-1700) works for me.
Comment 23 Dani Megert CLA 2008-02-20 02:42:53 EST
You find the non-default values here:
<workspace>\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui.editors.prefs

>3.4M4 (Version: 3.4.0 Build id: I20071213-1700) works for me.
Very interesting. Do you use the same VM and command line options? I'd really like to find out what's going on here. You could debug it if you know how to do this, or we could do a NetMeeting session if you want.
Comment 24 Dani Megert CLA 2008-02-20 02:45:27 EST
You are running on WindowsXP as indicated, right? Do you see strange behavior with other preferences?
Comment 25 Peter Larsen CLA 2008-02-20 04:10:00 EST
> You find the non-default values here:
> <workspace>\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui.editors.prefs

Thank you.

>> 3.4M4 (Version: 3.4.0 Build id: I20071213-1700) works for me.
> Very interesting. Do you use the same VM and command line options? 

I would asume so. With both extracted I can change between them, using the same workspace, and M5 will show empty modifier keys for some entries. 


> I'd really like to find out what's going on here. 
> You could debug it if you know how to do
> this, or we could do a NetMeeting session if you want.

I have no idear of how to that. Is there a "migration" plan from M4 -> M5? E.i how could I replace M4 plugins to get M5? Is there an intergration build around january? 

Last nigh I installing M5 on my inspiron 9300 laptop, danish keyboard, no luck. I did not try M4 as downloading took a while.
Comment 26 Dani Megert CLA 2008-02-20 04:25:27 EST
>I did not try M4 as downloading took a while.
Why do you then say "3.4M4 (Version: 3.4.0 Build id: I20071213-1700) works for me." in comment 22?

If you have C:\Program Files\NetMeeting\conf.exe then you can share your machine and I could remotely debug it with you.
Comment 27 Peter Larsen CLA 2008-02-20 04:31:45 EST
>>I did not try M4 as downloading took a while.
> Why do you then say "3.4M4 (Version: 3.4.0 Build id: I20071213-1700) works for
> me." in comment 22?

I should have been more clear here: 

>> Last nigh I installing M5 on my inspiron 9300 laptop, danish keyboard, no 
>> luck.

This is my personal laptop I tried it on after going home from work, where as the other 2 is at my work. 
Comment 28 Peter Larsen CLA 2008-02-20 05:20:05 EST
> If you have C:\Program Files\NetMeeting\conf.exe then you can 
> share your machine and I could remotely debug it with you.

Not allowed at work, and I doubt you want to try that at home
with my connection.

What is the smallest set of plugins eclipse need to; start and have an pref->editors->texteditors->Hyperlinking->URL?
Comment 29 Peter Larsen CLA 2008-02-20 12:57:24 EST
> If you have C:\Program Files\NetMeeting\conf.exe then you can share your
> machine and I could remotely debug it with you.

Ok, I am in a position where it can be done now.
Comment 30 Peter Larsen CLA 2008-02-23 04:14:46 EST
Just tried a fourth machine with same behavious; this time a vista home
edition (danish).
Comment 31 Dani Megert CLA 2008-02-25 03:35:06 EST
OK Peter, let me know when you have time for a Netmeeting session. We can't do much from here without being able to look closer on this.
Comment 32 Dani Megert CLA 2008-02-26 05:47:35 EST
Looked at this together with Peter and I think I figured it out now and it looks like being a general problem of the preference store regarding different locales which got fixed recently.

Peter will verify and confirm shortly.
Comment 33 Peter Larsen CLA 2008-02-26 09:15:08 EST
> Peter will verify and confirm shortly.

Following drops works for me:

http://download.eclipse.org/eclipse/downloads/drops/I20080222-1622/index.php

Peter
Comment 34 Dani Megert CLA 2008-02-26 11:06:39 EST

*** This bug has been marked as a duplicate of bug 217294 ***