Re: Bean Shell Preprocessor query

2011-09-23 Thread ZK
bshFoo = (vars.get(Foo));
bshFoo = Four;
vars.put(Foo, +bshFoo);



ZK

--
View this message in context: 
http://jmeter.512774.n5.nabble.com/Bean-Shell-Preprocessor-query-tp4831233p4832617.html
Sent from the JMeter - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: jmeter-user-unsubscr...@jakarta.apache.org
For additional commands, e-mail: jmeter-user-h...@jakarta.apache.org



Re: Bean Shell Preprocessor query

2011-09-23 Thread Bruce Ide
You don't need to use + to convert bshFoo into a String! It's already a
String! And using + to convert something to a String is the wrong way to
do that, anyway!

God!

;-)

-- 
Bruce Ide
flyingrhenqu...@gmail.com


Re: Bean Shell Preprocessor query

2011-09-23 Thread Bruce Ide
Heh, I'm a programmer. I have to admit though, that I very rarely check my
return value for null after vars.get. I figure if my BSF sampler fails with
a null pointer exception, I should know what's going on. Using  + for
string conversion is probably a little less efficient than
Long.toString(variable), since you're creating some extra temporary strings
that you'll have to garbage collect later on. It probably wouldn't make a
measurable difference in your test, unless you looped through doing it a few
thousand times or using a multi-megabyte String. A system I used to work on
would store 30+ megabyte Strings on a regular basis. You definitely don't
want to create any more copies of those than you have to!

-- 
Bruce Ide
flyingrhenqu...@gmail.com