Skip to content

Latest commit

 

History

History
57 lines (47 loc) · 2.72 KB

File metadata and controls

57 lines (47 loc) · 2.72 KB

Java design research

Product framing

Java already has the mature original ArchUnit. ArchUnitJava is an independent Java member of the ArchUnitEverything family, not a claim that Java lacks an architecture-testing library. The design aims for broad conceptual coverage and strong engineering contracts without copying or claiming API compatibility.

What is genuinely Java-specific

The Java compiler records dependencies across multiple class-file structures, not in one import list. Correct extraction must cover descriptors, generic Signature attributes, annotations (including invisible, parameter, and type-use annotations), inheritance, exceptions, bytecode instructions, bootstrap methods, method handles, dynamic constants, and invokedynamic.

The model must also preserve Java constructs with dedicated class-file attributes: modules, nests, records, and permitted subclasses. Compiler-created bridge and synthetic methods cannot simply be discarded because they can carry real call evidence, but they should be distinguishable in selectors and reports.

Classpath and packaging are product semantics. Directories, ordinary JARs, modular JARs, automatic modules, duplicate classes, missing dependencies, and multi-release JAR version selection all affect the graph. The importer must model precedence deterministically without loading classes or running Maven or Gradle builds.

Deliberate scope choices

  • Analyze compiled artifacts first; source parsing and compiler-equivalent resolution are not initial goals.
  • Do not infer arbitrary reflective targets from strings.
  • Do not execute builds to discover outputs; accept explicit inputs and inspect build metadata conservatively.
  • Keep bytecode extraction independent from the public rule grammar.
  • Treat JPMS readability/exports/opens as distinct from observed bytecode dependencies.
  • Make incomplete debug information explicit rather than manufacturing line numbers or source paths.

Primary references