ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [24/28] ignite git commit: Fixed NPE in special case.
Date Mon, 22 Aug 2016 03:26:56 GMT
Fixed NPE in special case.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9db16d1b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9db16d1b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9db16d1b

Branch: refs/heads/master
Commit: 9db16d1b2a23e703546c472676620139e82e747f
Parents: a20ca35
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Fri Aug 19 17:40:30 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Fri Aug 19 17:40:30 2016 +0700

----------------------------------------------------------------------
 .../visor/cache/VisorCacheTypeMetadata.java     | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9db16d1b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheTypeMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheTypeMetadata.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheTypeMetadata.java
index 4e38d81..870e033 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheTypeMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheTypeMetadata.java
@@ -134,21 +134,25 @@ public class VisorCacheTypeMetadata implements Serializable, LessNamingBean
{
 
                 JdbcTypeField[] keyFields = jdbcType.getKeyFields();
 
-                meta.keyFields = new ArrayList<>(keyFields.length);
+                if (keyFields != null) {
+                    meta.keyFields = new ArrayList<>(keyFields.length);
 
-                for (JdbcTypeField fld : keyFields)
-                    meta.keyFields.add(new VisorCacheTypeFieldMetadata(
-                        fld.getDatabaseFieldName(), fld.getDatabaseFieldType(),
-                        fld.getDatabaseFieldName(), U.compact(fld.getJavaFieldType().getName())));
+                    for (JdbcTypeField fld : keyFields)
+                        meta.keyFields.add(new VisorCacheTypeFieldMetadata(
+                            fld.getDatabaseFieldName(), fld.getDatabaseFieldType(),
+                            fld.getDatabaseFieldName(), U.compact(fld.getJavaFieldType().getName())));
+                }
 
                 JdbcTypeField[] valFields = jdbcType.getValueFields();
 
-                meta.valFields = new ArrayList<>(valFields.length);
+                if (valFields != null) {
+                    meta.valFields = new ArrayList<>(valFields.length);
 
-                for (JdbcTypeField fld : valFields)
-                    meta.valFields.add(new VisorCacheTypeFieldMetadata(
+                    for (JdbcTypeField fld : valFields)
+                        meta.valFields.add(new VisorCacheTypeFieldMetadata(
                             fld.getDatabaseFieldName(), fld.getDatabaseFieldType(),
                             fld.getDatabaseFieldName(), U.compact(fld.getJavaFieldType().getName())));
+                }
 
                 if (notFound)
                     metas.add(meta);


Mime
View raw message