use of com.github.javaparser.resolution.types.ResolvedUnionType in project javaparser by javaparser.
the class JavaParserFacadeResolutionTest method solveMultiCatchType.
@Test
public void solveMultiCatchType() {
String code = "class A {\n" + " public void foo() {\n" + " try {\n" + " \n" + " } catch (IllegalStateException | IllegalArgumentException e) {\n" + " \n" + " }\n" + " }\n" + " }";
CompilationUnit cu = parseWithTypeSolver(code);
CatchClause catchClause = Navigator.findNodeOfGivenClass(cu, CatchClause.class);
Type jpType = catchClause.getParameter().getType();
ResolvedType jssType = jpType.resolve();
assertEquals(true, jssType instanceof ResolvedUnionType);
}
Aggregations