use of org.sonar.java.bytecode.loader.SquidClassLoader in project sonar-java by SonarSource.
the class RequiresDirectiveTreeImplTest method createTree.
private CompilationUnitTree createTree(String... lines) {
CompilationUnitTree compilationUnitTree = (CompilationUnitTree) p.parse(Arrays.stream(lines).collect(Collectors.joining("\n")));
SemanticModel.createFor(compilationUnitTree, new SquidClassLoader(Collections.emptyList()));
return compilationUnitTree;
}
use of org.sonar.java.bytecode.loader.SquidClassLoader in project sonar-java by SonarSource.
the class GenericsTest method treeOf.
private static CompilationUnitTree treeOf(String... lines) {
StringBuilder builder = new StringBuilder();
for (String line : lines) {
builder.append(line).append(System.lineSeparator());
}
CompilationUnitTree cut = (CompilationUnitTree) JavaParser.createParser().parse(builder.toString());
SemanticModel.createFor(cut, new SquidClassLoader(Lists.newArrayList(new File("target/test-classes"), new File("target/classes"))));
return cut;
}
use of org.sonar.java.bytecode.loader.SquidClassLoader in project sonar-java by SonarSource.
the class TypeInferenceSolverTest method setUp.
@Before
public void setUp() {
parametrizedTypeCache = new ParametrizedTypeCache();
symbols = new Symbols(new BytecodeCompleter(new SquidClassLoader(Collections.emptyList()), parametrizedTypeCache));
TypeSubstitutionSolver typeSubstitutionSolver = new TypeSubstitutionSolver(parametrizedTypeCache, symbols);
LeastUpperBound lub = new LeastUpperBound(typeSubstitutionSolver, parametrizedTypeCache, symbols);
typeInferenceSolver = new TypeInferenceSolver(lub, symbols, typeSubstitutionSolver);
T = getTypeVariable("T");
}
Aggregations