public void finish()
throws IOException
{
if (constants.size() > 0) {
final ConstantsContext constantContext = contextGenerator.constantsFromThrift();
for (final Const constant : constants) {
try {
constantContext.addConstant(contextGenerator.constantFromThrift(constant));
}
catch (IllegalStateException e) {
LOG.error("Could not generate code for constant '{}' due to https://github.com/facebook/swift/issues/209, skipping...", constant.getName());
}
}