Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.0.0-RC39
-
None
-
None
Description
There are many methods like :
public void setReqMod( List<String> reqMod ) { this.reqMod = reqMod; }
Storing the list that is passed is doom to major issues when the original list is modified outside of the instance, as the stored value will also be modified, even if it was not intended.
Here, we should copy the list internally :
public void setReqMod( List<String> reqMod ) { if ( reqMod != null ) { this.reqMod = new ArrayList<String>( reqMod.size() ); System.arraycopy( reqMod, 0, this.reqMod, 0, reqMod.size() ); } else { this.reqMod = reqMod; } }