From 7ac0b7a0a4dc16d89fac68dcdfbf15dbb251fb79 Mon Sep 17 00:00:00 2001 From: Lars Quentin Date: Tue, 7 May 2024 21:09:19 +0200 Subject: [PATCH 1/2] bug: using bit operations instead of boolean logic --- .../java/sc/fiji/labkit/ui/inputimage/SpimDataToImgPlus.java | 2 +- src/main/java/sc/fiji/labkit/ui/models/ImageLabelingModel.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/sc/fiji/labkit/ui/inputimage/SpimDataToImgPlus.java b/src/main/java/sc/fiji/labkit/ui/inputimage/SpimDataToImgPlus.java index 989aa090..36a11c27 100644 --- a/src/main/java/sc/fiji/labkit/ui/inputimage/SpimDataToImgPlus.java +++ b/src/main/java/sc/fiji/labkit/ui/inputimage/SpimDataToImgPlus.java @@ -280,6 +280,6 @@ static boolean transformationEquals(AffineTransform3D a, AffineTransform3D b) { max_difference = Math.max(max_difference, Math.abs(va - vb)); } } - return max_difference == 0.0 | max_difference < max_abs_value * 1e-6; + return max_difference == 0.0 || max_difference < max_abs_value * 1e-6; } } diff --git a/src/main/java/sc/fiji/labkit/ui/models/ImageLabelingModel.java b/src/main/java/sc/fiji/labkit/ui/models/ImageLabelingModel.java index d2dc2209..dd78bffd 100644 --- a/src/main/java/sc/fiji/labkit/ui/models/ImageLabelingModel.java +++ b/src/main/java/sc/fiji/labkit/ui/models/ImageLabelingModel.java @@ -195,7 +195,7 @@ private AffineTransform3D getScaling(Interval inputImage, private long[] get3dDimensions(Interval interval) { long[] result = new long[3]; int n = interval.numDimensions(); - for (int i = 0; i < n & i < 3; i++) + for (int i = 0; i < n && i < 3; i++) result[i] = interval.dimension(i); for (int i = n; i < 3; i++) result[i] = 1; From e3001ca247d2bfaf5b08b932ada395d5608851ac Mon Sep 17 00:00:00 2001 From: Lars Quentin Date: Tue, 7 May 2024 21:09:54 +0200 Subject: [PATCH 2/2] bug: use equals on strings since its an object --- src/main/java/sc/fiji/labkit/ui/panel/GuiUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/sc/fiji/labkit/ui/panel/GuiUtils.java b/src/main/java/sc/fiji/labkit/ui/panel/GuiUtils.java index 1814d8c3..9e93ccf8 100644 --- a/src/main/java/sc/fiji/labkit/ui/panel/GuiUtils.java +++ b/src/main/java/sc/fiji/labkit/ui/panel/GuiUtils.java @@ -55,7 +55,7 @@ public static JButton createActionIconButton(String name, final Action action, { JButton button = new JButton(action); button.setText(name); - if (icon != "") { + if (icon.isEmpty()) { button.setIcon(loadIcon(icon)); button.setIconTextGap(5); button.setMargin(new Insets(button.getMargin().top, 3, button