Re: Long String concatenation failed

2018-09-25 Thread Jmeter Tea
Paul King: Thank you, I can live with a workaround of adding a line continuation slash at the end of the line Can you answer the original question in stackoverflow ? On Tue, Sep 25, 2018 at 10:27 PM, Pa

Re: @Immutable backwards compatibility

2018-09-25 Thread Paul King
I'll have to look a little more closely. There is some provision for handling backwards compatibility. The string value of the class name of Annotations is compared with "groovy.transform.Immutable", which will handle some cases but we've removed the annotation attributes like knownClasses so that

Re: Long String concatenation failed

2018-09-25 Thread Paul King
Groovy uses the end of line as the statement terminator unless it can safely tell that the next line should follow on. We didn't allow plus or minus on the next line when working out the list of things to safely accept since it would have been a breaking change for anyone using the unaryPlus or una

Re: Long String concatenation failed

2018-09-25 Thread mg
I don't know if your specific case might be improved in the future, but in general Groovy supports e.g. operator overloading as well as DSL creation, which in turn means that it cannot always be 100% Java copy & paste compatible, even if it strives to do so as much as possible. In any case it sh

Re: Long String concatenation failed

2018-09-25 Thread Jmeter Tea
*mg: *Yes, I saw that it's working, but still, groovy should add sugar to java instead of removing support of working code in java as: String text= "0"+"1" + "2" +"3"; Which I'm getting error: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: java.lang.Stri

Re: Long String concatenation failed

2018-09-25 Thread mg
You can have new lines, just move the "<<" oi the end of the previous line, so Groovy knows there is more coming (Groovy does not need end-of-line semicolons btw): String text ="" <" << vars["id2"] << "" Ursprüngliche Nachricht Von: Jmeter Tea Datum: 25.09.18 14:54 (GMT+01:00

Re: Long String concatenation failed

2018-09-25 Thread mg
I replied to the original question and how to fix the the compile time error shown there, not your (valid) suggestion for a completely different approach... :-) Ursprüngliche Nachricht Von: "Nelson, Erick" Datum: 25.09.18 14:39 (GMT+01:00) An: users@groovy.apache.org Betreff

Re: Long String concatenation failed

2018-09-25 Thread Nelson, Erick
Your example looked like you were building xml to me Erick Nelson Senior Developer – IT HD Supply Facilities Maintenance (858) 740-6523 From: Jmeter Tea Reply-To: "users@groovy.apache.org" Date: Tuesday, September 25, 2018 at 5:55 AM To: "users@groovy.apache.org" Subject: Re: Long String conc

Re: Long String concatenation failed

2018-09-25 Thread Jmeter Tea
Thank for your answers, I still have some comments: *mg: *I don't want to have a huge line with 20 parameters that can't be seen on screen so I need new lines between parameters Nelson, Erick: I don't need XML as the article suggest " builder classes to create XML " On Tue, Sep 25, 2018 at 3:39 PM

Re: Long String concatenation failed

2018-09-25 Thread Nelson, Erick
No, I mean markup builder. Mr Haki says it best…. http://mrhaki.blogspot.com/2009/10/groovy-goodness-creating-xml-with.html Erick Nelson Senior Developer – IT HD Supply Facilities Maintenance (858) 740-6523 From: mg Reply-To: "users@groovy.apache.org" Date: Tuesday, September 25, 2018 at 5:19

Re: Long String concatenation failed

2018-09-25 Thread mg
If it is just the CTE that is the problem, you just have ro move the "<<" to the end of the previous line...  Ursprüngliche Nachricht Von: Jmeter Tea Datum: 25.09.18 09:56 (GMT+01:00) An: users@groovy.apache.org Betreff: Long String concatenation failed Hello,I have to  c

Re: Long String concatenation failed

2018-09-25 Thread Jmeter Tea
Hi Nelson, You mean to use append method as in StringBuilder: new StringBuilder().append( foo ) .append( bar ) .append( www ) .toString() On Tue, Sep 25, 2018 at 2:19 PM, Nelson, Erick wrote: > Looks like a job for MarkupBuild

Re: Long String concatenation failed

2018-09-25 Thread Nelson, Erick
Looks like a job for MarkupBuilder or StreamingMarkupBuilder Sent from my iPhone On Sep 25, 2018, at 3:56 AM, Jmeter Tea mailto:jmeter...@gmail.com>> wrote: Hello, I have to concatenate a lot of variables in a script and I want to make it readable, but I failed to separate lines as in java,

Re: Long String concatenation failed

2018-09-25 Thread Jmeter Tea
Thanks for both answers, but it's not what I need exactly Regarding Susanne Jaeckel: I want concatenate with *specific*(not all) values and with different order and prefix for each, e.g. "My Name is" << vars["first"] >> " " << vars["last"] << "and ..." Regarding Batuhan Bayrakçı : I'm using insi

Re: Long String concatenation failed

2018-09-25 Thread Susanne Jaeckel
Hi! If I have a hashmap and have to concatenate them the way you show, I would try: def vars = ["id": "value", "id2": "value2", "id3": "value3"] String text = "" vars.each { k, v ->     text += "<${k}>${v}" } println text Regards, Susanne. Am 25.09.2018 um 09:56 schrieb Jmeter Tea:

Re: Long String concatenation failed

2018-09-25 Thread Batuhan Bayrakçı
Hello, You can use GString that let you put variables into double quotes more easy. example: String text = "${vars["id"]}" 2018-09-25 10:56 GMT+03:00 Jmeter Tea : > Hello, > > I have to > concatenate a lot of variables in a script and I want to make it readable, > but I failed to separate l

Long String concatenation failed

2018-09-25 Thread Jmeter Tea
Hello, I have to concatenate a lot of variables in a script and I want to make it readable, but I failed to separate lines as in java, The following code doesn't compile due to: Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 2: unexpecte