This article explains how to replace repetitive if‑else rule checks in PHP with a generic rule module using the Strategy design pattern and reflection, providing step‑by‑step code examples, architectural diagrams, and a clear path to extend rules without modifying client code.
This article explains why swapping Integer objects using a simple assignment fails in Java, covering formal vs. actual parameters, value versus reference passing, autoboxing mechanics, the Integer cache, and a reflective workaround that avoids the cache to correctly exchange values.
This article explains how to implement a Swift‑centric conversion framework that maps Realm.Object instances to plain business models and vice versa by defining protocols, leveraging Mirror for reflection, handling basic and complex types, and providing generic solutions for collections and optionals.
This article compares three common Java techniques—using the class literal, Class.forName, and an object's getClass method—to obtain a Class object, demonstrating their distinct effects on class loading, static initialization, and instance creation through detailed code examples and test results.
This article provides a comprehensive guide to Java's reflection mechanism, covering its definition, core capabilities, practical code examples, common API usage, and considerations such as performance and security, enabling developers to understand and apply reflection effectively in real-world projects.
To prevent translation errors and post‑release crashes in multilingual Android apps, the article describes a dynamic resource‑replacement system that loads external language packs via AssetManager, proxies Resources through reflection, integrates the proxy with ResourcesManager, and updates WebView assets, eliminating garbled text and long‑press crashes.
This article explains how to launch an Android 10 APK by reflecting the shellCommand method of ActivityManager, detailing the changes from startActivityAndWait, the required reflection steps, implementation code, and demonstration results on Android devices.
This tutorial walks through the principles of Android hotfixing, explains class loaders, and provides a complete hands‑on implementation—including a buggy class, a custom Dex loader, patch creation, and runtime injection—so developers can quickly patch bugs without releasing a full app update.
This article explains the internal workings of Java reflection, from obtaining Method objects via getMethod and getDeclaredMethod to the invoke process, and details why reflection incurs significant performance overhead due to argument boxing, visibility checks, parameter validation, lack of inlining, and JIT optimization limits.
The author, a former technical director, recounts a three‑month period managing a 20‑person R&D team across four legacy projects, analyzes four critical management mistakes—including over‑estimating team skill, under‑estimating project difficulty, spreading resources too thin, and neglecting dedicated management—and shares concrete reflections and actionable lessons for future leaders.
The article presents a bytecode‑generation technique that creates dynamic wrapper classes to invoke arbitrary Java methods with near‑native speed, avoiding reflection’s overhead, and details the CallerWrap base, generator, and thread‑safe cache implementation that together enable high‑performance middleware calls.
This article explains what Java annotations are, why they were introduced, how they work, how to create and use custom annotations with reflection, and demonstrates their practical applications in popular frameworks and Oracle ADF.
This article explains how to build a Java wrapper that loads and runs Groovy test scripts at runtime, covering classloader nuances, reflection-like execution, file discovery, method filtering, and provides a complete code example for a custom test framework.
This article explains the purpose and advantages of Java annotations, categorizes built‑in, third‑party and custom annotations, describes meta‑annotations, demonstrates how to define and apply custom annotations, and shows how to parse them at runtime using reflection, complete with code examples.
This article presents a Java reflection‑based utility that automatically discovers all classes in a specified package and executes each of their non‑main methods, enabling comprehensive API test execution without manually invoking each test case.
The article presents a Java HttpClient testing framework that leverages reflection to dynamically invoke API methods, detailing optimized functions for running all test cases of an interface, single test cases, and the core execution logic that interacts with a MySQL database and records results.
This article examines various Java singleton implementations—eager, lazy, double‑checked locking, static inner class, enum, and Kotlin object—analyzing their thread safety, reflection and serialization vulnerabilities, and shows how to harden them using volatile, constructor guards, and readResolve.
This article explains Java reflection fundamentals, including Class object usage, dynamic class loading, method and field introspection, generic type handling, and detailed class loader mechanisms, providing code examples and practical insights for backend developers.
This article explains how to replace Java's default DNS resolver with a custom NameService, disable DNS caching, and manipulate DNS entries at runtime using reflection, enabling flexible, environment‑agnostic automated test cases without hard‑coding IP addresses.
Go’s reflection, accessed via the reflect package’s TypeOf and ValueOf functions, lets programs inspect and modify runtime types and values—including fields, tags, and slices—while obeying settable rules, enabling generic utilities such as JSON serialization, deep equality checks, and dynamic ORM-like behavior.
This article explains how to extract generic type information in Spring, first by manually parsing class hierarchies with reflection and then using Spring 4's ResolvableType utility, providing code examples and API references for fields, methods, constructors, and instances.
This article explains Java reflection, serialization, dynamic proxy mechanisms, and object cloning techniques, including code examples and the differences between deep and shallow copies, providing a comprehensive overview of these core Java concepts.
This guide explains Java's annotation feature, covering its definition, common uses, meta‑annotations, retention policies, target elements, and provides a complete example that demonstrates custom annotations for field initialization and validation using reflection.
This article explores the limitations of Java generics, demonstrates how to remove repetitive TypeReference declarations by capturing generic type information via reflection, adds runtime validation for illegal generic types, and presents a comprehensive solution that handles Class, ParameterizedType, GenericArrayType, TypeVariable, and WildcardType.
This article introduces Java annotations, explains their three main purposes—documentation, compile‑time checks, and runtime code analysis—demonstrates how to define and use custom annotations, and walks through a handcrafted ButterKnife‑like example that binds UI elements via reflection.
This article breaks down eight core Java interview questions, offering deep analysis of platform fundamentals, exception handling, reflection, I/O, concurrency, and object‑oriented design to help candidates demonstrate solid understanding beyond superficial answers.
This article explains Java annotations—what they are, how they work, their common uses such as documentation generation and compile‑time checks, the four built‑in meta‑annotations, standard annotations like @Override, and how to create and apply custom annotations with a complete code example.
The article investigates a high‑traffic Java backend issue caused by synchronized reflection calls, analyzes thread‑blocking stack traces, demonstrates the problematic code, and presents a compile‑time PropertyDescriptor optimization that eliminates runtime locking, resulting in significant latency improvements and a deeper understanding of JVM lock mechanisms.
This tutorial explains how JavaScript ES6 Proxies work, demonstrates creating a Proxy with get, set, and deleteProperty traps, and walks through rebuilding the on‑change library to monitor object and array mutations, including handling deep nesting and common pitfalls.
This article analyzes the restriction mechanism of hidden APIs in Android P Preview 1 and presents three verified techniques—direct module provisioning, class‑loader manipulation, and access‑flag tampering—that allow developers to invoke system hidden APIs without triggering runtime warnings.
This article analyzes Android P's hidden API restrictions, explains the underlying distinction mechanisms, and presents three practical techniques—direct calls with a provided module, classloader manipulation via reflection, and access flag tampering—to reliably invoke hidden system APIs on Android devices.
The article explains how Android P disables hidden (non‑official) APIs, describes the reasons behind the restriction, outlines the grey‑list classification, provides verification steps and code examples for testing, and warns developers of the potential consequences for apps that rely on these APIs.
Protocol Buffers, Google’s cross‑platform serialization format, dramatically reduces payload size and speeds up transmission compared to JSON or XML by using compact binary encoding, Varint and ZigZag techniques, and offers powerful reflection mechanisms illustrated with Objective‑C examples and detailed code snippets.
This article explains how Android P disables the use of hidden (non‑SDK) APIs, describes the official restrictions and grey‑list classifications, provides verification steps and download links, and demonstrates a practical reflection test on the WifiManager hidden field, highlighting the impact on developers.
This article explains Java's reflection mechanism, describing how Class objects represent runtime types, how to obtain them, and demonstrating common reflective operations such as inspecting methods, accessing fields, invoking constructors, handling arrays, and solving typical exercises with complete code examples.
This article explains Java's reflection mechanism, outlines its capabilities such as runtime class inspection, object instantiation, method invocation, and dynamic proxy creation, and provides numerous code examples demonstrating how to retrieve class information, manipulate fields, invoke methods, and apply reflection in patterns like factories.
Explore multiple Java singleton implementations—including a thread‑safe double‑checked locking version, a static inner‑class approach, an enum‑based solution, and a reflection‑based attack—while learning their key technical details, advantages, pitfalls, and how to protect against serialization and reflection vulnerabilities.
This article explains the concept of immutable objects in Java, using String as a case study, clarifies the difference between object references and objects, examines String’s internal fields across JDK versions, demonstrates how typical mutating methods actually create new instances, and shows how reflection can bypass immutability.
This article dissects a Java interview question about swapping two Integer variables, explaining Java's pass‑by‑value semantics, the difference between handle‑based and direct pointer object access, Integer immutability, autoboxing, the IntegerCache mechanism, and how reflection can (or cannot) modify private final fields.
This article introduces Java generics, covering generic classes and methods, wildcard usage with the PECS principle, bounded type parameters, and the implications of type erasure, illustrating each concept with code examples and discussing common pitfalls such as generic arrays, bridge methods, and runtime type checks.
This article explains five Java object‑creation techniques—using the new keyword, Class.newInstance, Constructor.newInstance, clone, and deserialization—shows their bytecode differences, provides a complete Employee example, and demonstrates each method with runnable code and output.
This article explains the concept of the Proxy design pattern, demonstrates how to implement static and dynamic proxies in Java with complete source code, and analyzes the advantages, limitations, and internal workings of Java's runtime-generated proxy classes.
The open‑source Robust hot‑update system now includes an automated patch‑generation tool that scans original methods, rewrites field and method accesses to reflective calls, and creates hook classes to overcome ProGuard’s obfuscation, optimization, and inner‑class challenges, cutting patch creation time from a day to minutes.
This article explains the Java reflection Type interface, its subinterfaces ParameterizedType, TypeVariable, GenericArrayType, and WildcardType, their methods and usage, and why generic‑related types are represented separately from Class.
This article explains the origin, purpose, and usage of the java.lang.reflect.Type interface and its subinterfaces—including ParameterizedType, TypeVariable, GenericArrayType, and WildcardType—detailing their methods, relationships with Class, and role in Java generics and reflection.
The article explains how a framework acts as a semi‑finished product that relies on abstract classes, the Open‑Closed principle, reflection, XML or annotation configuration, and conventions to let developers extend functionality while keeping the core immutable.
This article explains the concept of an EventBus as an observer‑pattern based communication mechanism for Android components, illustrates it with a newspaper subscription analogy, and provides step‑by‑step Java implementation details—including registration, unregistration, and posting of events using reflection—plus integration tips within an Activity lifecycle.
This guide explains how to create and use Android plugins in Unity, detailing wrapper placement, bidirectional calls between Unity’s Mono/IL2CPP and Android’s Dalvik/ART, reflection‑based interface design, Gradle‑MSBuild hybrid project setup, ADB remote debugging, and support for AAR files and manifest configuration.
This article explores several under‑used yet useful Google Guava utilities—including unsigned primitive types, 128‑bit MurmurHash, InternetDomainName parsing, class‑path reflection, and CharMatcher string handling—providing code examples and explanations of how they can improve Java development efficiency.