Program: 135764
Project: 135764
Buggy source:
Object get(Object index){
  Object base=null;
  if (this.storageType == TokenStorageType.CONSTANT) {
    return this.value;
  }
  if (this.namespace.containsKey(this.name)) {
    base=this.namespace.get(this.name);
  }
 else {
    throw new UndefinedValueException(String.format("String_Node_Str",this.name));
  }
  if (index == null) {
    index=this.index;
  }
  if (index == null) {
    value=base;
  }
 else {
    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.get(idx);
      }
 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.get(idx);
    }
 else {
      throw new InvalidTypeException(String.format("String_Node_Str",this.name,index,base.getClass().getSimpleName()));
    }
  }
  this.type=classify(value);
  return value;
}

Fixed version (ground truth):
Object get(Object index){
  Object base=null;
  if (this.storageType == TokenStorageType.CONSTANT) {
    return this.value;
  }
  if (this.namespace.containsKey(this.name)) {
    base=this.namespace.get(this.name);
  }
 else {
    throw new UndefinedValueException(String.format("String_Node_Str",this.name));
  }
  if (index == null) {
    index=this.index;
  }
  if (index == null) {
    value=base;
  }
 else {
    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.get(idx);
      }
 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.get(idx);
    }
 else {
      throw new InvalidTypeException(String.format("String_Node_Str",this.name,index,base.getClass().getSimpleName()));
    }
  }
  this.type=classify(value);
  return value;
}