Get easy look-alike readable code with IntelliJ Spotless is are really cool tool for formatting your code with build tools. If you like, you can do that with your IDE too. I show your how to configure IntelliJ, so your code is automatically formatted while you save a file. First you have to install the …
Kategorie-Archiv: Software Engineering
Discover updates or vulnerabilities
Keep your dependencies up-to-date with gradle This is an import task, e.g. nearly every 6 months major releases of frameworks are available or new vulnerabilities are found on a daily basis. I’ll show you two gradle plugins which helps you that your software project won’t be left behind. The first one is gradle-version-plugin. This plugin …
Creating a generic array in Java
Generic array initialization Recently I work with CompletableFutures. I used the allOf method which takes a varargs as input. Based on the request, a couple of things had to be processed. So how do I create a generic array that I could use at CompletableFuture.allof()? Array.newInstance together with toArray() does the trick. This is my …
Echo your REST calls with a echo service
Echo services are a simple tool for developing and testing When you implement a service are often in a situation where you have to call another web service, for example service B. And to complicate the situation, service B is not fully implemented or even not available. Than an echo service could make sense for …
Counting active accounts with Metrics
Based on a request parameter in a servlet context Recently I had the task to report active accounts based on http requests. Here I’m going to show you my solution with Dropwizard Metrics. Basically I am using a servlet filter togehter with an counter. [code] @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws …
Hey SDKMAN!
This tool is great! I came across SDKMAN in a Spring tutorial. It’s a tool like rvm which helps you to manage parallel version of a SDK for the JVM like: * Java * Gradle * Groovy * Kotlin * Maven * Scala * Spring Boot * Vert.x It’s what compelling, so I installed it …
Why you should use new language features
A quick list I put together a list with a number of reasons why you should use new language features. The list includes points which are obvious, I learned or I found on the internet. improved design * easier to understand * easier to change * less defects effectiveness * using standards * getting help …
Find duplicate code with CPD
A copy/paste detector I’m sure that you know PMD, the famous static code analyzer. But have you ever tried CPD? Installation CPD belongs to PMD. You have to install PMD first. [code] $ cd $HOME $ wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F5.8.1/pmd-bin-5.8.1.zip $ unzip pmd-bin-5.8.1.zip $ alias pmd="$HOME/tools/pmd-bin-5.8.1/bin/run.sh pmd" $ alias cpd="$HOME/tools/pmd-bin-5.8.1/bin/run.sh cpd" [/code] Command line usage I give you some examples …
Why are engineering values important?
Everything else will grow from values and behaviour Wikipedia writes „… Values can be defined as broad preferences concerning appropriate courses of action or outcomes. As such, values reflect a person’s sense of right and wrong or what „ought“ to be… Values tend to influence attitudes and behavior [value].“ And culture comes from these shared …
Test JSON with a few lines of code
JSONassert helps you writing JSON unit tests You have to write a unit test and JSON is involved. Usually this will end up in a lot of lines of code. You know the situation, I bet. Here JSONassert comes into play. It allows to write JSON unit tests with just a few lines of code. For example checking an …