Archived
0

Зачем нам Location.copyOf(), когда есть clone()?

This commit is contained in:
2018-07-11 19:59:26 +03:00
parent aae2035207
commit 6143c88b52
2 changed files with 2 additions and 6 deletions

View File

@@ -12,10 +12,6 @@ import lombok.Data;
public class Location implements Cloneable {
private double x, y, z;
public static Location copyOf(Location location) {
return location.clone();
}
public Location (Location location) {
this.x = location.getX();
this.y = location.getY();
@@ -49,7 +45,7 @@ public class Location implements Cloneable {
}
@Override
protected Location clone() {
public Location clone() {
try {
return (Location) super.clone();
} catch (CloneNotSupportedException e) {