Spring Security and OpenID Connect (Legacy)
Note that this content is outdated. Take a look at Spring Security's latest OAuth support. 1. Overview In this quick tutorial, we'll focus on setting up OpenID Connect with a Spring Security OAuth2...
View ArticleSpring Boot – Using a Color Startup Banner
1. Introduction One of the endearing features of Spring Boot is its startup banner. Over the years, Spring Boot has evolved to support various types of banners. For example, both text and background...
View ArticleBranch Prediction in Java
1. Introduction Branch Prediction is an interesting concept in computer science and can have a profound impact on the performance of our applications. Yet it's generally not well understood and most...
View ArticleThe Difference between var in Kotlin and Java 10
1. Introduction In this short tutorial, we’ll cover differences between var keywords in Java and Kotlin. We cover the identifier var in Java in more depth in our article Java 10 LocalVariable...
View ArticleArrays.sort vs Arrays.parallelSort
1. Overview We've all used Arrays.sort() to sort an array of objects or primitives. In JDK 8, creators enhanced the API to provide a new method: Arrays.parallelSort(). In this tutorial, we'll draw a...
View ArticleJava Weekly, Issue 314
Welcome to 2020 1. Spring and Java >> New Classes in Java 11 [blog.code-cop.org] A categorized list of classes added in Java 11 as well as those that were removed. >> Prototyping with...
View ArticleGuide to the Java finally Keyword
1. Overview In this tutorial, we'll explore the finally keyword in Java. We'll see how to use it alongside try/catch blocks in error handling. Though finally is intended to guarantee the execution of...
View ArticleHow to Return Multiple Values From a Java Method
1. Overview In this tutorial, we'll learn different ways to return multiple values from a Java method. First, we'll return arrays and collections. Then, we'll show how to use container classes for...
View ArticleDecompiling Classes in Java
1. Introduction In this tutorial, we'll discuss decompiling Java classes. When source code is not available, decompiling Java classes helps to debug and understand source code behavior. Let's take a...
View ArticleSpecify an Array of Strings as Body Parameters in Swagger
1. Overview Swagger is a set of specifications to document and describe REST APIs. It also provides example values for the endpoint parameters. In this tutorial, we'll show how to produce a default...
View ArticleApache RocketMQ with Spring Boot
1. Introduction In this tutorial, we’ll create a message producer and consumer using Spring Boot and Apache RocketMQ, an open-source distributed messaging and streaming data platform. 2. Dependencies...
View ArticleConvert Double to Long in Java
1. Overview In this tutorial, we'll explore various methods to convert from double to long in Java. 2. Using Type Casting Let's check a straightforward way to cast the double to long using the cast...
View ArticleUsing Cookies With Selenium WebDriver in Java
1. Overview In this article, we'll have a quick look at how to use cookies with Selenium WebDriver in Java. We'll talk a bit about some use cases, and then we'll jump straight into code. 2. Working...
View ArticleKotlin Ternary Conditional Operator
1. Overview Briefly speaking, there is no ternary operator in Kotlin. However, using if and when statements helps to fill this gap. In this tutorial, we'll look into a few different ways to mimic the...
View ArticleRead Excel Cell Value Rather Than Formula With Apache POI
1. Introduction When reading an Excel file in Java, we usually want to read the values of cells to perform some computation or generate a report. However, we may encounter one or more cells that...
View ArticleCucumber Hooks
1. Introduction Cucumber hooks can come in handy when we want to perform specific actions for every scenario or step, but without having these actions explicitly in the Gherkin code. In this tutorial,...
View ArticleIntroduction to Greedy Algorithms with Java
1. Introduction In this tutorial, we're going to introduce greedy algorithms in the Java ecosystem. 2. Greedy problem When facing a mathematical problem, there may be several ways to design a solution....
View ArticleGuide to the @Serial Annotation in Java 14
1. Introduction In this quick tutorial, we'll take a look at the new @Serial annotation introduced with Java 14. Similarly to @Override, this annotation is used in combination with the serial lint flag...
View ArticleObtaining a Power Set of a Set in Java
1. Introduction In this tutorial, we'll study the process of generating a power set of a given set in Java. As a quick reminder, for every set of size n, there is a power set of size 2n. We'll learn...
View ArticleLooking for Java Developer to Help with Brainstorming Topics for the Site...
Who? I'm looking for an experienced Java developer, optionally with knowledge of the Spring ecosystem – to help us brainstorm new topics for the site. The Work The process of brainstorming new topics...
View Article