Tagged articles
JDK8
52 articles · Page 1 of 1
This guide covers Java date/time handling from legacy Date and SimpleDateFormat to modern JDK 8+ APIs including LocalDateTime, DateTimeFormatter, Period, and Duration with practical code examples and conversion techniques.
DATETIMEDateTimeFormatterDuration
0 likes · 14 min read

This article details the implementation of a generic @UserPermission annotation for horizontal authorization in Java web applications, covering annotation design, AOP-based interception, reflection-based parameter extraction, and compile-time validation using JDK8 annotation processors to prevent configuration errors.
Annotation ProcessingCompile-time ValidationJDK8
0 likes · 19 min read


DabaoshiAug 18, 2026 · Backend Development
This article explains why HashMap isn’t thread‑safe, how Hashtable’s single lock hurts performance, and walks through the evolution from JDK 1.7 segment locks to JDK 1.8’s CAS‑plus‑synchronized bucket locking, including lock‑free size counting and a comparison with CopyOnWriteArrayList for read‑heavy scenarios.
ConcurrencyConcurrentHashMapCopyOnWriteArrayList
0 likes · 17 min read

This article thoroughly examines Java's ConcurrentHashMap by tracing its evolution from JDK 1.5's segment‑lock design to JDK 8's CAS‑plus‑synchronized implementation, detailing internal structures, put/get algorithms, resizing mechanics, performance trade‑offs, and common interview questions.
ConcurrencyConcurrentHashMapJDK7
0 likes · 12 min read

The article analyzes Java developers' anxiety about AI, outlines the technical obstacles of existing AI integrations, and presents McpTool as a lightweight bridge that lets developers keep writing CRUD while instantly adding AI Agent capabilities with minimal code and JDK 8 compatibility.
AIBackendJDK8
0 likes · 9 min read

The article explains how Feat removed the SSE implementation from its MCP client, adopted the Streamable protocol, and kept full JDK 8 support so that legacy Java projects can safely integrate the latest AI capabilities with minimal code changes.
AIHTTPJDK8
0 likes · 7 min read

This article explores why many enterprises continue to run on JDK 8 despite newer releases, examining compatibility breaks, stability, learning costs, third‑party library support, performance trade‑offs, commercial considerations, and toolchain readiness, and offers practical guidance for migration decisions.
JDK upgradeJDK8compatibility
0 likes · 14 min read

This article provides a comprehensive, step‑by‑step analysis of Java's ConcurrentHashMap, covering its evolution from JDK 7’s segment‑lock design to JDK 8’s bucket‑level CAS and synchronized approach, complete with macro diagrams, microscopic source‑code walkthroughs, hash calculations, resizing mechanisms, and practical usage tips.
ConcurrencyConcurrentHashMapHashMap
0 likes · 16 min read

Java 8 enriches the Map interface with default methods such as getOrDefault, forEach, merge, putIfAbsent, compute, computeIfAbsent, computeIfPresent and replace, allowing developers to retrieve values with fallbacks, iterate entries, combine or conditionally update entries, and thus write more concise, readable code with far less boilerplate.
APIJDK8Java
0 likes · 9 min read

This article explains why JDK 8's CompletableFuture lacks built‑in timeout interruption, analyzes common usage patterns and their limitations, and presents a custom asynchronous timeout solution that works in both JDK 8 and JDK 9 environments, complete with reusable utility code.
Async TimeoutCompletableFutureConcurrency
0 likes · 13 min read

This article introduces the JDK 8 Map API enhancements—including getOrDefault, forEach, merge, putIfAbsent, compute, computeIfAbsent, computeIfPresent, and replace—explaining their usage with clear examples and showing how they simplify common map‑handling patterns in Java.
JDK8Javacollections
0 likes · 10 min read

Learn how Java 8 introduced powerful Map methods such as getOrDefault, forEach, merge, putIfAbsent, compute, computeIfAbsent, computeIfPresent, and replace, with clear code examples that show how they simplify common tasks like default value handling, iteration, merging entries, and conditional updates.
Code TutorialJDK8Java
0 likes · 10 min read

This article introduces the Java 8 Map API enhancements—including getOrDefault, forEach, merge, putIfAbsent, compute, computeIfAbsent, computeIfPresent, and replace—explaining their purpose, showing concise code examples, and demonstrating how they simplify common map‑handling scenarios.
JDK8collectionsmap
0 likes · 9 min read

This article explains the recent correction in Alibaba's developer manual that replaces the ambiguous "expansion count" of HashMap with the precise "resize count", details the conditions under which HashMap triggers resize during the first put operation, and shows why storing 1024 elements in JDK 1.8 results in eight resize calls.
BackendJDK8Java
0 likes · 9 min read

The article explains the critical remote code execution vulnerability discovered in Apache ActiveMQ, lists the affected and safe versions, and provides practical mitigation steps—including upgrading, network restrictions, and a custom Docker image for JDK8 users—to protect systems from exploitation.
Apache ActiveMQDockerJDK8
0 likes · 4 min read


JD TechMay 15, 2023 · Backend Development
This article explains how to use Java's CompletableFuture for parallel execution, demonstrates the limitations of simple timeout handling in JDK 8, and shows how JDK 9's built‑in orTimeout method and a custom utility class can provide precise asynchronous timeout control for backend services.
Async TimeoutCompletableFutureConcurrency
0 likes · 12 min read

This article explains how LinkedBlockingQueue, normally thread‑safe, can enter an infinite loop when its stream traversal is used under JDK 8 with concurrent remove() calls, analyzes the root cause in the tryAdvance method, and shows how the bug was fixed in later JDK versions.
JDK8JavaLinkedBlockingQueue
0 likes · 15 min read

This article explains the internal structure of Java’s HashMap across JDK 7 and JDK 8, covering its array‑based storage, linked‑list and red‑black‑tree collision handling, resizing mechanics, load factor choices, power‑of‑two capacity growth, and thread‑safety concerns with practical solutions.
HashMapJDK8Java
0 likes · 11 min read

Oracle’s Enterprise Performance Pack, offered free to Java SE subscribers and OCI users, brings Java 17‑level memory management and performance enhancements—including modern garbage collection, compact strings, and improved observability—to legacy Java 8 applications, delivering up to 40% better memory and CPU efficiency under heavy loads.
JDK8JavaOracle
0 likes · 4 min read

This article introduces Java 8’s new language features—Lambda expressions, the Stream API, and the modern date‑time classes—explaining their syntax, core concepts, and practical usage through clear examples and code snippets that illustrate how they simplify collection processing and date handling.
JDK8JavaLocalDateTime
0 likes · 29 min read

This article explains the shortcomings of HashMap, compares Hashtable, synchronizedMap, and ConcurrentHashMap implementations in JDK 7 and JDK 8, discusses lock states, fail‑fast vs fail‑safe behavior, and provides code examples and optimization tips for thread‑safe map operations.
ConcurrentHashMapJDK7JDK8
0 likes · 12 min read

This article compares Java's legacy date handling in JDK7 with the modern java.time API introduced in JDK8, demonstrating how to create, format, and convert dates using LocalDate, LocalDateTime, DateTimeFormatter, and related methods, and provides a comprehensive table of useful LocalDate APIs.
DATETIMEJDK8Java
0 likes · 9 min read

The author humorously explores a newly disclosed Spring framework RCE 0‑day vulnerability caused by Java serialization, explains why systems running JDK 8 or earlier are unaffected, compares its impact to Log4j2, and warns against indiscriminate JDK upgrades.
JDK8JavaRCE
0 likes · 3 min read

This article explains the JDK 1.8 HashMap resize/re‑hash optimization, showing how the new algorithm splits buckets instead of re‑hashing every entry, and includes the full source code and visual illustrations for single nodes, linked lists, and red‑black trees.
HashMapJDK8Rehash
0 likes · 8 min read

This article provides an in‑depth analysis of Java’s CompletableFuture introduced in JDK 8, explaining its motivations, core methods, internal mechanisms such as asyncSupplyStage, thenAcceptAsync, and postComplete, and includes practical code examples to illustrate asynchronous task handling and dependency management.
CompletableFutureJDK8Java
0 likes · 13 min read

This article explains how to replace synchronous price‑lookup APIs with Java 8's CompletableFuture, compares synchronous and asynchronous performance, introduces the most useful CompletableFuture creation and composition methods, shows practical code examples, and discusses when to prefer it over traditional Future or thread‑pool approaches.
CompletableFutureJDK8Java
0 likes · 21 min read

The article examines the origins and practical equivalence of Java’s infinite loop constructs for(;;) and while(true), showing through JDK8u source searches and javac bytecode that both compile to identical code and have no performance difference.
JDK8Loopscompilation
0 likes · 5 min read

This article explains the internal structure and algorithms of Java's HashMap and LinkedHashMap, covering node definitions, constructors, hash calculations, collision handling, treeification, resizing mechanics, power‑of‑two bucket sizing, thread‑safety issues, and how LinkedHashMap enables LRU caching.
DataStructureHashMapJDK8
0 likes · 35 min read

This article explains why the pre‑JDK 1.8 HashMap can enter an infinite loop during concurrent resizing, illustrates the problem with detailed step‑by‑step diagrams, and shows how JDK 1.8 redesigns the resize algorithm to prevent the loop.
ConcurrencyDeadLoopHashMap
0 likes · 5 min read

This tutorial explains how Java 8's Optional class and lambda expressions simplify null handling and collection processing, offering concise code examples, method summaries, and a clear comparison with Java 7 approaches to improve readability and development efficiency.
Code ExamplesJDK8Java
0 likes · 8 min read

This article introduces the various thread pool creation methods available in JDK 1.8—including fixed, cached, scheduled, single, single‑scheduled, and work‑stealing executors—explains their characteristics, provides sample Java code for each, and shows typical execution results.
ExecutorServiceJDK8Java
0 likes · 10 min read

This article explains the structural changes of ConcurrentHashMap in JDK 8, covering the new table layout, node types, hash spreading, initialization, resizing mechanics, treeification, and the lock‑free algorithms that enable concurrent expansion and high‑performance operations.
ConcurrencyConcurrentHashMapJDK8
0 likes · 31 min read

This tutorial shows how Java 8's new Map methods—getOrDefault, computeIfAbsent, and merge—can replace verbose null‑checking patterns, prevent NullPointerExceptions, and make common tasks like grouping values or counting words concise and readable.
JDK8JavacomputeIfAbsent
0 likes · 8 min read

This article explains how Java 8’s ConcurrentHashMap improves concurrency by replacing segment locks with fine‑grained CAS operations, introduces ForwardingNode for lock‑free resizing, and details the internal algorithms for initialization, put, dynamic expansion, and size counting, complete with code examples.
CASConcurrentHashMapJDK8
0 likes · 28 min read

After observing TiDB taking 35 minutes versus Oracle’s 15 minutes for a massive batch job, we traced the slowdown to MyBatis’s use of ConcurrentHashMap.computeIfAbsent in JDK 8, which caused thread blocking, and resolved it by upgrading to JDK 9 and applying MyBatis patches.
BatchProcessingConcurrentHashMapJDK8
0 likes · 11 min read

This article explains the major differences between JDK 1.8 and JDK 1.7 HashMap implementations, detailing the initialization process, the putVal algorithm steps, how collisions are handled with linked lists and red‑black trees, and the changes in resizing behavior.
HashMapJDK8Java
0 likes · 5 min read

This article explains how Java 8's ConcurrentHashMap implements the get operation without acquiring locks by using volatile fields, CAS, and a simplified node structure, contrasting it with the segment‑based design of JDK 1.7 and detailing the memory‑visibility guarantees provided by volatile.
ConcurrencyConcurrentHashMapJDK8
0 likes · 9 min read

This article explains why Java's HashMap is unsafe in multithreaded environments, detailing how JDK 1.7's resize operation can create circular linked lists and data loss, and how JDK 1.8's tail‑insertion still suffers from element overwriting under concurrent puts.
ConcurrencyHashMapJDK7
0 likes · 10 min read

This article explains how ThreadPoolExecutor in JDK 1.8 recycles worker threads by analyzing the runWorker loop, the conditions under which getTask() returns null, and the different scenarios of thread termination with and without invoking shutdown(), illustrating the role of CAS and interrupt handling.
BackendConcurrencyJDK8
0 likes · 11 min read

This article explains the fundamentals of HashMap, then dissects the internal fields, node‑array safety, read‑path guarantees, write‑path locking, atomic compute methods, resize‑transfer mechanics, traverser design, and bulk‑task support that together make Java's ConcurrentHashMap (C13Map) a highly concurrent, lock‑free data structure.
ConcurrencyConcurrentHashMapHashMap
0 likes · 49 min read

This article explains the root cause of a memory‑leak bug in JDK8's ConcurrentLinkedQueue, demonstrates how to reproduce and visualize the issue with custom CLQ implementations, analyzes the removal algorithm, and shares practical debugging tips including a notorious IDEA debug pitfall and its resolution.
ConcurrentLinkedQueueDebuggingJDK8
0 likes · 14 min read

This article presents a comprehensive overview of JDK8's garbage collection mechanisms, detailing memory regions, available collectors, key tuning parameters, thread settings, and practical commands, complemented by eight illustrative diagrams and a downloadable PDF cheat sheet for quick reference.
GC tuningJDK8JVM
0 likes · 7 min read

This article explains how ConcurrentHashMap ensures thread safety in Java, comparing the lock‑segmentation design of JDK 7 with the CAS‑based, bucket‑level synchronization of JDK 8, and includes key source code excerpts illustrating the insertion process.
CASConcurrencyConcurrentHashMap
0 likes · 11 min read

This article explains why ConcurrentHashMap provides thread‑safe and high‑performance map operations, compares it with HashMap and Hashtable, and details the architectural changes from JDK 1.7’s segment‑lock design to JDK 1.8’s array‑list‑red‑black‑tree and CAS‑based implementation.
ConcurrentHashMapJDK7JDK8
0 likes · 7 min read

This article explains why Java's HashMap is not thread‑safe, analyzing the dead‑loop and data‑loss problems caused by resizing in JDK 7 and the overwrite issue in JDK 8, with code examples and step‑by‑step thread interleaving illustrations.
ConcurrencyHashMapJDK7
0 likes · 11 min read

This article explains why Java 8's ConcurrentHashMap.get() operation is lock‑free, describing the underlying data‑structure changes from JDK 1.7 to 1.8, the role of volatile‑marked Node fields and array, and how visibility and cache‑coherence guarantee thread‑safe reads.
ConcurrentHashMapJDK8Java
0 likes · 10 min read

This article explains the Compare‑And‑Swap (CAS) primitive, its three operands, how Java's Unsafe class implements CAS methods, the internal workings of AtomicInteger, common pitfalls like spinning, single‑variable limits and the ABA problem, and the enhancements introduced in Java 8.
CASConcurrencyJDK8
0 likes · 9 min read

This article explains the thread‑safety problems of Java's HashMap in JDK 1.7 and JDK 1.8, showing how concurrent resize operations can create circular linked lists, cause infinite loops or data loss, and why the underlying implementation remains unsafe despite JDK 1.8's optimizations.
ConcurrencyHashMapJDK7
0 likes · 9 min read

This article explains the hidden multithreading bugs in JDK 7 HashMap and JDK 8 ConcurrentHashMap that can cause 100% CPU usage, demonstrates how to reproduce them, and offers practical ways to avoid or resolve the issue.
CPUConcurrentHashMapJDK8
0 likes · 4 min read

This article explains the fundamental principles of Java's HashMap, covering hash basics, time‑complexity of operations, the role of load factor and initial capacity, the resize algorithm without full rehashing, and the treeification of long buckets, illustrated with JDK 1.8 source code examples.
ConcurrencyHashMapJDK8
0 likes · 16 min read

This article explains the internal design of Java's AbstractQueuedSynchronizer (AQS), covering its state management, FIFO sync queue, node structure, exclusive lock acquisition and release processes, and key helper methods, with detailed diagrams from JDK 8 implementation.
AQSAbstractQueuedSynchronizerConcurrency
0 likes · 11 min read

This article explains Java’s HashMap internals, compares JDK 1.7 and 1.8 implementations, details the bucket array, linked‑list‑to‑red‑black‑tree conversion, resizing logic, performance gains of up to 100 % in 1.8, and warns against using HashMap in concurrent contexts.
AlgorithmsConcurrencyHashMap
0 likes · 20 min read
