Program: 147640
Project: 147640
Buggy source:
protected void inputChanged(Object component){
  if (component instanceof XSDAnnotation) {
    annotation=(XSDAnnotation)component;
    if (annotation.getContainer() instanceof XSDElementDeclaration) {
      declaration=(XSDElementDeclaration)annotation.getContainer();
    }
 else     if (annotation.getContainer() instanceof XSDComplexTypeDefinition) {
      complexTypeDef=(XSDComplexTypeDefinition)annotation.getContainer();
    }
  }
  if (component instanceof XSDElementDeclaration) {
    declaration=(XSDElementDeclaration)component;
    if (declaration.getAnnotation() == null) {
      XSDFactory factory=XSDSchemaBuildingTools.getXSDFactory();
      annotation=factory.createXSDAnnotation();
    }
 else {
      annotation=declaration.getAnnotation();
    }
  }
  if (component instanceof XSDComplexTypeDefinition) {
    complexTypeDef=(XSDComplexTypeDefinition)component;
    if (complexTypeDef.getAnnotation() == null) {
      XSDFactory factory=XSDSchemaBuildingTools.getXSDFactory();
      annotation=factory.createXSDAnnotation();
    }
 else {
      annotation=complexTypeDef.getAnnotation();
    }
  }
  if (component instanceof XSDModelGroup) {
    XSDModelGroup group=(XSDModelGroup)component;
    if (group.getContainer().getContainer() instanceof XSDComplexTypeDefinition) {
      complexTypeDef=(XSDComplexTypeDefinition)group.getContainer().getContainer();
      if (complexTypeDef.getAnnotation() == null) {
        XSDFactory factory=XSDSchemaBuildingTools.getXSDFactory();
        annotation=factory.createXSDAnnotation();
      }
 else {
        annotation=complexTypeDef.getAnnotation();
      }
    }
  }
  if (component instanceof XSDParticle) {
    XSDTerm term=((XSDParticle)component).getTerm();
    if (term instanceof XSDElementDeclaration) {
      declaration=(XSDElementDeclaration)term;
      if (declaration.getAnnotation() == null) {
        XSDFactory factory=XSDSchemaBuildingTools.getXSDFactory();
        annotation=factory.createXSDAnnotation();
      }
 else {
        annotation=declaration.getAnnotation();
      }
    }
  }
}

Fixed version (ground truth):
protected void inputChanged(Object component){
  if (component instanceof XSDAnnotation) {
    annotation=(XSDAnnotation)component;
    if (annotation.getContainer() instanceof XSDElementDeclaration) {
      declaration=(XSDElementDeclaration)annotation.getContainer();
    }
 else     if (annotation.getContainer() instanceof XSDComplexTypeDefinition) {
      complexTypeDef=(XSDComplexTypeDefinition)annotation.getContainer();
    }
  }
  if (component instanceof XSDElementDeclaration) {
    declaration=(XSDElementDeclaration)component;
    if (declaration.getAnnotation() == null) {
      XSDFactory factory=XSDSchemaBuildingTools.getXSDFactory();
      annotation=factory.createXSDAnnotation();
    }
 else {
      annotation=declaration.getAnnotation();
    }
  }
  if (component instanceof XSDComplexTypeDefinition) {
    complexTypeDef=(XSDComplexTypeDefinition)component;
    componet=complexTypeDef;
    if (complexTypeDef.getAnnotation() == null) {
      XSDFactory factory=XSDSchemaBuildingTools.getXSDFactory();
      annotation=factory.createXSDAnnotation();
    }
 else {
      annotation=complexTypeDef.getAnnotation();
    }
  }
  if (component instanceof XSDModelGroup) {
    XSDModelGroup group=(XSDModelGroup)component;
    if (group.getContainer().getContainer() instanceof XSDComplexTypeDefinition) {
      complexTypeDef=(XSDComplexTypeDefinition)group.getContainer().getContainer();
      if (complexTypeDef.getAnnotation() == null) {
        XSDFactory factory=XSDSchemaBuildingTools.getXSDFactory();
        annotation=factory.createXSDAnnotation();
      }
 else {
        annotation=complexTypeDef.getAnnotation();
      }
    }
  }
  if (component instanceof XSDParticle) {
    XSDTerm term=((XSDParticle)component).getTerm();
    if (term instanceof XSDElementDeclaration) {
      declaration=(XSDElementDeclaration)term;
      if (declaration.getAnnotation() == null) {
        XSDFactory factory=XSDSchemaBuildingTools.getXSDFactory();
        annotation=factory.createXSDAnnotation();
      }
 else {
        annotation=declaration.getAnnotation();
      }
    }
  }
}