Can non-final arguments or returned objects make an object mutable?
What difference does it make by changing this:
public final class MyImmutableClass {
public final MyObject doStuff(final SomeObject someObject) {
...
}
}
to this:
public final class MyImmutableClass {
public MyObject doStuff(SomeObject someObject) {
...
}
}
When the goal is to make MyImmutableClass
truly immutable.
After appling the change, is MyImmutableClass
still considered immutable? If not, what state could be altered by making the changes?