ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [16/50] [abbrv] ignite git commit: IGNITE-4066 Fixed NPE.
Date Wed, 26 Oct 2016 22:55:08 GMT
IGNITE-4066 Fixed NPE.


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

Branch: refs/heads/ignite-4110
Commit: b1ec58f716ece3a5866dd654ebc707bef67caf57
Parents: eaf8ae2
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Thu Oct 13 12:58:22 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Thu Oct 13 12:58:22 2016 +0700

----------------------------------------------------------------------
 .../visor/cache/VisorCacheTypeMetadata.java     | 70 +++++++++++---------
 1 file changed, 37 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b1ec58f7/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 870e033..f17e588 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
@@ -111,51 +111,55 @@ public class VisorCacheTypeMetadata implements Serializable, LessNamingBean
{
         if (factory != null && factory instanceof CacheJdbcPojoStoreFactory) {
              CacheJdbcPojoStoreFactory jdbcFactory = (CacheJdbcPojoStoreFactory) factory;
 
-            for (JdbcType jdbcType : jdbcFactory.getTypes()) {
-                VisorCacheTypeMetadata meta = metaMap.get(jdbcType.getKeyType());
+            JdbcType[] jdbcTypes = jdbcFactory.getTypes();
 
-                boolean notFound = meta == null;
+            if (jdbcTypes != null && jdbcTypes.length > 0) {
+                for (JdbcType jdbcType : jdbcTypes) {
+                    VisorCacheTypeMetadata meta = metaMap.get(jdbcType.getKeyType());
 
-                if (notFound) {
-                    meta = new VisorCacheTypeMetadata();
+                    boolean notFound = meta == null;
 
-                    meta.keyType = jdbcType.getKeyType();
-                    meta.valType = jdbcType.getValueType();
+                    if (notFound) {
+                        meta = new VisorCacheTypeMetadata();
 
-                    meta.qryFlds = Collections.emptyMap();
-                    meta.ascFlds = Collections.emptyMap();
-                    meta.descFlds = Collections.emptyMap();
-                    meta.txtFlds = Collections.emptyList();
-                    meta.grps = Collections.emptyMap();
-                }
+                        meta.keyType = jdbcType.getKeyType();
+                        meta.valType = jdbcType.getValueType();
 
-                meta.dbSchema = jdbcType.getDatabaseSchema();
-                meta.dbTbl = jdbcType.getDatabaseTable();
+                        meta.qryFlds = Collections.emptyMap();
+                        meta.ascFlds = Collections.emptyMap();
+                        meta.descFlds = Collections.emptyMap();
+                        meta.txtFlds = Collections.emptyList();
+                        meta.grps = Collections.emptyMap();
+                    }
 
-                JdbcTypeField[] keyFields = jdbcType.getKeyFields();
+                    meta.dbSchema = jdbcType.getDatabaseSchema();
+                    meta.dbTbl = jdbcType.getDatabaseTable();
 
-                if (keyFields != null) {
-                    meta.keyFields = new ArrayList<>(keyFields.length);
+                    JdbcTypeField[] keyFields = jdbcType.getKeyFields();
 
-                    for (JdbcTypeField fld : keyFields)
-                        meta.keyFields.add(new VisorCacheTypeFieldMetadata(
-                            fld.getDatabaseFieldName(), fld.getDatabaseFieldType(),
-                            fld.getDatabaseFieldName(), U.compact(fld.getJavaFieldType().getName())));
-                }
+                    if (keyFields != null) {
+                        meta.keyFields = new ArrayList<>(keyFields.length);
 
-                JdbcTypeField[] valFields = jdbcType.getValueFields();
+                        for (JdbcTypeField fld : keyFields)
+                            meta.keyFields.add(new VisorCacheTypeFieldMetadata(
+                                fld.getDatabaseFieldName(), fld.getDatabaseFieldType(),
+                                fld.getDatabaseFieldName(), U.compact(fld.getJavaFieldType().getName())));
+                    }
 
-                if (valFields != null) {
-                    meta.valFields = new ArrayList<>(valFields.length);
+                    JdbcTypeField[] valFields = jdbcType.getValueFields();
 
-                    for (JdbcTypeField fld : valFields)
-                        meta.valFields.add(new VisorCacheTypeFieldMetadata(
-                            fld.getDatabaseFieldName(), fld.getDatabaseFieldType(),
-                            fld.getDatabaseFieldName(), U.compact(fld.getJavaFieldType().getName())));
-                }
+                    if (valFields != null) {
+                        meta.valFields = new ArrayList<>(valFields.length);
 
-                if (notFound)
-                    metas.add(meta);
+                        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