H
HK
What I would like to do is this:
public interface Boo {
Boo mergeWith(Boo const other) const;
}
The intention would be to force an implementation
to not modify any of `this' or `other', but return either
one unchanged or create a freshly allocated object.
I read
http://groups-beta.google.com/group...3de?tvc=2&q=readonly+method+parameters+final+
and
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4211070
but most of the discussion and proposed workarounds
relate to concrete implemented methods. Any ideas of how to
come at least close to the above other than by calling
the method only ever with copies of the original
things or write blurb in *BOLD* into the spec?
Thanks,
Harald.
public interface Boo {
Boo mergeWith(Boo const other) const;
}
The intention would be to force an implementation
to not modify any of `this' or `other', but return either
one unchanged or create a freshly allocated object.
I read
http://groups-beta.google.com/group...3de?tvc=2&q=readonly+method+parameters+final+
and
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4211070
but most of the discussion and proposed workarounds
relate to concrete implemented methods. Any ideas of how to
come at least close to the above other than by calling
the method only ever with copies of the original
things or write blurb in *BOLD* into the spec?
Thanks,
Harald.