{"id":23853,"date":"2014-04-08T13:00:20","date_gmt":"2014-04-08T10:00:20","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=23853"},"modified":"2015-01-05T12:43:08","modified_gmt":"2015-01-05T10:43:08","slug":"java-8-friday-the-dark-side-of-java-8","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html","title":{"rendered":"Java 8 Friday: The Dark Side of Java 8"},"content":{"rendered":"<p>At <a href=\"http:\/\/www.datageekery.com\/\">Data Geekery<\/a>, we love Java. And as we\u2019re really into <a href=\"http:\/\/www.jooq.org\">jOOQ\u2019s fluent API and query DSL<\/a>, we\u2019re absolutely thrilled about what Java 8 will bring to our ecosystem.<\/p>\n<h2>Java 8 Friday<\/h2>\n<p>Every Friday, we\u2019re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and other great stuff. <a href=\"https:\/\/github.com\/jOOQ\/jOOQ-s-Java-8-Goodies\">You\u2019ll find the source code on GitHub<\/a>.<\/p>\n<h2>The dark side of Java 8<\/h2>\n<p>So far, we\u2019ve been showing the <a href=\"http:\/\/blog.jooq.org\/tag\/java-8\/\">thrilling parts of this new major release<\/a>. But there are also caveats. Lots of them. Things that<\/p>\n<ul>\n<li>\u2026 are confusing<\/li>\n<li>\u2026 are wrong<\/li>\n<li>\u2026 are omitted (for now)<\/li>\n<li>\u2026 are omitted (for long)<\/li>\n<\/ul>\n<p>There are always two sides to Java major releases. On the bright side, we get lots of new functionality that most people would say was <em>overdue<\/em>. Other languages, platforms have had generics long before Java 5. Other languages, platforms have had lambdas long before Java 8. But now, we finally have these features. In the usual quirky Java-way.<\/p>\n<p>Lambda expressions were introduced quite elegantly. The idea of being able to write every anonymous SAM instance as a lambda expression is very compelling from a backwards-compatiblity point of view. So what <em>are<\/em> the dark sides to Java 8?<\/p>\n<h2>Overloading gets even worse<\/h2>\n<p>Overloading, generics, and varargs aren\u2019t friends. <a title=\"10 Subtle Best Practices when Coding Java\" href=\"http:\/\/blog.jooq.org\/2013\/08\/20\/10-subtle-best-practices-when-coding-java\/\">We\u2019ve explained this in a previous article<\/a>, and also <a href=\"http:\/\/stackoverflow.com\/q\/5361513\/521799\">in this Stack Overflow question<\/a>. These might not be every day problems in your odd application, but they\u2019re very important problems for API designers and maintainers.<\/p>\n<p>With lambda expressions, things get \u201cworse\u201d. So you think you can provide some convenience API, overloading your existing <code>run()<\/code> method that accepts a <code>Callable<\/code> to also accept the new <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/function\/Supplier.html\"><code>Supplier<\/code><\/a> type:<\/p>\n<pre class=\" brush:java\">static &lt;T&gt; T run(Callable&lt;T&gt; c) throws Exception {\r\n    return c.call();\r\n}\r\n\r\nstatic &lt;T&gt; T run(Supplier&lt;T&gt; s) throws Exception {\r\n    return s.get();\r\n}<\/pre>\n<p>What looks like perfectly useful Java 7 code is a major pain in Java 8, now. Because you cannot just simply call these methods with a lambda argument:<\/p>\n<pre class=\" brush:java\">public static void main(String[] args)\r\nthrows Exception {\r\n    run(() -&gt; null);\r\n    \/\/  ^^^^^^^^^^ ambiguous method call\r\n}<\/pre>\n<p>Tough luck. You\u2019ll have to resort to either of these \u201cclassic\u201d solutions:<\/p>\n<pre class=\" brush:java\">run((Callable&lt;Object&gt;) (() -&gt; null));\r\n    run(new Callable&lt;Object&gt;() {\r\n        @Override\r\n        public Object call() throws Exception {\r\n            return null;\r\n        }\r\n    });<\/pre>\n<p>So, while there\u2019s always a workaround, these workarounds always \u201csuck\u201d. That\u2019s quite a bummer, even if things don\u2019t break from a backwards-compatibility perspective.<\/p>\n<h2>Not all keywords are supported on default methods<\/h2>\n<p>Default methods are a nice addition. Some may claim that <a href=\"http:\/\/stackoverflow.com\/q\/17037120\/521799\">Java finally has traits<\/a>. Others clearly dissociate themselves from the term, e.g. Brian Goetz:<\/p>\n<blockquote>\n<p>The key goal of adding default methods to Java was \u201cinterface evolution\u201d, not \u201cpoor man\u2019s traits.\u201d<\/p>\n<\/blockquote>\n<p><a href=\"http:\/\/mail.openjdk.java.net\/pipermail\/lambda-dev\/2013-March\/008435.html\">As found on the lambda-dev mailing list.<\/a><\/p>\n<p>Fact is, default methods are quite a bit of an orthogonal and irregular feature to anything else in Java. Here are a couple of critiques:<\/p>\n<h4>They cannot be made final<\/h4>\n<p>Given that default methods can also be used as convenience methods in API:<\/p>\n<pre class=\" brush:java\">public interface NoTrait {\r\n\r\n    \/\/ Run the Runnable exactly once\r\n    default final void run(Runnable r) {\r\n        \/\/  ^^^^^ modifier final not allowed\r\n        run(r, 1);\r\n    }\r\n\r\n    \/\/ Run the Runnable \"times\" times\r\n    default void run(Runnable r, int times) {\r\n        for (int i = 0; i &lt; times; i++)\r\n            r.run();\r\n    }\r\n}<\/pre>\n<p>Unfortunately, the above is not possible, and so the first overloaded convenience method could be overridden in subtypes, even if that makes no sense to the API designer.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h4>They cannot be made synchronized<\/h4>\n<p>Bummer! Would that have been difficult to implement in the language?<\/p>\n<pre class=\" brush:java\">public interface NoTrait {\r\n    default synchronized void noSynchronized() {\r\n        \/\/  ^^^^^^^^^^^^ modifier synchronized\r\n        \/\/  not allowed\r\n        System.out.println(\"noSynchronized\");\r\n    }\r\n}<\/pre>\n<p>Yes, <code>synchronized<\/code> is used rarely, just like final. But when you have that use-case, why not just allow it? What makes interface method bodies so special?<\/p>\n<h4>The default keyword<\/h4>\n<p>This is maybe the weirdest and most irregular of all features. The <code>default<\/code> keyword itself. Let\u2019s compare interfaces and abstract classes:<\/p>\n<pre class=\" brush:java\">\/\/ Interfaces are always abstract\r\npublic \/* abstract *\/ interface NoTrait {\r\n\r\n    \/\/ Abstract methods have no bodies\r\n    \/\/ The abstract keyword is optional\r\n    \/* abstract *\/ void run1();\r\n\r\n    \/\/ Concrete methods have bodies\r\n    \/\/ The default keyword is mandatory\r\n    default void run2() {}\r\n}\r\n\r\n\/\/ Classes can optionally be abstract\r\npublic abstract class NoInterface {\r\n\r\n    \/\/ Abstract methods have no bodies\r\n    \/\/ The abstract keyword is mandatory\r\n    abstract void run1();\r\n\r\n    \/\/ Concrete methods have bodies\r\n    \/\/ The default keyword mustn't be used\r\n    void run2() {}\r\n}<\/pre>\n<p>If the language were re-designed from scratch, it would probably do without any of <code>abstract<\/code> or <code>default<\/code> keywords. Both are unnecessary. The mere fact that there is or is not a body is sufficient information for the compiler to assess whether a method is abstract. I.e, how things should be:<\/p>\n<pre class=\" brush:java\">public interface NoTrait {\r\n    void run1();\r\n    void run2() {}\r\n}\r\n\r\npublic abstract class NoInterface {\r\n    void run1();\r\n    void run2() {}\r\n}<\/pre>\n<p>The above would be much leaner and more regular. It\u2019s a pity that the usefulness of <code>default<\/code> was never really debated by the EG. Well, it was debated but the EG never wanted to accept this as an option. <a href=\"http:\/\/mail.openjdk.java.net\/pipermail\/lambda-dev\/2012-August\/005394.html\">I\u2019ve tried my luck, with this response<\/a>:<\/p>\n<blockquote>\n<p>I don\u2019t think #3 is an option because interfaces with method bodies are unnatural to begin with. At least specifying the \u201cdefault\u201d keyword gives the reader some context why the language allows a method body. Personally, I wish interfaces would remain as pure contracts (without implementation), but I don\u2019t know of a better option to evolve interfaces.<\/p>\n<\/blockquote>\n<p>Again, this is a clear commitment by the EG not to commit to the vision of \u201ctraits\u201d in Java. Default methods were a pure necessary means to implement 1-2 other features. They weren\u2019t well-designed from the beginning.<\/p>\n<h4>Other modifiers<\/h4>\n<p>Luckily, the <code>static<\/code> modifier made it into the specs, late in the project. It is thus possible to specifiy static methods in interfaces now. For some reason, though, these methods do not need (nor allow!) the <code>default<\/code> keyword, which must\u2019ve been a totally random decision by the EG, just like you apparently cannot define <code>static final<\/code> methods in interfaces.<\/p>\n<p>While visibility modifiers were <a href=\"http:\/\/mail.openjdk.java.net\/pipermail\/lambda-dev\/2012-August\/005437.html\">discussed on the lambda-dev mailing list<\/a>, but were out of scope for this release. Maybe, we can get them in a future release.<\/p>\n<h2>Few default methods were actually implemented<\/h2>\n<p>Some methods would have sensible default implementations on interface \u2013 one might guess. Intuitively, the collections interfaces, like <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/List.html\"><code>List<\/code><\/a> or <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/Set.html\"><code>Set<\/code><\/a> would have them on their <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/List.html#equals-java.lang.Object-\"><code>equals()<\/code><\/a> and <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/List.html#hashCode--\"><code>hashCode()<\/code><\/a> methods, because the contract for these methods is well-defined on the interfaces. It is also implemented in <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/AbstractList.html\"><code>AbstractList<\/code><\/a>, using <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/List.html#listIterator--\"><code>listIterator()<\/code><\/a>, which is a reasonable default implementation for most tailor-made lists.<\/p>\n<p>It would\u2019ve been great if these API were retrofitted to make implementing custom collections easier with Java 8. I could make all my business objects implement <code>List<\/code> for instance, without wasting the single base-class inheritance on <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/AbstractList.html\"><code>AbstractList<\/code><\/a>.<\/p>\n<p>Probably, though, there has been a compelling reason related to backwards-compatibility that prevented the Java 8 team at Oracle from implementing these default methods. Whoever sends us the reason why this was omitted will get a <a href=\"http:\/\/www.jooq.org\/img\/sticker-jooq-sql-aficionado.png\">free jOOQ sticker<\/a>\u00a0!<\/p>\n<h2>The wasn\u2019t invented here \u2013 mentality<\/h2>\n<p>This, too, was criticised a couple of times on the lambda-dev EG mailing list. And while writing this <a href=\"http:\/\/blog.jooq.org\/tag\/java-8\/\">blog series<\/a>, I can only confirm that the new functional interfaces are very confusing to remember. They\u2019re confusing for these reasons:<\/p>\n<h4>Some primitive types are more equal than others<\/h4>\n<p>The <code>int<\/code>, <code>long<\/code>, <code>double<\/code> primitive types are preferred compared to all the others, in that they have a functional interface in the <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/function\/package-summary.html\">java.util.function<\/a> package, and in the whole Streams API. <code>boolean<\/code> is a second-class citizen, as it still made it into the package in the form of a <code><a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/function\/BooleanSupplier.html\">BooleanSupplier<\/a><\/code> or a <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/function\/Predicate.html\"><code>Predicate<\/code><\/a>, or worse: <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/function\/IntPredicate.html\"><code>IntPredicate<\/code><\/a>.<\/p>\n<p>All the other primitive types don\u2019t really exist in this area. I.e. there are no special types for <code>byte<\/code>, <code>short<\/code>, <code>float<\/code>, and <code>char<\/code>. While the argument of meeting deadlines is certainly a valid one, this quirky status-quo will make the language even harder to learn for newbies.<\/p>\n<h4>The types aren\u2019t just called Function<\/h4>\n<p>Let\u2019s be frank. All of these types are simply \u201cfunctions\u201d. No one really cares about the implicit difference between a <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/function\/Consumer.html\"><code>Consumer<\/code><\/a>, a <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/function\/Predicate.html\"><code>Predicate<\/code><\/a>, a <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/function\/UnaryOperator.html\"><code>UnaryOperator<\/code><\/a>, etc.<\/p>\n<p>In fact, when you\u2019re looking for a type with a non-<code>void<\/code> return value and two arguments, what would you probably be calling it? <code>Function2<\/code>? Well, you were wrong. It is called a <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/function\/BiFunction.html\"><code>BiFunction<\/code><\/a>.<\/p>\n<p>Here\u2019s a decision tree to know how the type you\u2019re looking for is called:<\/p>\n<ul>\n<li>Does your function return <code>void<\/code>? It\u2019s called a <code>Consumer<\/code><\/li>\n<li>Does your function return <code>boolean<\/code>? It\u2019s called a <code>Predicate<\/code><\/li>\n<li>Does your function return an <code>int<\/code>, <code>long<\/code>, <code>double<\/code>? It\u2019s called <code>XXToIntYY<\/code>, <code>XXToLongYY<\/code>, <code>XXToDoubleYY<\/code> something<\/li>\n<li>Does your function take no arguments? It\u2019s called a <code>Supplier<\/code><\/li>\n<li>Does your function take a single <code>int<\/code>, <code>long<\/code>, <code>double<\/code> argument? It\u2019s called an <code>IntXX<\/code>, <code>LongXX<\/code>, <code>DoubleXX<\/code> something<\/li>\n<li>Does your function take two arguments? It\u2019s called <code>BiXX<\/code><\/li>\n<li>Does your function take two arguments of the same type? It\u2019s called <code>BinaryOperator<\/code><\/li>\n<li>Does your function return the same type as it takes as a single argument? It\u2019s called <code>UnaryOperator<\/code><\/li>\n<li>Does your function take two arguments of which the first is a reference type and the second is a primitive type? It\u2019s called <code>ObjXXConsumer<\/code> (only consumers exist with that configuration)<\/li>\n<li>Else: It\u2019s called <code>Function<\/code><\/li>\n<\/ul>\n<p>Good lord! We should certainly go over to Oracle Education to check if the price for <a href=\"http:\/\/education.oracle.com\/\">Oracle Certified Java Programmer<\/a> courses have drastically increased, recently\u2026 Thankfully, with Lambda expressions, we hardly ever have to remember all these types!<\/p>\n<h2>More on Java 8<\/h2>\n<p>Java 5 generics have brought a lot of great new features to the Java language. But there were also quite a few caveats related to type erasure. Java 8\u2032s default methods, Streams API and lambda expressions will again bring a lot of great new features to the Java language and platform. But we\u2019re sure that <a href=\"http:\/\/stackoverflow.com\/\">Stack Overflow<\/a> will soon burst with questions by confused programmers that are getting lost in the Java 8 jungle.<\/p>\n<p>Learning all the new features won\u2019t be easy, but the new features (and caveats) are here to stay. If you\u2019re a Java developer, you better start practicing now, when you get the chance. Because we have a long way to go.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/blog.jooq.org\/2014\/04\/04\/java-8-friday-the-dark-side-of-java-8\/\">Java 8 Friday: The Dark Side of Java 8<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Lukas Eder at the <a href=\"http:\/\/blog.jooq.org\/\">JAVA, SQL, AND JOOQ<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>At Data Geekery, we love Java. And as we\u2019re really into jOOQ\u2019s fluent API and query DSL, we\u2019re absolutely thrilled about what Java 8 will bring to our ecosystem. Java 8 Friday Every Friday, we\u2019re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and &hellip;<\/p>\n","protected":false},"author":68,"featured_media":148,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[196],"class_list":["post-23853","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-java","tag-java-8"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java 8 Friday: The Dark Side of Java 8<\/title>\n<meta name=\"description\" content=\"At Data Geekery, we love Java. And as we\u2019re really into jOOQ\u2019s fluent API and query DSL, we\u2019re absolutely thrilled about what Java 8 will bring to our\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java 8 Friday: The Dark Side of Java 8\" \/>\n<meta property=\"og:description\" content=\"At Data Geekery, we love Java. And as we\u2019re really into jOOQ\u2019s fluent API and query DSL, we\u2019re absolutely thrilled about what Java 8 will bring to our\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2014-04-08T10:00:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-01-05T10:43:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Lukas Eder\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/JavaOOQ\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lukas Eder\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html\"},\"author\":{\"name\":\"Lukas Eder\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/2e5562e68acc527c00dbe1cc618081b2\"},\"headline\":\"Java 8 Friday: The Dark Side of Java 8\",\"datePublished\":\"2014-04-08T10:00:20+00:00\",\"dateModified\":\"2015-01-05T10:43:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html\"},\"wordCount\":1477,\"commentCount\":9,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"keywords\":[\"Java 8\"],\"articleSection\":[\"Core Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html\",\"name\":\"Java 8 Friday: The Dark Side of Java 8\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"datePublished\":\"2014-04-08T10:00:20+00:00\",\"dateModified\":\"2015-01-05T10:43:08+00:00\",\"description\":\"At Data Geekery, we love Java. And as we\u2019re really into jOOQ\u2019s fluent API and query DSL, we\u2019re absolutely thrilled about what Java 8 will bring to our\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/04\\\/java-8-friday-the-dark-side-of-java-8.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Core Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/core-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Java 8 Friday: The Dark Side of Java 8\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/2e5562e68acc527c00dbe1cc618081b2\",\"name\":\"Lukas Eder\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g\",\"caption\":\"Lukas Eder\"},\"description\":\"Lukas is a Java and SQL enthusiast developer. He created the Data Geekery GmbH. He is the creator of jOOQ, a comprehensive SQL library for Java, and he is blogging mostly about these three topics: Java, SQL and jOOQ.\",\"sameAs\":[\"http:\\\/\\\/blog.jooq.org\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/profile\\\/view?id=6409824\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/JavaOOQ\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Lukas-Eder\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java 8 Friday: The Dark Side of Java 8","description":"At Data Geekery, we love Java. And as we\u2019re really into jOOQ\u2019s fluent API and query DSL, we\u2019re absolutely thrilled about what Java 8 will bring to our","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html","og_locale":"en_US","og_type":"article","og_title":"Java 8 Friday: The Dark Side of Java 8","og_description":"At Data Geekery, we love Java. And as we\u2019re really into jOOQ\u2019s fluent API and query DSL, we\u2019re absolutely thrilled about what Java 8 will bring to our","og_url":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-04-08T10:00:20+00:00","article_modified_time":"2015-01-05T10:43:08+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","type":"image\/jpeg"}],"author":"Lukas Eder","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/JavaOOQ","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Lukas Eder","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html"},"author":{"name":"Lukas Eder","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/2e5562e68acc527c00dbe1cc618081b2"},"headline":"Java 8 Friday: The Dark Side of Java 8","datePublished":"2014-04-08T10:00:20+00:00","dateModified":"2015-01-05T10:43:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html"},"wordCount":1477,"commentCount":9,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","keywords":["Java 8"],"articleSection":["Core Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html","url":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html","name":"Java 8 Friday: The Dark Side of Java 8","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","datePublished":"2014-04-08T10:00:20+00:00","dateModified":"2015-01-05T10:43:08+00:00","description":"At Data Geekery, we love Java. And as we\u2019re really into jOOQ\u2019s fluent API and query DSL, we\u2019re absolutely thrilled about what Java 8 will bring to our","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2014\/04\/java-8-friday-the-dark-side-of-java-8.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/core-java"},{"@type":"ListItem","position":4,"name":"Java 8 Friday: The Dark Side of Java 8"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/2e5562e68acc527c00dbe1cc618081b2","name":"Lukas Eder","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g","caption":"Lukas Eder"},"description":"Lukas is a Java and SQL enthusiast developer. He created the Data Geekery GmbH. He is the creator of jOOQ, a comprehensive SQL library for Java, and he is blogging mostly about these three topics: Java, SQL and jOOQ.","sameAs":["http:\/\/blog.jooq.org\/","http:\/\/www.linkedin.com\/profile\/view?id=6409824","https:\/\/x.com\/http:\/\/twitter.com\/JavaOOQ"],"url":"https:\/\/www.javacodegeeks.com\/author\/Lukas-Eder"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/23853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=23853"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/23853\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/148"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=23853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=23853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=23853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}