Follow-up to OpenSHA logging cleanup

Bug #894040 reported by Lars Butler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Undecided
Unassigned

Bug Description

In bug # 888013, we disabled some unnecessary logging.

In reviewing the changed files, I noticed several warnings and FindBugs errors. These aren't critical to fix; just a bit of house cleaning.

- Test for floating point equality: https://github.com/gem/OpenSHA/blob/master/java/org/opensha/commons/data/function/ArbitrarilyDiscretizedFunc.java#L602
  - Can be replaced with `if (((Double)expY).equals(Double.MIN_VALUE))`
- invokes inefficient new Integer(int) constructor: https://github.com/gem/OpenSHA/blob/master/java/org/opensha/commons/data/function/ArbitrarilyDiscretizedFunc.java#L831
  - Can be replaced with `s.writeObject(getNum());`
- ArbitrarilyDiscretizedFunc.java also has a ton of commented-out code (line 608, line 939, etc.)
- Dead store to fltType: https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/attenRelImpl/Abrahamson_2000_AttenRel.java#L473
- Dead store to component: https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/attenRelImpl/Abrahamson_2000_AttenRel.java#L476
- Abrahamson_2000_AttenRel.java als has a ton of commented-out code.
- Unused variable f4: https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/attenRelImpl/Abrahamson_2000_AttenRel.java#L575
- Static field COMPONENT_AVE_HORZ should be accessed in a static way: https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/attenRelImpl/Abrahamson_2000_AttenRel.java#L884 and https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/attenRelImpl/Abrahamson_2000_AttenRel.java#L888
- Static field COMPONENT_AVE_HORZ should be accessed in a static way: https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/attenRelImpl/CB_2003_AttenRel.java#L822
- Should org.opensha.sha.imr.attenRelImpl.CB_2003_AttenRel$CB_2003_AttenRelCoefficients be a _static_ inner
 class?
- Method org.opensha.sha.imr.attenRelImpl.Campbell_1997_AttenRel.getStdDev() uses the same code for two
 branches: https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/attenRelImpl/Campbell_1997_AttenRel.java#L603
- Should org.opensha.sha.imr.attenRelImpl.Campbell_1997_AttenRel$Campbell_1997_AttenRelCoefficients be a _static_ inner
 class?
- Dead store to component: https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/attenRelImpl/SadighEtAl_1997_AttenRel.java#L303
- Should org.opensha.sha.imr.attenRelImpl.SadighEtAl_1997_AttenRel$SCEMY_1997_AttenRelCoefficients be a _static_ inner
 class?
- Unused imports: https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/param/PropagationEffectParams/DistanceX_Parameter.java#L22, https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/param/PropagationEffectParams/DistanceX_Parameter.java#L33
- Unused commented-out code: https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/param/PropagationEffectParams/DistanceX_Parameter.java#L296

matley (matley)
Changed in openquake:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.