@Test public void isSubTypeOf_with_cycle() { ClassSymbolIndex symbols = createSymbols( data("a", "b"), data("b", "a")); ClassSymbol a = symbols.get(fqn("a")); assertThat(a.isSubTypeOf(fqn("a"))).isEqualTo(Trilean.TRUE); assertThat(a.isSubTypeOf(fqn("b"))).isEqualTo(Trilean.TRUE); assertThat(a.isSubTypeOf(fqn("c"))).isEqualTo(Trilean.FALSE); }
public ClassSymbol get(QualifiedName qualifiedName) { return symbolsByQualifiedName.computeIfAbsent(qualifiedName, qn -> projectSymbolData.classSymbolData(qn) .<ClassSymbol>map(ClassSymbolImpl::new) .orElse(new UnknownClassSymbol(qualifiedName))); }
ClassSymbolIndex { public ClassSymbol get(QualifiedName qualifiedName) { return symbolsByQualifiedName.computeIfAbsent(qualifiedName, qn -> projectSymbolData.classSymbolData(qn) .<ClassSymbol>map(ClassSymbolImpl::new) .orElse(new UnknownClassSymbol(qualifiedName))); } }
ClassSymbolIndex { public ClassSymbol get(QualifiedName qualifiedName) { return symbolsByQualifiedName.computeIfAbsent(qualifiedName, qn -> projectSymbolData.classSymbolData(qn) .<ClassSymbol>map(ClassSymbolImpl::new) .orElse(new UnknownClassSymbol(qualifiedName))); } private  ClassSymbolIndex(ProjectSymbolData projectSymbolData); }
ClassSymbolIndex { public ClassSymbol get(QualifiedName qualifiedName) { return symbolsByQualifiedName.computeIfAbsent(qualifiedName, qn -> projectSymbolData.classSymbolData(qn) .<ClassSymbol>map(ClassSymbolImpl::new) .orElse(new UnknownClassSymbol(qualifiedName))); } private  ClassSymbolIndex(ProjectSymbolData projectSymbolData); static ClassSymbolIndex create(Set<ClassSymbolData> fileDeclarations, ProjectSymbolData projectSymbolData); ClassSymbol get(QualifiedName qualifiedName); ClassSymbol get(ClassSymbolData classSymbolData); }
ClassSymbolIndex { public ClassSymbol get(QualifiedName qualifiedName) { return symbolsByQualifiedName.computeIfAbsent(qualifiedName, qn -> projectSymbolData.classSymbolData(qn) .<ClassSymbol>map(ClassSymbolImpl::new) .orElse(new UnknownClassSymbol(qualifiedName))); } private  ClassSymbolIndex(ProjectSymbolData projectSymbolData); static ClassSymbolIndex create(Set<ClassSymbolData> fileDeclarations, ProjectSymbolData projectSymbolData); ClassSymbol get(QualifiedName qualifiedName); ClassSymbol get(ClassSymbolData classSymbolData);  }