// VisibleForTesting protected Set<JDeclaredType> gatherReboundTypes(RebindPermutationOracle rpo) { Collection<CompilationUnit> compilationUnits = rpo.getCompilationState().getCompilationUnits(); Set<JDeclaredType> reboundTypes = Sets.newLinkedHashSet(); for (CompilationUnit compilationUnit : compilationUnits) { for (JDeclaredType type : compilationUnit.getTypes()) { ReboundTypeRecorder.exec(type, reboundTypes); } } return reboundTypes; }
public void addCompilationUnit(CompilationUnit compilationUnit) { String compilationUnitTypeSourceName = compilationUnit.getTypeName(); compilationUnitsByTypeName.put(compilationUnitTypeSourceName, compilationUnit); compilationUnitTypeNames.add(compilationUnitTypeSourceName); Collection<CompiledClass> compiledClasses = compilationUnit.getCompiledClasses(); for (CompiledClass compiledClass : compiledClasses) { String sourceName = compiledClass.getSourceName(); String binaryName = InternalName.toBinaryName(compiledClass.getInternalName()); nestedSourceNamesByCompilationUnitName.put(compilationUnitTypeSourceName, sourceName); nestedBinaryNamesByCompilationUnitName.put(compilationUnitTypeSourceName, binaryName); compilationUnitNamesByNestedSourceName.put(sourceName, compilationUnitTypeSourceName); compilationUnitNamesByNestedBinaryName.put(binaryName, compilationUnitTypeSourceName); } }
// VisibleForTesting protected JDeclaredType ensureFullTypeLoaded(JDeclaredType type) { String resourcePath = LibraryGroupUnitCache.typeSourceNameToResourcePath(type.getName()); CompilationUnit compilationUnit = compilerContext.getUnitCache().find(resourcePath); type = compilationUnit.getTypeByName(type.getName()); return type; }