String ruleKey = getRuleKey(event);
if (ruleKey != null) {
Rule rule = ruleFinder.findByKey(CheckstyleConstants.REPOSITORY_KEY, ruleKey);
if (rule != null) {
initResource(event);
<BUG>Violation violation = new Violation(rule, currentResource)
</BUG>
.setLineId(getLineId(event))
.setMessage(getMessage(event));
context.saveViolation(violation);

String ruleKey = getRuleKey(event);
if (ruleKey != null) {
Rule rule = ruleFinder.findByKey(CheckstyleConstants.REPOSITORY_KEY, ruleKey);
if (rule != null) {
initResource(event);
Violation violation = Violation.create(rule, currentResource)
.setLineId(getLineId(event))
.setMessage(getMessage(event));
context.saveViolation(violation);
