Java 核心

BlogSearch Architecture

The overview of the BlogSearch, a simple search service for blog posts.

26 May 2022

Setting Up Monitoring For Java With Datadog

This article explains how to set up Datadog monitoring for a Java application and an Elasticsearch service running in Alibaba Cloud.

27 Mar 2022

Change Log Level At Runtime in Logback

This Q&A explains how to change logger level dynamically at runtime via RESTful API for your Java application when using Logback.

18 Dec 2021

Audit Logs

This article discusses how to implement a simple audit logs solution with Java JAX-RS, including requirements, considerations for the implementation, and 3 different solutions based on Java Servlet, Jetty, and JAX-RS filter.

20 Nov 2021

Using Java Time In Different Frameworks

How to use Java Time in different frameworks? This article shares examples in Java concurrency classes, Jackson, Akka, and Elasticsearch.

25 Oct 2020

Controlling Time with Java Clock

Use java.time.Clock to control time in your unit tests. This article will mainly focus on usage of fixed clock and offset clock.

24 May 2020

Introduction of Immutables

Introduction of Java framework Immutables which creates immutable objects and builders for you. Type-safe, null-safe and thread-safe, with no boilerplate.

13 Apr 2020

Unzipping File in Java

Unzipping zip file in Java 8 using builtin Java classes: ZipInputStream and ZipEntry. Implementation supports sub-directories as well.

27 Oct 2019

Testing with GwtMockito

My recent bug fixing experience on Google Web Kit (GWT) with GwtMockito: problem understanding, code refactoring, mocking framework preparation, testing, and comparison between GwtMockito and GWTTestCase.

26 Aug 2019

6 Tips for Fixing Bugs with Legacy Frameworks

In my daily work, I have to deal with legacy frameworks. Here are 6 tips that I summarized for bug-fixing, including documentation, searching, testing, patching library and more.

13 Aug 2019

Fixing Comparator

Fun experience on fixing a custom comparator by identifying the sub-problems, testing different combinations, and finally fix it.

18 Jul 2019

Viewing the Contents of JAR

Listing files inside a JAR or displaying content of a single file using different commands: "jar", "unzip", or "vim".

30 Apr 2019

Glob Expression Understanding

Glob expression syntax, and its usage in Java through Path Matcher and Directory Stream.

16 Apr 2019

Understanding ISO-8859-1 / UTF-8

Character mapping between ISO-8859-1 / UTF-8, decode and encode data between string and bytes, and file I/O operations including MIME encoding detection. All examples are written in Java and Python 3.

07 Apr 2019

Design Pattern: Static Factory Method

Understand static factory method pattern in Java with concrete examples from Selenium WebDriver, Jackson JSON object mapper, and SAX reader for XML.

19 Feb 2019

Vavr List vs Java List

Difference between Vavr List and Java List? I'll compare them via CRUD operations, immutability, performance, streaming, and thread safety in this article.

13 Feb 2019

VAVR HashMap vs Java HashMap

What is the difference between VAVR Collection API and Java Collection API? Why should you give it a try? Today, we will start comparing them via Map and HashMap, including the map creation, entries iteration, streaming, and the side effect.

15 Jan 2019

Why You Should Use Auto Value in Java?

Auto Value generates immutable value classes during Java compilation, including equals(), hashCode(), toString(). It lighten your load from writing these boilerplate source code.

21 Aug 2018

Use Auto Value and Jackson in REST API

This post explains what is Google Auto Value and why it is the best alternative for Data Transfer Objects (DTO) in your web service. It shares how to apply Jackson annotations on top of Auto Value classes. There're also some advanced configurations about this topic.

19 Jun 2018

Learning HashMap

Understand java.util.HashMap in Java 11: bitwise operations, hash computation using hash code, index calculation, and more.

08 Apr 2018

Java 9 Migration

Java 9 migration for Maven project. It consists Java 9 installation, IDE update, Maven project update, CI update, and fixing tests. This article is written using macOS and IntelliJ IDEA.

28 Feb 2018

OCP Java 8 Review Notes

Here're some review notes before my Oracle Certified Professional Java SE 8 exam. They're highly inspired by the following books: OCP Java SE 7 Certification Guide and Java 8 in Action. They are excellent resources for learning Java, which I highly recommend.

03 Jan 2018

OCA Review 8 - Notes

Today, I want to write blog post to summarize all the important review notes for Oracle Certification Associate (OCA) - Java SE 8 Programmer. This article will be separated into several subjects: Java basics, Java data types, methods and encapsulation, core APIs, flow control, inheritance, and exception handling.

06 Apr 2017

OCA Review 7 - Online Test Chapter 5

Today, I’m going to review my online test, chapter 5 of Oracle Certified Associate (OCA), provided by SYBEX. If you need to access to this online resources, you need to buy their book first. See https://sybextestbanks.wiley.com/.

21 Mar 2017

OCA Review 6 - Online Test Chapter 4

Today, I’m going to review my online test, chapter 4 of Oracle Certified Associate (OCA), provided by SYBEX. If you need to access to this online resources, you need to buy their book first. See https://sybextestbanks.wiley.com/.

20 Mar 2017

OCA Review 5 - Online Test Chapter 3

Today, I’m going to review my online test, chapter 3 of Oracle Certified Associate (OCA), provided by SYBEX. If you need to access to this online resources, you need to buy their book first. See https://sybextestbanks.wiley.com/.

15 Mar 2017

OCA Review 4 - Online Test Chapter 2

Today, I’m going to review my online test, chapter 2 of Oracle Certified Associate (OCA), provided by SYBEX. If you need to access to this online resources, you need to buy their book first. See https://sybextestbanks.wiley.com/.

14 Mar 2017

OCA Review 3 - Online Test Chapter 1

Today, I’m going to review my online test, chapter 1 of Oracle Certified Associate (OCA), provided by SYBEX. If you need to access to this online resources, you need to buy their book first. See https://sybextestbanks.wiley.com/.

11 Mar 2017

OCA Review 2 - Java Core APIs

I’m preparing the OCAJP: Oracle Certified Associate Java SE 8 Programmer. Here’s the second review of the certification training. In this review, I’ll talk about the Java Core APIs, including operations of String, StringBuiler, Arrays, ArrayList, and Java Time in Java 8.

04 Mar 2017

OCA Review 1 - Java Basics

I’m preparing the OCAJP: Oracle Certified Associate Java SE 8 Programmer. Here’re something interesting that I learned from the study guide, chapter 1 and chapter 2. They’re rarely used in our daily mission, but I just wrote them down for fun.

23 Feb 2017

Convert Date to ISO 8601 String in Java

Convert Java dates to ISO-8601 string: this post explains how to convert java.util.Date, java.util.Calendar, java.time.ZonedDateTime to string.

16 Feb 2017