use of org.sonar.java.resolve.JavaSymbol.TypeJavaSymbol in project sonar-java by SonarSource.
the class TypeSubstitutionSolver method applySiteSubstitutionToFormalParameters.
@VisibleForTesting
List<JavaType> applySiteSubstitutionToFormalParameters(List<JavaType> formals, JavaType site, Set<Type> visited) {
TypeSubstitution typeSubstitution = new TypeSubstitution();
if (site.isParameterized()) {
typeSubstitution = ((ParametrizedTypeJavaType) site).typeSubstitution;
}
TypeJavaSymbol siteSymbol = site.getSymbol();
List<JavaType> newFormals = formals;
Type superClass = siteSymbol.superClass();
if (superClass != null) {
JavaType newSuperClass = applySubstitution((JavaType) superClass, typeSubstitution);
if (visited.add(newSuperClass)) {
newFormals = applySiteSubstitutionToFormalParameters(newFormals, newSuperClass, visited);
}
}
for (Type interfaceType : siteSymbol.interfaces()) {
JavaType newInterfaceType = applySubstitution((JavaType) interfaceType, typeSubstitution);
if (visited.add(newInterfaceType)) {
newFormals = applySiteSubstitutionToFormalParameters(newFormals, newInterfaceType, visited);
}
}
return applySubstitutionToFormalParameters(newFormals, typeSubstitution);
}
use of org.sonar.java.resolve.JavaSymbol.TypeJavaSymbol in project sonar-java by SonarSource.
the class BytecodeCompleterTest method bridge_method_not_synthetic_should_not_be_created_as_symbol_nor_fail_analysis.
@Test
public void bridge_method_not_synthetic_should_not_be_created_as_symbol_nor_fail_analysis() throws Exception {
TypeJavaSymbol prezModel42 = bytecodeCompleter.getClassSymbol("model42.PresentationModel42");
prezModel42.complete();
assertThat(prezModel42.members().lookup("setSliderMinValue")).isEmpty();
assertThat(logTester.logs(LoggerLevel.WARN)).contains("bridge method setSliderMinValue not marked as synthetic in class model42/PresentationModel42");
}
Aggregations