Path not found when adding colum/row #26

Closed
opened 2017-12-29 23:31:59 +00:00 by antograb · 2 comments
Owner

Probably linked with updates on the departure and arrival attributes in the model, see 286023c5.

Probably linked with updates on the departure and arrival attributes in the model, see 286023c5.
antograb added the bug label 2017-12-29 23:31:59 +00:00
antograb changed title from #286023c5d8 Path not found when adding colum/row to 286023c5d8 Path not found when adding colum/row 2017-12-29 23:32:08 +00:00
antograb changed title from 286023c5d8 Path not found when adding colum/row to commit:286023c5d8 Path not found when adding colum/row 2017-12-29 23:32:13 +00:00
antograb changed title from commit:286023c5d8 Path not found when adding colum/row to 286023c5 Path not found when adding colum/row 2017-12-29 23:34:14 +00:00
regar42 changed title from 286023c5 Path not found when adding colum/row to Path not found when adding colum/row 2017-12-30 11:27:16 +00:00
Collaborator

I think it's a problem of references.
When you do this,

maze.getMaze()[line][row] = previousMaze[line][row];
:

maze.getMaze()[line][row] = previousMaze[line][row];

you keep the reference on previousMaze, that could potentially trigger this bad behavior. I'm just wildly theorizing here, since I can't test a patch right now.

That's why I'd prefer a more elegant way of adding a column/row, like when we added deepMatrixCopy() to let Maze handle such things internally.

I think it's a problem of references. When you do this, https://git.regar42.fr/antograb/TpMazeJava/src/commit/286023c5d8b1695a7e13d281cd32861dd6743982/src/model/MazeAppModel.java#L184 : maze.getMaze()[line][row] = previousMaze[line][row]; you keep the reference on previousMaze, that could potentially trigger this bad behavior. I'm just wildly theorizing here, since I can't test a patch right now. That's why I'd prefer a more elegant way of adding a column/row, like when we added `deepMatrixCopy()` to let `Maze` handle such things internally.
Collaborator

Addressed in 024a4f70.

Addressed in 024a4f70.
regar42 self-assigned this 2018-01-01 11:38:45 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
-
Dependencies

No dependencies set.

Reference: antograb/TpMazeJava#26