Project: JDT
Bug 149803 [quick assist] 'exchange left and right operands' for all comparison types
Reported: 2006-07-06 06:30:36 | Status: resolved fixed

Currently we have the quick fix 'exchange left and right operands for infix expression' that can be applied to == comparisons e.g., if(a == b) --> if(b == a) However, it would also be useful to have this quickfix for less-than, greater-than etc. - although obviously this is slightly more complex as it must take into account the change in the logic. I believe the following would be correct: if(a > b) --> if(b <= a) if(a >= b) --> if(b < a) if(a < b) --> if(b >= a) if(a <= b) --> if(b > a)

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java