<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Java8 on Rowanto Luo</title><link>https://log.rowanto.com/categories/java8/</link><description>Recent content in Java8 on Rowanto Luo</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 06 May 2015 17:06:16 +0000</lastBuildDate><atom:link href="https://log.rowanto.com/categories/java8/index.xml" rel="self" type="application/rss+xml"/><item><title>The Difference between For-Each Loop and forEach()</title><link>https://log.rowanto.com/posts/the-difference-between-classic-foreach-and-java-8-functional-foreach-loop/</link><pubDate>Wed, 06 May 2015 17:06:16 +0000</pubDate><guid>https://log.rowanto.com/posts/the-difference-between-classic-foreach-and-java-8-functional-foreach-loop/</guid><description>
&lt;p&gt;People who have played enough with the brand new Java 8 will be familiar with the new &lt;a href="https://docs.oracle.com/javase/tutorial/collections/streams/"&gt;forEach(fn(x))&lt;/a&gt; loop in lambda. This syntax is quite popular among developers because it&amp;rsquo;s easier and prettier to use than the normal &lt;a href="https://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html"&gt;For-Each&lt;/a&gt; loop. It is also popular in other languages, especially JavaScript.&lt;/p&gt;
&lt;p&gt;The problem is, I&amp;rsquo;ve seen a very specific bug, which is related to this &amp;ldquo;functional&amp;rdquo; forEach() loop, quite a few times, again and again. People tend to think that these two kinds of loop are 100% identical, which is not. Although Java 8&amp;rsquo;s type-safety make it harder for people to make this mistake because of its compilation error, it&amp;rsquo;s still not 100% safe.&lt;/p&gt;</description></item><item><title>Java 8 - Turning off SSL Certificate Check</title><link>https://log.rowanto.com/posts/java-8-turning-off-ssl-certificate-check/</link><pubDate>Sat, 21 Mar 2015 09:11:56 +0000</pubDate><guid>https://log.rowanto.com/posts/java-8-turning-off-ssl-certificate-check/</guid><description>
&lt;p&gt;There&amp;rsquo;s usually no good reason to turn off SSL certificate check. So this is actually wrong in many ways, but maybe we&amp;rsquo;re still developing in an isolated dev environment and somehow the dev machine of another application you&amp;rsquo;re depending on only allows SSL connection even though it doesn&amp;rsquo;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. If not, you might forgot to turn the ssl certificate check back on when launching the stuff and it will be bad. So, use this on your own risk.&lt;/p&gt;</description></item></channel></rss>