Skip to content

Commit dab9f42

Browse files
committed
fix: fix or suppress some rank-8 bugs
1 parent 24895f3 commit dab9f42

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

common-tools/clas-utils/src/main/java/org/jlab/utils/benchmark/Benchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class Benchmark {
2626
private Timer updateTimer = null;
2727

2828

29-
public Benchmark(){
29+
private Benchmark(){
3030

3131
}
3232

common-tools/cnuphys/magfield/src/main/java/cnuphys/magfield/MagneticFields.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public String getVersion() {
123123
*
124124
* @return the MagneticFields singleton
125125
*/
126-
public static MagneticFields getInstance() {
126+
public static synchronized MagneticFields getInstance() {
127127
if (instance == null) {
128128
instance = new MagneticFields();
129129
}

common-tools/cnuphys/splot/src/main/java/cnuphys/splot/plot/ColorScaleModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ColorScaleModel {
4141
* @param minVal the minimum value;
4242
* @param maxVal the maximum value the array of colors.
4343
*/
44-
public ColorScaleModel(double minVal, double maxVal, Color[] colors) {
44+
private ColorScaleModel(double minVal, double maxVal, Color[] colors) {
4545
_colors = colors;
4646
_minVal = minVal;
4747
_maxVal = maxVal;

spotbugs-exclude.xml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,39 @@
88
15-20 informational
99
-->
1010
<Match>
11-
<Rank value="7"/>
11+
<Rank value="8"/>
1212
</Match>
1313

1414
<!-- RANK 4 SUPRESSIONS -->
1515
<Match> <!-- not ours -->
16-
<Class name="eu.mihosoft.vrl.v3d.ext.openjfx.shape3d.symbolic.SymbolicPolygonMesh"/>
1716
<Bug pattern="UR_UNINIT_READ"/>
17+
<Class name="eu.mihosoft.vrl.v3d.ext.openjfx.shape3d.symbolic.SymbolicPolygonMesh"/>
1818
</Match>
1919

20-
<!-- HIGHER RANK SUPRESSIONS -->
20+
<!-- RANK 8 SUPRESSIONS -->
21+
<Match> <!-- the pattern `while(phi > 360) phi -= 360.0;` -->
22+
<Bug pattern="FL_FLOATS_AS_LOOP_COUNTERS"/>
23+
</Match>
24+
<Match> <!-- ignore this static method hiding -->
25+
<Bug pattern="HSM_HIDING_METHOD"/>
26+
<Class name="cnuphys.splot.plot.VerticalLabelUI"/>
27+
<Method name="createUI"/>
28+
</Match>
29+
<Match> <!-- not quite a singleton pattern -->
30+
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR"/>
31+
<Class name="cnuphys.splot.plot.VerticalLabelUI"/>
32+
</Match>
2133

34+
<!-- HIGHER RANK SUPPRESSIONS -->
2235
<!-- <Match> --> <!-- not worth fixing -->
2336
<!-- <Class name="cnuphys.snr.ExtendedWord"/> -->
24-
<!-- <Method name="equals" params="cnuphys.snr.ExtendedWord"/> -->
2537
<!-- <Bug pattern="EQ_SELF_USE_OBJECT"/> -->
38+
<!-- <Method name="equals" params="cnuphys.snr.ExtendedWord"/> -->
2639
<!-- </Match> -->
2740
<!-- <Match> --> <!-- DefaultLogger may be deprecated soon -->
41+
<!-- <Bug pattern="OBL_UNSATISFIED_OBLIGATION"/> -->
2842
<!-- <Class name="org.jlab.logging.DefaultLogger"/> -->
2943
<!-- <Method name="init" params="String"/> -->
30-
<!-- <Bug pattern="OBL_UNSATISFIED_OBLIGATION"/> -->
3144
<!-- </Match> -->
3245

3346
</FindBugsFilter>

0 commit comments

Comments
 (0)