Text: The class "Point" contains 2 variables. There may be privacy leaks within 4 methods (line 9 to line 24). I would be grateful if you could tell me why these methods cause privacy leaks and how I can fix them.
Customer.java
public class Line
Point.java
Line.java
LineTest.java
protected Point start;
protected Point end;
public Line(Point start, Point end) {
this.start = new Point(start);
this.end = new Point(end);
}
public Point getStart() {
return this.start;
}
public Point getEnd() {
return this.end;
}
public void setStart(Point x) {
this.start = x;
}
public void setEnd(Point y) {
this.end = y;
}
public double length() {
double xd, yd;
if (this.start.xcoord >= this.end.xcoord) {
// calculation for length
}
}