@Test public void testIndexVersionNoIndex() throws Exception { IndexVersion.check(new ArrayList<>()); }
public static void check(List<String> subFilesList) throws Exception { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); File indexRoot = new File(env.getDataRootPath(), IndexDatabase.INDEX_DIR); LOGGER.log(Level.FINE, "Checking for Lucene index version mismatch in {0}", indexRoot); if (!subFilesList.isEmpty()) { for (String projectName : subFilesList) { LOGGER.log(Level.FINER, "Checking Lucene index version in project {0}", projectName); checkDir(new File(indexRoot, projectName)); } } else { if (env.isProjectsEnabled()) { for (String projectName : env.getProjects().keySet()) { LOGGER.log(Level.FINER, "Checking Lucene index version in project {0}", projectName); checkDir(new File(indexRoot, projectName)); } } else { LOGGER.log(Level.FINER, "Checking Lucene index version in {0}", indexRoot); checkDir(indexRoot); } } }
IndexVersion { public static void check(List<String> subFilesList) throws Exception { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); File indexRoot = new File(env.getDataRootPath(), IndexDatabase.INDEX_DIR); LOGGER.log(Level.FINE, "Checking for Lucene index version mismatch in {0}", indexRoot); if (!subFilesList.isEmpty()) { for (String projectName : subFilesList) { LOGGER.log(Level.FINER, "Checking Lucene index version in project {0}", projectName); checkDir(new File(indexRoot, projectName)); } } else { if (env.isProjectsEnabled()) { for (String projectName : env.getProjects().keySet()) { LOGGER.log(Level.FINER, "Checking Lucene index version in project {0}", projectName); checkDir(new File(indexRoot, projectName)); } } else { LOGGER.log(Level.FINER, "Checking Lucene index version in {0}", indexRoot); checkDir(indexRoot); } } } }
IndexVersion { public static void check(List<String> subFilesList) throws Exception { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); File indexRoot = new File(env.getDataRootPath(), IndexDatabase.INDEX_DIR); LOGGER.log(Level.FINE, "Checking for Lucene index version mismatch in {0}", indexRoot); if (!subFilesList.isEmpty()) { for (String projectName : subFilesList) { LOGGER.log(Level.FINER, "Checking Lucene index version in project {0}", projectName); checkDir(new File(indexRoot, projectName)); } } else { if (env.isProjectsEnabled()) { for (String projectName : env.getProjects().keySet()) { LOGGER.log(Level.FINER, "Checking Lucene index version in project {0}", projectName); checkDir(new File(indexRoot, projectName)); } } else { LOGGER.log(Level.FINER, "Checking Lucene index version in {0}", indexRoot); checkDir(indexRoot); } } } private  IndexVersion(); }
IndexVersion { public static void check(List<String> subFilesList) throws Exception { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); File indexRoot = new File(env.getDataRootPath(), IndexDatabase.INDEX_DIR); LOGGER.log(Level.FINE, "Checking for Lucene index version mismatch in {0}", indexRoot); if (!subFilesList.isEmpty()) { for (String projectName : subFilesList) { LOGGER.log(Level.FINER, "Checking Lucene index version in project {0}", projectName); checkDir(new File(indexRoot, projectName)); } } else { if (env.isProjectsEnabled()) { for (String projectName : env.getProjects().keySet()) { LOGGER.log(Level.FINER, "Checking Lucene index version in project {0}", projectName); checkDir(new File(indexRoot, projectName)); } } else { LOGGER.log(Level.FINER, "Checking Lucene index version in {0}", indexRoot); checkDir(indexRoot); } } } private  IndexVersion(); static void check(List<String> subFilesList); }
IndexVersion { public static void check(List<String> subFilesList) throws Exception { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); File indexRoot = new File(env.getDataRootPath(), IndexDatabase.INDEX_DIR); LOGGER.log(Level.FINE, "Checking for Lucene index version mismatch in {0}", indexRoot); if (!subFilesList.isEmpty()) { for (String projectName : subFilesList) { LOGGER.log(Level.FINER, "Checking Lucene index version in project {0}", projectName); checkDir(new File(indexRoot, projectName)); } } else { if (env.isProjectsEnabled()) { for (String projectName : env.getProjects().keySet()) { LOGGER.log(Level.FINER, "Checking Lucene index version in project {0}", projectName); checkDir(new File(indexRoot, projectName)); } } else { LOGGER.log(Level.FINER, "Checking Lucene index version in {0}", indexRoot); checkDir(indexRoot); } } } private  IndexVersion(); static void check(List<String> subFilesList);  }