Program: 91203
Project: 91203
Buggy source:
private void typeMappingUpdate(Type type,SymbolType typeArg) throws InvalidTypeException {
  if (type instanceof TypeVariable) {
    String name=((TypeVariable<?>)type).getName();
    Symbol<?> s=typeParamsSymbolTable.findSymbol(name,ReferenceType.TYPE,ReferenceType.TYPE_PARAM);
    SymbolType st=null;
    if (s != null) {
      st=s.getType();
    }
    if ((s == null || st == null) || (st.isTemplateVariable() && s.getReferenceType().equals(ReferenceType.TYPE_PARAM)) || (Object.class.equals(st.getClazz()) && !s.getReferenceType().equals(ReferenceType.TYPE))) {
      typeParamsSymbolTable.pushSymbol(name,ReferenceType.TYPE,typeArg,null);
    }
 else {
      if (s.getReferenceType().equals(ReferenceType.TYPE)) {
        SymbolType aux=(SymbolType)st.merge(typeArg);
        s.setType(aux);
      }
 else {
        typeParamsSymbolTable.pushSymbol(name,ReferenceType.TYPE,typeArg,null);
      }
    }
  }
 else   if (type instanceof ParameterizedType) {
    ParameterizedType paramType=(ParameterizedType)type;
    Type[] args=paramType.getActualTypeArguments();
    if (typeArg != null) {
      Map<String,SymbolType> updateMapping=new LinkedHashMap<String,SymbolType>();
      SymbolType rewrittenType=SymbolType.valueOf(paramType.getRawType(),typeArg,updateMapping,null);
      List<SymbolType> callParams=typeArg.getParameterizedTypes();
      List<SymbolType> rewrittenParams=rewrittenType.getParameterizedTypes();
      if (rewrittenParams != null) {
        Iterator<SymbolType> itP=rewrittenParams.iterator();
        Iterator<SymbolType> auxIt=null;
        if (callParams != null) {
          auxIt=callParams.iterator();
        }
        int i=0;
        while (itP.hasNext() && i < args.length) {
          SymbolType st=itP.next();
          if ((st.getName() == null || Object.class.equals(st.getClazz()))) {
            if (auxIt != null && auxIt.hasNext()) {
              typeMappingUpdate(args[i],auxIt.next());
            }
 else {
              typeMappingUpdate(args[i],st);
            }
          }
 else {
            typeMappingUpdate(args[i],st);
          }
          i++;
        }
      }
    }
  }
 else   if (type instanceof WildcardType) {
    if (typeArg != null) {
      WildcardType wildcardType=(WildcardType)type;
      Type[] upper=wildcardType.getUpperBounds();
      List<SymbolType> bounds=typeArg.getBounds();
      if (bounds == null) {
        bounds=new LinkedList<SymbolType>();
        bounds.add(typeArg);
      }
      for (int i=0; i < upper.length; i++) {
        typeMappingUpdate(upper[i],bounds.get(i));
      }
      Type[] lower=wildcardType.getLowerBounds();
      List<SymbolType> lowerBounds=typeArg.getLowerBounds();
      if (lowerBounds != null) {
        bounds=lowerBounds;
      }
      if (bounds != null) {
        for (int i=0; i < lower.length; i++) {
          typeMappingUpdate(lower[i],bounds.get(i));
        }
      }
    }
  }
 else   if (type instanceof GenericArrayType) {
    if (typeArg != null) {
      GenericArrayType arrayType=(GenericArrayType)type;
      SymbolType aux=typeArg.clone();
      if (typeArg.getArrayCount() > 0) {
        aux.setArrayCount(typeArg.getArrayCount() - 1);
      }
      typeMappingUpdate(arrayType.getGenericComponentType(),aux);
    }
  }
 else   if (type instanceof Class<?>) {
    if (typeArg != null) {
      Class<?> clazz=(Class<?>)type;
      Map<String,SymbolType> updateMapping=new LinkedHashMap<String,SymbolType>();
      SymbolType rewrittenType=SymbolType.valueOf(clazz,typeArg,updateMapping,null);
      TypeVariable[] tvs=clazz.getTypeParameters();
      List<SymbolType> paramTypes=rewrittenType.getParameterizedTypes();
      if (paramTypes != null) {
        Iterator<SymbolType> it=paramTypes.iterator();
        for (int i=0; i < tvs.length && it.hasNext(); i++) {
          SymbolType st=it.next();
          if (st != null) {
            typeMappingUpdate(tvs[i],st);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void typeMappingUpdate(Type type,SymbolType typeArg) throws InvalidTypeException {
  if (type instanceof TypeVariable) {
    String name=((TypeVariable<?>)type).getName();
    Symbol<?> s=typeParamsSymbolTable.findSymbol(name,ReferenceType.TYPE,ReferenceType.TYPE_PARAM);
    SymbolType st=null;
    if (s != null) {
      st=s.getType();
    }
    if ((s == null || st == null) || (st.isTemplateVariable() && s.getReferenceType().equals(ReferenceType.TYPE_PARAM)) || (Object.class.equals(st.getClazz()) && !s.getReferenceType().equals(ReferenceType.TYPE))) {
      typeParamsSymbolTable.pushSymbol(name,ReferenceType.TYPE,typeArg,null);
    }
 else {
      if (s.getReferenceType().equals(ReferenceType.TYPE)) {
        SymbolType aux=(SymbolType)st.merge(typeArg);
        s.setType(aux);
      }
 else {
        typeParamsSymbolTable.pushSymbol(name,ReferenceType.TYPE,typeArg,null);
      }
    }
  }
 else   if (type instanceof ParameterizedType) {
    ParameterizedType paramType=(ParameterizedType)type;
    Type[] args=paramType.getActualTypeArguments();
    if (typeArg != null) {
      Map<String,SymbolType> updateMapping=new LinkedHashMap<String,SymbolType>();
      SymbolType rewrittenType=SymbolType.valueOf(paramType.getRawType(),typeArg,updateMapping,null);
      List<SymbolType> callParams=typeArg.getParameterizedTypes();
      String name=rewrittenType.getName();
      if (name == null || !"String_Node_Str".equals(name)) {
        List<SymbolType> rewrittenParams=rewrittenType.getParameterizedTypes();
        if (rewrittenParams != null) {
          Iterator<SymbolType> itP=rewrittenParams.iterator();
          Iterator<SymbolType> auxIt=null;
          if (callParams != null) {
            auxIt=callParams.iterator();
          }
          int i=0;
          while (itP.hasNext() && i < args.length) {
            SymbolType st=itP.next();
            if ((st.getName() == null || Object.class.equals(st.getClazz()))) {
              if (auxIt != null && auxIt.hasNext()) {
                typeMappingUpdate(args[i],auxIt.next());
              }
 else {
                typeMappingUpdate(args[i],st);
              }
            }
 else {
              typeMappingUpdate(args[i],st);
            }
            i++;
          }
        }
      }
    }
  }
 else   if (type instanceof WildcardType) {
    if (typeArg != null) {
      WildcardType wildcardType=(WildcardType)type;
      Type[] upper=wildcardType.getUpperBounds();
      List<SymbolType> bounds=typeArg.getBounds();
      if (bounds == null) {
        bounds=new LinkedList<SymbolType>();
        bounds.add(typeArg);
      }
      for (int i=0; i < upper.length; i++) {
        typeMappingUpdate(upper[i],bounds.get(i));
      }
      Type[] lower=wildcardType.getLowerBounds();
      List<SymbolType> lowerBounds=typeArg.getLowerBounds();
      if (lowerBounds != null) {
        bounds=lowerBounds;
      }
      if (bounds != null) {
        for (int i=0; i < lower.length; i++) {
          typeMappingUpdate(lower[i],bounds.get(i));
        }
      }
    }
  }
 else   if (type instanceof GenericArrayType) {
    if (typeArg != null) {
      GenericArrayType arrayType=(GenericArrayType)type;
      SymbolType aux=typeArg.clone();
      if (typeArg.getArrayCount() > 0) {
        aux.setArrayCount(typeArg.getArrayCount() - 1);
      }
      typeMappingUpdate(arrayType.getGenericComponentType(),aux);
    }
  }
 else   if (type instanceof Class<?>) {
    if (typeArg != null) {
      Class<?> clazz=(Class<?>)type;
      Map<String,SymbolType> updateMapping=new LinkedHashMap<String,SymbolType>();
      SymbolType rewrittenType=SymbolType.valueOf(clazz,typeArg,updateMapping,null);
      TypeVariable[] tvs=clazz.getTypeParameters();
      List<SymbolType> paramTypes=rewrittenType.getParameterizedTypes();
      if (paramTypes != null) {
        Iterator<SymbolType> it=paramTypes.iterator();
        for (int i=0; i < tvs.length && it.hasNext(); i++) {
          SymbolType st=it.next();
          if (st != null) {
            typeMappingUpdate(tvs[i],st);
          }
        }
      }
    }
  }
}