Avoid use of try-catch as control flow

This commit is contained in:
2019-03-19 21:37:11 +01:00
parent 51885d8c53
commit 5be59b37f0
2 changed files with 14 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ import java.awt.event.MouseEvent;
import java.util.Optional;
public class Controller {
private final Logger logger = LoggerFactory.getLogger(ShapesView.class);
private final static Logger logger = LoggerFactory.getLogger(ShapesView.class);
private final ShapesView view;
private final Shape model;
private Selection selection;
@@ -46,7 +46,7 @@ public class Controller {
s -> {
if (selection != null) resetSelection();
selection = new Selection(s, true);
this.logger.debug("Selecting {}", selection.shape);
logger.debug("Selecting {}", selection.shape);
},
() -> {
if (selection != null) resetSelection();
@@ -56,7 +56,7 @@ public class Controller {
}
private void resetSelection() {
this.logger.debug("Un-selecting {}", selection.shape);
logger.debug("Un-selecting {}", selection.shape);
selection.unselect();
selection = null;
}