Merges new class-doc into old one.
770181
def merge_classes(old, new)
      # Merge booleans
      [:extends, :singleton, :private].each do |tag|
        old[tag] = old[tag] || new[tag]
      end
      # Merge arrays
      [:mixins, :alternateClassNames, :requires, :uses, :files].each do |tag|
        old[tag] = (old[tag] || []) + (new[tag] || [])
      end
      # Merge hashes of arrays
      [:aliases].each do |tag|
        new[tag].each_pair do |key, contents|
          old[tag][key] = (old[tag][key] || []) + contents
        end
      end
      old[:doc] = old[:doc].length > 0 ? old[:doc] : new[:doc]
      # Additionally the doc-comment can contain configs and constructor
      old[:members] += new[:members]
    end
1248760
protected ClassInfo mergeClassConfigInfo(ClassInfo classInfo) {
        // Update introspected class information from introspected package
        PackageInfo packageInfo = configFileParser.getPackageInfo(classInfo.getInternalPackageName());
        if (packageInfo == null) {
            packageInfo = getPackageInfo(classInfo.getInternalPackageName());
        }
        classInfo.updateDefaultValuesFromPackageInfo(packageInfo);

        // Override introspected class information from configuration document
        ClassInfo ci = configFileParser.getClassInfo(classInfo.getInternalClassName());
        if (ci != null) {
            classInfo.overrideValuesFromExplicitClassInfo(ci);
        }

        return classInfo;
    }
1332712
@Override
   void addDocuments(Document[] docs) throws IOException
   {
      for (int i = 0; i < docs.length; i++)
      {
         Document old = pending.put(docs[i].get(FieldNames.UUID), docs[i]);
         if (old != null)
         {
            Util.disposeDocument(old);
         }
         if (pending.size() >= bufferSize)
         {
            commitPending();
         }
         numDocs++;
      }
      invalidateSharedReader();
   }
594082
function merge(docset, customTags) {
  doc_ast.linenr = docset["linenr"];

  // useful for applying global NS items to the proper NS
  docset["original_name"] = docset["code"].name;
  docset["comment"] = doc_ast.detect(docset["tagname"], docset["comment"], customTags);
  
  return Merger.merge(docset);
}
336985
def reassemble(cls, fields, document):
        
        for field_name in cls._instructions:
            if field_name in fields:
                maker = cls._instructions[field_name]
                with maker.target(document):
                    document[field_name] = maker()
607090
void replaceC4Document(C4Document c4doc) {
        synchronized (lock) {
            final C4Document oldDoc = this.c4doc;
            this.c4doc = c4doc;
            if (oldDoc != this.c4doc) {
                if (this.c4doc != null) { this.c4doc.retain(); }
                if (oldDoc != null) {
                    oldDoc.release();  // oldDoc should be retained.
                }
            }
        }
    }
588950
def general_merge(h, docs, code)
      # Add all items in docs not already in result.
      docs.each_pair do |key, value|
        h[key] = value unless h[key]
      end

      # Add all items in code not already in result and mark them as
      # auto-detected.  But only if the explicit and auto-detected
      # names don't conflict.
      if Merger.can_be_autodetected?(docs, code)
        code.each_pair do |key, value|
          unless h[key]
            h[key] = value
            mark_autodetected(h, key)
          end
        end
      end
    end
242292
def clean_up(self):
        """"""
        self.action_buffer = []
        self.sources = {}
        self.doc_to_get = {}
        self.doc_to_update = []
446495
function reset_methods(doc) {

				if(is.array(doc)) {
					return ARRAY(doc).map(reset_methods).valueOf();
				}

				if(is.object(doc)) {
					ARRAY(methods).forEach(function(method) {
						delete doc[method.$name];
					});
				}

				return doc;
			}
713124
def update_or_replace(cls_desc)
      old_cls = nil

      if @options.merge
        rdr = RI::RiReader.new(RI::RiCache.new(@options.op_dir))

        namespace = rdr.top_level_namespace
        namespace = rdr.lookup_namespace_in(cls_desc.name, namespace)
        if namespace.empty?
          $stderr.puts "You asked me to merge this source into existing "
          $stderr.puts "documentation. This file references a class or "
          $stderr.puts "module called #{cls_desc.name} which I don't"
          $stderr.puts "have existing documentation for."
          $stderr.puts 
          $stderr.puts "Perhaps you need to generate its documentation first"
          exit 1
        else
          old_cls = namespace[0]
        end
      end

      if old_cls.nil?
        # no merge: simply overwrite
        @ri_writer.remove_class(cls_desc)
        @ri_writer.add_class(cls_desc)
      else
        # existing class: merge in
        old_desc = rdr.get_class(old_cls)

        old_desc.merge_in(cls_desc)
        @ri_writer.add_class(old_desc)
      end
    end
426659
private void mergeOneOf() {
        if (SchemaCompositeMatchers.hasOneOf().matches(schema)) {
            SchemaList list = schema.getOneOf();
            Schema choice = list.get(rnd.nextInt(list.size()));
            schema.getJson().remove("oneOf");
            schema.merge(choice);
        }
    }
1115880
public function updateReferences()
    {
        // update all subclass references
        foreach ($this->classes as $class) {
            $className = $class->name;
            while (isset($this->classes[$class->parentClass])) {
                $class = $this->classes[$class->parentClass];
                $class->subclasses[] = $className;
            }
        }
        // update interfaces of subclasses
        foreach ($this->classes as $class) {
            $this->updateSubclassInterfacesTraits($class);
        }
        // update implementedBy and usedBy for interfaces and traits
        foreach ($this->classes as $class) {
            foreach ($class->traits as $trait) {
                if (isset($this->traits[$trait])) {
                    $trait = $this->traits[$trait];
                    $trait->usedBy[] = $class->name;
                    $class->properties = array_merge($trait->properties, $class->properties);
                    $class->methods = array_merge($trait->methods, $class->methods);
                }
            }
            foreach ($class->interfaces as $interface) {
                if (isset($this->interfaces[$interface])) {
                    $this->interfaces[$interface]->implementedBy[] = $class->name;
                    if ($class->isAbstract) {
                        // add not implemented interface methods
                        foreach ($this->interfaces[$interface]->methods as $method) {
                            if (!isset($class->methods[$method->name])) {
                                $class->methods[$method->name] = $method;
                            }
                        }
                    }
                }
            }
        }
        foreach ($this->interfaces as $interface) {
            foreach ($interface->parentInterfaces as $pInterface) {
                if (isset($this->interfaces[$pInterface])) {
                    $this->interfaces[$pInterface]->implementedBy[] = $interface->name;
                }
            }
        }
        // inherit docs
        foreach ($this->classes as $class) {
            $this->inheritDocs($class);
        }
        // inherit properties, methods, contants and events to subclasses
        foreach ($this->classes as $class) {
            $this->updateSubclassInheritance($class);
        }
        foreach ($this->interfaces as $interface) {
            $this->updateSubInterfaceInheritance($interface);
        }
        // add properties from getters and setters
        foreach ($this->classes as $class) {
            $this->handlePropertyFeature($class);
        }

        // TODO reference exceptions to methods where they are thrown
    }
761775
def overwrite_docs(self, doc):
        """"""
        for i in range(len(self.docstring)):
            if (self.docstring[i].doctype == doc.doctype and
                self.docstring[i].pointsto == doc.pointsto):
                del self.docstring[i]
                break

        self.docstring.append(doc)
617307
def make_deprecated_class(oldname, NewClass):
    
    msg = ("{module}.{} has been renamed to {module}.{}"
           .format(oldname, NewClass.__name__, module=NewClass.__module__))

    class OldClass(NewClass):
        def __new__(cls, *args, **kwargs):
            raise NotImplementedError(msg)
    OldClass.__doc__ = msg
    OldClass.__qualname__ = OldClass.__name__ = oldname
    return OldClass
377535
def merge(self, *others):
        '''
        
        '''
        new_pileups = {}
        for collection in (self,) + others:
            for (locus, pileup) in collection.pileups.items():
                if locus in new_pileups:
                    new_pileups[locus].update(pileup)
                else:
                    new_pileups[locus] = Pileup(locus, pileup.elements)
        return PileupCollection(new_pileups, parent=self)
83490
def merge_join_docs(self, keys):
        

        join = defaultdict(list)

        for key in keys:
            join[key] = self.generate_join_docs_list(
                self.collections_data['left'].get(key, []), self.collections_data['right'].get(key, []))
        return join
525086
function mergeField(memo, key){
  var result = {},
    match;

  if(_.isPlainObject(key)){
    result = key;
  }else if(_.isString(key) && (match = key.match(re.RENAME))){
    result[match[2]] = match[1];
  }else{
    result[key] = null;
  }

  return _.merge(memo, result);
}