Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 572180

Summary: [dogfooding][cleanup] "Ternary operator" on jdt.core codebase
Product: [Eclipse Project] JDT Reporter: Fabrice Tiercelin <fabrice.tiercelin>
Component: CoreAssignee: Jeff Johnston <jjohnstn>
Status: VERIFIED FIXED QA Contact: Fabrice Tiercelin <fabrice.tiercelin>
Severity: normal    
Priority: P3 CC: jarthana, jjohnstn
Version: 4.19   
Target Milestone: 4.22 M1   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/172331
https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=6ff95d2a3b4f16a3eb181511885ed251df282412
Whiteboard:
Bug Depends on: 568822    
Bug Blocks:    

Description Fabrice Tiercelin CLA 2021-03-22 07:49:26 EDT
This ticket uses and tests the "Ternary operator" cleanup feature:
 - It reviews the feature.
 - It improves the readability of the code by removing useless information.
 - It also reduces the size of the source code and the binaries

If the dogfooding leads to a regression, a ticket should be created for the cleanup and the dogfooding should be pending.

The dogfooding should not be merged if there is opened/reopened bugs related to the cleanup. If a bug is fixed, the dogfooding should be regenerated using the latest version of the feature.

Here is an explanation of the cleanup of Bug 568822:

Given:
boolean newBoolean = b1 && b2 || !b1 && b3;

When:
Clean up the code enabling "Replace (X && Y) || (!X && Z) by X ? Y : Z"

Then:
boolean newBoolean = (b1 ? b2 : b3);
Comment 1 Jay Arthanareeswaran CLA 2021-07-09 02:20:06 EDT
This one fell between cracks. May be be next milestone.
Comment 3 Jay Arthanareeswaran CLA 2021-09-30 03:11:29 EDT
Verified for 4.22 M1 by code inspection.