Bug 225883 - [quick assist] Simplify boolean expressions with redundancy
Summary: [quick assist] Simplify boolean expressions with redundancy
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL: http://thedailywtf.com/Articles/The-T...
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-04-05 16:27 EDT by Erkki Lindpere CLA
Modified: 2009-01-23 11:36 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erkki Lindpere CLA 2008-04-05 16:27:14 EDT
Granted, these don't happen often, but it would be helpful if Eclipse could assist simplifying complex boolean expressions that have redundant checks. For example this from http://thedailywtf.com/Articles/The-Test-of-Truth.aspx : 

return (test == true)? ( (test == false)? false : true) : ((test == false) ? false : true);
// can be reduced to 'return test;'
Comment 1 Erkki Lindpere CLA 2008-04-05 16:31:29 EDT
Ideally, it should be able to simplify if-else statements as well.
Comment 2 Olivier Thomann CLA 2008-04-06 09:10:59 EDT
Move to JDT/UI
Comment 3 Martin Aeschlimann CLA 2008-04-07 05:35:49 EDT
Would make a nice project to implement for somebody interested.