wolf problems bugs fixed
[fedora-idea.git] / source / com / intellij / codeInsight / problems / ProblemImpl.java
blobacdba30669c0d7479cb497c3d195fc320da79c26
1 package com.intellij.codeInsight.problems;
3 import com.intellij.openapi.vfs.VirtualFile;
4 import com.intellij.codeInsight.daemon.impl.HighlightInfo;
5 import com.intellij.problems.Problem;
6 import org.jetbrains.annotations.NonNls;
8 /**
9 * @author cdr
11 public class ProblemImpl implements Problem {
12 private VirtualFile virtualFile;
13 public HighlightInfo highlightInfo;
14 private boolean isSyntax;
16 public ProblemImpl(final VirtualFile virtualFile, final HighlightInfo highlightInfo, final boolean isSyntax) {
17 this.isSyntax = isSyntax;
18 this.virtualFile = virtualFile;
19 this.highlightInfo = highlightInfo;
22 public VirtualFile getVirtualFile() {
23 return virtualFile;
26 public boolean isSyntaxOnly() {
27 return isSyntax;
30 public boolean equals(final Object o) {
31 if (this == o) return true;
32 if (o == null || getClass() != o.getClass()) return false;
34 final ProblemImpl problem = (ProblemImpl)o;
36 if (isSyntax != problem.isSyntax) return false;
37 if (!highlightInfo.equals(problem.highlightInfo)) return false;
38 if (!virtualFile.equals(problem.virtualFile)) return false;
40 return true;
43 public int hashCode() {
44 int result;
45 result = virtualFile.hashCode();
46 result = 31 * result + highlightInfo.hashCode();
47 result = 31 * result + (isSyntax ? 1 : 0);
48 return result;
51 @NonNls
52 public String toString() {
53 return "Problem: " + highlightInfo;