Program: 11847
Project: 11847
Buggy source:
/** 
 * Returns whether code can be generated for the given object and project type. A project type is repesented by an arbitrary object that is meaningful to the generator adapters for the relevant objects. <p>This result is obtained as follows: <ol> <li>The   {@link GeneratorAdapter adapters} for the object are obtained.<li>A complete collection of objects to be considered is formed by iteratively invoking the {@link GeneratorAdapter#getCanGenerateParent(Object,Object) getCanGenerateParent(Object, Object)} and{@link GeneratorAdapter#getCanGenerateChildren(Object,Object) getCanGenerateChildren(Object, Object)} methodson the adapters for the object, the adapters for the object's parent and children, and so on. It is the adapters' responsibility to determine the relevant objects through their implementations of these methods. <li>The  {@link GeneratorAdapter#canGenerate(Object,Object) canGenerate(Object, Object)} method is invoked on allthe adapters for every object in the set formed in step 2. If any adapter returns <code>true</code> for any object, this method returns <code>true</code>. <li>Otherwise, <code>false</code> is returned. </ol>
 * @see GeneratorAdapter#getCanGenerateParent(Object,Object)
 * @see GeneratorAdapter#getCanGenerateChildren(Object,Object)
 * @see GeneratorAdapter#canGenerate(Object,Object)
 */
public boolean canGenerate(Object object,Object projectType){
  GeneratorData[] data=getGeneratorData(object,projectType,false);
  for (int i=0; i < data.length; i++) {
    if (data[i].adapter.canGenerate(data[i].object,projectType)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns whether code can be generated for the given object and project type. A project type is represented by an arbitrary object that is meaningful to the generator adapters for the relevant objects. <p>This result is obtained as follows: <ol> <li>The   {@link GeneratorAdapter adapters} for the object are obtained.<li>A complete collection of objects to be considered is formed by iteratively invoking the {@link GeneratorAdapter#getCanGenerateParent(Object,Object) getCanGenerateParent(Object, Object)} and{@link GeneratorAdapter#getCanGenerateChildren(Object,Object) getCanGenerateChildren(Object, Object)} methodson the adapters for the object, the adapters for the object's parent and children, and so on. It is the adapters' responsibility to determine the relevant objects through their implementations of these methods. <li>The  {@link GeneratorAdapter#canGenerate(Object,Object) canGenerate(Object, Object)} method is invoked on allthe adapters for every object in the set formed in step 2. If any adapter returns <code>true</code> for any object, this method returns <code>true</code>. <li>Otherwise, <code>false</code> is returned. </ol>
 * @see GeneratorAdapter#getCanGenerateParent(Object,Object)
 * @see GeneratorAdapter#getCanGenerateChildren(Object,Object)
 * @see GeneratorAdapter#canGenerate(Object,Object)
 */
public boolean canGenerate(Object object,Object projectType){
  GeneratorData[] data=getGeneratorData(object,projectType,false);
  for (int i=0; i < data.length; i++) {
    if (data[i].adapter.canGenerate(data[i].object,projectType)) {
      return true;
    }
  }
  return false;
}