Externalize the source map.
510192
public SourceMap toJSON() {
        SourceMap map = new SourceMap();
        map.version = this._version;
        map.sources = this._sources.toArray();
        map.names = this._names.toArray();
        map.mappings = serializeMappings();
        map.file = this._file;
        map.sourceRoot = this._sourceRoot;
        if (this._sourcesContents != null) {
            map.sourcesContent = _generateSourcesContent(map.sources, this._sourceRoot);
        }
        return map;
    }
1359964
function fixImportedSourceMap(file, state, callback) {
  if (!state.map) {
    return callback();
  }

  state.map.sourcesContent = state.map.sourcesContent || [];

  nal.map(state.map.sources, normalizeSourcesAndContent, callback);

  function assignSourcesContent(sourceContent, idx) {
    state.map.sourcesContent[idx] = sourceContent;
  }

  function normalizeSourcesAndContent(sourcePath, idx, cb) {
    var sourceRoot = state.map.sourceRoot || '';
    var sourceContent = state.map.sourcesContent[idx] || null;

    if (isRemoteSource(sourcePath)) {
      assignSourcesContent(sourceContent, idx);
      return cb();
    }

    if (state.map.sourcesContent[idx]) {
      return cb();
    }

    if (sourceRoot && isRemoteSource(sourceRoot)) {
      assignSourcesContent(sourceContent, idx);
      return cb();
    }

    var basePath = path.resolve(file.base, sourceRoot);
    var absPath = path.resolve(state.path, sourceRoot, sourcePath);
    var relPath = path.relative(basePath, absPath);
    var unixRelPath = normalizePath(relPath);

    state.map.sources[idx] = unixRelPath;

    if (absPath !== file.path) {
      // Load content from file async
      return fs.readFile(absPath, onRead);
    }

    // If current file: use content
    assignSourcesContent(state.content, idx);
    cb();

    function onRead(err, data) {
      if (err) {
        assignSourcesContent(null, idx);
        return cb();
      }
      assignSourcesContent(removeBOM(data).toString('utf8'), idx);
      cb();
    }
  }
}
825434
function getSourceMap(options) {
  var sourceMap = options.sourceMap;

  if (sourceMap && typeof sourceMap !== 'string' && options.outFile) {
    sourceMap = options.outFile + '.map';
  }

  return sourceMap && typeof sourceMap === 'string' ? path.resolve(sourceMap) : null;
}
1283810
function insert(outMap, inMap, length, index) {
  // Move existing mappings
  if (length) {
    outMap._mappings.unsortedForEach(mapping => {
      if (mapping.generatedLine > index) mapping.generatedLine += length;
    });
  }

  // Add new mappings
  if (inMap) {
    const inConsumer = new SourceMapConsumer(inMap.toJSON());

    inConsumer.eachMapping(mapping => {
      outMap.addMapping({
        source: mapping.source,
        original: mapping.source == null
          ? null
          : {
              line: mapping.originalLine,
              column: mapping.originalColumn
            },
        generated: {
          line: index + mapping.generatedLine - 1,
          column: mapping.generatedColumn
        }
      });
    });

    inConsumer.sources.forEach((source, idx) => {
      outMap.setSourceContent(source, inConsumer.sourcesContent[idx]);
    });
  }
}
209325
function externalizeRow(row, columns, mapColumnIdToExtractFnName)
{
  var externalizedRow = {};
  for (var index = 0, length = columns.length; index < length; index++)
  {
    var column = columns[index];
    var extractFnName = mapColumnIdToExtractFnName[column.getId()];
    externalizedRow[column.getName()] = row[extractFnName](column.getId());
  }

  return externalizedRow;
}
901249
private static void copyTo(Map lastMap, Dialect d) {
		Map<String, String> target = d.functions;
		target.clear();
		target.putAll(lastMap);
	}
802856
function mapSources (sourceMap, mapCallback) {
  let chain = Promise.resolve()
  function pushChain (path, index, arr) {
    chain = chain
      .then(() => mapCallback(path))
      .then(replacement => {
        arr[index] = replacement || path
      })
  }
  if (sourceMap.sources) {
    sourceMap.sources.forEach(pushChain)
  }
  if (sourceMap.sections) {
    sourceMap.sections.forEach(section => {
      if (section.map && section.map.sources) {
        section.map.sources.forEach(pushChain)
      }
    })
  }
  return chain.then(() => sourceMap)
}
410701
@Override
  public void store(DefaultExternalIssue externalIssue) {
    if (externalIssue.primaryLocation().inputComponent() instanceof DefaultInputFile) {
      DefaultInputFile defaultInputFile = (DefaultInputFile) externalIssue.primaryLocation().inputComponent();
      defaultInputFile.setPublished(true);
    }
    moduleIssues.initAndAddExternalIssue(externalIssue);
  }
1119659
public static byte[] externalize(byte[] buf, int offset, int len) {
        byte[] translated = new byte[len];
        for (int j = 0; j < len; j++) {
            byte b = buf[offset + j];
            if (b == '.') translated[j] = (byte) '/';
            else translated[j] = b;
        }
        return translated;
    }
1195195
function createFromMap(mapObject, content, url) {
  url = url || '<source>';
  if ('string' == typeof mapObject) {
    try {
      mapObject = JSON.parse(mapObject);
    } catch (err) {
      mapObject = {
        version: 3,
        names: [],
        mappings: '',
        file: ''
      };
    }
  }
  if (emptySources(mapObject)) {
    mapObject.sources = [url];
    mapObject.sourcesContent = [content];
  }

  return SourceMapGenerator.fromSourceMap(new SourceMapConsumer(mapObject));
}
211339
public static Map<String, Object> putAllIfNew(Map<String, Object> dest, Map<String, Object> source)
    {
    	if (dest == null)
    		return source;
    	if (source == null)
    	    return dest;
    	for (String key : source.keySet())
    	{
    		if (dest.get(key) == null)
    			dest.put(key, source.get(key));
    	}
    	return dest;
    }
392105
private Object invokeMapper(File source) throws IOException {
        Object[] results;
        String name;
        Reader src;

        name = source.getPath();
        mork.output.verbose("mapping " + name);
        results = run(name);
        mork.output.verbose("finished mapping " + name);
        if (results == null) {
            return null;
        } else {
            return results[0];
        }
    }
329299
@SuppressWarnings("unchecked")
    public static <K, V> Map<K, V> extend(final Map<K, V> destination, final Map<K, V> ... sources) {
        final Map<K, V> result = newLinkedHashMap();
        for (final Map.Entry<K, V> entry : destination.entrySet()) {
            result.put(entry.getKey(), entry.getValue());
        }
        for (final Map<K, V> source : sources) {
            for (final Map.Entry<K, V> entry : source.entrySet()) {
                result.put(entry.getKey(), entry.getValue());
            }
        }
        return result;
    }
1248370
public static Map<Integer,AdvancedExternalizer<?>> moduleExternalizers() {
      Map<Integer,AdvancedExternalizer<?>> externalizerMap = new HashMap<>();
      externalizerMap.put(ExternalizerIds.CHUNK_CACHE_KEY, new ChunkCacheKey.Externalizer());
      externalizerMap.put(ExternalizerIds.FILE_CACHE_KEY, new FileCacheKey.Externalizer());
      externalizerMap.put(ExternalizerIds.FILE_LIST_CACHE_KEY, new FileListCacheKey.Externalizer());
      externalizerMap.put(ExternalizerIds.FILE_METADATA, new FileMetadata.Externalizer());
      externalizerMap.put(ExternalizerIds.FILE_READLOCK_KEY, new FileReadLockKey.Externalizer());
      externalizerMap.put(ExternalizerIds.FILE_LIST_CACHE_VALUE, new FileListCacheValue.Externalizer());
      return externalizerMap;
   }
825285
function extend(destination, source) {
  for (var prop in source)
    if (source.hasOwnProperty(prop))
      destination[prop] = source[prop];
}
365651
function(options) {
    if (config.sourcemaps) {
        options = _.defaults(
            options,
            { devtool: '#source-map' }
        );
    }

    if (config.production) {
        var currPlugins = _.isArray(options.plugins) ? options.plugins : [];
        options.plugins = currPlugins.concat([new UglifyJsPlugin({ sourceMap: false })]);
    }

    return options;
}
408014
private void createReverseMapping() {
    reverseSourceMapping = new HashMap<>();

    for (int targetLine = 0; targetLine < lines.size(); targetLine++) {
      ArrayList<Entry> entries = lines.get(targetLine);

      if (entries != null) {
        for (Entry entry : entries) {
          if (entry.getSourceFileId() != UNMAPPED
              && entry.getSourceLine() != UNMAPPED) {
            String originalFile = sources[entry.getSourceFileId()];

            if (!reverseSourceMapping.containsKey(originalFile)) {
              reverseSourceMapping.put(originalFile,
                  new HashMap<Integer, Collection<OriginalMapping>>());
            }

            Map<Integer, Collection<OriginalMapping>> lineToCollectionMap =
                reverseSourceMapping.get(originalFile);

            int sourceLine = entry.getSourceLine();

            if (!lineToCollectionMap.containsKey(sourceLine)) {
              lineToCollectionMap.put(sourceLine,
                  new ArrayList<OriginalMapping>(1));
            }

            Collection<OriginalMapping> mappings =
                lineToCollectionMap.get(sourceLine);

            Builder builder = OriginalMapping.newBuilder().setLineNumber(
                targetLine).setColumnPosition(entry.getGeneratedColumn());

            mappings.add(builder.build());
          }
        }
      }
    }
  }