Skip to content

Linkage Check Steps

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

1. Get Class Path

From list of Maven artifacts or a BOM, ClassPathBuilder generates a class path, List<ClassPathEntry>. Alternatively you can provide JAR files without Maven artifacts.

ClassPathEntry:
  Path jar
  Artifact artifact (null if it's non-artifact JAR)

2. Get References

Given List<ClassPathEntry>, LinkageChecker builds SymbolReferenceMaps by reading class files in them:

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 many-to-many relationship between ClassFiles and SymbolProblems.

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