anchor.diff:  <%
     db = LorDataSource.getConnection();
   
  -  Statement st = db.createStatement();
  -  ResultSet rs = st.executeQuery("SELECT topic FROM comments WHERE id=" + msgid);
  -  rs.next();
  -
  -  int topicId = rs.getInt("topic");
  -  rs.close();
  +  Comment comment = new Comment(db, msgid);
  +
  +  if (comment.isDeleted()) {
  +    throw new AccessViolationException("комментарий уже удален");
  +  }
  +
  +  int topicId = comment.getTopic();
   
     try {
       Message topic = new Message(db, topicId);
  
positive.code: <%@ page contentType="text/html; charset=utf-8"%>
  <%@ page import="java.sql.Connection,java.sql.PreparedStatement,java.sql.ResultSet"  %>
  <%@ page import="java.sql.Statement"%>
  <%@ page import="ru.org.linux.site.*"%>
  <%@ page import="ru.org.linux.util.ServletParameterParser" %>
  <%--
    ~ Copyright 1998-2009 Linux.org.ru
    ~    Licensed under the Apache License, Version 2.0 (the "License");
  
negative.code:    try {
  
     if (request.getParameter("reason")==null) {
  %>
  <script language="Javascript" type="text/javascript">
  <!--
  