You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Philippe Mouawad <ph...@gmail.com> on 2017/02/11 13:25:27 UTC

JAVA 8 interesting

http://fr.slideshare.net/scolebourne/java-se-8-best-practices-53975908

Re: JAVA 8 interesting

Posted by Graham Russell <gr...@ham1.co.uk>.
Philippe

Good find - thanks for sharing.

I think some of those topics might be worth further discussion
regarding how/if we use them in the future.

* Optional: I like the idea of using Optional for return types (where
null is/could be returned) - however it might not be worth the
change/effort?
  * As a quick example: JMeterUtils.loadProperties could return
Optional<Properties> (and even log if not found) which would clean up
calling code. Perhaps the getPropertiesAsX methods in TestElement
could also return Optional.

* Default methods on Interfaces: I've been looking at this for the
TestElement Interface
https://github.com/ham1/jmeter/commits/default-methods-TE-interface
I don't know if this is better or worse than the current code - maybe
the interface is a bit too big already (but then again so is the
AbstractClass).

* Parallel streams: should be used with caution, they can be slower
due to the overhead of the parallelism

* These also might be interesting to watch/read:
https://www.youtube.com/watch?v=NcetKbGayZY
https://blog.jetbrains.com/idea/2016/07/java-8-top-tips/
https://blog.jetbrains.com/upsource/2016/08/03/what-to-look-for-in-java-8-code/

I was also about to send an email asking about code style - I will
also mention these there.

Thanks again for the link.

Graham

On 11 February 2017 at 13:25, Philippe Mouawad
<ph...@gmail.com> wrote:
> http://fr.slideshare.net/scolebourne/java-se-8-best-practices-53975908