This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 225984

Summary: Suggestion : flip > with <
Product: java Reporter: lforet <lforet>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED DUPLICATE    
Severity: normal CC: markiewb
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Shows the hint based on the custom inspection

Description lforet 2013-02-11 13:35:42 UTC
Another usefull suggestion : flip > with <

if (a < b)
-flip->

if (b > a)

Rem : another IDE(a) provide a lot of operations of this kinds that can be very useful for refactoring operations
Comment 1 markiewb 2013-02-11 15:52:52 UTC
You can implement as an inspection

<!description="Flip &lt;&gt;">
$a < $b 
=>
$b > $a
;;
$a > $b 
=>
$b < $a
;;
Comment 2 lforet 2013-02-11 16:02:34 UTC
Indeed, but the common mortal programmer won't do that. And inspect tasks are really hard to execute quickly. So everybody will do the flip manually.

The main idea here is to have quick fixes/hints to help developer to do that kind of job quickly
Comment 3 markiewb 2013-02-11 16:35:24 UTC
Created attachment 131254 [details]
Shows the hint based on the custom inspection

(In reply to comment #2)
> The main idea here is to have quick fixes/hints to help developer to do that
> kind of job quickly

Custom inspections ARE available as hints. See screenshot for an example.
Comment 4 lforet 2013-02-12 10:07:53 UTC
Indeed, I test it and it works like a charm. 

That functionality should be more visible and maybe enable by default.
Comment 5 markiewb 2014-05-14 16:11:14 UTC
Worksforme
(a < b) will be transformed to (a>=b)

Has been fixed in 7.4 timeline (org.netbeans.modules.java.hints.suggestions.FlipOperands)

https://netbeans.org/bugzilla/show_bug.cgi?id=225981

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