The Difference between For-Each Loop and forEach()

People who have played enough with the brand new Java 8 will be familiar with the new forEach(fn(x)) loop in lambda. This syntax is quite popular among developers because it’s easier and prettier to use than the normal For-Each loop. It is also popular in other languages, especially JavaScript. The problem is, I’ve seen a very specific bug, which is related to this “functional” forEach() loop, quite a few times, again and again.
Read more →

Java 8 - Turning off SSL Certificate Check

There’s usually no good reason to turn off SSL certificate check. So this is actually wrong in many ways, but maybe we’re still developing in an isolated dev environment and somehow the dev machine of another application you’re depending on only allows SSL connection even though it doesn’t have a valid certificate. The correct solution is actually to self sign a certificate or add it in the system, so that if your application go live, you will still have ssl certificate check turned on.
Read more →