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

Bug 238718

Summary: [navigation] Quick Outline filters items incorrectly
Product: [Eclipse Project] JDT Reporter: Mohsen Saboorian <mohsens>
Component: TextAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: adi, caniszczyk, daniel_megert, kobipe3, markus.kell.r
Version: 3.4Flags: daniel_megert: review+
Target Milestone: 3.4.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Mohsen Saboorian CLA 2008-06-27 03:25:37 EDT
Ctrl+O doesn't work as expected. It filters out some items incorrectly. Write a sample class, with the following code:

public class CtrlO {
	boolean loaded;

	public void load() {
	}
}

Now press ctrl+o and type "lo" to filter all methods/members but items starting with lo (like loaded or load). You can see that load is removed as you type lo, and just loaded field remains in the list.
Comment 1 Mohsen Saboorian CLA 2008-06-27 05:54:04 EDT
Well, seems to be another bug with locale. Try running eclipse.exe -nl ar, or eclipse.exe -nl fa and see that Quick Outline's filter on method names doesn't work at all. It filters all methods. It seems that there is a controlling character (which is not shown, like RLM) at the beginning of method names which causes this problem.
Comment 2 Eric Moffatt CLA 2008-07-02 10:51:55 EDT
Mohsen, do the filters on Ctrl-3 and Alt+Shift+T work under the same scenarios?

I'm just wondering how wide-spread the issue is...
Comment 3 Mohsen Saboorian CLA 2008-07-03 01:05:55 EDT
It's very similar to other i18n issues with Eclipse.

Alt+Shift+T brings up refactoring menu, so it doesn't have anything to filter. Ctrl-3 works ok. The problem with Quick Outline is only for methods. Fields are filtered correctly.

To reproduce the issue, please add the following configuration detail to your eclipse.ini (after -vmargs):
-Duser.language=fa

When I switch to -Duser.language=en, Quick Outline filters perfectly.
Comment 4 Chris Aniszczyk CLA 2008-07-23 14:20:16 EDT
JDT UI owns the quick outline for Java
Comment 5 Markus Keller CLA 2008-07-24 06:13:11 EDT
I can reproduce with M20080723-0800 with vmarg -Duser.language=fa .
Works fine with I20080723-1200.
Comment 6 Markus Keller CLA 2008-07-24 06:14:22 EDT
*** Bug 236834 has been marked as a duplicate of this bug. ***
Comment 7 Markus Keller CLA 2008-07-24 09:00:50 EDT
> Works fine with I20080723-1200.
Actually not. I can also reproduce with HEAD if 'Preferences > Java >
Appearance > Show method return types' is disabled (default setting).

I that case, TextProcessor.process("load()", ".:/\\<>(),?:{}") adds LRE and PDF
to the string. With return types enabled, process("load() : void", ...) leaves
the string untouched.
Comment 8 Markus Keller CLA 2008-07-24 09:47:55 EDT
Created attachment 108344 [details]
Fix

The problem is that the filter is applied on the result from ILabelProvider#getText(Object), which is already processed. The fix is to deprocess the label before applying the filter.

This is not a problem for the Open Type dialog (CTRL+Shift+T, not Alt+Shift+T), since we filter on the model there, not on the view.
Comment 9 Markus Keller CLA 2008-07-24 12:52:48 EDT
Released to HEAD. Dani, please review for 3.4.1.
Comment 10 Dani Megert CLA 2008-07-30 07:09:08 EDT
+1 for 3.4.1
Comment 11 Dani Megert CLA 2008-08-04 10:12:54 EDT
Committed to R3_4_maintenance.
Comment 12 Dani Megert CLA 2008-08-06 09:25:11 EDT
Verified in build input for M20080808-0800.
Comment 13 Markus Keller CLA 2008-08-08 08:35:57 EDT
Verified in I20080807-1402.