Posts Tagged: java8

The eternal issue about Object.hashCode() in Java

Posted by & filed under , .

Have you heard of hashCode() and equals() in Java and the eternal discussions around this? And you know by now the implications of having a messed up relationship in between hashCode and equals so you make sure every time you implement a class with an equals() you have to make sure hashCode() follows suit right? […]

Nicer implementations using Java streams

Posted by & filed under , .

I am not entirely sold on the performance of the Java streams but I will accept they are getting much better compared to the first cut, we now have parallel streams and all sorts, and also it provides a (nicer) functional approach to coding. I’m not going to go into the whole dispute of whether […]

Java Map and Subtleties of getOrDefault vs computeIfAbsent

Posted by & filed under , .

I wrote recently about the new niceties in the Map interface that Java 8 brought to light where I’m highlighting in particular 2 new methods: getOrDefault and computeIfAbsent (see my previous post here about it). These provide a cleaner (and as it turns out faster too!) way of retrieving values from a Map instance. However, […]

Please Stop Using Thread.sleep() in Java!

Posted by & filed under , , .

Ok, I need a good moan about this to the extent that it deserves its own blog post, but I had it with the bloody Thread.sleep() method in Java! I know it was the only way to “sleep” back in the day but seriously, but seriously, we have TimeUnit since JDK 1.5 — and nowadays […]

Using OS-level Signals in Java for Monitoring

Posted by & filed under , .

For those of you familiar to monitoring Java applications, I’m sure the first thing that springs to mind is JMX. And I agree, that is a nice framework to provide various app insights for tracking and monitoring. The trouble with JMX though, if you haven’t got a system in place already to collect this data […]

Tracking Users Online — Part 3

Posted by & filed under , , .

I’ve been lucky enough to get some time on my hands to put together a small release of the PixelServer project — and this is the post to accompany it. If you’re familiar with my posts from this series (see the previous entry here btw), you know that the code is hosted on Github under […]

java code

Parallel Sorting in Java 8

Posted by & filed under , , .

I started playing with Java 8 relatively recently (booo! 🙂 ) — and going through the new features this JDK brought, I keep discovering things which I feel deserve more attention than they have been given. Sure, everyone is raving about the lambda expressions, try-with-resources and so on, but occasionally there are small additions that […]