chocoteam / chocoteam/choco-solver

`Settings` object should become immutable once the model is setup

Open
#1,070 2 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
779
Forks
159
Avg merge
6d 9h
Merged PRs (30d)
10

Description

This way of declaring settings is correct:
```java
Model model = new Model(Settings.init().setWarnUser(false));
```
because the `Settings` instance is not stored and cannot be modified once the model is created.
But the following declaration makes possible to change the settings afterward:
```java
Settings settings = Settings.init().setWarnUser(false);
Model model = new Model(settings);
settings.setWarnUser(true);
```

I suppose the settings must be set immutable or the model should have a deep copy of it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.