Program: 135746
Project: 135746
Buggy source:
void set(Object value,Object index){
  if (this.storageType == TokenStorageType.CONSTANT) {
    throw new InvalidTypeException("String_Node_Str");
  }
  if (index == null) {
    index=this.index;
  }
  if (index == null) {
    this.namespace.put(this.name,value);
  }
 else {
    Object base=null;
    if (this.namespace.containsKey(this.name)) {
      base=this.namespace.get(this.name);
    }
 else {
      throw new UndefinedValueException(String.format("String_Node_Str",this.name));
    }
    if (base instanceof List) {
      @SuppressWarnings("String_Node_Str") List<Object> list=(List<Object>)base;
      Integer idx=null;
      if (index instanceof Long) {
        idx=new Integer(((Long)index).intValue());
      }
 else       if (index instanceof String) {
        try {
          idx=new Integer((String)index);
        }
 catch (        NumberFormatException e) {
          throw new InvalidTypeException(String.format("String_Node_Str",this.name,index));
        }
      }
 else {
        throw new InvalidTypeException(String.format("String_Node_Str",this.name,index,index.getClass().getSimpleName()));
      }
      try {
        value=list.set(idx,value);
      }
 catch (      IndexOutOfBoundsException e) {
        throw new UndefinedValueException(String.format("String_Node_Str",this.name,list.size(),idx));
      }
    }
 else     if (base instanceof Map) {
      @SuppressWarnings("String_Node_Str") Map<String,Object> map=(Map<String,Object>)base;
      String idx=null;
      if (index instanceof String) {
        idx=(String)index;
      }
 else {
        throw new InvalidTypeException(String.format("String_Node_Str",this.name,index,index.getClass().getSimpleName()));
      }
      if (!map.containsKey(idx)) {
        throw new UndefinedValueException(String.format("String_Node_Str",this.name,index));
      }
      value=map.put(idx,value);
    }
 else {
      throw new InvalidTypeException(String.format("String_Node_Str",this.name,index,base.getClass().getSimpleName()));
    }
  }
}

Fixed version (ground truth):
void set(Object value,Object index){
  if (this.storageType == TokenStorageType.CONSTANT) {
    throw new InvalidTypeException("String_Node_Str");
  }
  if (index == null) {
    index=this.index;
  }
  if (index == null) {
    this.namespace.put(this.name,value);
  }
 else {
    Object base=null;
    if (this.namespace.containsKey(this.name)) {
      base=this.namespace.get(this.name);
    }
 else {
      throw new UndefinedValueException(String.format("String_Node_Str",this.name));
    }
    if (base instanceof List) {
      @SuppressWarnings("String_Node_Str") List<Object> list=(List<Object>)base;
      Integer idx=null;
      if (index instanceof Long) {
        idx=new Integer(((Long)index).intValue());
      }
 else       if (index instanceof String) {
        try {
          idx=new Integer((String)index);
        }
 catch (        NumberFormatException e) {
          throw new InvalidTypeException(String.format("String_Node_Str",this.name,index,e));
        }
      }
 else {
        throw new InvalidTypeException(String.format("String_Node_Str",this.name,index,index.getClass().getSimpleName()));
      }
      try {
        value=list.set(idx,value);
      }
 catch (      IndexOutOfBoundsException e) {
        throw new UndefinedValueException(String.format("String_Node_Str",this.name,list.size(),idx,e));
      }
    }
 else     if (base instanceof Map) {
      @SuppressWarnings("String_Node_Str") Map<String,Object> map=(Map<String,Object>)base;
      String idx=null;
      if (index instanceof String) {
        idx=(String)index;
      }
 else {
        throw new InvalidTypeException(String.format("String_Node_Str",this.name,index,index.getClass().getSimpleName()));
      }
      if (!map.containsKey(idx)) {
        throw new UndefinedValueException(String.format("String_Node_Str",this.name,index));
      }
      value=map.put(idx,value);
    }
 else {
      throw new InvalidTypeException(String.format("String_Node_Str",this.name,index,base.getClass().getSimpleName()));
    }
  }
}