Avoid use of try-catch as control flow
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user