code: private void refreshIndexes(int version) {
          try {
              Collection<Path> paths = new ArrayList<>();
              MemoryFileManager fm = proc.taskFactory.fileManager();
  
              appendPaths(fm, StandardLocation.PLATFORM_CLASS_PATH, paths);
              appendPaths(fm, StandardLocation.CLASS_PATH, paths);
              appendPaths(fm, StandardLocation.SOURCE_PATH, paths);
  
              Map<Path, ClassIndex> newIndexes = new HashMap<>();
  
              //setup existing/last known data:
              for (Path p : paths) {
                  ClassIndex index = PATH_TO_INDEX.get(p);
                  if (index != null) {
                      newIndexes.put(p, index);
                  }
              }
  
              synchronized (currentIndexes) {
                  //temporary setting old data:
                  currentIndexes.clear();
                  currentIndexes.putAll(newIndexes);
              }
  
              //update/compute the indexes if needed:
              for (Path p : paths) {
                  waitIndexingNotSuspended();
  
                  ClassIndex index = indexForPath(p);
                  newIndexes.put(p, index);
              }
  
              synchronized (currentIndexes) {
                  currentIndexes.clear();
                  currentIndexes.putAll(newIndexes);
              }
          } catch (Exception ex) {
              proc.debug(ex, "SourceCodeAnalysisImpl.refreshIndexes(" + version + ")");
          } finally {
              synchronized (currentIndexes) {
                  indexVersion = version;
              }
          }
      }
docs: update indexes, either initially or after a classpath change: