Introduction to OpenGrok
1. Overview OpenGrok is an open-source and powerful source code search and cross-reference engine. It allows us to explore, search, and navigate through the source code of various projects efficiently....
View ArticleMutable vs. Immutable Objects in Java
1. Introduction When working with objects in Java, understanding the difference between mutable and immutable objects is crucial. These concepts impact the behavior and design of your Java code. In...
View ArticleGet All Results at Once in a Spring Boot Paged Query Method
1. Overview In Spring Boot applications, we’re often tasked to present tabular data to clients in chunks of 20 or 50 rows at a time. Pagination is a common practice for returning a fraction of data...
View ArticleConvert Infix to Postfix Expressions in Java
1. Introduction In this tutorial, we’ll discuss the algorithm and code for converting the infix notation of a mathematical expression to a postfix notation. 2. Expressions in Java A programming...
View ArticleHow to Check if a Variable is Defined in Thymeleaf
1. Introduction In this tutorial, we’ll learn how to check if a variable is defined in Thymeleaf using three different methods. For this purpose, we’ll use Spring MVC and Thymeleaf to build a simple...
View ArticleMoves Zeros to the End of an Array in Java
1. Overview When we work with arrays in Java, one common task is rearranging arrays to optimize their structure. One such scenario involves moving zeros to the end of an array. In this tutorial, we’ll...
View ArticleFind the First Non-repeating Element of a List
1. Introduction In this tutorial, we’ll explore the problem of finding the first non-repeating element in a list. We’ll first understand the problem statement and then implement a few methods to...
View ArticleGuide to System.in.read()
1. Overview Java offers a variety of tools and functions to engage with user input. System.in.read() is one of the frequently used methods for reading input from the console. In this article, we’ll...
View ArticleCollect Stream of entrySet() to a LinkedHashMap
1. Overview In this tutorial, we’ll explore the different ways to collect a stream of Map.Entry objects into a LinkedHashMap. A LinkedHashMap is similar to HashMap but differs in the respect that it...
View ArticleCount Uppercase and Lowercase Letters in a String
1. Overview When working with String types in Java, it’s often necessary to analyze the composition of the characters within them. One common task is counting the number of uppercase and lowercase...
View ArticleHow to Collect All Results and Handle Exceptions With CompletableFuture in a...
1. Overview Java 8’s CompletableFuture is well-suited to handling asynchronous computation. For instance, a web client may employ CompletableFuture when making a server call. It’s easy to get started...
View ArticlePreventing Gson from Expressing Integers as Floats
1. Introduction The Gson library developed by Google is quite a good choice for serialization and deserialization of Java objects to and from JSON format. Besides, we typically come across the problem...
View ArticleJava Weekly, Issue 529
1. Spring and Java >> Emulating C# LINQ in Java using Code Reflection [openjdk.org] Java’s LINQ Inspiration: unleashing Code Reflection Power, Emulating the LINQ in Java. >> FetchType:...
View ArticleMask an Email Address and Phone Number in Java
1. Introduction Privacy and data security are important elements of software development. Masking sensitive details such as the user’s email address and phone number is usually one procedure used to...
View ArticleLogging With AOP in Spring
1. Overview We often use logging to document meaningful steps and valuable information during the program execution. It allows us to record data we can use later to debug and analyze the code....
View ArticleView Kafka Headers in Java
1. Introduction Apache Kafka is a distributed streaming platform that allows us to publish and subscribe to streams of records, often referred to as messages. Additionally, Kafka headers provide a way...
View ArticleHow To Use findBy() With Multiple Columns in JPA
1. Introduction Spring Dat;u JPA provides a query derivation feature, using which we can derive queries automatically by just following the method name conventions. In this article, we’ll use the query...
View ArticleAdd Camel Route at Runtime in Java
1. Overview Apache Camel is a Java framework that makes it easy to implement various Enterprise Integration Patterns (EIPs) for providing solutions to enterprise integration. One of the common tasks in...
View ArticleUnderstanding Kafka InstanceAlreadyExistsException in Java
1. Introduction Apache Kafka is a powerful distributed streaming platform that is widely used for building real-time data pipelines and streaming applications. However, Kafka may encounter various...
View ArticleJava Weekly, Issue 530
1. Spring and Java >> Pattern match Optional in Java 21 [joda.org] Exploring Optional Pattern Matching in Java 21: a deep dive into the latest features. >> When should a compiler expand...
View Article