@Test public void unknown_class_and_method() { ClassSymbolIndex symbols = createSymbols(data("a")); ClassSymbol classSymbol = symbols.get(fqn("x")); assertThat(classSymbol).isInstanceOf(UnknownClassSymbol.class); assertThat(classSymbol.is(ClassSymbol.Kind.NORMAL)).isFalse(); MethodSymbol methodSymbol = classSymbol.getDeclaredMethod("y"); assertThat(methodSymbol).isInstanceOf(UnknownMethodSymbol.class); assertThat(methodSymbol.visibility()).isEqualTo(Visibility.PUBLIC); assertThat(methodSymbol.owner()).isInstanceOf(UnknownClassSymbol.class); }
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);  }