} else if (tp.getBounds().size() == 1) { ResolvedTypeParameterDeclaration.Bound bound = tp.getBounds().get(0); if (bound.isExtends()) { } else if (tp.getBounds().size() == 1) { ResolvedTypeParameterDeclaration.Bound bound = tp.getBounds().get(0); if (bound.isExtends()) { expectedType2 = expectedType2.replaceTypeVariables(tp, bound.getType()); } else {
} else if (tp.getBounds().size() == 1) { ResolvedTypeParameterDeclaration.Bound bound = tp.getBounds().get(0); if (bound.isExtends()) { } else if (tp.getBounds().size() == 1) { ResolvedTypeParameterDeclaration.Bound bound = tp.getBounds().get(0); if (bound.isExtends()) { expectedType2 = expectedType2.replaceTypeVariables(tp, bound.getType()); } else {
} else if (tp.getBounds().size() == 1) { ResolvedTypeParameterDeclaration.Bound bound = tp.getBounds().get(0); if (bound.isExtends()) { } else if (tp.getBounds().size() == 1) { ResolvedTypeParameterDeclaration.Bound bound = tp.getBounds().get(0); if (bound.isExtends()) { expectedType2 = expectedType2.replaceTypeVariables(tp, bound.getType()); } else {
} else if (other.isTypeVariable()) { for (ResolvedTypeParameterDeclaration.Bound bound : other.asTypeVariable().asTypeParameter().getBounds()) { if (bound.isExtends()) { if (this.isAssignableBy(bound.getType())) { return true;
} else if (other.isTypeVariable()) { for (ResolvedTypeParameterDeclaration.Bound bound : other.asTypeVariable().asTypeParameter().getBounds()) { if (bound.isExtends()) { if (this.isAssignableBy(bound.getType())) { return true;
} else if (other.isTypeVariable()) { for (ResolvedTypeParameterDeclaration.Bound bound : other.asTypeVariable().asTypeParameter().getBounds()) { if (bound.isExtends()) { if (this.isAssignableBy(bound.getType())) { return true;
@Test public void nodesTypeIsCorrect() throws IOException, ParseException { CompilationUnit cu = parse("com/github/javaparser/utils/PositionUtils"); NameExpr nodes = Navigator.findAllNodesOfGivenClass(cu, NameExpr.class).stream().filter(it -> it.getName() != null && it.getName().getId().equals("nodes")).findFirst().get(); ResolvedType type = JavaParserFacade.get(TYPESOLVER).solve(nodes).getCorrespondingDeclaration().getType(); assertEquals("java.util.List<T>", type.describe()); assertEquals(1, type.asReferenceType().typeParametersValues().size()); assertEquals(true, type.asReferenceType().typeParametersValues().get(0).isTypeVariable()); assertEquals("T", type.asReferenceType().typeParametersValues().get(0).asTypeParameter().getName()); assertEquals("com.github.javaparser.utils.PositionUtils.sortByBeginPosition(java.util.List<T>).T", type.asReferenceType().typeParametersValues().get(0).asTypeParameter().getQualifiedName()); assertEquals(1, type.asReferenceType().typeParametersValues().get(0).asTypeParameter().getBounds().size()); ResolvedTypeParameterDeclaration.Bound bound = type.asReferenceType().typeParametersValues().get(0).asTypeParameter().getBounds().get(0); assertEquals(true, bound.isExtends()); assertEquals("com.github.javaparser.ast.Node", bound.getType().describe()); }