use of org.eclipse.jdt.core.dom.ThrowStatement in project evosuite by EvoSuite.
the class TestExtractingVisitor method endVisit.
/**
* {@inheritDoc}
*/
@Override
public void endVisit(ClassInstanceCreation instanceCreation) {
if (instanceCreation.getParent() instanceof ThrowStatement) {
logger.warn("Ignoring throw statements!");
return;
}
List<?> paramTypes = Arrays.asList(instanceCreation.resolveConstructorBinding().getParameterTypes());
List<?> paramValues = instanceCreation.arguments();
Constructor<?> constructor = retrieveConstructor(instanceCreation.getType(), paramTypes, paramValues);
List<VariableReference> params = convertParams(instanceCreation.arguments(), paramTypes);
VariableReference retVal = retrieveVariableReference(instanceCreation, null);
retVal.setOriginalCode(instanceCreation.toString());
ConstructorStatement statement = new ValidConstructorStatement(testCase.getReference(), constructor, retVal, params);
testCase.addStatement(statement);
}
Aggregations