Program: 169010
Project: 169010
Buggy source:
@SuppressWarnings("String_Node_Str") private ViewTypeObjectBuilderTemplate(String aliasPrefix,List<String> mappingPrefix,String idPrefix,int[] idPositions,int tupleOffset,Metamodel metamodel,EntityViewManagerImpl evm,ExpressionFactory ef,ViewType<T> viewType,MappingConstructor<T> mappingConstructor,ProxyFactory proxyFactory){
  if (mappingConstructor == null) {
    if (viewType.getConstructors().size() > 1) {
      throw new IllegalArgumentException("String_Node_Str" + viewType.getJavaType().getName() + "String_Node_Str");
    }
 else     if (viewType.getConstructors().size() == 1) {
      mappingConstructor=(MappingConstructor<T>)viewType.getConstructors().toArray()[0];
    }
  }
  this.aliasPrefix=aliasPrefix;
  this.mappingPrefix=mappingPrefix;
  this.idPrefix=idPrefix;
  this.idPositions=idPositions;
  this.tupleOffset=tupleOffset;
  this.metamodel=metamodel;
  this.evm=evm;
  this.ef=ef;
  this.proxyFactory=proxyFactory;
  Set<MethodAttribute<? super T,?>> attributeSet=viewType.getAttributes();
  attributeSet.remove(viewType.getIdAttribute());
  MethodAttribute<?,?>[] attributes=attributeSet.toArray(new MethodAttribute<?,?>[attributeSet.size()]);
  ParameterAttribute<?,?>[] parameterAttributes;
  if (mappingConstructor == null) {
    parameterAttributes=new ParameterAttribute<?,?>[0];
  }
 else {
    List<ParameterAttribute<? super T,?>> parameterAttributeList=mappingConstructor.getParameterAttributes();
    parameterAttributes=parameterAttributeList.toArray(new ParameterAttribute<?,?>[parameterAttributeList.size()]);
  }
  int length=1 + attributes.length + parameterAttributes.length;
  EntityType<?> entityType=metamodel.entity(viewType.getEntityClass());
  javax.persistence.metamodel.SingularAttribute<?,?> jpaIdAttr=entityType.getId(entityType.getIdType().getJavaType());
  Class<?> idAttributeType;
  if (jpaIdAttr.getJavaMember() instanceof Field) {
    idAttributeType=ReflectionUtils.getResolvedFieldType(viewType.getEntityClass(),(Field)jpaIdAttr.getJavaMember());
  }
 else {
    idAttributeType=ReflectionUtils.getResolvedMethodReturnType(viewType.getEntityClass(),(Method)jpaIdAttr.getJavaMember());
  }
  if (idAttributeType == null) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + jpaIdAttr.getName() + "String_Node_Str"+ viewType.getEntityClass().getName()+ "String_Node_Str");
  }
  String idAttributeName=jpaIdAttr.getName();
  MethodAttribute<?,?> idAttribute=viewType.getIdAttribute();
  MappingAttribute<?,?> idMappingAttribute=(MappingAttribute<?,?>)idAttribute;
  if (!idAttributeName.equals(idMappingAttribute.getMapping())) {
    throw new IllegalArgumentException("String_Node_Str" + idMappingAttribute.getMapping() + "String_Node_Str"+ viewType.getJavaType().getName()+ "String_Node_Str"+ idAttributeName+ "String_Node_Str");
  }
  String idMapping=idPrefix == null ? idAttributeName : idPrefix + "String_Node_Str" + idAttributeName;
  List<Object> mappingList=new ArrayList<Object>(length);
  List<String> parameterMappingList=new ArrayList<String>(length);
  Class<?>[] parameterTypes=new Class<?>[length];
  boolean[] featuresFound=new boolean[3];
  parameterTypes[0]=idAttributeType;
  mappingList.add(0,new Object[]{idMapping,getAlias(aliasPrefix,idAttribute)});
  parameterMappingList.add(0,null);
  for (int i=0; i < attributes.length; i++) {
    parameterTypes[i + 1]=attributes[i].getJavaType();
  }
  for (int i=0; i < parameterAttributes.length; i++) {
    parameterTypes[i + attributes.length + 1]=parameterAttributes[i].getJavaType();
  }
  this.objectInstantiator=new UnsafeInstantiator<T>(mappingConstructor,proxyFactory,viewType,parameterTypes);
  for (int i=0; i < attributes.length; i++) {
    applyMapping(attributes[i],mappingList,parameterMappingList,featuresFound);
  }
  for (int i=0; i < parameterAttributes.length; i++) {
    applyMapping(parameterAttributes[i],mappingList,parameterMappingList,featuresFound);
  }
  this.hasParameters=featuresFound[0];
  this.hasIndexedCollections=featuresFound[1];
  this.hasSubviews=featuresFound[2];
  this.effectiveTupleSize=length;
  this.mappers=getMappers(mappingList);
  this.parameterMapper=new TupleParameterMapper(parameterMappingList,tupleOffset);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private ViewTypeObjectBuilderTemplate(String aliasPrefix,List<String> mappingPrefix,String idPrefix,int[] idPositions,int tupleOffset,Metamodel metamodel,EntityViewManagerImpl evm,ExpressionFactory ef,ViewType<T> viewType,MappingConstructor<T> mappingConstructor,ProxyFactory proxyFactory){
  if (mappingConstructor == null) {
    if (viewType.getConstructors().size() > 1) {
      throw new IllegalArgumentException("String_Node_Str" + viewType.getJavaType().getName() + "String_Node_Str");
    }
 else     if (viewType.getConstructors().size() == 1) {
      mappingConstructor=(MappingConstructor<T>)viewType.getConstructors().toArray()[0];
    }
  }
  this.aliasPrefix=aliasPrefix;
  this.mappingPrefix=mappingPrefix;
  this.idPrefix=idPrefix;
  this.idPositions=idPositions;
  this.tupleOffset=tupleOffset;
  this.metamodel=metamodel;
  this.evm=evm;
  this.ef=ef;
  this.proxyFactory=proxyFactory;
  Set<MethodAttribute<? super T,?>> attributeSet=viewType.getAttributes();
  attributeSet.remove(viewType.getIdAttribute());
  MethodAttribute<?,?>[] attributes=attributeSet.toArray(new MethodAttribute<?,?>[attributeSet.size()]);
  ParameterAttribute<?,?>[] parameterAttributes;
  if (mappingConstructor == null) {
    parameterAttributes=new ParameterAttribute<?,?>[0];
  }
 else {
    List<ParameterAttribute<? super T,?>> parameterAttributeList=mappingConstructor.getParameterAttributes();
    parameterAttributes=parameterAttributeList.toArray(new ParameterAttribute<?,?>[parameterAttributeList.size()]);
  }
  int length=1 + attributes.length + parameterAttributes.length;
  EntityType<?> entityType=metamodel.entity(viewType.getEntityClass());
  javax.persistence.metamodel.SingularAttribute<?,?> jpaIdAttr=entityType.getId(entityType.getIdType().getJavaType());
  Class<?> idAttributeType;
  if (jpaIdAttr.getJavaMember() instanceof Field) {
    idAttributeType=ReflectionUtils.getResolvedFieldType(viewType.getEntityClass(),(Field)jpaIdAttr.getJavaMember());
  }
 else {
    idAttributeType=ReflectionUtils.getResolvedMethodReturnType(viewType.getEntityClass(),(Method)jpaIdAttr.getJavaMember());
  }
  if (idAttributeType == null) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + jpaIdAttr.getName() + "String_Node_Str"+ viewType.getEntityClass().getName()+ "String_Node_Str");
  }
  String idAttributeName=jpaIdAttr.getName();
  MethodAttribute<?,?> idAttribute=viewType.getIdAttribute();
  MappingAttribute<?,?> idMappingAttribute=(MappingAttribute<?,?>)idAttribute;
  if (!idAttributeName.equals(idMappingAttribute.getMapping())) {
    throw new IllegalArgumentException("String_Node_Str" + idMappingAttribute.getMapping() + "String_Node_Str"+ viewType.getJavaType().getName()+ "String_Node_Str"+ idAttributeName+ "String_Node_Str");
  }
  String idMapping=idPrefix == null ? idAttributeName : idPrefix + "String_Node_Str" + idAttributeName;
  List<Object> mappingList=new ArrayList<Object>(length);
  List<String> parameterMappingList=new ArrayList<String>(length);
  Class<?>[] parameterTypes=new Class<?>[length];
  boolean[] featuresFound=new boolean[3];
  parameterTypes[0]=idAttributeType;
  mappingList.add(0,new Object[]{idMapping,getAlias(aliasPrefix,idAttribute)});
  parameterMappingList.add(0,null);
  for (int i=0; i < attributes.length; i++) {
    parameterTypes[i + 1]=attributes[i].getJavaType();
  }
  for (int i=0; i < parameterAttributes.length; i++) {
    parameterTypes[i + attributes.length + 1]=parameterAttributes[i].getJavaType();
  }
  if (viewType.getConstructors().isEmpty()) {
    this.objectInstantiator=new ReflectionInstantiator<T>(mappingConstructor,proxyFactory,viewType,parameterTypes);
  }
 else {
    this.objectInstantiator=new UnsafeInstantiator<T>(mappingConstructor,proxyFactory,viewType,parameterTypes);
  }
  for (int i=0; i < attributes.length; i++) {
    applyMapping(attributes[i],mappingList,parameterMappingList,featuresFound);
  }
  for (int i=0; i < parameterAttributes.length; i++) {
    applyMapping(parameterAttributes[i],mappingList,parameterMappingList,featuresFound);
  }
  this.hasParameters=featuresFound[0];
  this.hasIndexedCollections=featuresFound[1];
  this.hasSubviews=featuresFound[2];
  this.effectiveTupleSize=length;
  this.mappers=getMappers(mappingList);
  this.parameterMapper=new TupleParameterMapper(parameterMappingList,tupleOffset);
}