Program: 69221
Project: 69221
Buggy source:
public DirScan(Profile profile,File dir,ProgressHandler handler,boolean is_dest) throws BreakException {
  this();
  need_sha1_or_md5=profile.getProperty("String_Node_Str",false);
  use_parallelism=profile.getProperty("String_Node_Str",false);
  Path path=Paths.get(dir.getAbsolutePath());
  containers_byname=load(dir,handler);
  try (Stream<Path> stream=Files.walk(path,is_dest ? 1 : 100,FileVisitOption.FOLLOW_LINKS)){
    AtomicInteger i=new AtomicInteger();
    handler.setProgress("String_Node_Str" + dir + "String_Node_Str",-1);
    StreamEx.of(StreamSupport.stream(stream.spliterator(),use_parallelism)).unordered().takeWhile((p) -> !handler.isCancel()).forEach(p -> {
      Container c=null;
      if (path.equals(p))       return;
      File file=p.toFile();
      try {
        BasicFileAttributes attr=Files.readAttributes(p,BasicFileAttributes.class);
        if (is_dest) {
          if (null == (c=containers_byname.get(file.getName())) || c.modified != attr.lastModifiedTime().toMillis() || (c instanceof Archive && c.size != attr.size())) {
            if (attr.isRegularFile())             containers.add(c=new Archive(file,attr));
 else             containers.add(c=new Directory(file,attr));
            if (c != null) {
              c.up2date=true;
              containers_byname.put(file.getName(),c);
            }
          }
 else {
            c.up2date=true;
            containers.add(c);
          }
        }
 else {
          if (attr.isRegularFile()) {
            if (Container.getType(file) == Type.UNK) {
              File parent_dir=file.getParentFile();
              BasicFileAttributes parent_attr=Files.readAttributes(p.getParent(),BasicFileAttributes.class);
              if (null == (c=containers_byname.get(parent_dir.getAbsolutePath())) || c.modified != parent_attr.lastModifiedTime().toMillis()) {
                containers.add(c=new Directory(parent_dir,attr));
                if (c != null) {
                  c.up2date=true;
                  containers_byname.put(parent_dir.getAbsolutePath(),c);
                }
              }
 else {
                c.up2date=true;
                containers.add(c);
              }
            }
 else {
              if (null == (c=containers_byname.get(file.getName())) || c.modified != attr.lastModifiedTime().toMillis() || c.size != attr.size()) {
                containers.add(c=new Archive(file,attr));
                if (c != null) {
                  c.up2date=true;
                  containers_byname.put(file.getName(),c);
                }
              }
 else {
                c.up2date=true;
                containers.add(c);
              }
            }
          }
        }
        handler.setProgress("String_Node_Str" + dir + "String_Node_Str"+ i.incrementAndGet()+ "String_Node_Str");
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
);
    if (containers_byname.entrySet().removeIf(entry -> !entry.getValue().up2date))     Log.info("String_Node_Str");
  }
 catch (  IOException e) {
    Log.err("String_Node_Str",e);
  }
catch (  Throwable e) {
    Log.err("String_Node_Str",e);
  }
  AtomicInteger i=new AtomicInteger(0);
  handler.setProgress("String_Node_Str" + dir + "String_Node_Str",i.get(),containers.size());
  StreamEx.of(use_parallelism ? containers.parallelStream().unordered() : containers.stream()).takeWhile((c) -> !handler.isCancel()).forEach(c -> {
    try {
switch (c.getType()) {
case ZIP:
{
          if (c.loaded < 1 || (need_sha1_or_md5 && c.loaded < 2)) {
            Map<String,Object> env=new HashMap<>();
            env.put("String_Node_Str",Boolean.TRUE);
            try (FileSystem fs=FileSystems.newFileSystem(URI.create("String_Node_Str" + c.file.toURI()),env)){
              final Path root=fs.getPath("String_Node_Str");
              Files.walkFileTree(root,new SimpleFileVisitor<Path>(){
                @Override public FileVisitResult visitFile(                Path entry_path,                BasicFileAttributes attrs) throws IOException {
                  update_entry(profile,c.add(new Entry(entry_path.toString())),entry_path);
                  return FileVisitResult.CONTINUE;
                }
                @Override public FileVisitResult preVisitDirectory(                Path dir,                BasicFileAttributes attrs) throws IOException {
                  return FileVisitResult.CONTINUE;
                }
              }
);
              c.loaded=need_sha1_or_md5 ? 2 : 1;
            }
           }
 else {
            for (            Entry entry : c.getEntries())             update_entry(profile,entry);
          }
          break;
        }
case SEVENZIP:
{
        try (SevenZUpdateEntries entries=new SevenZUpdateEntries(profile,c)){
          entries.updateEntries();
        }
         break;
      }
case DIR:
{
      Files.walkFileTree(c.file.toPath(),new SimpleFileVisitor<Path>(){
        @Override public FileVisitResult visitFile(        Path entry_path,        BasicFileAttributes attrs) throws IOException {
          update_entry(profile,c.add(new Entry(entry_path.toString(),attrs)),entry_path);
          return FileVisitResult.CONTINUE;
        }
        @Override public FileVisitResult preVisitDirectory(        Path dir,        BasicFileAttributes attrs) throws IOException {
          return FileVisitResult.CONTINUE;
        }
      }
);
      c.loaded=need_sha1_or_md5 ? 2 : 1;
      break;
    }
default :
  break;
}
handler.setProgress("String_Node_Str" + c.file.getName(),i.incrementAndGet(),null,i.get() + "String_Node_Str" + containers.size()+ "String_Node_Str"+ (int)(i.get() * 100.0 / containers.size())+ "String_Node_Str");
}
 catch (IOException e) {
Log.err("String_Node_Str",e);
}
catch (BreakException e) {
handler.cancel();
}
catch (Throwable e) {
Log.err("String_Node_Str",e);
}
}
);
save(dir,containers_byname);
}

Fixed version (ground truth):
public DirScan(Profile profile,File dir,ProgressHandler handler,boolean is_dest) throws BreakException {
  this();
  need_sha1_or_md5=profile.getProperty("String_Node_Str",false);
  use_parallelism=profile.getProperty("String_Node_Str",false);
  Path path=Paths.get(dir.getAbsolutePath());
  if (!Settings.getProperty("String_Node_Str",false))   containers_byname=load(dir,handler);
  try (Stream<Path> stream=Files.walk(path,is_dest ? 1 : 100,FileVisitOption.FOLLOW_LINKS)){
    AtomicInteger i=new AtomicInteger();
    handler.setProgress("String_Node_Str" + dir + "String_Node_Str",-1);
    StreamEx.of(StreamSupport.stream(stream.spliterator(),use_parallelism)).unordered().takeWhile((p) -> !handler.isCancel()).forEach(p -> {
      Container c=null;
      if (path.equals(p))       return;
      File file=p.toFile();
      try {
        BasicFileAttributes attr=Files.readAttributes(p,BasicFileAttributes.class);
        if (is_dest) {
          if (null == (c=containers_byname.get(file.getName())) || c.modified != attr.lastModifiedTime().toMillis() || (c instanceof Archive && c.size != attr.size())) {
            if (attr.isRegularFile())             containers.add(c=new Archive(file,attr));
 else             containers.add(c=new Directory(file,attr));
            if (c != null) {
              c.up2date=true;
              containers_byname.put(file.getName(),c);
            }
          }
 else {
            c.up2date=true;
            containers.add(c);
          }
        }
 else {
          if (attr.isRegularFile()) {
            if (Container.getType(file) == Type.UNK) {
              File parent_dir=file.getParentFile();
              BasicFileAttributes parent_attr=Files.readAttributes(p.getParent(),BasicFileAttributes.class);
              if (null == (c=containers_byname.get(parent_dir.getAbsolutePath())) || c.modified != parent_attr.lastModifiedTime().toMillis()) {
                containers.add(c=new Directory(parent_dir,attr));
                if (c != null) {
                  c.up2date=true;
                  containers_byname.put(parent_dir.getAbsolutePath(),c);
                }
              }
 else {
                c.up2date=true;
                containers.add(c);
              }
            }
 else {
              if (null == (c=containers_byname.get(file.getName())) || c.modified != attr.lastModifiedTime().toMillis() || c.size != attr.size()) {
                containers.add(c=new Archive(file,attr));
                if (c != null) {
                  c.up2date=true;
                  containers_byname.put(file.getName(),c);
                }
              }
 else {
                c.up2date=true;
                containers.add(c);
              }
            }
          }
        }
        handler.setProgress("String_Node_Str" + dir + "String_Node_Str"+ i.incrementAndGet()+ "String_Node_Str");
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
);
    if (containers_byname.entrySet().removeIf(entry -> !entry.getValue().up2date))     Log.info("String_Node_Str");
  }
 catch (  IOException e) {
    Log.err("String_Node_Str",e);
  }
catch (  Throwable e) {
    Log.err("String_Node_Str",e);
  }
  AtomicInteger i=new AtomicInteger(0);
  handler.setProgress("String_Node_Str" + dir + "String_Node_Str",i.get(),containers.size());
  StreamEx.of(use_parallelism ? containers.parallelStream().unordered() : containers.stream()).takeWhile((c) -> !handler.isCancel()).forEach(c -> {
    try {
switch (c.getType()) {
case ZIP:
{
          if (c.loaded < 1 || (need_sha1_or_md5 && c.loaded < 2)) {
            Map<String,Object> env=new HashMap<>();
            env.put("String_Node_Str",Boolean.TRUE);
            try (FileSystem fs=FileSystems.newFileSystem(URI.create("String_Node_Str" + c.file.toURI()),env)){
              final Path root=fs.getPath("String_Node_Str");
              Files.walkFileTree(root,new SimpleFileVisitor<Path>(){
                @Override public FileVisitResult visitFile(                Path entry_path,                BasicFileAttributes attrs) throws IOException {
                  update_entry(profile,c.add(new Entry(entry_path.toString())),entry_path);
                  return FileVisitResult.CONTINUE;
                }
                @Override public FileVisitResult preVisitDirectory(                Path dir,                BasicFileAttributes attrs) throws IOException {
                  return FileVisitResult.CONTINUE;
                }
              }
);
              c.loaded=need_sha1_or_md5 ? 2 : 1;
            }
           }
 else {
            for (            Entry entry : c.getEntries())             update_entry(profile,entry);
          }
          break;
        }
case SEVENZIP:
{
        try (SevenZUpdateEntries entries=new SevenZUpdateEntries(profile,c)){
          entries.updateEntries();
        }
         break;
      }
case DIR:
{
      Files.walkFileTree(c.file.toPath(),new SimpleFileVisitor<Path>(){
        @Override public FileVisitResult visitFile(        Path entry_path,        BasicFileAttributes attrs) throws IOException {
          update_entry(profile,c.add(new Entry(entry_path.toString(),attrs)),entry_path);
          return FileVisitResult.CONTINUE;
        }
        @Override public FileVisitResult preVisitDirectory(        Path dir,        BasicFileAttributes attrs) throws IOException {
          return FileVisitResult.CONTINUE;
        }
      }
);
      c.loaded=need_sha1_or_md5 ? 2 : 1;
      break;
    }
default :
  break;
}
handler.setProgress("String_Node_Str" + c.file.getName(),i.incrementAndGet(),null,i.get() + "String_Node_Str" + containers.size()+ "String_Node_Str"+ (int)(i.get() * 100.0 / containers.size())+ "String_Node_Str");
}
 catch (IOException e) {
Log.err("String_Node_Str",e);
}
catch (BreakException e) {
handler.cancel();
}
catch (Throwable e) {
Log.err("String_Node_Str",e);
}
}
);
if (!handler.isCancel()) save(dir,containers_byname);
}