use of com.github.javaparser.ast.validator.Java5Validator in project javaparser by javaparser.
the class TypeTest method primitiveTypeArgumentLenientValidator.
@Test
public void primitiveTypeArgumentLenientValidator() {
ParserConfiguration config = new ParserConfiguration().setLanguageLevel(RAW);
config.getPostProcessors().add(new Java5Validator() {
{
remove(noPrimitiveGenericArguments);
}
}.postProcessor());
ParseResult<VariableDeclarationExpr> result = new JavaParser(config).parse(VARIABLE_DECLARATION_EXPR, provider("List<long> x"));
assertTrue(result.isSuccessful());
VariableDeclarationExpr decl = result.getResult().get();
assertEquals("List<long>", decl.getVariable(0).getType().asString());
}
Aggregations