Ensure resource is closed in annotation processor.