This repository provides TransmittableThreadLocal (TTL), a Java library that extends InheritableThreadLocal to propagate thread-local values across threads even when using thread pools, executors, ForkJoinPool, and other asynchronous constructs. It solves the common problem of context loss (e.g., tracing, security, session) in asynchronous Java applications. The library offers three usage modes: manual wrapping of Runnable/Callable via TtlRunnable/TtlCallable, wrapping executors via TtlExecutors, and transparent bytecode transformation via a Java Agent (TtlAgent) that automatically instruments JDK thread pool classes. The architecture is modular: ttl-core contains the core API and CRR (Capture-Replay-Restore) pattern, ttl-agent provides the agent with Javassist-based transformlets, ttl-kotlin adds Kotlin extensions, and ttl-integrations includes Vert.x 3/4 support. A ttl2-compatible module maintains backward compatibility with the v2 API. The library is widely adopted in the Java ecosystem (e.g., Apache ShardingSphere, SOFARPC) and is under active development with a v3 branch introducing a refined API. While primarily a library, it includes a Java Agent component that operates at the JVM level, making it a hybrid of library and instrumentation tool.
Querydsl is a type-safe query DSL framework for Java and Scala, with compile-time code generation via annotation processing. It provides a fluent, strongly-typed API for constructing queries across multiple backends: JPA/Hibernate, SQL (with many dialects), JDO, MongoDB, Lucene, in-memory collections, and spatial data. The library uses a core expression tree (Expression, Path, Operation) and visitors for serialization to backend-specific languages (JPQL, SQL, MongoDB query, Lucene query). Code generation produces static Q-types from annotated domain classes, enabling IDE-friendly autocompletion and refactoring safety. The architecture is modular: querydsl-core provides the DSL foundation, querydsl-apt handles APT, querydsl-codegen offers generic code generation utilities, and backend-specific modules (e.g., querydsl-jpa, querydsl-sql) supply serializers and templates. Despite its breadth, the core design is clean and extensible, with well-defined interfaces for operators, templates, and visitors. Some modules (e.g., Lucene 3/4, Morphia) show lower activity and dual spatial library support (JTS old/new) indicates ongoing migration. Overall, Querydsl is a mature, highly-crafted library that significantly simplifies database querying in type-safe Java applications.
Java-Thread-Affinity is a low-level Java library for pinning threads to specific CPU cores and querying CPU/thread identity. The main artifact exposes Affinity as a static facade, AffinityLock for CPU/core reservation with strategy-based allocation, AffinityThreadFactory for executor-aware binding, CpuLayout/VanillaCpuLayout for topology detection, LockCheck/FileLockBasedLockChecker for inter-process CPU reservation coordination, and a Ticker abstraction for high-resolution timing. On Linux it uses JNA sched_* calls via LinuxJNAAffinity/LinuxHelper or an optional JNI libCEInternals; Windows uses kernel32; macOS/Solaris provide only process/thread IDs; unsupported platforms degrade to NullAffinity. AffinityLock builds its topology from /proc/cpuinfo or a properties file, computes reservable CPUs from the process base affinity and the affinity.reserved mask, and coordinates reservations across JVMs via cpu-N.lock files in java.io.tmpdir. The architecture is a Maven multi-module OSGi-style bundle: the affinity core plus affinity-test for Pax Exam OSGi checks. There is no server or CLI product; the entry points are public APIs plus demonstration mains such as AffinityLockMain, AffinityThreadFactoryMain, and MicroJitterSampler. The design is layered cleanly: per-OS IAffinity implementations, LockInventory for lock allocation logic, a lockchecker package for multi-process file locking, and a ticker package for rdtsc/System.nanoTime timing. The library deliberately targets Java 8 bytecode and is maintained on a 2026.x release train. The strongest code is the robust file-lock implementation, CPU topology parser, and Linux native FFI helpers. The code handles hyper-threaded core reservation, lock-file deletion races, interrupted lock acquisition, and graceful fallback when JNA or the native library is unavailable. Drift is visible in ignored or disabled tests around OSGi/JUnit 5, PosixJNAAffinity, NativeAffinity, and JNIClock; the README and requirements still claim JNA 4.4 while the code enforces JNA 5+; and a few deprecated Java APIs such as finalize and reflective setAccessible remain.
iban4j is a Java library for generating, validating, and parsing International Bank Account Numbers (IBAN) and Business Identifier Codes (BIC). It also supports EPC QR code payload generation for SEPA credit transfers. The library is a single JAR with no runtime dependencies, providing a builder pattern for IBAN construction, static utility methods for validation, and an immutable value object model. It includes comprehensive support for country-specific BBAN structures and optional national check digit validation via a pluggable algorithm registry. The codebase is well-structured with clear separation of concerns, extensive unit tests, and adherence to ISO standards.
Joda-Time is a mature, comprehensive Java library for date and time manipulation, offering a rich set of immutable and thread-safe classes for instants, partials, intervals, periods, durations, and time zones. It supports multiple calendar systems (ISO, Gregorian, Julian, Buddhist, Coptic, Ethiopic, Islamic, GJ) and provides extensive formatting and parsing facilities, including ISO 8601 and locale-aware period formatting. The library is designed for production use, with a clean interface hierarchy (Readable* and ReadWritable*), a pluggable chronology architecture, a converter pattern for flexible object construction, and a field system that allows modular arithmetic. Despite being 'largely finished' since Java 8's java.time (JSR-310), Joda-Time remains a high-craftsmanship codebase demonstrating immutable value objects, abstract base classes, builder patterns, and internationalization support. Its design influenced java.time, and many components (e.g., the converter set, chronology assembly, type-safe period classes) are reusable patterns for any domain with complex temporal logic.
DynamicTp is a Java library for dynamic thread pool management, primarily targeting Spring Boot applications. It allows runtime modification of thread pool parameters (core size, max size, queue capacity, etc.) via configuration centers like Nacos, Apollo, Zookeeper, Consul, Etcd, and Polaris. The library provides a rich set of executor variants (eager, ordered, priority, scheduled) and integrates with over a dozen middleware frameworks (Dubbo, gRPC, RocketMQ, RabbitMQ, Tomcat, Jetty, Undertow, Hystrix, Motan, OkHttp3, Thrift, SofaRPC, Tars, LiteFlow, brpc) by wrapping their native thread pools. It includes comprehensive monitoring and alerting: metrics collection via Micrometer, JMX, and logging; notification channels for DingTalk, WeChat, Lark, email, and custom notifiers; and alarm thresholds for capacity, liveness, rejections, and timeouts. The architecture is modular: a core module defines executors, registries, and lifecycle management; a common module provides utilities, parsers, queues, and SPI extension points; adapter modules wrap middleware executors; starter modules provide Spring Boot auto-configuration; and extension modules add optional features like Redis rate limiting and OpenTelemetry tracing. Key entry points are the @EnableDynamicTp annotation, DtpRegistry for executor registration, and ThreadPoolBuilder for programmatic pool creation. External dependencies include Spring Boot, Guava EventBus, ByteBuddy (for interception), Micrometer, and various config-center client libraries.
GeoTools is an open-source Java GIS library that provides a comprehensive toolkit for geospatial data manipulation, analysis, and visualization. It implements a wide range of OGC (Open Geospatial Consortium) standards including WFS, WMS, WCS, WPS, GML, SLD, Filter Encoding, and CQL/ECQL/CQL2. The library is modular, with a core API layer defining interfaces for features, geometry, styles, filters, and coordinate reference systems, and a plugin architecture for data access (JDBC databases, shapefiles, GeoPackage, Elasticsearch, etc.), XML parsing/encoding (GML, SLD, WFS, etc.), and extensions (app-schema, brewer styling, graph algorithms, DGGS). It is used as a foundational component in server-side applications like GeoServer and desktop GIS tools like uDig. Key entry points include the DataStore API for reading/writing geospatial data, the Filter API for spatial and attribute queries, the Style API for cartographic rendering, and the Process API for geoprocessing operations. External dependencies include JTS (geometry library), PROJ (coordinate transformations), various JDBC drivers, and EMF models for OGC schemas.
PipelinR is a lightweight Java library implementing the mediator/pipeline pattern for command processing. It provides a type-safe way to send commands to handlers through a configurable pipeline of middleware, supporting cross-cutting concerns like logging, validation, and transactions. The library also implements notification (event publishing) with multiple handling strategies including synchronous, asynchronous, and parallel execution modes. With zero dependencies and a focus on simplicity, it aims to help developers follow SOLID principles by replacing monolithic service classes with focused handlers.
ZXing ("Zebra Crossing") is a mature, multi-format barcode scanning and generation library for Java, first released in 2007. The core library provides readers and writers for QR Code, Aztec, Data Matrix, PDF417, MaxiCode, and all common 1D barcodes (EAN/UPC, Code 128, Code 39, Codabar, ITF, RSS). It implements the full decoding pipeline: image luminance extraction (via `LuminanceSource` subclasses), binarization (`HybridBinarizer`, `GlobalHistogramBinarizer`), pattern detection (finder patterns, alignment patterns, white rectangles), perspective-corrected grid sampling, and error correction using Reed-Solomon codes. The codebase is organized as a multi-module Maven project: `core` (pure Java library), `javase` (command-line tools and `MatrixToImageWriter`), `android` (fully functional barcode scanner app), `android-integration` (helper library for embedding scanning in third-party Android apps), `zxingorg` (Jakarta EE web servlet for decoding), and `zxing.appspot.com` (GWT-based web generator). The Android app is no longer maintained and does not work with Android 14+. The project is in "maintenance mode" — only bug fixes are accepted via pull requests, and no new features or updates are planned. Despite this, the core library remains a de facto standard for barcode processing in Java ecosystems, widely used and ported to many other languages. The code exhibits high craftsmanship with clean abstractions (e.g., `Reader`/`Writer` interfaces, `Binarizer` strategy pattern, `ResultParser` hierarchy) and is extensively tested with thousands of black-box test images.
JavaCV is a Java wrapper library for computer vision and multimedia processing, providing bindings to OpenCV, FFmpeg, and other native libraries via JavaCPP Presets. It offers a unified abstraction layer for video capture (FrameGrabber), recording (FrameRecorder), filtering (FrameFilter), and frame conversion (FrameConverter), with concrete implementations for file, stream, camera, and depth sensor sources. The library also includes advanced computer vision capabilities such as geometric and color calibration, image alignment (Gauss-Newton), projective transformations, blob analysis, marker detection for augmented reality, and OpenCL-accelerated image processing. It is primarily a library (not a standalone application), with sample programs demonstrating real-time video streaming, face detection, object tracking, and projector-camera systems. The codebase is large and well-structured, with abstract base classes and reusable patterns, but shows signs of technical drift due to reliance on deprecated OpenCV APIs (IplImage) and legacy native SDKs. Maintenance is active, with frequent updates to keep pace with upstream library versions.
NewPipe Extractor is a Java library that extracts metadata and media streams from multiple streaming services, including YouTube, SoundCloud, Bandcamp, PeerTube, and media.ccc.de. It is the core extraction component of the NewPipe Android app, designed to work without official APIs by reverse-engineering web interfaces and internal APIs. The library provides a unified abstraction layer with extractors for streams, channels, playlists, comments, search results, and trending content, all accessed through a service registry and link handler factories that convert URLs into internal IDs. The architecture follows a template method pattern: base extractor classes (StreamExtractor, ChannelExtractor, etc.) define the extraction lifecycle (fetchPage, onFetchPage, getInitialPage, getPage), while service-specific subclasses implement the parsing logic for each platform's response format (JSON, protobuf, HTML). Data flows from HTTP requests through a pluggable Downloader interface, into JSON/HTML parsers, and into typed data models (StreamInfo, ChannelInfo, PlaylistInfo, etc.) with error-tolerant collectors that accumulate extraction errors per field. Pagination is handled uniformly via a Page class that can carry URLs, IDs, or continuation tokens. Key entry points include the NewPipe.init() method for library initialization, ServiceList for accessing service instances, and static getInfo() methods on Info subclasses (e.g., StreamInfo.getInfo(url)). External dependencies are minimal: nanojson for JSON parsing, Jsoup for HTML parsing, and protobuf for YouTube binary data. The library also includes a JavaScript lexer for deobfuscating YouTube streaming URLs, a rate limiter for polite scraping, and a DASH manifest generator for adaptive streaming.
This is a comprehensive Java library for numerical computing, linear algebra, optimization, machine learning, and quantitative finance. The codebase is pure Java with optional native BLAS/LAPACK acceleration via Java 22+ Foreign Function & Memory API. It provides high-performance dense/sparse matrix storage and decompositions (LU, QR, SVD, Eigenvalue, Cholesky), a full-featured optimization suite (LP, QP, MIP with branch-and-bound and cut generation), artificial neural networks (feedforward, backpropagation), clustering (KMeans, spectral), time series analysis, statistical distributions, and financial portfolio modeling (Markowiz, Black-Litterman). The architecture is modular with clean interfaces (Access1D, Mutate2D, FunctionSet) and factory/build patterns. The library is well-tested and actively maintained (0 open issues, recent commits), though some parts show technical drift due to deprecated APIs and reliance on evolving JDK foreign-memory features. Overall, ojAlgo is a strong, production-ready numerical toolkit for Java applications requiring mathematical optimization and linear algebra, with several reusable infrastructure components.
OptaPlanner is a Java library for constraint satisfaction optimization, solving planning and scheduling problems such as employee rostering, vehicle routing, and cloud resource allocation. The architecture is modular: a core engine provides heuristic search algorithms (construction heuristics, local search, exhaustive search) and incremental score calculation via two constraint stream implementations (Bavet, a custom tuple-based engine, and Drools, a rule-based engine). The public API centers on annotations (@PlanningSolution, @PlanningEntity, @PlanningVariable) and interfaces (ConstraintProvider, SolverFactory, SolverManager). Key entry points include SolverFactory.create() to build a solver, Solver.solve() to run optimization, and ConstraintVerifier for testing constraints. Data flows involve defining a domain model with planning entities and variables, providing constraints as a ConstraintProvider, and the solver iterating through moves while evaluating scores incrementally. External dependencies include Drools (optional), Quarkus or Spring Boot for integration, Jackson/JAXB for serialization, and JPA for persistence. The repository also includes a benchmarking module, a Kubernetes operator, and extensive example applications.
This repository is a Java library for industrial communication protocols, providing implementations for Siemens S7 PLC, Modbus, Mitsubishi Melsec, RTSP/RTP/RTCP media streaming, and MP4 file format handling. The library features a modular architecture with clear separation by protocol, annotation-based serialization frameworks, and low-level utilities for binary data handling. It serves as an SDK for developers to integrate industrial device communication and media streaming capabilities into their applications. The code demonstrates consistent use of design patterns (builder, template method, annotation-based processing) and includes comprehensive test suites showing usage patterns.
Dekorate is a Java annotation-processing framework that generates Kubernetes, OpenShift, Knative, and other container orchestration manifests at compile time. It is primarily a library consumed by Java applications, especially those built with Spring Boot, Quarkus, Thorntail, or plain Java. The architecture centers around a `Session` that coordinates `ConfigurationGenerator`s, `ManifestGenerator`s, and a graph of `Decorator`s to produce deployment descriptors. It supports multiple platforms via separate annotation modules (e.g., kubernetes-annotations, openshift-annotations, knative-annotations) and integrates with build tools like Docker, Jib, S2I, and Tekton for CI/CD pipelines. The codebase is well-structured with clean abstractions (Decorator, Configurator, SPI factories) and extensive testing, though it suffers from a high module count and some outdated dependencies (e.g., Java 1.8 baseline, old Spring Boot versions in examples). Overall, it is a mature and capable tool for generating Kubernetes manifests from Java annotations.
This is the HAPI FHIR core library, a multi-module Java implementation of the HL7 FHIR standard. It provides FHIR object models for versions DSTU2, DSTU3, R4, R4B, R5, and an experimental R6, along with cross-version conversion, validation, terminology services, code generation, CLI tooling, and HTTP service endpoints. The architecture is a monolithic Maven project with modules for each FHIR version, a shared convertors module with pairwise converters, a validation engine with picocli-based CLI, and a services layer for rendering and terminology. Key entry points include VersionConvertorFactory for conversion, ValidationEngine for validation, and CLI commands for the validator. The codebase is actively maintained with CI/CD, security scanning, and regular releases to Maven Central. However, it suffers from significant duplication across version modules, some deprecated interfaces, and generated code that may drift from upstream specifications. The project demonstrates strong engineering practices with reusable security utilities (SSRF protection, zip-slip prevention), generic data structure utilities (MergedList, BaseList), and a well-structured conversion pattern using advisors and contexts.
Flyway is a database migration tool that applies version-controlled SQL scripts to manage schema changes across 50+ database engines (relational and NoSQL). It operates as a Java library, CLI, Maven/Gradle plugin, and Docker image. The core architecture centers on a plugin system where `DatabaseType`, `VerbExtension`, `ConfigurationExtension`, and `Callback` implementations are discovered via Java ServiceLoader. The migration lifecycle is orchestrated by `FlywayExectutor`: it resolves migration scripts (SQL or Java), validates them against a schema history table, applies pending migrations in transaction-aware batches, and registers the result. Telemetry and license enforcement are woven into execution. The codebase is large but well-organised into modules: `flyway-core` for the engine, `flyway-commandline` for the CLI, `flyway-database-*` for per-database parsers and connections, `flyway-nc` for a dual native-connector path, and `flyway-reports` for output generation. External dependencies include JDBC drivers, AWS SDK (S3), and third-party helpers like SQLFluff (via Docker). Key entry points are the `Flyway` API class, the `Main` CLI class, and the `VerbExtension` implementations.
This repository provides the `org.json` package, a widely-used reference implementation for JSON processing in Java. It is a pure library with zero external runtime dependencies, designed for parsing JSON strings into Java objects (`JSONObject`, `JSONArray`, Maps, Lists, and POJOs) and serializing Java objects back into JSON. Beyond core JSON, it offers robust converters for XML, CDL (Comma Delimited Lists), HTTP headers, and Cookies. The library features configurable parsing strictness (RFC compliance vs. lenient), protection against deep nesting and numeric overflow attacks (CVE-2026-59171), and support for Java generics and bean serialization via annotations. It is released into the public domain and is under active maintenance, supporting a wide range of Java versions. While the codebase shows some signs of its long history (code duplication in XML/JSONObject, monolithic core classes), its core abstractions are clean, well-tested, and highly reusable. Key reusable patterns include the immutable configuration objects (`JSONParserConfiguration`, `XMLParserConfiguration`), the `JSONString` interface for custom serialization, and the optimized `StringBuilderWriter`.
Apache Commons Codec is a mature Java library providing a comprehensive set of encoders and decoders for binary-to-text formats (Base16, Base32, Base64, Base45, Base58, Hex), digest and hash algorithms (MD5, SHA-1/2/3, MurmurHash, XXHash32, Blake3, CRC16/32), phonetic encoding (Soundex, Metaphone, Caverphone, Beider-Morse, Daitch-Mokotoff), and network codecs (URL encoding, Quoted-Printable, RFC 1522 MIME). The architecture is modular with clear package separation: `binary`, `digest`, `language`, `net`, and `cli`. Key design patterns include a builder pattern for configuring codecs (e.g., `Base64.builder()`), an abstract base class `BaseNCodec` with streaming support via `BaseNCodecInputStream`/`OutputStream`, and a `CodecPolicy` enum for strict vs. lenient decoding. The library has no production dependencies; only test dependencies on commons-lang3 and commons-io. It is widely used across the Java ecosystem, with extensive test coverage including RFC vectors and backward compatibility tests. However, some deprecated methods and known bugs (e.g., in MurmurHash3 legacy methods) are preserved for compatibility, and certain algorithms (SHAKE) require Java 25, introducing version drift.
Flamingock is a Java library for applying versioned, auditable 'change-as-code' migrations to databases and external systems, evolved from Mongock. At runtime it discovers annotated @Change classes or YAML change templates, orders them into pipeline stages, acquires a distributed lock, executes each change with optional transaction/rollback semantics, and records an audit trail. It supports Mongo DB (sync/reactive/Spring Data), SQL dialects, DynamoDB, and Couchbase, and ships both a community edition (local audit stores) and a cloud edition (HTTP client for a SaaS backend). The project also provides Spring Boot auto-configuration, a Gradle plugin, an annotation processor, a CLI runner, GraalVM native-image support, and legacy Mongock importers. Architecturally this is a multi-module Gradle build with a clean separation between core execution, audit-persistence abstractions, target-system adapters, and platform integrations. The code is heavily tested, including Testcontainers-based end-to-end tests across database backends, conformance suites for audit compaction, and wire-contract tests for the cloud API. However, the breadth of supported backends leads to notable duplication across MongoDB sync/reactive, DynamoDB, Couchbase, and SQL modules, and a few documented deficiencies are accepted as known test behavior rather than fixed. Overall it is a production-grade, actively maintained framework with strong engineering discipline and a few genuinely reusable patterns embedded among its internal abstractions.