0

So basically I have code that looks like this

supersetRowModel.setExerciseModelList(exerciseModelList);
exerciseModelList.clear();

My getter and setter for this class

 public void setExerciseModelList(List<ExerciseModel> exerciseModelList){
    this.exerciseModelList = exerciseModelList;
}

public List<ExerciseModel> getExerciseModelList(){
    return exerciseModelList;
}

Whenever I call getExerciseModelList() right after I clear the array list, it returns a list with size 0. I have checked and made sure that exerciseModelList is not size 0. This is confusing me, since clearing exerciseModelList should not affect the objects arraylist since it is already set, right?

Gerald Tan
  • 91
  • 14

0 Answers0