From 6e67022134f58aa2ab61cfb9dbd9dc4337ec7bb8 Mon Sep 17 00:00:00 2001 From: Jon Herrmann Date: Wed, 31 Oct 2018 17:52:39 +0100 Subject: [PATCH] Avoid and handle fault masking --- .../etf/bsxm/topox/BoundaryBuilder.java | 29 +++++++++---------- .../etf/bsxm/topox/TopologyErrorType.java | 1 - 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/main/java/de/interactive_instruments/etf/bsxm/topox/BoundaryBuilder.java b/src/main/java/de/interactive_instruments/etf/bsxm/topox/BoundaryBuilder.java index 54c34fb..7fd3351 100644 --- a/src/main/java/de/interactive_instruments/etf/bsxm/topox/BoundaryBuilder.java +++ b/src/main/java/de/interactive_instruments/etf/bsxm/topox/BoundaryBuilder.java @@ -44,31 +44,28 @@ private static class InternalHandler implements HashingSegmentHandler { @Override public void coordinate2d(final double x, final double y, final long hash, final long location, final int type) { - if(previousNode==null) { - previousNode=theme.topology.node(x,y); - if(previousNode==null) { + if (previousNode == null) { + previousNode = theme.topology.node(x, y); + if (previousNode == null) { errorCollector.collectError(BOUNDARY_POINT_DETACHED, - x,y, - "IS", String.valueOf(location) - ); + x, y, + "IS", String.valueOf(location)); } - }else{ + } else { final Topology.Node nextNode = theme.topology.node(x, y); - if(nextNode==null) { + if (nextNode == null) { errorCollector.collectError(BOUNDARY_POINT_DETACHED, - x,y, - "IS", String.valueOf(location) - ); + x, y, + "IS", String.valueOf(location)); previousNode = null; - }else{ + } else { final Topology.Edge edge = previousNode.edge(nextNode); - if(edge==null) { + if (edge == null) { errorCollector.collectError(BOUNDARY_EDGE_INVALID, - x,y, + x, y, "IS", String.valueOf(location), "X2", String.valueOf(previousNode.x()), - "Y2", String.valueOf(previousNode.y()) - ); + "Y2", String.valueOf(previousNode.y())); } previousNode = nextNode; } diff --git a/src/main/java/de/interactive_instruments/etf/bsxm/topox/TopologyErrorType.java b/src/main/java/de/interactive_instruments/etf/bsxm/topox/TopologyErrorType.java index 938ad29..b88f5b6 100644 --- a/src/main/java/de/interactive_instruments/etf/bsxm/topox/TopologyErrorType.java +++ b/src/main/java/de/interactive_instruments/etf/bsxm/topox/TopologyErrorType.java @@ -90,7 +90,6 @@ enum TopologyErrorType { */ BOUNDARY_EDGE_INVALID, - ////////////////////////////////////////////////////////////////////////// // Deprecated and removed later /**