kazurayam / materialstore

A domain-specific file system to store "materials" (screenshots, HTML, JSON, XML) collected during End-to-End testings using Selenium WebDriver etc. Features to make "diff" and compiling HTML reports are also included. This is written in pure Java8
Apache License 2.0
0 stars 0 forks source link

MaterialProductGroup class's copy constructor should do "deep clone" #368

Open kazurayam opened 1 year ago

kazurayam commented 1 year ago

v0.12.5, com.kazurayam.materialstore.base.reduce.MaterialProductGroup class has the following code:

    public MaterialProductGroup(MaterialProductGroup source,
                                List<MaterialProduct> newMaterialProductList) {
        this(source);
        Objects.requireNonNull(newMaterialProductList);
        this.materialProductList = newMaterialProductList;
    }

I have a doubt about the statement this.materialProductList = newMaterialProductList;

Is it OK to do simple substitution?

I would rathe like to do a deep copy, for robustness, for safety.