fixed some findbugs issues

This commit is contained in:
hneemann 2016-04-10 10:21:10 +02:00
parent ff4a3eb8e7
commit 9f56f7b37a
2 changed files with 17 additions and 1 deletions

View File

@ -430,6 +430,22 @@ public class Model {
return name.compareTo(o.name);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Signal signal = (Signal) o;
return name.equals(signal.name);
}
@Override
public int hashCode() {
return name.hashCode();
}
@Override
public String toString() {
return name;

View File

@ -93,7 +93,7 @@ public class GraphicSVG implements Graphic, Closeable {
public void drawCircle(Vector p1, Vector p2, Style style) {
try {
Vector c = p1.add(p2).div(2);
double r = Math.abs(p2.sub(p1).x) / 2;
double r = Math.abs(p2.sub(p1).x) / 2.0;
if (style.isFilled())
w.write("<circle cx=\"" + c.x + "\" cy=\"" + c.y + "\" r=\"" + r + "\" stroke=\"" + getColor(style) + "\" stroke-width=\"" + getStrokeWidth(style) + "\" fill=\"" + getColor(style) + "\" />\n");
else {