fex-team / fis-velocity-tools

Like velocity-tools, we focus on the front-end integrated solution.
29 stars 23 forks source link

即使文件没被修改也被reload #28

Open wyzssw opened 8 years ago

wyzssw commented 8 years ago

版本: fis-velocity-tools-2.11.jar bug 代码位置:com.baidu.fis.servlet.ListenerTask.java 67行

                for (int i = 0; i < currentFiles.length; i++) {
                    if (Arrays.binarySearch(filelist, currentFiles[i]) > -1){
                        File file = new File(path, currentFiles[i]);

//                        System.out.println("Check " + file.toPath());
                        if (file.exists() && isFileUpdated(file)) {
                            setRefresh();
                            System.out.println(currentFiles[i]+" changed");
                            break;
                        }
                    }else{
                        System.out.println("File " +  currentFiles[i] + " has be created.");
                        setRefresh();
                        filelist = currentFiles;
                        break;
                    }
                }

//请事先Arrays.sort(filelist)再Arrays.binarySearch

//建议去除System.out代码