计算拖放目标可以释放的节点列表（释放意味着成为其子树），存在这条限制规则： - 不能拖放到拖放目标的子树上（允许拖放到自身，因为多选的情况下可以把其它节点加入）  1. 加入当前节点（初始为根节点）到允许列表 2. 对于当前节点的每一个子节点： (1) 如果是拖放目标的其中一个节点，忽略（整棵子树被剪枝） (2) 如果不是拖放目标之一，以当前子节点为当前节点，回到 1 计算 3. 返回允许列表
482106
function() {
                function findAvailableParents(nodes, root) {
                    var availables = [], i;
                    availables.push(root);
                    root.getChildren().forEach(function(test) {
                        for (i = 0; i < nodes.length; i++) {
                            if (nodes[i] == test) return;
                        }
                        availables = availables.concat(findAvailableParents(nodes, test));
                    });
                    return availables;
                }
                this._dropTargets = findAvailableParents(this._dragSources, this._minder.getRoot());
                this._dropTargetBoxes = this._dropTargets.map(function(source) {
                    return source.getLayoutBox();
                });
            }
504873
function Context(ret) {
    this.ret = ret;

    // 初始化文件列表
    var fileMap = this.filePathMap = ret.src;

    // 初始化资源映射表
    var fileIdMap = this.fileIdMap = {};
    var fileUrlMap = this.fileUrlMap = {};
    var files = this.files = [];
    Object.keys(fileMap).forEach(function (subpath) {
        var file = fileMap[subpath];
        files.push(file);
        fileIdMap[file.id] = file;
        if (file.release) {
            fileUrlMap[file.getUrl()] = file;
        }
    });
    this.resIdMap = {};
    this.root = fis.project.getProjectPath();
    this.requireConfig = getAmdConfig();
    this.moduleConfig = amdHelper.initModuleConfig(this.requireConfig, this.root);
    this.toPackItems = [];
}
468403
async function rmdir(src) {
    let stats = await stat(src);

    // 判断是否存在文件夹
    if (stats) {
        if (stats.isDirectory()) {
            let files = await readdir(src);

            // 移除下级目录
            await Promise.all(
                files.map(file => rmdir(path.join(src, file)))
            );

            // 移除文件夹
            await removedir(src);
        } else {
            await unlink(src);
        }
    }
}
528611
function (path, cb) {
    if ($bc_.pN) {
      try {
        var params = {}
        // 限制内部属性：
        params['callback'] = params['callback'] || $bc_._get_callback(function (obj) {
          cb && cb(obj)
        }, true)
        params['path'] = path || ($bc_.pN.path.tempDir() + '/tmp_dir001')

        return $bc_.pN.window.getOtherAppInfo(JSON.stringify(params))
      } catch (e) {
        console.error(e)
      }
    }

    return ''
  }
306460
function merge(need, options, level){
    // 如果没有传第三个参数，默认无限递归右边覆盖左边
    if (level == undefined) level = -1;
    if (options === undefined) options = {};
    if (need.length == 1) return need[0];
    var res = {};
    for (var i = 0; i < need.length; i++){
        _merge(res, need[i], options, level - 1);
    }
    return res;
}
1033377
public void addChild(ViewNode child) throws IllegalArgumentException {
		tree.addNode(child);
		child.setParent(this);
		this.leaf = false; // 一旦增加子节点，该节点就不是叶了。
		int n = children.size();
		if (n > 0) {
			ViewNode node = (ViewNode) children.get(n - 1);
			node.setLast(false);
		}
		child.setLast(true);
		children.add(child);
	}
418892
function attachConsole(options) {
    var appender = {
        type: 'console',
        layout: extend({}, options.layout)
    };

    if (appender.layout.type === 'pattern' && options.layout.pattern) {
        // 给终端的level加个颜色～
        appender.layout.pattern = options.layout.pattern.replace(/\[%p\]/g, '[%[%p%]]');
    }

    config.appenders.push(appender);
}
293127
static public function init() {

        // 日志目录转换为绝对路径 默认情况下存储到公共模块下面
        C('LOG_PATH',   realpath(LOG_PATH).'/Common/');

        // 定义当前请求的系统常量
        define('NOW_TIME',      $_SERVER['REQUEST_TIME']);
        define('REQUEST_METHOD',$_SERVER['REQUEST_METHOD']);
        define('IS_GET',        REQUEST_METHOD =='GET' ? true : false);
        define('IS_POST',       REQUEST_METHOD =='POST' ? true : false);
        define('IS_PUT',        REQUEST_METHOD =='PUT' ? true : false);
        define('IS_DELETE',     REQUEST_METHOD =='DELETE' ? true : false);

        // URL调度
        Dispatcher::dispatch();

        if(C('REQUEST_VARS_FILTER')){
			// 全局安全过滤
			array_walk_recursive($_GET,		'think_filter');
			array_walk_recursive($_POST,	'think_filter');
			array_walk_recursive($_REQUEST,	'think_filter');
		}

        define('IS_AJAX',       ((isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') || !empty($_POST[C('VAR_AJAX_SUBMIT')]) || !empty($_GET[C('VAR_AJAX_SUBMIT')])) ? true : false);

        // TMPL_EXCEPTION_FILE 改为绝对地址
        C('TMPL_EXCEPTION_FILE',realpath(C('TMPL_EXCEPTION_FILE')));
        return ;
    }
1237142
function otfContours2ttfContours(otfContours) {
            if (!otfContours || !otfContours.length) {
                return otfContours;
            }
            var contours = [];
            for (var i = 0, l = otfContours.length; i < l; i++) {

                // 这里可能由于转换错误导致空轮廓，需要去除
                if (otfContours[i][0]) {
                    contours.push(transformContour(otfContours[i]));
                }
            }

            return contours;
        }
1247202
public void init() throws WatchException{
		//获取目录或文件路径
		if(false ==Files.exists(this.path, LinkOption.NOFOLLOW_LINKS)) {
			final Path lastPathEle = FileUtil.getLastPathEle(this.path);
			if(null != lastPathEle) {
				final String lastPathEleStr = lastPathEle.toString();
				//带有点表示有扩展名，按照未创建的文件对待。Linux下.d的为目录，排除之
				if(StrUtil.contains(lastPathEleStr, StrUtil.C_DOT) && false ==StrUtil.endWithIgnoreCase(lastPathEleStr, ".d")) {
					this.filePath = this.path;
					this.path = this.filePath.getParent();
				}
			}
			
			//创建不存在的目录或父目录
			try {
				Files.createDirectories(this.path);
			} catch (IOException e) {
				throw new IORuntimeException(e);
			}
		}else if(Files.isRegularFile(this.path, LinkOption.NOFOLLOW_LINKS)){
			this.filePath = this.path;
			this.path = this.filePath.getParent();
		}
		
		//初始化监听
		try {
			watchService = FileSystems.getDefault().newWatchService();
		} catch (IOException e) {
			throw new WatchException(e);
		}
		
		isClosed = false;
	}
146968
function(pathname) {
        var prefix = this._options.root + pathname;
        var paths;
        if (pathname.charAt(pathname.length - 1) === "/") {
            // pathname是个路径，比如： /path/name/
            paths = [   prefix + "index.js",
                prefix + "index.json",
                prefix + "index.html"
            ];
        } else {
            var result = ExtReg.exec(pathname);
            if (result && result[1]) {
                // pathname有后缀，比如：/path/to/filename.do

                var ext = result[1].toLowerCase();
                if (ext != "js") {
                    paths = [   prefix + ".js",
                        prefix + ".json",
                        prefix + ".html"
                    ];
                }
                paths.push(prefix);
            } else {
                // pathname没有后缀，比如：/path/name
                paths = [   prefix + ".js",
                    prefix + ".json",
                    prefix + ".html",
                    prefix + "/index.js",
                    prefix + "/index.json",
                    prefix + "/index.html"
                ];
            }
        }

        return paths;
    }
1336955
private int fetch(State parent, List<Map.Entry<Integer, State>> siblings)
    {
        if (parent.isAcceptable())
        {
            State fakeNode = new State(-(parent.getDepth() + 1));  // 此节点是parent的子节点，同时具备parent的输出
            fakeNode.addEmit(parent.getLargestValueId());
            siblings.add(new AbstractMap.SimpleEntry<Integer, State>(0, fakeNode));
        }
        for (Map.Entry<Character, State> entry : parent.getSuccess().entrySet())
        {
            siblings.add(new AbstractMap.SimpleEntry<Integer, State>(entry.getKey() + 1, entry.getValue()));
        }
        return siblings.size();
    }
1109983
function ( src, dst, callback ){
      fs.exists( dst, function ( exists ){
          // 已存在
          if( exists ){
              callback( src, dst );
          }

          // 不存在
          else{
              fs.mkdir( dst, function (){
                  callback( src, dst );
              });
          }
      });
  }
891833
private void moveFiles(FileLoadContext context, List<FileData> fileDatas, File rootDir) {
        Exception exception = null;
        adjustPoolSize(context);
        ExecutorCompletionService<Exception> executorComplition = new ExecutorCompletionService<Exception>(executor);

        List<Future<Exception>> results = new ArrayList<Future<Exception>>();
        for (FileData fileData : fileDatas) {
            Future<Exception> future = executorComplition.submit(new FileLoadWorker(context, rootDir, fileData));
            results.add(future);

            // fast fail
            if (future.isDone()) { // 如果是自己执行的任务(线程池采用 CallerRunsPolicy)，则立刻进行检查
                try {
                    exception = future.get();
                } catch (Exception e) {
                    exception = e;
                }
                if (exception != null) {
                    for (Future<Exception> result : results) {
                        if (!result.isDone() && !result.isCancelled()) {
                            result.cancel(true);
                        }
                    }
                    throw exception instanceof LoadException ? (LoadException) exception : new LoadException(exception);
                }
            }

        }

        int resultSize = results.size();
        int cursor = 0;
        while (cursor < resultSize) {
            try {
                Future<Exception> result = executorComplition.take();
                exception = result.get();
            } catch (Exception e) {
                exception = e;
                break;
            }
            cursor++;
        }

        if (cursor != resultSize) { // 发现任务出错，立刻把正在进行的任务取消
            for (Future<Exception> future : results) {
                if (!future.isDone() && !future.isCancelled()) {
                    future.cancel(true);
                }
            }

        }

        if (exception != null) {
            throw exception instanceof LoadException ? (LoadException) exception : new LoadException(exception);
        }
    }
949104
function combine(file) {
      if (!file) return;

      if (pathArr.indexOf(file.path) < 0) {
        pathArr.push(file.path);

        if (file.caculateContents) {
          cont = file.caculateContents
        } else {
          return;
        }

        contents.push(cont);

        size += cont.length;
      }

      if (file.children) {
        // 遍历依赖文件并且合并
        file.children.forEach(function(fc) {
          combine(denps[fc] || {path: fc});
        });
      }
    }
286541
private void addRootNode(TrieNode rootNode){
        //计算节点的存储索引
        int index = rootNode.getCharacter()%INDEX_LENGTH;
        //检查索引是否和其他节点冲突
        TrieNode existTrieNode = ROOT_NODES_INDEX[index];
        if(existTrieNode != null){
            //有冲突，将冲突节点附加到当前节点之后
            rootNode.setSibling(existTrieNode);
        }
        //新增的节点总是在最前
        ROOT_NODES_INDEX[index] = rootNode;
    }
1349446
function findModulePath(filename_rootfile, filename, options = DEFAULT_OPTIONS) {
    /**
     * . 相对路径
     * . 绝对路径
     */
    const ext = path.extname(filename);
    if (ext && exports.extensions.indexOf(ext) === -1) {
        return null;
    }
    if (path.dirname(filename_rootfile) !== filename_rootfile) {
        filename_rootfile = path.dirname(filename_rootfile);
    }
    const storeKey = storePathKey(filename_rootfile, filename);
    const storeKeyVal = store.get(storeKey);
    const { baseUrl = DEFAULT_OPTIONS.baseUrl } = options;
    if (storeKeyVal) {
        return storeKeyVal === "null" ? null : storeKeyVal;
    }
    // save result path and return pathname
    const storeAndReturn = (rpath) => {
        store.set(storeKey, String(rpath));
        return rpath;
    };
    const roots = baseUrl.concat(filename_rootfile);
    let r = null;
    roots.some(baseRoot => {
        if (ext) {
            const namepath = genPath(baseRoot, filename);
            r = namepath;
            return !!namepath;
        }
        let namepath2 = null;
        exports.extensions.some(extname => {
            namepath2 = genPath(baseRoot, `${filename}${extname}`);
            if (!namepath2) {
                namepath2 = genPath(baseRoot, `${filename}/index${extname}`);
            }
            return !!namepath2;
        });
        if (namepath2) {
            r = namepath2;
            return true;
        }
        return false;
    });
    return storeAndReturn(r);
}