assertNotNull(elem);
assertEquals("Math", elem.getDeclaringType().getName().asString());
assertEquals("abs", elem.getName().asString());
assertEquals(1, elem.getParameters().size());
{
IrDocMethodParameter param = elem.getParameters().get(0);
assertEquals(IrDocElementKind.BASIC_TYPE, param.getType().getKind());
assertEquals(IrBasicTypeKind.INT, ((IrDocBasicType) param.getType()).getTypeKind());
assertNull(param.getName());
}
assertEquals(EOF, scanner.lookahead(0).getKind());
}
{
DefaultJavadocScanner scanner = string("Math#abs(int number)");
IrDocMethod elem = JavadocBlockParserUtil.fetchMethod(scanner, null);
assertNotNull(elem);
assertEquals("Math", elem.getDeclaringType().getName().asString());
assertEquals("abs", elem.getName().asString());
assertEquals(1, elem.getParameters().size());
{
IrDocMethodParameter param = elem.getParameters().get(0);
assertEquals(IrDocElementKind.BASIC_TYPE, param.getType().getKind());
assertEquals(IrBasicTypeKind.INT, ((IrDocBasicType) param.getType()).getTypeKind());
assertFalse(param.isVariableArity());
assertNotNull(param.getName());
assertEquals("number", param.getName().getIdentifier());
}
assertEquals(EOF, scanner.lookahead(0).getKind());
}
{
DefaultJavadocScanner scanner = string("Arrays#asList(Object...)");
IrDocMethod elem = JavadocBlockParserUtil.fetchMethod(scanner, null);
assertNotNull(elem);
assertEquals("Arrays", elem.getDeclaringType().getName().asString());
assertEquals("asList", elem.getName().asString());
assertEquals(1, elem.getParameters().size());
{
IrDocMethodParameter param = elem.getParameters().get(0);
assertEquals(IrDocElementKind.NAMED_TYPE, param.getType().getKind());
assertEquals("Object", ((IrDocNamedType) param.getType()).getName().asString());
assertTrue(param.isVariableArity());
assertNull(param.getName());
}
assertEquals(EOF, scanner.lookahead(0).getKind());
}
{
DefaultJavadocScanner scanner = string("Arrays#asList(Object...elems)");
IrDocMethod elem = JavadocBlockParserUtil.fetchMethod(scanner, null);
assertNotNull(elem);
assertEquals("Arrays", elem.getDeclaringType().getName().asString());
assertEquals("asList", elem.getName().asString());
assertEquals(1, elem.getParameters().size());
{
IrDocMethodParameter param = elem.getParameters().get(0);
assertEquals(IrDocElementKind.NAMED_TYPE, param.getType().getKind());
assertEquals("Object", ((IrDocNamedType) param.getType()).getName().asString());
assertTrue(param.isVariableArity());
assertNotNull(param.getName());
assertEquals("elems", param.getName().getIdentifier());
}
assertEquals(EOF, scanner.lookahead(0).getKind());
}
{
DefaultJavadocScanner scanner = string("Math#max(int, int)");
IrDocMethod elem = JavadocBlockParserUtil.fetchMethod(scanner, null);
assertNotNull(elem);
assertEquals("Math", elem.getDeclaringType().getName().asString());
assertEquals("max", elem.getName().asString());
assertEquals(2, elem.getParameters().size());
{
IrDocMethodParameter param = elem.getParameters().get(0);
assertEquals(IrDocElementKind.BASIC_TYPE, param.getType().getKind());
assertEquals(IrBasicTypeKind.INT, ((IrDocBasicType) param.getType()).getTypeKind());
assertFalse(param.isVariableArity());
assertNull(param.getName());
}
{
IrDocMethodParameter param = elem.getParameters().get(1);
assertEquals(IrDocElementKind.BASIC_TYPE, param.getType().getKind());
assertEquals(IrBasicTypeKind.INT, ((IrDocBasicType) param.getType()).getTypeKind());
assertFalse(param.isVariableArity());
assertNull(param.getName());
}
assertEquals(EOF, scanner.lookahead(0).getKind());
}
{
DefaultJavadocScanner scanner = string("Math#max(int a, int b)");
IrDocMethod elem = JavadocBlockParserUtil.fetchMethod(scanner, null);
assertNotNull(elem);
assertEquals("Math", elem.getDeclaringType().getName().asString());
assertEquals("max", elem.getName().asString());
assertEquals(2, elem.getParameters().size());
{
IrDocMethodParameter param = elem.getParameters().get(0);
assertEquals(IrDocElementKind.BASIC_TYPE, param.getType().getKind());
assertEquals(IrBasicTypeKind.INT, ((IrDocBasicType) param.getType()).getTypeKind());
assertFalse(param.isVariableArity());
assertNotNull(param.getName());
assertEquals("a", param.getName().getIdentifier());
}
{
IrDocMethodParameter param = elem.getParameters().get(1);
assertEquals(IrDocElementKind.BASIC_TYPE, param.getType().getKind());
assertEquals(IrBasicTypeKind.INT, ((IrDocBasicType) param.getType()).getTypeKind());
assertFalse(param.isVariableArity());
assertNotNull(param.getName());
assertEquals("b", param.getName().getIdentifier());
}
assertEquals(EOF, scanner.lookahead(0).getKind());
}
{
DefaultJavadocScanner scanner = string("/Math#max(int a, int b)");