You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2010/03/02 20:43:52 UTC

svn commit: r918160 - in /pivot/trunk: build.xml core/src/org/apache/pivot/serialization/JSONSerializer.java

Author: gbrown
Date: Tue Mar  2 19:43:52 2010
New Revision: 918160

URL: http://svn.apache.org/viewvc?rev=918160&view=rev
Log:
Fix potential NPEs in JSONSerializer; temporarily disable deprecation warnings in build.xml.

Modified:
    pivot/trunk/build.xml
    pivot/trunk/core/src/org/apache/pivot/serialization/JSONSerializer.java

Modified: pivot/trunk/build.xml
URL: http://svn.apache.org/viewvc/pivot/trunk/build.xml?rev=918160&r1=918159&r2=918160&view=diff
==============================================================================
--- pivot/trunk/build.xml (original)
+++ pivot/trunk/build.xml Tue Mar  2 19:43:52 2010
@@ -36,12 +36,12 @@
     <property name="keystore.passwd" value="apache"/>
 
     <!-- Compiler properties -->
-    <property name="compiler.deprecation" value="true"/>
+    <property name="compiler.deprecation" value="false"/>
     <property name="compiler.debug" value="false"/>
     <property name="compiler.target" value="1.6"/>
     <property name="compiler.encoding" value="UTF-8"/>
     <property name="compiler.indexJars" value="true"/>
-    <property name="compiler.arg" value="-Xlint"/>
+    <property name="compiler.arg" value="-Xlint:-deprecation"/>
 
     <!-- Test properties -->
     <property name="test.verbose" value="false"/>

Modified: pivot/trunk/core/src/org/apache/pivot/serialization/JSONSerializer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/src/org/apache/pivot/serialization/JSONSerializer.java?rev=918160&r1=918159&r2=918160&view=diff
==============================================================================
--- pivot/trunk/core/src/org/apache/pivot/serialization/JSONSerializer.java (original)
+++ pivot/trunk/core/src/org/apache/pivot/serialization/JSONSerializer.java Tue Mar  2 19:43:52 2010
@@ -772,7 +772,8 @@
      * @see #get(Object, String)
      */
     public static Short getShort(Object root, String path) {
-        return getNumber(root, path).shortValue();
+        Number number = getNumber(root, path);
+        return (number == null) ? null : number.shortValue();
     }
 
     /**
@@ -784,7 +785,8 @@
      * @see #get(Object, String)
      */
     public static Integer getInteger(Object root, String path) {
-        return getNumber(root, path).intValue();
+        Number number = getNumber(root, path);
+        return (number == null) ? null : number.intValue();
     }
 
     /**
@@ -796,7 +798,8 @@
      * @see #get(Object, String)
      */
     public static Long getLong(Object root, String path) {
-        return getNumber(root, path).longValue();
+        Number number = getNumber(root, path);
+        return (number == null) ? null : number.longValue();
     }
 
     /**
@@ -808,7 +811,8 @@
      * @see #get(Object, String)
      */
     public static Float getFloat(Object root, String path) {
-        return getNumber(root, path).floatValue();
+        Number number = getNumber(root, path);
+        return (number == null) ? null : number.floatValue();
     }
 
     /**
@@ -820,7 +824,8 @@
      * @see #get(Object, String)
      */
     public static Double getDouble(Object root, String path) {
-        return getNumber(root, path).doubleValue();
+        Number number = getNumber(root, path);
+        return (number == null) ? null : number.doubleValue();
     }
 
     /**