[
https://issues.apache.org/jira/browse/EAGLE-844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15761829#comment-15761829
]
ASF GitHub Bot commented on EAGLE-844:
--------------------------------------
Github user lifove commented on a diff in the pull request:
https://github.com/apache/incubator-eagle/pull/751#discussion_r93083865
--- Diff:
eagle-core/eagle-query/eagle-storage-hbase/src/main/java/org/apache/eagle/storage/hbase/HBaseEntitySchemaManager.java
---
@@ -65,7 +65,7 @@ public void init() {
try {
admin = new HBaseAdmin(conf);
Map<String, EntityDefinition> entityServiceMap =
EntityDefinitionManager.entities();
- if (entityServiceMap != null || entityServiceMap.values() !=
null) {
+ if (entityServiceMap != null && entityServiceMap.values() !=
null) {
--- End diff --
Right. It shouldn't. will update soon. Thanks~
> Potential NPE issue
> -------------------
>
> Key: EAGLE-844
> URL: https://issues.apache.org/jira/browse/EAGLE-844
> Project: Eagle
> Issue Type: Bug
> Reporter: Jaechang Nam
> Priority: Minor
>
> The following file accessed on Dec 18 2016 (Github revision id:
> 8fe968cb7e340e2f21711b5a0f701e760cb91d59),
> eagle-core/eagle-query/eagle-storage-hbase/src/main/java/org/apache/eagle/storage/hbase/HBaseEntitySchemaManager.java,
> seems to have a potential null pointer exception.
> Map<String, EntityDefinition> entityServiceMap =
> EntityDefinitionManager.entities();
> if (entityServiceMap != null || entityServiceMap.values() !=
> null) {
> for (EntityDefinition entityDefinition :
> entityServiceMap.values()) {
> createTable(entityDefinition);
> }
> }
> ---
> if entityServiceMap is null, entityServiceMap.values() could have NPE.
> I have no idea if entityServiceMap can be null. Having said that, at least it
> could be a code smell.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)