Subscribe: Javalobby - The heart of the Java developer community
Added By: Feedage Forager Feedage Grade B rated
Language: English
application  code  dual pivot  edition  effective java  effective  framework  java edition  java  maven  new  objects  pivot quicksort 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Javalobby - The heart of the Java developer community

DZone Java Zone

Recent posts in Java on


Faster Sorting of Arrays of Primitives Coming to Java?

Tue, 23 Jan 2018 10:02:56 GMT

It appears that sorting arrays of primitives in Java may experience a performance improvement in the not-so-far future. Vladimir Yaroslavskiy has posted a message to the core-libs-dev mailing list titled "The new optimized version of Dual-Pivot Quicksort" in which Yaroslavskiy writes of an "optimized and faster version of Dual-Pivot Quicksort" that he has "been working on ... for the last 5 years."

The "The new optimized version of Dual-Pivot Quicksort" message includes some historical background on the Dual-Pivot Quicksort; highlights relative performance of the new version for random data, "nearly structured arrays," and "period inputs"; provides a comprehensive summary of the changes involved; and provides a link for open code review of the changes.

Maven Dependency Management Without Going Full Maven

Tue, 23 Jan 2018 06:02:51 GMT

You may have already discovered the joys of managing your projects with Maven, thanks to a virtually endless range of features it has to offer. Whether you are a newbie or a pro, using it in MyEclipse will take it to a whole new level if you are looking for a better experience inside an IDE.

Dependencies Only Mode

You might be used to the fact that with Maven you can manage a project's dependencies, builds, reporting, and documentation from a single place. Maven dependency management is one of the best-known Maven features, and is one of the areas where Maven excels. However, exploiting only this feature is typically not possible - you would need to go almost all the way with a Maven-based project configuration, adding and configuring Maven plugins, dealing with profiles, and goals. If you don't have the time or the need to go through the works, MyEclipse jumps into the picture, offering the Dependencies Only mode, which has actually been available since MyEclipse 2015.

Easy Fine-Grained Sorting With JDK 8

Mon, 22 Jan 2018 21:01:01 GMT

Java 8's introduction of streams and useful static/default methods on the Comparator interface make it easy to compare two objects based on individual fields' values without the need to implement a compare(T,T) method on the class whose objects are being compared.

I'm going to use a simple Song class to help demonstrate this and its code listing is shown next.

Java in 2018

Mon, 22 Jan 2018 17:01:02 GMT

So what’s ahead in 2018? How will the community deal with the transition? How will Java evolve to meet the new needs of organizations big and small?

Thanks to John Duimovich, IBM Distinguished Engineer and Java CTO, for sharing his predictions on what to expect from Java 2018.

Mapping Enum Keys With EnumMaps [Snippets]

Mon, 22 Jan 2018 11:01:01 GMT

Here’s a type that has been around in the JDK for a while and that comes in handy when we want to define maps with enum types as keys: An EnumMap is a specialized Map.

We’ll create a map for a given enum:

What's New in Effective Java's Third Edition?

Mon, 22 Jan 2018 08:01:03 GMT

Ever since hearing about the pending publication of the Third Edition of Effective Java, I've wondered what would be new in it. I assumed that features introduced to Java since Java 6 would be covered and that is indeed the case. However, there are some other changes as well to this third edition of the Java developer classic. In this post, I provide a high-level overview of the topics that are added, changed significantly, or removed in this third edition.

Before listing what I've observed that appears to be new in Effective Java, Third Edition, I need to make the disclaimer statement that I'm likely to miss several changes throughout this book with 12 chapters encompassing 90 items covering well over 350 pages. This post is not intended to provide detailed coverage of the changes in the third edition, but rather is intended as a high-level sampling of the changes and readers are encouraged to borrow or purchase a copy of this Third Edition of Effective Java to access the low-level details.

Converting HTML to RichTextString for Apache POI

Mon, 22 Jan 2018 05:01:01 GMT

In this tutorial, we will be building an application that takes HTML as an input and creates a Microsoft Excel Workbook with a RichText representation of the HTML that was provided. To generate the Microsoft Excel Workbook, we will be using Apache POI. To analyze the HTML, we will be using Jericho.

The full source code for this tutorial is available on GitHub.

5 Tips for Performant, Thread-Safe Java From ConcurrentHashMap

Sun, 21 Jan 2018 06:01:03 GMT

java.util.concurrent.ConcurrentHashMap is a highly optimized concurrent hash map implementation. Here are 5 tips we can learn from its implementation:

Disclaimer: The techniques described here increase the complexity of the code, making it harder to reason about it and test. So please only apply have them when you have seen through profiling that your code is on the hot path.

Functional Programming Principles Every Imperative Programmer Should Use

Sat, 20 Jan 2018 06:01:55 GMT

Sometimes it seems like functional programmers are a totally different breed. Even by programmer standards, they seem more nerdy than the rest. They use weird terms such as "monad," "for-comprehension," and "lambda." They use languages that don't end every line with a semicolon. And, no matter how uneasy Java programmers are around C++ programmers, both groups can at least agree that Haskell is weird.

The truth is, functional programming has much to offer, even to developers accustomed to working in imperative languages. (Source:

This Week in Spring: Kafka, Spring Cloud, and Testing

Fri, 19 Jan 2018 14:59:47 GMT

Aloha! This week I’m in sunny Honolulu for the first annual LavaOne conference. If you’re not here, you should be! The show is amazing, enjoys 50% female to male audience attendance, the speakers are world-class (well, except yours truly, but don’t tell them that..), and the location is pretty hard to beat!

That said, nothing gives me more pleasure than saddling up to a table with a laptop, some green tea, sunglasses, and sunscreen and checking in on the community. This week’s been a heckuva week indeed! Lot’s of great stuff so let’s get to it!

9 Things Java Programmers Should Learn in 2018

Fri, 19 Jan 2018 08:01:01 GMT

First of all, I wish you a very happy new year, guys. It's that time of year when we start afresh, make plans, set goals, and make resolutions for the new year.

Being a Java developer and the author of a Java blog, I frequently receive requests from Java programmers from all over the world asking how they can improve themselves.

Why You Should Take a Look at Kotlin's Standard Library

Fri, 19 Jan 2018 05:01:01 GMT

As we add support for Java deployments at Octopus, more integration code is being written in Kotlin. As a longtime Java developer, I took the opportunity to learn some of the improvements that the Kotlin language designers added to their language over Java.

About the same time, I completed Dave Fancher's Functional Programming with C# course on Pluralsight. I enjoyed the course because it provides some clear and practical advice on how to approach function programming in C#. In it, Dave provides two extension methods, Map and Tee, which allow you to transform objects and pass them onto other mutating methods, along with examples on how and why you would use them.

Java Quiz 9: Demonstrating Multilevel Inheritance

Thu, 18 Jan 2018 14:02:14 GMT

Before we start with this week's quiz, here is the answer to Java Quiz 8: Upcasting and Downcasting Objects.

By upcasting objects, the overridden variable depends on the type of the object reference vc, but the overridden methods depend on the type of the object that was created. By downcasting objects, both variables and methods depend on the type of the object reference car.

Docker and Java: Why My App Is OOMKilled

Thu, 18 Jan 2018 08:01:01 GMT

Those who have already run a Java application inside Docker have probably come across the problem of the JVM incorrectly detecting the available memory when running inside of the container. The JVM sees the available memory of the machine instead of the memory available only to the Docker container. This can lead to cases where applications running inside the container is killed when tries to use more memory beyond the limits of the Docker container.

The JVM incorrectly detecting the available memory has to do with the fact that the Linux tools/libs created for returning system resource information (e.g. /proc/meminfo/proc/vmstat) were created before cgroups even existed. These will return resource information of the host (physical or virtual machine).

Play Zork, Learn OAuth

Wed, 17 Jan 2018 22:57:38 GMT

In the early '80s, some of the best “video” games were text-based adventures. These games would print out descriptive text of your surroundings and you would interact with the game using simple, but natural language commands like: “go north” or “take sword”. Fast forward some 30 years and a specification for an authorization framework called OAuth 2.0 was published. This framework allows an application to receive a token from an external party (like Okta) that indicates a user is authorized to use the application. What do these two things have in common? Absolutely nothing. But, I thought it would be fun to mash them together to demonstrate how OAuth works by playing a text-based game.

Infocom was a popular producer of text-based games and they standardized a file format and interpreter for them called zMachine. There’s a great zMachine interpreter written in Java. I incorporated this into a Spring Boot/Spring Security application that interacts with Okta for OAuth so that you can play Zork — one of the most iconic of these games. The application is available on the Okta Developer GitHub account.

Classification of Development Frameworks for Enterprise Apps

Wed, 17 Jan 2018 21:01:01 GMT

If you Google "best Java framework", most probably, you will stumble on this article, which gives a great overview of the landscape in the Java Enterprise world. However, from my point of view, it lacks a very important thing — classification of the mentioned frameworks. Let's have a look at another angle at this ecosystem and go beyond the Java world.

Picking the best framework for developing an application (or another framework), means trying to find the best trade-off between the following criteria:

Java 8: Oogway's Advice on Optional

Wed, 17 Jan 2018 17:01:03 GMT

While Po was reading about Java 8 Optionals, a few questions popped into mind. Why was it added to Java? How does it save us from the almighty villain the null pointer exception?

So, he goes to Master Shifu, but the irony is that Shify was also unsure of how Optional will save the Java villagers from NPEs. But Oogway foretold their arrival, so they went to Oogway for advice on Optionals.

Would You Use JSF for Your Next Project?

Wed, 17 Jan 2018 11:01:01 GMT

There was an excellent StackOverflow blog post last week about the “Brutal Lifecycle of JavaScript Frameworks”. The article was about the speed at which JavaScript UI frameworks (Angular, Jquery, and React) come into and fall out of fashion. The key metric for this post is questions per month on the framework, which is a reasonable metric to demonstrate these trends. Downloads would have been interesting too.

It got me thinking: Where are we with JSF? And my starting point was to superimpose JSF on top of the JavaScript data.

How to Add JARs to a JetBrains MPS Project

Wed, 17 Jan 2018 08:01:01 GMT

JetBrains MPS is a wonderful tool to create DSLs. We love it and use it regularly in our consultancy work, and we have written about JetBrains MPS before.

Being a projectional editor, it allows you to easily create DSLs that can be used through a graphical interface or things like mathematical formulas, though all this power requires a bit of preparatory work.

Using Google's Protocol Buffers With Java

Wed, 17 Jan 2018 05:01:01 GMT

Effective Java, Third Edition was recently released, and I have been interested in identifying the updates to this classic Java development book, whose last edition only covered through Java 6. There are obviously completely new items in this edition that are closely related to Java 7, Java 8, and Java 9 such as Items 42 through 48 in Chapter 7 ("Lambdas and Streams"), Item 9 ("Prefer try-with-resources to try-finally"), and Item 55 ("Return optionals judiciously"). I was (very slightly) surprised to realize that the third edition of Effective Java had a new item not specifically driven by the new versions of Java, but that was instead was driven by developments in the software development world independent of the versions of Java. That item, Item 85 ("Prefer alternatives to Java Serialization") is what motivated me to write this introductory post on using Google's Protocol Buffers with Java.

In Item 85 of Effective Java, Third Edition, Josh Bloch emphasizes in bold text the following two assertions related to Java serialization: