Skip to content

Linkage Check Steps

Tomo Suzuki edited this page Apr 7, 2020 · 6 revisions

1. Get Class Path

A class path is List<ClassPathEntry>.

ClassPathEntry:
  Path jar
  Artifact artifact (optional)

2. Get References

Given List<ClassPathEntry>, LinkageChecker builds SymbolReferenceMaps:

SymbolReferenceMaps:
  Multimap<ClassFile, ClassSymbol>  classToClassSymbols;
  Multimap<ClassFile, MethodSymbol> classToMethodSymbols;
  Multimap<ClassFile, FieldSymbol>  classToFieldSymbols;

Each map entry represents a reference from one Java class file to a symbol.

3. Validate the References

Linkage Checker validates the references to get Linkage Errors. Multimap<SymbolProblem, ClassFile> represents the errors. It's a many-to-many relationship between ClassFiles and Symbols.

SymbolProblem:
  Symbol  symbol  (ClassSymbol, MethodSymbol, or FieldSymbol)
  ClassFile containingClass  (nullable)
  ErrorType errorType
ClassFile:
  ClassPathEntry classPathEntry
  String binaryName

Clone this wiki locally