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

Bug 572048

Summary: Exit loop early results in wrong logic
Product: [Eclipse Project] JDT Reporter: Lars Vogel <Lars.Vogel>
Component: UIAssignee: Fabrice Tiercelin <fabrice.tiercelin>
Status: VERIFIED FIXED QA Contact: Lars Vogel <Lars.Vogel>
Severity: normal    
Priority: P3 CC: fabrice.tiercelin, kalyan_prasad, Lars.Vogel
Version: 4.18   
Target Milestone: 4.20 M1   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/178136
https://github.com/eclipse-m2e/m2e-core/pull/97
Whiteboard:
Bug Depends on:    
Bug Blocks: 572155    

Description Lars Vogel CLA 2021-03-17 15:33:17 EDT
For am example please see https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/177897

for (byte element : alphaData) {
			int alpha = element & 0xFF;
			if (!(alpha == 0 || alpha == 255)) {
				/* Full alpha channel transparency */
				return imageData;
			}
			if (!transparency && alpha == 0) {
				transparency = true;
				// break; --> added by clean which in not correct
 			}
		}
Comment 1 Lars Vogel CLA 2021-03-17 15:34:53 EDT
Fabrice, thanks for looking into this.
Comment 2 Eclipse Genie CLA 2021-03-20 05:19:27 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/178136
Comment 4 Fabrice Tiercelin CLA 2021-04-07 01:04:02 EDT
Verified for 4.20M1 using I20210405-1800 build