Program: 148253
Project: 148253
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(xsdTerm) != null && Util.getKeyInfo(xsdTerm).size() > 0)       return ImageCache.getCreatedImage(EImage.PRIMARYKEY.getPath());
      XSDConcreteComponent xsdConcreteComponent=xsdParticle.getContainer();
      if (xsdConcreteComponent instanceof XSDModelGroup) {
        return ImageCache.getCreatedImage(EImage.SCHEMAELEMENT.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 {
log.info("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 XSDComplexTypeDefinition) {
XSDComplexTypeDefinition ctd=(XSDComplexTypeDefinition)obj;
XSDComplexTypeContent ctc=ctd.getContent();
if (ctc instanceof XSDParticle) {
if (((XSDParticle)ctc).getTerm() instanceof XSDModelGroup) {
  int type=((XSDModelGroup)((XSDParticle)ctc).getTerm()).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 {
return ImageCache.getCreatedImage("String_Node_Str");
}
}
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(EImage.FACET.getPath());
}
if (obj instanceof XSDIdentityConstraintDefinition) {
XSDIdentityConstraintDefinition identity=(XSDIdentityConstraintDefinition)obj;
if (identity.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) return ImageCache.getCreatedImage(EImage.KEYS.getPath());
return ImageCache.getCreatedImage(EImage.PRIMARYKEY.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.PRIMARYKEY.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 {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
}
 else {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
}
 else {
return ImageCache.getCreatedImage(EImage.DOCUMENTATION.getPath());
}
}
 catch (Exception e) {
log.error(e.getMessage(),e);
}
}
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(xsdTerm) != null && Util.getKeyInfo(xsdTerm).size() > 0)       return ImageCache.getCreatedImage(EImage.PRIMARYKEY.getPath());
      XSDConcreteComponent xsdConcreteComponent=xsdParticle.getContainer();
      if (xsdConcreteComponent instanceof XSDModelGroup) {
        return ImageCache.getCreatedImage(EImage.SCHEMAELEMENT.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 {
log.info("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 XSDComplexTypeDefinition) {
XSDComplexTypeDefinition ctd=(XSDComplexTypeDefinition)obj;
XSDComplexTypeContent ctc=ctd.getContent();
if (ctc instanceof XSDParticle) {
if (((XSDParticle)ctc).getTerm() instanceof XSDModelGroup) {
  int type=((XSDModelGroup)((XSDParticle)ctc).getTerm()).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 {
return ImageCache.getCreatedImage("String_Node_Str");
}
}
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(EImage.FACET.getPath());
}
if (obj instanceof XSDIdentityConstraintDefinition) {
XSDIdentityConstraintDefinition identity=(XSDIdentityConstraintDefinition)obj;
if (identity.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) return ImageCache.getCreatedImage(EImage.KEYS.getPath());
return ImageCache.getCreatedImage(EImage.PRIMARYKEY.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.PRIMARYKEY.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.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.SECURITYANNOTATION.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) {
log.error(e.getMessage(),e);
}
}
return ImageCache.getCreatedImage("String_Node_Str");
}