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

Bug 366293

Summary: [Xtend2.2] While loop with try/catch and rethrow produces illegall Java code.
Product: [Modeling] TMF Reporter: Ingo Meyer <ingo.meyer>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: sven.efftinge
Version: unspecifiedFlags: sven.efftinge: juno+
Target Milestone: M4   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Ingo Meyer CLA 2011-12-10 05:31:16 EST
Build Identifier: 

A while loop where its expression always returns and not loops will produce illegal code.
In my language I introduced the "break" and "continue" keywords together with a endless loop "while (true) ...", but my example works in any Xtend file.

Reproducible: Always

Steps to Reproduce:
1. use snippet:
	def void whileLoopTest () {		
		var s = 'Test'
		while (true)
			try {
				s = s + ' failed'
				return
			}
			catch (Exception ex)
			{
				throw ex
			}	
	}
Comment 1 Sven Efftinge CLA 2011-12-12 02:41:52 EST
pushed to master
Comment 2 Karsten Thoms CLA 2017-09-19 17:19:12 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:30:43 EDT
Closing all bugs that were set to RESOLVED before Neon.0