Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342123 - [quick assist] option to "Exchange left and right operands for infix expression" does not appear.
Summary: [quick assist] option to "Exchange left and right operands for infix expressi...
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-07 05:23 EDT by Harendra CLA
Modified: 2011-04-07 22:52 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harendra CLA 2011-04-07 05:23:27 EDT
Build Identifier: I20110329-0800

Eclipse version:I20110329-0800
OS: Red Hat Enterprise Linux 6.0
Java Version: JRE 1.6.0 IBM Linux build pxi3260sr9fp1-20110208_03 (SR9 FP1)
Locale: ja_JP.utf8

Quick Assist option to "Exchange left and right operands for infix expression" does not appear unless there is a space between the operator and the operand. For example i > 1 will work but i>1 will not work.

Reproducible: Always

Steps to Reproduce:
1.Add following method to a class.
	public void hello(){
		int i=0;
		System.out.println("Hello world");
		int エラー=1;
		if(エラー > 1){
		System.out.println(エラー);
		}
	}
2.Place you cursor at if(エラー > 1), next to the > operator and press ctrl+1.
3.The pop-up is expected to display "Exchange left and right operands for infix expression" but it does not.
Comment 1 Harendra CLA 2011-04-07 05:32:30 EDT
There is a problem with the method provided above. Please use following method.
 public void hello(){
        int i=0;
        System.out.println("Hello world");
        int エラー=1;
        if(エラー>1){
        System.out.println(エラー);
        }
    }

Hence the expression in step 3 should be
 if(エラー>1){
Comment 2 Deepak Azad CLA 2011-04-07 06:17:38 EDT
This has nothing to do with DBCS characters. As mentioned in comment 0 the behavior can be seen with "i>1".

There are 2 cases (consider | as the caret)
1. "i |> 1": caret is clearly at the operator and "Exchange left and right operands for infix expression" is shown
2. "i|>1": Where is the caret now - on the operator or the operand 'i' ? Currently the operand wins, and you see quick assists like 'Rename', 'Inline local' etc. I do not see any good reasons to change this behavior. Closing this as Invalid.

Note that in the second case you can *select* the operator and then invoke Ctrl+1 to see the quick assist.
Comment 3 Harendra CLA 2011-04-07 22:52:00 EDT
(In reply to comment #2)
> This has nothing to do with DBCS characters. As mentioned in comment 0 the
> behavior can be seen with "i>1".
> 
> There are 2 cases (consider | as the caret)
> 1. "i |> 1": caret is clearly at the operator and "Exchange left and right
> operands for infix expression" is shown
> 2. "i|>1": Where is the caret now - on the operator or the operand 'i' ?
> Currently the operand wins, and you see quick assists like 'Rename', 'Inline
> local' etc. I do not see any good reasons to change this behavior. Closing this
> as Invalid.
> 
> Note that in the second case you can *select* the operator and then invoke
> Ctrl+1 to see the quick assist.
Ok I probably should have mentioned that this bug had nothing to do with DBCS. 
So by what you say does it mean that if you put the caret |i>1 position the option should display? It doesn't do so in practice. There is no way the option appears unless there the operator and the operand are separated by a white space. This seems like a bit of limitation to me as most people while coding tend not to add space like that. However this becomes a non issue if you use eclipse formatter and use the function during refactoring.