package com.intellij.lang.ant.psi.impl.reference;

import com.intellij.lang.ant.AntElementRole;
import com.intellij.lang.ant.psi.impl.AntElementImpl;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;

public class AntElementCompletionWrapper extends AntElementImpl {

  private final String myName;
  private final Project myProject;
  private final AntElementRole myRole;

  public AntElementCompletionWrapper(final String name, @NotNull final Project project, final AntElementRole role) {
    super(null, null);
    myName = name;
    myProject = project;
    myRole = role;
  }


  public boolean equals(final Object o) {
    if (this != o) {
      final AntElementCompletionWrapper that = (AntElementCompletionWrapper)o;
      if (!myName.equals(that.myName)) return false;
    }
    return true;
  }

  public int hashCode() {
    return myName.hashCode();
  }

  public String getName() {
    return myName;
  }

  @NotNull
  public Project getProject() {
    return myProject;
  }

  public AntElementRole getRole() {
    return myRole;
  }

  public boolean isValid() {
    return true;
  }

  public boolean isPhysical() {
    return false;
  }
}

@@ -238,16 +238,22 @@
 %0Apublic 
+final 
 class An
@@ -678,16 +678,93 @@
 his 
-!
+=
 = o) %7B%0A
+      return true;%0A    %7D%0A    if (o instanceof AntElementCompletionWrapper) %7B%0A
     
@@ -848,13 +848,15 @@
     
-if (!
+return 
 myNa
@@ -881,22 +881,8 @@
 ame)
-) return false
 ;%0A  
@@ -888,35 +888,36 @@
    %7D%0A    return 
-tru
+fals
 e;%0A  %7D%0A%0A  public

correct equals() implementation, avoiding CCE