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

Bug 356507

Summary: [Xbase] Slow validator on chained method calls (with Clojures?)
Product: [Modeling] TMF Reporter: Benjamin Schwertfeger <benjamin.schwertfeger>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: christian.dietrich.opensource, dennis.huebner, mail, sebastian.zarnekow
Version: 2.0.1   
Target Milestone: M6   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 376037    
Bug Blocks:    

Description Benjamin Schwertfeger CLA 2011-09-01 14:45:11 EDT
I noticed in a large xtend-file, that a long line of method calls leads to very bad editing experience. The following small example leads to visible Xtext validation for seconds. If not on your machine feel free to duplicate the .map line.

class Test {
	def test() {
		Collections::singleton("")
		.map([String e|e])
		.map([String e|e])
		.map([String e|e])
		.map([String e|e])
		.map([String e|e])
	}
}

I had a more complex construct at office with the nighly build from 20110830, where also updating resource description took it's time.
Comment 1 Benjamin Schwertfeger CLA 2011-09-02 01:49:47 EDT
This does not work with a chain of .filter(typeof(String)) but with a chain of .filter(e|e!=null).
Comment 2 Sebastian Zarnekow CLA 2011-10-09 15:33:14 EDT
I made some first improvements that will at least be a lot faster if you explicitly define the parameter types for closure arguments like in comment 0.
Comment 3 Sebastian Zarnekow CLA 2011-11-09 14:51:01 EST
Not 2.1
Comment 4 Dennis Huebner CLA 2013-02-13 05:14:24 EST
Fixed with the new TS (for valid code)
Comment 5 Eclipse Webmaster CLA 2017-10-31 10:46:16 EDT
Requested via bug 522520.

-M.
Comment 6 Eclipse Webmaster CLA 2017-10-31 10:57:31 EDT
Requested via bug 522520.

-M.