Community
Participate
Working Groups
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.
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){
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.
(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.