Posts Categorized: Tech

Gotcha When Building Gradle Plugins on Top of docker-java-plugin

Posted by & filed under , .

If you use gradle and docker you must have come across the gradle-docker-plugin. And if you started using it a lot you probably found out that more often than not your builds start using the same boilerplate code to prepare your microservices containers. And if you end up in that situation best thing to avoid boilerplate rubbish […]

Disable PMD Plugin to Run for Test Sources

Posted by & filed under , .

I use PMD in my Gradle builds quite a bit. (Maybe a bit more nowadays that the FindBugs peeps seem to be struggling with that project — see this email from Andrey on this: The issue I had with it is that there is no way to quickly turn off their checks for the src/test/… […]

PMD Rules

Posted by & filed under , .

If you have used such plugins in your project as FindBugs, Checkstyle etc then you quite likely have heard of PMD too. (I have used these tools initially with Apache Maven and nowadays use them via Gradle in my builds, but there’s lots of support for others tools, Ant included.) The trouble with PMD as […]

node.js Annoyance: url-download

Posted by & filed under , .

I been using node.js for a while now, and I do like it. I think I am still to make up my mind as to I consider this a solid production environment or it’s just a great tool for scripting and getting prototype off the ground — but even so, I definitely see its place in […]

Of Fibonacci’s Number and Groovy’s Memoization

Posted by & filed under , .

As a developer, chances are every time you hear recursion mentioned you probably also hear of Fibonacci’s number. And in the same breath you probably hear also of stack overflow 🙂 Because — as you get to learn quickly — if you decide to implement Fibonacci’s number via a recursive function, you end up abusing […]

Gradle Multi-module Projects — Centralized Configuration

Posted by & filed under , .

This is a sweet gradle trick for those of you working on multi-module projects, if you are looking to centralize some of the configuration in the parent gradle build, and avoid repeating configuration / build code across sub-modules. Let’s say you have the following gradle project structure (see image below) where project A is the […]

Collection Sorting — Java vs Groovy

Posted by & filed under , .

With the introduction of lambdas in Java (not so) recently, some argue that Groovy lost some of its thunder, as closures are now first class citizens in the JDK. However, as I’m about to show, while lambda’s pushed the Java language a great deal forward, Groovy still makes a lot of things incredibly easy (and […]

A Bit of Lovin’ for the Groovy Object Initialization

Posted by & filed under , .

I’m going to spread some lovin’ today for the widely-used yet less appreciated feature in Groovy which allows creating a Java bean and setting its properties in one line. Especially when dealing with unit tests this saves me a great deal of time and frustration. If you ever worked with “pure” (??) Java beans, then […]

The Big Data Scare

Posted by & filed under , , , .

I came across this article on Tech Crunch today (AI accountability needs action now, say UK MPs) and wanted to share some thoughts on it. It sounds to me like once again Europe, and UK in this case, is getting cold feet about AI and big data and the interesting results this renders sometimes. Because […]

Goodies in Groovy from DefaultGroovyMethods

Posted by & filed under , .

If you ever programmed in Groovy language, you probably “enjoyed” (maybe without realising) the joys of DefaultGroovyMethods. What you probably don’t realise is that you can override these methods to customize your classes — and occasionally generate some code that’s not that easy to read. (Do you remember the old C++ way of overriding operators […]

On Java Annotations and Type Safety

Posted by & filed under , .

Nicolas Fränkel published a blog entry recently talking about “Type-safe annotations” in Java — which trigger my thoughts on the same matter, and voila, there’s this post as a result of it. This is in fact my 2 cents on the matter — and as such I’d recommend you read Nicolas’ point of view too […]

Small Note on gradle’s afterEvaluate

Posted by & filed under , .

If you use gradle and you took the path to write your own gradle plugins (try it, it’s fun!) to make your build process more … “enjoyable”, then this might come in handy one day. I have worked on a few gradle plugins, some of them inside the Netflix Nebula suite, some of them outside Netflix […]

java code

Java … FunctionalInterface … WTF?

Posted by & filed under , .

If you’ve been doing “stuff” with Java 8 for a while I’m sure you’ve stepped into lambdas territory and the joys of succinct code it allows to be written. And if you are like me you probably found yourself using lambda’s everywhere you are confronted with a single-method interface. Which is allowed. In fact it’s […]

Why You Should Use Default Methods in Java 8 Interfaces

Posted by & filed under , .

With Java 8, Oracle introduced the concept of “default methods” in interfaces (and if you really haven’t heard of this — wtf?? — you can read more here about it: This argue some is a step towards multiple inheritance and as such should be banished from the oh, so pure! Java language. Others point out […]