From d372cf80f9aef4644f1da7bbc96552257543916c Mon Sep 17 00:00:00 2001 From: Richard Peter Date: Tue, 21 Jan 2014 11:18:06 -0600 Subject: [PATCH] Issue #2724: Fix Airep/Pirep Autoboxing NPE Change-Id: Ieb2823dc220daf4d77a071ba8baaf3831957bd38 Former-commit-id: c6206fd6a87d0dfd817b850bb50720db0b1d0dc2 [formerly cbdaaf4d6e28d7001df205ffb7d8d2d56bacd35f] Former-commit-id: 57f60968331677a4ce7b7cd86df1d1b70d200f82 --- .../ncep/common/dataplugin/airep/AirepRecord.java | 15 +++++++++------ .../ncep/common/dataplugin/pirep/PirepRecord.java | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.airep/src/gov/noaa/nws/ncep/common/dataplugin/airep/AirepRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.airep/src/gov/noaa/nws/ncep/common/dataplugin/airep/AirepRecord.java index f09569e5e0..27b3979b78 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.airep/src/gov/noaa/nws/ncep/common/dataplugin/airep/AirepRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.airep/src/gov/noaa/nws/ncep/common/dataplugin/airep/AirepRecord.java @@ -75,6 +75,9 @@ import com.vividsolutions.jts.geom.Geometry; * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Sep 05, 2013 2316 bsteffen Unify airep and ncairep. * Dec 03, 2013 2551 rjpeter Extend PersistablePluginDataObject + * Jan 21, 2013 2724 rjpeter Update getter/setter to use same Object as + * internal variable to prevent auto unboxing + * NPE on serialization. * * * @author jkorman @@ -454,7 +457,7 @@ public class AirepRecord extends PersistablePluginDataObject implements /** * @return the temp */ - public float getTemp() { + public Float getTemp() { return temp; } @@ -462,14 +465,14 @@ public class AirepRecord extends PersistablePluginDataObject implements * @param temp * the temp to set */ - public void setTemp(float temp) { + public void setTemp(Float temp) { this.temp = temp; } /** * @return the windDirection */ - public float getWindDirection() { + public Float getWindDirection() { return windDirection; } @@ -477,14 +480,14 @@ public class AirepRecord extends PersistablePluginDataObject implements * @param windDirection * the windDirection to set */ - public void setWindDirection(float windDirection) { + public void setWindDirection(Float windDirection) { this.windDirection = windDirection; } /** * @return the windspeed */ - public float getWindSpeed() { + public Float getWindSpeed() { return windSpeed; } @@ -492,7 +495,7 @@ public class AirepRecord extends PersistablePluginDataObject implements * @param windspeed * the windspeed to set */ - public void setWindSpeed(float windSpeed) { + public void setWindSpeed(Float windSpeed) { this.windSpeed = windSpeed; } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.pirep/src/gov/noaa/nws/ncep/common/dataplugin/pirep/PirepRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.pirep/src/gov/noaa/nws/ncep/common/dataplugin/pirep/PirepRecord.java index cde4508c04..95a1c0285d 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.pirep/src/gov/noaa/nws/ncep/common/dataplugin/pirep/PirepRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.pirep/src/gov/noaa/nws/ncep/common/dataplugin/pirep/PirepRecord.java @@ -73,6 +73,9 @@ import com.vividsolutions.jts.geom.Geometry; * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Sep 05, 2013 2316 bsteffen Unify pirep and ncpirep. * Dec 03, 2013 2551 rjpeter Extend PersistablePluginDataObject. + * Jan 21, 2013 2724 rjpeter Update getter/setter to use same Object as + * internal variable to prevent auto unboxing + * NPE on serialization. * * * @author jkorman @@ -433,7 +436,7 @@ public class PirepRecord extends PersistablePluginDataObject implements * @return the temp */ // public Double getTemp() { - public float getTemp() { + public Float getTemp() { return temp; } @@ -442,7 +445,7 @@ public class PirepRecord extends PersistablePluginDataObject implements * the temp to set */ // public void setTemp(Double temp) { - public void setTemp(float temp) { + public void setTemp(Float temp) { this.temp = temp; } @@ -450,7 +453,7 @@ public class PirepRecord extends PersistablePluginDataObject implements * @return the windDirection */ // public Integer getWindDirection() { - public float getWindDirection() { + public Float getWindDirection() { return windDirection; } @@ -459,7 +462,7 @@ public class PirepRecord extends PersistablePluginDataObject implements * the windDirection to set */ // public void setWindDirection(Integer windDirection) { - public void setWindDirection(float windDirection) { + public void setWindDirection(Float windDirection) { this.windDirection = windDirection; } @@ -467,7 +470,7 @@ public class PirepRecord extends PersistablePluginDataObject implements * @return the windspeed */ // public Double getWindSpeed() { - public float getWindSpeed() { + public Float getWindSpeed() { return windSpeed; } @@ -476,7 +479,7 @@ public class PirepRecord extends PersistablePluginDataObject implements * the windspeed to set */ // public void setWindSpeed(Double windSpeed) { - public void setWindSpeed(float windSpeed) { + public void setWindSpeed(Float windSpeed) { this.windSpeed = windSpeed; }