@Test public void get_by_qualified_name() { ClassSymbolData a = data("ns1\\a", "ns1\\c"); ClassSymbolData b = data("ns1\\b", "ns1\\c"); ClassSymbolData c = data("ns1\\c"); ClassSymbolIndex symbols = createSymbols(projectData(a), b, c); assertThat(symbols.get(a)).isNull(); assertThat(symbols.get(b.qualifiedName())).isSameAs(symbols.get(b)); assertThat(symbols.get(a.qualifiedName()).superClass()).containsSame(symbols.get(c)); assertThat(symbols.get(qualifiedName("unknown")).isUnknownSymbol()).isTrue(); assertThat(symbols.get(qualifiedName("unknown"))).isSameAs(symbols.get(qualifiedName("unknown"))); assertThat(symbols.get(qualifiedName("unknown"))).isNotEqualTo(symbols.get(qualifiedName("otherunknown"))); }
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);  }