Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32931

What goes wrong with cloning here

Path csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.java.programmer
Subject What goes wrong with cloning here
Date Fri, 23 Oct 2015 17:49:58 +0200
Organization Decebal Computing
Lines 149
Message-ID <87oafplh3t.fsf@Equus.decebal.nl> (permalink)
Mime-Version 1.0
Content-Type multipart/mixed; boundary="=-=-="
Injection-Info mx02.eternal-september.org; posting-host="528adfd6ad074c92fdc6a7f8fb9e23d8"; logging-data="6098"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ei9+jt423EGfjN7fsYniciJvG7tJ2SYc="
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
X-Homepage http://www.decebal.nl/
Cancel-Lock sha1:NoWSDFmIf+OoZERxSWQEiUeiV7s= sha1:eCaDf/9kVnAQyUbuYpF40hXe2aE=
Xref csiph.com comp.lang.java.programmer:32931

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

I need to use Cloneable. (I know that some people say you should never
use it, but it is a requirement of the project.)

I made something I thought should work, but it does not. I have
attached my dumbed down code. What am I doing wrong?

When I in class A change a field from class B in the clone, the field
in the original is also changed. That should not happen.

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

What goes wrong with cloning here Cecil Westerhof <Cecil@decebal.nl> - 2015-10-23 17:49 +0200
  Re: What goes wrong with cloning here Tassilo Horn <tsdh@gnu.org> - 2015-10-23 18:12 +0200
    Re: What goes wrong with cloning here Cecil Westerhof <Cecil@decebal.nl> - 2015-10-24 00:51 +0200
      Re: What goes wrong with cloning here Cecil Westerhof <Cecil@decebal.nl> - 2015-10-24 01:44 +0200

csiph-web