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
;
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() {
26 public boolean isSyntaxOnly() {
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;
43 public int hashCode() {
45 result
= virtualFile
.hashCode();
46 result
= 31 * result
+ highlightInfo
.hashCode();
47 result
= 31 * result
+ (isSyntax ?
1 : 0);
52 public String
toString() {
53 return "Problem: " + highlightInfo
;