This article introduces Excel fundamentals, demonstrates how to install and use the Go tealeg library to create spreadsheets, and explains how to leverage Go reflection to convert structs, slices, or arrays into Excel files with practical code examples.
Converting Java beans to maps often leads to type loss and incorrect property names due to JSON frameworks and BeanUtils behavior, and this article examines those pitfalls, demonstrates them with code examples, analyzes underlying Java introspection mechanisms, and presents a Dubbo‑based solution to reliably preserve types and property names.
This article explains the fundamentals of TCP/UDP and HTTP, details OkHttp's interceptor chain and caching mechanisms, and demonstrates a generic offline‑upload solution using Kotlin reflection to persist and replay network calls when connectivity is restored.
This article explains how java.lang.String, traditionally considered immutable, can be altered via reflection in Java 11, how Java 17 blocks such modifications with exceptions, and demonstrates using StackTrace-based checks and other practical applications for security and debugging in Java.
This article explains Java reflection’s core concepts, how the JVM dynamically loads Class objects, and provides practical examples—including field retrieval, caching strategies, and integration with Spring—to help developers harness reflection for dynamic code manipulation while avoiding common pitfalls.
This article demonstrates how reflection can alter the internal byte array of a java.lang.String in Java 11, causing both identical literals to change, explains why the hashCode remains unchanged, and shows that Java 17 blocks such modifications with runtime exceptions.
This article provides a comprehensive guide to Java's reflection mechanism, class loading process, ClassLoader usage, and dynamic proxy techniques, illustrating how to inspect class structures, create objects, access fields and methods, retrieve generic type information, and implement both static and dynamic proxies with practical code examples.
The article examines how Log4j2’s AsyncAppender can block threads when its default 128‑entry queue fills, because creating LogEvent snapshots triggers ThrowableProxy parsing that loads reflective and lambda‑generated classes, causing class‑loader bottlenecks, and recommends custom async appenders, disabling reflection inflation, using synchronous loggers, and proper configuration to avoid these delays.
Converting Java Beans to Maps can cause type loss and incorrect property names due to JSON serialization and BeanMap implementations, but using Dubbo's PojoUtils.generalize method or custom reflection with caching can preserve types and correctly map property names, as demonstrated with code examples and analysis.
This article provides a comprehensive guide to Java annotations, covering built‑in annotations, meta‑annotations, retention policies, repeatable annotations, and how to create and apply custom annotations with reflection and AOP for practical use cases.
This article explains how to reduce repetitive Java business code by applying the factory and template‑method patterns for shopping‑cart processing, using custom annotations with reflection to generate API requests, and leveraging bean‑mapping utilities to copy properties between DTO/DO objects, while illustrating each technique with concrete code examples.
The PHP RFC introduces readonly classes, allowing all properties of a class to be immutable, prohibiting dynamic and static properties, and providing reflection support, with examples, restrictions, inheritance rules, and compatibility notes, helping developers write safer, more robust code.
The article explains that Fastjson sometimes throws a syntax‑error exception when deserializing a JSON list of StewardTipCategory objects because the JVM returns overloaded constructors in nondeterministic order, causing Fastjson to pick the wrong constructor; removing or renaming the ambiguous constructor fixes the issue.
This article demonstrates how to define a simple Java interface, provide two implementation styles (Spring‑annotation and pure‑reflection), package the implementation as a JAR, and dynamically load, register, replace, or remove the implementation at runtime using URLClassLoader and Spring's bean factory.
This article demonstrates how to design a simple Calculator interface, provide two implementation strategies (annotation‑based Spring beans and reflection‑based classes), and dynamically load, register, and unload user‑supplied JAR files at runtime through hot‑deployment mechanisms in a Java backend system.
This article demonstrates how to define a simple Calculator interface, implement it via both Spring-managed and reflection-based approaches, and achieve hot deployment by uploading JAR files, dynamically loading classes, registering or deregistering beans in the Spring container, and testing the process.
This article demonstrates how to design a simple Calculator interface, provide two implementation strategies (Spring annotation and reflection), and achieve hot deployment by uploading JAR files, dynamically loading classes, registering or removing beans in the Spring container, and testing the runtime behavior.
The article demonstrates how to build an offline C# reflection tool using libclang and ClangSharp by parsing C++ headers into an AST, traversing it, generating structured data, and applying Liquid templates, while introducing meta‑attributes via C++ annotate macros for fine‑grained code‑generation control.
This article demonstrates how to design a simple Calculator interface, provide both annotation‑based and reflection‑based implementations, and achieve hot deployment by loading user‑supplied JAR files at runtime, including dynamic bean registration and removal in a Spring container.
This article explains the purpose, construction, and key functionalities of Java's sun.misc.Unsafe class, covering memory management, object allocation, class definition, offset handling, array operations, thread scheduling, CAS, and memory fences, while also showing how to obtain an Unsafe instance via reflection.
The article walks through building a lightweight Java ORM framework from scratch, showing JDBC drawbacks, defining XML configuration and mapper files, implementing core components like SqlSessionFactory, SimpleExecutor, and reflection‑based parameter and result mapping, and demonstrating a working test that returns POJOs.
This article introduces Spring's Assert utilities, explains the purpose and usage of various Spring‑provided helper classes such as ObjectUtils, StringUtils, CollectionUtils, FileCopyUtils, ResourceUtils, ReflectionUtils, and AOP utilities, and provides code snippets illustrating their typical methods for validation, conversion, and reflection tasks in Java backend development.
Reporting modeling results—whether to yourself or others—helps you organize thoughts, reflect on the process, improve communication, and gain fresh perspectives that enhance both your modeling thinking and overall expressive abilities.
This article explains Java hidden classes—runtime‑generated, reflection‑only classes—through a clear example that creates a simple class, encodes it, loads it as a hidden class, and invokes its method, demonstrating a powerful dynamic feature for frameworks.
This article walks through creating a lightweight Java logging framework—from motivation and project setup to defining constants, configuration loading, utility classes, annotation processing, asynchronous message handling, and a complete test—showing how to inject values, write logs, and package the solution as a reusable JAR.
This article demonstrates how to simplify and decouple a complex Android RecyclerView adapter by extracting view‑holder logic into a sealed BaseVH class, automatically registering subclasses via Kotlin reflection, and optionally replacing the whole approach with Jetpack Compose.
This article explains why the assumption that java.lang.Object is an instance of java.lang.Class is wrong, how Class actually extends Object, and how the JVM resolves the chicken‑egg problem through a bootstrap process that initializes core types before normal execution.
This article explains how Java annotations can be leveraged not only at runtime via reflection but also during compilation by creating custom annotation processors, illustrating the definition of an annotation, implementing a processor, configuring SPI, and demonstrating error handling with Maven.
This article provides a comprehensive guide to Spring's most useful utility classes—including Assert, ObjectUtils, StringUtils, CollectionUtils, FileCopyUtils, ResourceUtils, ReflectionUtils, and AopUtils—detailing their purpose, key methods, and practical code examples for backend developers.
This article demonstrates how to create a lightweight Spring‑style IoC container in Java by parsing a properties file for XML‑like configuration, implementing annotation‑driven bean registration with a custom @Bean annotation, and adding automatic field injection using a custom @Autowired annotation, complete with full source code examples.
The article shows how to overcome extensibility limits in a Java list‑management system by creating a custom DynamicClassLoader that loads encrypted .class files at runtime, explains Java’s class‑loading stages, fixes a Tomcat deployment issue via proper parent delegation, and demonstrates dynamic invocation of new encryption modules without code changes.
This article explains how Java's compiler creates synthetic bridge methods during type erasure for generic interfaces and overridden methods, demonstrates how to identify them via reflection, and explores various scenarios where bridge methods appear, providing code examples and bytecode analysis.
This article explains how to reduce repetitive business‑level Java code by applying the Template Method and Factory patterns, leveraging custom annotations with reflection, and using bean‑mapping utilities, thereby improving maintainability, extensibility, and overall code quality.
This article provides an in‑depth overview of Java annotations, covering their definition, common applications, built‑in standard annotations, meta‑annotations, functional interfaces, and step‑by‑step instructions for creating and using custom annotations with complete code examples.
This article provides a comprehensive overview of Spring's core utility classes—including Assert, ObjectUtils, StringUtils, CollectionUtils, FileCopyUtils, ResourceUtils, StreamUtils, ReflectionUtils, and AOP helpers—detailing their purpose, key methods, and practical code examples for robust backend development.
This article provides a comprehensive reference of Spring Framework utility classes—including Assert, ObjectUtils, StringUtils, CollectionUtils, FileCopyUtils, ResourceUtils, StreamUtils, ReflectionUtils, and AopUtils—detailing their purpose, typical usage scenarios, and full method signatures for Java backend development.
This article explains what Java annotations are, how they serve as metadata for classes, methods, and fields, outlines their common applications such as documentation generation and compile‑time checks, and details built‑in, meta‑ and custom annotations with code examples.
This article explains why comparing Integer objects with == yields false for large values but true for small values due to Java's internal IntegerCache, demonstrates the caching mechanism with code examples, and shows how reflection can manipulate the cache, highlighting memory optimization considerations.
This article provides a comprehensive overview of Spring Framework’s core utility classes—including Assert, ObjectUtils, StringUtils, CollectionUtils, FileCopyUtils, ResourceUtils, StreamUtils, ReflectionUtils, and AOP helpers—detailing their purpose and key method signatures for developers working on Java backend projects.
This article consolidates frequently used Spring utility classes—such as Assert, ObjectUtils, StringUtils, CollectionUtils, FileCopyUtils, ResourceUtils, ReflectionUtils, and AopUtils—explaining their purpose, typical usage patterns, and providing code snippets to help developers avoid redundant implementations and leverage built‑in Spring functionality.
This article presents a curated collection of Spring Framework utility classes—including assertion helpers, object/array/collection utilities, file and resource IO tools, as well as reflection and AOP utilities—providing ready‑to‑use methods that replace many custom helper functions in Java backend development.
This article presents six Java object‑creation techniques—including direct instantiation, cloning, reflection‑based allocation, dynamic class loading, constructor invocation via reflection, and deserialization—explaining each method with code examples and practical notes for developers.
This article provides a comprehensive guide to Spring's built‑in utility classes—including Assert, ObjectUtils, StringUtils, CollectionUtils, FileCopyUtils, ResourceUtils, StreamUtils, ReflectionUtils, and AOP helpers—explaining their purpose, common methods, and usage examples to replace redundant custom code.
The article explains that Java's Integer caching for values between -128 and 127 causes small integer objects to be shared, making == true for 100, whereas larger integers like 1000 are distinct objects, so == returns false, and it demonstrates this behavior with code and reflection examples.
This article explains what Java annotations are, how to define custom annotations, the built‑in meta‑annotations, annotation attributes, common built‑in annotations, and practical usage scenarios, providing code examples and runtime reflection details for developers.
The article introduces Java generics—showing how they prevent runtime ClassCastExceptions by enforcing compile-time type safety, demonstrating generic class and method definitions, type bounds (including multiple bounds), erasure effects observable via reflection, and the use of wildcards for flexible type constraints.
This article details the background, current status, and engineering architecture of introducing Swift into 58 Group’s real‑estate iOS apps, explains the two main mixed‑compilation approaches (bridging header and module), presents practical module setup, discusses reflection pitfalls, binding solutions, and performance comparisons between Swift and Objective‑C implementations.
Java reflection lets programs inspect and manipulate classes, methods, and fields at runtime, enabling dynamic object creation, method invocation, and flexible framework design; this guide explains its definition, benefits, underlying mechanics, practical usage with code examples, and common scenarios such as JDBC driver loading and Spring IoC.
This article explains Java's reflection mechanism, details how deserialization flaws in libraries like Apache Commons Collections and Fastjson allow attackers to craft malicious objects that trigger arbitrary command execution, and provides practical proof‑of‑concept steps and mitigation recommendations.
This article explains how to bypass Java's private access restrictions using reflection, introduces the core Field and setAccessible APIs, provides a reusable PriUtil wrapper with get/set methods for instance and static members, and demonstrates usage through concrete test classes and scripts.
This article explains the concept of proxy patterns, compares static and dynamic proxies in Java, provides detailed code examples for each, and discusses their advantages, disadvantages, and implementation steps, helping developers choose the appropriate proxy technique for their projects.
This article explains how Java reflection can be used to bypass private access modifiers, demonstrating code examples to access private fields, constructors, and methods, and discusses the advantages and disadvantages of using reflection in backend development.
This article explains how Laravel leverages PHP's modern features—namespaces, Composer‑managed packages, autoloading, reflection, and traits—to enable clean, modular, and extensible backend development with practical code examples.
This article demonstrates how to serialize bank API parameters into a fixed‑length string using Java annotations and reflection, covering the initial naïve implementation, its drawbacks, and a refactored solution that centralizes formatting, signing, and request logic for maintainable backend code.
This article explains how to build a simple PHP IoC container with reflection to automatically resolve constructor and method dependencies, demonstrates its use with example classes A, B, and C, and shows how to invoke methods with injected parameters.
This article explains how to keep UIAutomator 1.0 test cases running on Android 11+ by implementing a server‑side ContentProvider, accessing it via reflection from the UIAutomator or shell process, and demonstrates the complete Java code for provider creation and invocation.
This article explores the various ways to use Spring’s @Autowired annotation—including constructor, setter, field, and collection injection—examines its purpose, and provides a detailed analysis of its implementation in the Spring framework by dissecting the source code and related reflection mechanisms.
This article explains Java's reflection mechanism, discusses its strengths and weaknesses, and demonstrates common scenarios such as JDBC connection setup and Spring framework bean loading with clear code examples, helping developers decide when to apply reflection in backend development.
This article explores the motivation, design, and implementation of using Docs-as-Code with TypeDoc to generate and maintain documentation for TypeScript utility libraries, covering annotation conventions, plugin architecture, code organization, flag handling, event mechanisms, reflection generation, and practical plugin customizations.
This article examines how Nacos leverages Java's reflection mechanism to instantiate its NamingService, explains the fundamentals of reflection, compares alternative approaches, and analyzes the architectural reasons behind choosing reflection in the Nacos client design.
The article explains how compile‑time annotation processors in Android replace costly runtime reflection by generating binding classes during build time, showing step‑by‑step code examples, JavaPoet/KotlinPoet usage, and the performance benefits for cleaner, faster, maintainable apps.
This article explains Java's reflection and polymorphism mechanisms, detailing their theoretical foundations, runtime type identification (RTTI), method table implementation, practical code examples, common use cases, performance and security drawbacks, and the differences between reflection and polymorphism.
This article explains the various ways to use Spring's @Autowired annotation, examines its underlying implementation via reflection, and provides detailed code examples illustrating field, constructor, setter, and collection injection, while also discussing annotation lifecycle and best practices.
This article explains the various ways to use Spring's @Autowired annotation, explores its underlying implementation using reflection, analyzes the core processing classes in the Spring framework, and answers common questions about its lifecycle, bean relationships, and why static injection is discouraged.
This article explains how CGLIB creates proxy classes, decompiles them, sets thread callbacks, and uses MethodInterceptor and FastClass to efficiently intercept and invoke methods in a Java 8 environment, complete with code examples and diagram illustrations.
This guide explains why project post‑mortems are essential for designers, outlines a simple review framework, and shares a step‑by‑step case study of creating sticker designs, offering practical tips and reflections to improve future design work.
This article examines the puzzling condition if(a==1 && a==12) and demonstrates how JavaScript and Java can be coaxed to satisfy it using clever language tricks such as property getters, reflection, and cache manipulation, revealing deeper insights into language internals.
Java annotations, introduced in Java 5, provide a metadata mechanism to associate information with program elements, enabling documentation generation, compile‑time checks, and runtime processing; this guide explains their purpose, underlying principles, meta‑annotations, common built‑in annotations, and demonstrates how to define and use custom annotations with full code examples.
This article explains Java annotations introduced in Java 5, covering their purpose, usage, built‑in meta‑annotations, retention policies, target elements, and provides step‑by‑step examples of defining and applying custom annotations with accompanying code and output.
This article explains how to work around Groovy's invokeMethod limitation of accepting only a single Object argument by using String arrays or var‑args, demonstrates Java and Groovy reflection implementations, and provides complete code examples for multi‑parameter performance test scripts.
The article details a Java reflection issue where invoking a static test method via ExecuteSource caused IllegalAccessException, explains the root cause related to method visibility, and shows how adding the public modifier fixes the problem, enabling successful distributed performance testing.
This article explains Python's advanced class features—including static methods, class methods, property decorators, special dunder methods, reflection utilities, dynamic attribute manipulation, metaclass creation, and exception handling—illustrated with clear code examples and practical usage tips.
This article explains the multiple techniques for creating objects in Java—including the new operator, Class.newInstance, reflection with Constructor, cloning via Cloneable, and deserialization—while illustrating the underlying bytecode instructions and providing concrete code examples for each method.
This article explains Java's reflection mechanism, compares .class and Class.forName, clarifies instanceof and getClass behavior, outlines getDeclaredXXX methods, shows how to invoke methods, constructors, and fields via reflection, and provides practical tips to improve reflection performance and thread safety.
An in‑depth guide covering Java reflection fundamentals, three methods to obtain Class objects, and practical code examples, followed by a comprehensive overview of computer networking layers, protocols, TCP/IP versus OSI models, transport protocols, HTTP/HTTPS differences, status codes, GET/POST, cookies, sessions, tokens, and servlet lifecycle.
This article explains various Java singleton implementations—including eager, lazy, double‑checked locking, static inner class, and enum—demonstrates their thread‑safety issues, shows how reflection and serialization can break them, and presents the enum approach as a truly safe solution.
This article empirically investigates whether Java reflection incurs performance penalties, describing a series of benchmark tests that compare direct method/field access with reflective calls, analyzing results, identifying the main cost factors, and offering practical guidelines to mitigate reflection overhead in production code.
This article presents a series of benchmarks that compare direct method and field access with reflective calls in Java, analyzes where the performance overhead originates, and offers practical guidelines to mitigate reflection‑related slowdown in real‑world applications.
This article explains Java's reflection mechanism, its core classes, practical uses such as accessing private members and dynamic loading, demonstrates code examples, discusses performance, security and compatibility issues, and provides guidance for Android developers.
In this reflective piece, Robin shares three "cold thoughts" on R&D efficiency, using fables from The Little Prince to question whether productivity gains truly improve engineers' work‑life balance, and invites readers to consider small, actionable steps toward better development practices.
This article explores Spring Security’s ResolvableType class, demonstrating how its static factory methods—such as forClass, forClassWithGenerics, forField, and forMethodParameter—simplify obtaining generic type information via reflection, and shows practical code examples that replace cumbersome traditional Java reflection techniques.
This article explains Java's generic type erasure, why it exists, and demonstrates how to use Gson's TypeToken and reflection APIs to obtain actual generic type information at runtime, complete with code examples and a detailed walkthrough of the underlying mechanism.
Faced with network latency and only a Docker container available, this guide compares two practical ways to run Groovy test scripts—packaging the test class into a JAR and invoking its main method, or using a reflection utility to call methods dynamically—complete with code samples, Maven commands, and execution results.
This article demonstrates how to replace repetitive Java backend code for constructing fixed‑length API request strings by defining POJOs, custom annotations, and a reflection‑based utility that formats parameters, pads strings, handles numeric and monetary fields, and appends an MD5 signature, thereby improving maintainability and reducing bugs.
This article explains why Java reflection may invoke the wrong overloaded method, how generic type erasure creates bridge methods that cause duplicate calls, and provides practical fixes such as using getDeclaredMethod, filtering bridge methods, and applying @Override to ensure correct method overriding.
This article explains how MyBatis can instantiate a mapper interface without an implementation class by using a custom JDK dynamic proxy (referred to as "投鞭断流") that intercepts method calls, creates result objects, and demonstrates the full source code and execution output.
This article explains why using fastjson's Feature.OrderedField caused a NoSuchFieldError during unit tests, demonstrates two methods—Maven dependency tree and runtime class location—to pinpoint the conflicting JAR, and shows how switching to Gson resolved the issue.
This article explains five core techniques for instantiating Java objects—including the new keyword, Class.newInstance(), Constructor.newInstance(), clone(), and deserialization—provides code examples for each method, and demonstrates their usage in a complete program with sample output.
This article explains why duplicate code harms maintainability, then demonstrates step‑by‑step refactoring techniques—using factory and template method patterns, custom annotations with reflection, and BeanUtils—to consolidate business logic for different cart types and API calls while preserving extensibility.
This article explains how a custom JDK dynamic proxy can automatically map interface methods to concrete objects, demonstrates the implementation with a User POJO and UserMapper, shows test output, analyzes MyBatis internal proxy classes, and clarifies why mapper methods cannot be overloaded.
This article investigates whether Java reflection impacts performance by running systematic benchmarks that compare direct method calls, reflective method calls, direct field access, and reflective field access across varying iteration counts, presenting detailed results, analysis of the slow paths, and practical guidelines to mitigate any overhead.
This article explains the core ideas of Java reflection, demonstrates how to obtain Class objects, create instances, access fields and methods, and discusses common use cases such as Spring IoC, factory patterns, and JDBC driver loading, while also covering its advantages, drawbacks, and best‑practice tips.
This article explains why the == operator returns true for small Integer values in Java, detailing the internal IntegerCache mechanism, demonstrating the behavior with code examples, and showing how reflection can manipulate the cache, highlighting both the benefits and potential pitfalls of this optimization.
This article explains Java reflection, describing its ability to inspect and modify classes at runtime, the core reflection classes, practical use cases, performance considerations, and provides comprehensive code examples that demonstrate class, method, field, and interface introspection.
This article investigates whether Java reflection impacts performance by conducting systematic benchmarks that compare direct method/field access with reflective calls, analyzing the measured overhead, identifying the costly reflection operations, and offering practical guidelines to mitigate any performance penalties.
This article explains how to employ custom Java annotations together with reflection to mask sensitive fields in logs, define flexible desensitization rules, and dramatically reduce repetitive code when building fixed‑length, signed bank API requests, improving maintainability and extensibility of backend services.
The article explains how Log4j2 can cause thread blocking under heavy exceptions due to class‑loading locks, describes the JVM's reflection optimization mechanism, shows how to verify it with sample code, and outlines ways to disable or tune the optimization using system properties.
This article explains Java's reflection mechanism, showing how classes are represented by Class objects, how to obtain them at runtime, and demonstrates common reflective operations such as inspecting fields, constructors, methods, and arrays with practical code examples and typical interview questions.
This article explains the concepts, implementation mechanisms, performance considerations, and practical code examples of Java static and dynamic proxies, covering both JDK's proxy based on interfaces and CGLIB's subclass‑based proxy, and compares their suitable use cases.
This article explains Java's reflection mechanism, covering how to obtain Class objects, the java.lang.reflect API, practical code examples, common use cases such as dynamic proxies, JDBC driver loading, Spring bean initialization, and discusses the advantages and performance drawbacks of using reflection.