changeset 256:5199bf1a0754

8137199: DIO VTS 1.1, rpi, b235: NPE from com.oracle.dio.registry.RegistryList.toString(RegistryList.java:76) Summary: NULL property value is filtered out Reviewed-by: alkonsta
author snazarki
date Tue, 29 Sep 2015 13:56:01 +0300
parents 11ac31a1dc0c
children 9e84ee5ad33c
files src/se/classes/com/oracle/dio/registry/RegistryData.java src/se/classes/com/oracle/dio/registry/RegistryList.java
diffstat 2 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/se/classes/com/oracle/dio/registry/RegistryData.java	Mon Sep 28 19:41:55 2015 +0300
+++ b/src/se/classes/com/oracle/dio/registry/RegistryData.java	Tue Sep 29 13:56:01 2015 +0300
@@ -25,8 +25,10 @@
 
 package com.oracle.dio.registry;
 
+import java.util.Enumeration;
 import java.util.Hashtable;
-import java.util.Enumeration;
+
+import com.oracle.dio.utils.Logging;
 
 public final class RegistryData {
     private final Hashtable<String, Object> data;
@@ -44,6 +46,11 @@
     }
 
     public void putCharacterProperty(String key, String value) {
+        if (null == value) {
+            Logging.reportInformation("RegistryData ignores null element");
+            return;
+        }
+
         data.put(key, value);
     }
 
--- a/src/se/classes/com/oracle/dio/registry/RegistryList.java	Mon Sep 28 19:41:55 2015 +0300
+++ b/src/se/classes/com/oracle/dio/registry/RegistryList.java	Tue Sep 29 13:56:01 2015 +0300
@@ -25,9 +25,11 @@
 
 package com.oracle.dio.registry;
 
+import java.util.Arrays;
+import java.util.Enumeration;
 import java.util.Vector;
-import java.util.Enumeration;
-import java.util.Arrays;
+
+import com.oracle.dio.utils.Logging;
 
 public final class RegistryList {
     private final Vector data;
@@ -41,6 +43,10 @@
     }
 
     public void add(Object element) {
+        if (null == element) {
+            Logging.reportInformation("RegistryList ignores null element");
+            return;
+        }
         data.add(element);
     }