#vulnerable code 
                              public MetadataBuilder addDataSource(@NotNull InputStream dataSource, String path, boolean closeAfterBuild) {
    sources.add(new Source(dataSource, path, closeAfterBuild));
    return this;
  } 
                            #location 2 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              public MetadataBuilder addDataSource(@NotNull InputStream dataSource, String path, boolean closeAfterBuild) {
    checkHashingResultIsNotSet();
    filesPaths.add(path);
    dataSources.add(new StreamBasedHolderImpl(dataSource, closeAfterBuild));
    return this;
  }