Skipping Tests With Gradle
1. Introduction Although skipping tests is usually a bad idea, there are some situations where it might be useful, and it will save us some time. For instance, consider we are developing a new feature,...
View ArticleRemoving Docker Images
1. Introduction In a previous article, we explained the difference between Docker images and Docker containers. In short: An image is like a Java class, and containers are like Java objects. In this...
View ArticleCheck If a File or Directory Exists in Java
1. Overview In this quick tutorial, we're going to get familiar with different ways to check the existence of a file or directory. First, we'll start with the modern NIO APIs and then will cover the...
View ArticleXML Defined Beans in Spring Boot
1. Introduction Before Spring 3.0, XML was the only way to define and configure beans. Spring 3.0 introduced JavaConfig, allowing us to configure beans using Java classes. However, XML configuration...
View ArticleIntroduction to Transactions in Java and Spring
1. Introduction In this tutorial, we'll understand what is meant by transactions in Java. Thereby we'll understand how to perform resource local transactions and global transactions. This will also...
View ArticleDifference in Used, Committed, and Max Heap Memory
1. Overview In this short article, we're going to see the difference between various memory size metrics in the JVM. First, we'll talk about how adaptive sizing works, and then we'll evaluate the...
View ArticleA Guide to async-profiler
1. Overview Java Sampling Profilers are usually designed using the JVM Tool Interface (JVMTI) and collect stack traces at a safepoint. Therefore, these sampling profilers can suffer from the safepoint...
View ArticlePerformance Comparison of boolean[] vs BitSet
1. Overview In this article, we're going to compare BitSets and boolean[] in terms of performance in different scenarios. We usually use the term performance very loosely with different meanings in...
View ArticleFlyway Repair With Spring Boot
1. Overview Flyway migrations don't always go according to plan. In this tutorial, we'll explore the options we have for recovering from a failed migration. 2. Setup Let's start with a basic Flyway...
View ArticleJava Weekly, Issue 345
1. Spring and Java >> OpenJDK Comes to Windows 10 on ARM [infoq.com] More contributions to the Java ecosystem from Microsoft: A distribution of OpenJDK for Windows on ARM CPU architectures....
View ArticleCopy a Directory in Java
1. Introduction In this short tutorial, we'll see how to copy a directory in Java, including all its files and subdirectories. This can be achieved by using core Java features or third-party libraries....
View ArticleDetermine if an Object is of Primitive Type
1. Overview Sometimes we need to determine if an object is of primitive type, especially for wrapper primitive types. However, there are no built-in methods in the standard JDK to achieve this. In this...
View ArticleHypermedia Serialization With JSON-LD
1. Overview JSON-LD is a JSON-based RDF format for representing Linked Data. It enables extending existing JSON objects with hypermedia capabilities; in other words, the capability to contain links in...
View ArticleSpring @Pathvariable Annotation
1. Overview In this quick tutorial, we'll explore Spring's @PathVariable annotation. Simply put, the @PathVariable annotation can be used to handle template variables in the request URI mapping, and...
View ArticleDifference Between request.getSession() and request.getSession(true)
1. Overview In this quick tutorial, we'll see the difference between calling HttpServletRequest#getSession() and HttpServletRequest#getSession(boolean). 2. What's the Difference? The methods...
View ArticleSet Field Value With Reflection
1. Overview In our previous article, we discussed how we could read the values of private fields from a different class in Java. However, there can be scenarios when we need to set the values of...
View ArticleIntroduction to Spring Data JDBC
1. Overview Spring Data JDBC is a persistence framework that is not as complex as Spring Data JPA. It doesn't provide cache, lazy loading, write-behind, or many other features of JPA. Nevertheless, it...
View ArticleJava Files Open Options
1. Overview In this tutorial, we're going to focus on the standard open options available for files in Java. We'll explore the StandardOpenOption enum that implements the OpenOption interface and that...
View ArticleGetting Docker Container From Docker Engine API
1. Overview In this tutorial, we're going to see how to access Docker container information from inside the container using the Docker Engine API. 2. Setup We can connect to the Docker engine in...
View ArticleJava Reporting Tools: a Comparison
1. Overview When we talk about Reporting tools, a lot of software covers this area. However, most of them are full-fledged Business Intelligence platforms or Cloud services. But, what happens if we...
View Article