Program: 148966
Project: 148966
Buggy source:
public Image getImage(Object obj){
  if (obj instanceof XSDElementDeclaration) {
    XSDElementDeclaration decl=(XSDElementDeclaration)obj;
    boolean isConcept=false;
    EList l=decl.getIdentityConstraintDefinitions();
    for (Iterator iter=l.iterator(); iter.hasNext(); ) {
      XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)iter.next();
      if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) {
        isConcept=true;
        break;
      }
    }
    if (isConcept) {
      return ImageCache.getCreatedImage(EImage.CONCEPT.getPath());
    }
 else {
      return ImageCache.getCreatedImage(EImage.ELEMENT_ONLY.getPath());
    }
  }
  if (obj instanceof XSDParticle) {
    XSDParticle xsdParticle=(XSDParticle)obj;
    XSDTerm xsdTerm=xsdParticle.getTerm();
    if (xsdTerm instanceof XSDElementDeclaration) {
      if (Util.getKeyInfo((XSDElementDeclaration)xsdTerm) != null)       return ImageCache.getCreatedImage(EImage.PRIMARYKEY.getPath());
      XSDConcreteComponent xsdConcreteComponent=xsdParticle.getContainer();
      if (xsdConcreteComponent instanceof XSDModelGroup) {
        if (((XSDModelGroup)xsdConcreteComponent).getCompositor() == XSDCompositor.CHOICE_LITERAL)         return ImageCache.getCreatedImage("String_Node_Str");
        return ImageCache.getCreatedImage("String_Node_Str");
      }
    }
 else     if (xsdTerm instanceof XSDModelGroup) {
      int type=((XSDModelGroup)xsdTerm).getCompositor().getValue();
switch (type) {
case XSDCompositor.ALL:
        return ImageCache.getCreatedImage(EImage.COMPLEXTYPE.getPath());
case XSDCompositor.CHOICE:
      return ImageCache.getCreatedImage(EImage.COMPLEX_CHOICE.getPath());
case XSDCompositor.SEQUENCE:
    return ImageCache.getCreatedImage(EImage.COMPLEX_SEQUENCE.getPath());
}
}
 else if (xsdTerm instanceof XSDWildcard) {
return ImageCache.getCreatedImage("String_Node_Str");
}
 else {
System.out.println("String_Node_Str" + xsdTerm.getClass().getName());
return ImageCache.getCreatedImage("String_Node_Str");
}
}
if (obj instanceof XSDSimpleTypeDefinition) {
return ImageCache.getCreatedImage(EImage.SIMPLETYPE.getPath());
}
if (obj instanceof XSDModelGroup) {
int type=((XSDModelGroup)obj).getCompositor().getValue();
switch (type) {
case XSDCompositor.ALL:
return ImageCache.getCreatedImage(EImage.COMPLEXTYPE.getPath());
case XSDCompositor.CHOICE:
return ImageCache.getCreatedImage(EImage.COMPLEX_CHOICE.getPath());
case XSDCompositor.SEQUENCE:
return ImageCache.getCreatedImage(EImage.COMPLEX_SEQUENCE.getPath());
}
}
if (obj instanceof XSDFacet) {
return ImageCache.getCreatedImage("String_Node_Str");
}
if (obj instanceof XSDIdentityConstraintDefinition) {
XSDIdentityConstraintDefinition identity=(XSDIdentityConstraintDefinition)obj;
if (identity.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) return ImageCache.getCreatedImage(EImage.UNIQUE.getPath());
return ImageCache.getCreatedImage(EImage.KEY.getPath());
}
if (obj instanceof XSDXPathDefinition) {
XSDXPathDefinition xpath=(XSDXPathDefinition)obj;
if (xpath.getVariety().equals(XSDXPathVariety.FIELD_LITERAL)) return ImageCache.getCreatedImage("String_Node_Str");
return ImageCache.getCreatedImage("String_Node_Str");
}
if (obj instanceof XSDAttributeGroupDefinition) {
return ImageCache.getCreatedImage("String_Node_Str");
}
if (obj instanceof XSDAttributeUse) {
XSDAttributeUse att=(XSDAttributeUse)obj;
if ("String_Node_Str".equals(att.getAttributeDeclaration().getTargetNamespace())) {
return ImageCache.getCreatedImage(EImage.ANNOTATION.getPath());
}
if (att.getUse().equals(XSDAttributeUseCategory.REQUIRED_LITERAL)) return ImageCache.getCreatedImage("String_Node_Str");
 else return ImageCache.getCreatedImage("String_Node_Str");
}
if (obj instanceof XSDAnnotation) {
return ImageCache.getCreatedImage(EImage.ANNOTATION.getPath());
}
if (obj instanceof Element) {
try {
Element e=(Element)obj;
if (e.getLocalName().equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
 else if (e.getLocalName().equals("String_Node_Str")) {
String source=e.getAttribute("String_Node_Str");
if (source != null) {
if (source.startsWith("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.LABEL.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.KEY.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.KEYINFO.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage("String_Node_Str");
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage("String_Node_Str");
}
 else if (source.startsWith("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.SECURITYANNOTATION.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.SECURITYANNOTATION.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.ROUTINE.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.WORKFLOW_PROCESS.getPath());
}
 else {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
}
 else {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
}
 else {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
}
 catch (Exception e) {
e.printStackTrace();
}
}
return ImageCache.getCreatedImage("String_Node_Str");
}

Fixed version (ground truth):
public Image getImage(Object obj){
  if (obj instanceof XSDElementDeclaration) {
    XSDElementDeclaration decl=(XSDElementDeclaration)obj;
    boolean isConcept=false;
    EList l=decl.getIdentityConstraintDefinitions();
    for (Iterator iter=l.iterator(); iter.hasNext(); ) {
      XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)iter.next();
      if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) {
        isConcept=true;
        break;
      }
    }
    if (isConcept) {
      return ImageCache.getCreatedImage(EImage.CONCEPT.getPath());
    }
 else {
      return ImageCache.getCreatedImage(EImage.ELEMENT_ONLY.getPath());
    }
  }
  if (obj instanceof XSDParticle) {
    XSDParticle xsdParticle=(XSDParticle)obj;
    XSDTerm xsdTerm=xsdParticle.getTerm();
    if (xsdTerm instanceof XSDElementDeclaration) {
      if (Util.getKeyInfo((XSDElementDeclaration)xsdTerm) != null)       return ImageCache.getCreatedImage(EImage.PRIMARYKEY.getPath());
      XSDConcreteComponent xsdConcreteComponent=xsdParticle.getContainer();
      if (xsdConcreteComponent instanceof XSDModelGroup) {
        if (((XSDModelGroup)xsdConcreteComponent).getCompositor() == XSDCompositor.CHOICE_LITERAL)         return ImageCache.getCreatedImage(EImage.ELEMENTS_OBJ_CHOICE.getPath());
        if (((XSDModelGroup)xsdConcreteComponent).getCompositor() == XSDCompositor.CHOICE_LITERAL)         return ImageCache.getCreatedImage(EImage.ELEMENTS_OBJ_SEQUENCE.getPath());
      }
      if (((XSDElementDeclaration)xsdTerm).getAnonymousTypeDefinition() instanceof XSDComplexTypeDefinition)       return ImageCache.getCreatedImage(EImage.COMPLEXTYPE.getPath());
 else       if (((XSDElementDeclaration)xsdTerm).getAnonymousTypeDefinition() instanceof XSDSimpleTypeDefinition)       return ImageCache.getCreatedImage(EImage.SIMPLETYPE.getPath());
    }
 else     if (xsdTerm instanceof XSDModelGroup) {
      int type=((XSDModelGroup)xsdTerm).getCompositor().getValue();
switch (type) {
case XSDCompositor.ALL:
        return ImageCache.getCreatedImage(EImage.COMPLEX_ALL.getPath());
case XSDCompositor.CHOICE:
      return ImageCache.getCreatedImage(EImage.COMPLEX_CHOICE.getPath());
case XSDCompositor.SEQUENCE:
    return ImageCache.getCreatedImage(EImage.COMPLEX_SEQUENCE.getPath());
}
}
 else if (xsdTerm instanceof XSDWildcard) {
return ImageCache.getCreatedImage("String_Node_Str");
}
 else {
System.out.println("String_Node_Str" + xsdTerm.getClass().getName());
return ImageCache.getCreatedImage("String_Node_Str");
}
}
if (obj instanceof XSDSimpleTypeDefinition) {
return ImageCache.getCreatedImage(EImage.TYPE_DEFINITION.getPath());
}
if (obj instanceof XSDModelGroup) {
int type=((XSDModelGroup)obj).getCompositor().getValue();
switch (type) {
case XSDCompositor.ALL:
return ImageCache.getCreatedImage(EImage.COMPLEX_ALL.getPath());
case XSDCompositor.CHOICE:
return ImageCache.getCreatedImage(EImage.COMPLEX_CHOICE.getPath());
case XSDCompositor.SEQUENCE:
return ImageCache.getCreatedImage(EImage.COMPLEX_SEQUENCE.getPath());
}
}
if (obj instanceof XSDFacet) {
return ImageCache.getCreatedImage("String_Node_Str");
}
if (obj instanceof XSDIdentityConstraintDefinition) {
XSDIdentityConstraintDefinition identity=(XSDIdentityConstraintDefinition)obj;
if (identity.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) return ImageCache.getCreatedImage(EImage.UNIQUE.getPath());
return ImageCache.getCreatedImage(EImage.KEY.getPath());
}
if (obj instanceof XSDXPathDefinition) {
XSDXPathDefinition xpath=(XSDXPathDefinition)obj;
if (xpath.getVariety().equals(XSDXPathVariety.FIELD_LITERAL)) return ImageCache.getCreatedImage("String_Node_Str");
return ImageCache.getCreatedImage("String_Node_Str");
}
if (obj instanceof XSDAttributeGroupDefinition) {
return ImageCache.getCreatedImage("String_Node_Str");
}
if (obj instanceof XSDAttributeUse) {
XSDAttributeUse att=(XSDAttributeUse)obj;
if ("String_Node_Str".equals(att.getAttributeDeclaration().getTargetNamespace())) {
return ImageCache.getCreatedImage(EImage.ANNOTATION.getPath());
}
if (att.getUse().equals(XSDAttributeUseCategory.REQUIRED_LITERAL)) return ImageCache.getCreatedImage("String_Node_Str");
 else return ImageCache.getCreatedImage("String_Node_Str");
}
if (obj instanceof XSDAnnotation) {
return ImageCache.getCreatedImage(EImage.ANNOTATION.getPath());
}
if (obj instanceof Element) {
try {
Element e=(Element)obj;
if (e.getLocalName().equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
 else if (e.getLocalName().equals("String_Node_Str")) {
String source=e.getAttribute("String_Node_Str");
if (source != null) {
if (source.startsWith("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.LABEL.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.KEY.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.KEYINFO.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.SOURCESYSTEM.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.TARGETSYSTEM.getPath());
}
 else if (source.startsWith("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.SECURITYANNOTATION.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.SECURITYANNOTATION.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.ROUTINE.getPath());
}
 else if (source.equals("String_Node_Str")) {
return ImageCache.getCreatedImage(EImage.WORKFLOW_PROCESS.getPath());
}
 else {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
}
 else {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
}
 else {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
}
 catch (Exception e) {
e.printStackTrace();
}
}
return ImageCache.getCreatedImage("String_Node_Str");
}