Monthly Archives: January 2020

Vulnerability – Mutable members

Let’s imagine the situation when your class is responsible for complicated calculations and data for processing are delivered as List collection in the constructor. During the execution of the module on the test environment, you are receiving strange results despite the same data provide you correct results at JUnit tests.

public class SomeClass {
   private List<RawData> data;

   public SomeClass(List<RawData> data) {
...

You made double-check and the algorithm is fine. So what can be wrong?

Continue reading →