gem/OpenSHA — pull request #19 by larsbutler (2012-05-10 09:10:20+00:00)
Title: Fix for CY_2008 GMPE SA param NullPointerException

Addresses: https://bugs.launchpad.net/openquake/+bug/984838

Solving this problem took 3 different modifications:

- WarningDoubleParameter.java: Add bullet-proofing the handling of the `warningListeners` list to ensure that we don't add `null` values. Otherwise, later on an event can be fired to a `null` `ParameterChangeWarningListener` , which obviously results in a `NullPointerException`.
- CY_2008_AttenRel.java: Next, the SA param was neglected in some of the parameter event listener handling. Fixing this prevents another `NullPointerException` in particular cases.
- SA_Param.java: Finally, I removed the restriction on the maximum values for spectral acceleration. Previously, the max value was set to `ln(3.0)` (or ~1.09). Having such a restriction causes this error:

JavaException: Java traceback (most recent call last):
File "UHSCalculator.java", line 153, in org.gem.calc.UHSCalculator.computeUHS
File "UHSCalculator.java", line 244, in org.gem.calc.UHSCalculator.computeUHS
File "UHSCalculator.java", line 402, in org.gem.calc.UHSCalculator.updateHazCurveForInterpolatedPeriod
File "AttenuationRelationship.java", line 442, in org.opensha.sha.imr.AttenuationRelationship.setIntensityMeasureLevel
File "WarningDoubleParameter.java", line 76, in org.opensha.commons.param.WarningDoubleParameter.setValue
File "WarningDoubleParameter.java", line 539, in org.opensha.commons.param.WarningDoubleParameter.setValue
org.opensha.commons.exceptions.WarningException: SA: setValue(): Value is not recommended: 1.2383742310432684

After a discussion with Dr. Danciu and Dr. Monelli, it was concluded that this restriction was unnecessary.