if ((project == null) || (vFile == null))
{
return;
}
Issue issue = new Issue();
issue.setFile(vFile);
if (editor != null)
{
Document document = editor.getDocument();
int lineStart = document.getLineNumber(editor.getSelectionModel().getSelectionStart());
int lineEnd = document.getLineNumber(editor.getSelectionModel().getSelectionEnd());
issue.setLineStart(lineStart);
issue.setLineEnd(lineEnd);
CharSequence fragment = document.getCharsSequence().subSequence(document.getLineStartOffset(lineStart),
document.getLineEndOffset(lineEnd));
issue.setHash(fragment.toString().hashCode());
}
issue.setStatus(IssueStatus.TO_RESOLVE);
IssueDialog dialog = new IssueDialog(project, true);
dialog.show(issue);
if ((dialog.isOK()) && dialog.updateData(issue))
{
Review review = issue.getReview();
assert (RevuUtils.getCurrentUserLogin() != null) : "Login should be set";
issue.setHistory(RevuUtils.buildHistory(review));
if (RevuVcsUtils.fileIsModifiedFromVcs(project, vFile))
{
issue.setLocalRev(String.valueOf(System.currentTimeMillis()));
}
if (issue.getFile() != null)
{
VcsRevisionNumber vcsRev = RevuVcsUtils.getVcsRevisionNumber(project, issue.getFile());
if (vcsRev != null)
{
issue.setVcsRev(vcsRev.toString());
}
}
review.addIssue(issue);