Skip to content

Instantly share code, notes, and snippets.

@dfilimon
Created January 2, 2013 21:43
Show Gist options
  • Save dfilimon/4438413 to your computer and use it in GitHub Desktop.
Save dfilimon/4438413 to your computer and use it in GitHub Desktop.
DelegatingVector's clone()
@Override
public Vector clone() {
DelegatingVector r;
try {
r = (DelegatingVector) super.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException("Clone not supported for DelegatingVector, shouldn't be possible");
}
// delegate points to original without this
r.delegate = delegate.clone();
return r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment