}
public List<Violation> getViolations(Resource resource, Integer snapshotId) {
List<RuleFailureModel> models = session.getResults(RuleFailureModel.class, "snapshotId", snapshotId);
List<Violation> violations = new ArrayList<Violation>();
for (RuleFailureModel model : models) {
<BUG>Violation violation = new Violation(model.getRule(), resource);
</BUG>
violation.setLineId(model.getLine());
violation.setMessage(model.getMessage());
violation.setPriority(model.getPriority());

}
public List<Violation> getViolations(Resource resource, Integer snapshotId) {
List<RuleFailureModel> models = session.getResults(RuleFailureModel.class, "snapshotId", snapshotId);
List<Violation> violations = new ArrayList<Violation>();
for (RuleFailureModel model : models) {
Violation violation = Violation.create(model.getRule(), resource);
violation.setLineId(model.getLine());
violation.setMessage(model.getMessage());
violation.setPriority(model.getPriority());
