[ https://issues.apache.org/jira/browse/EAGLE-1094?focusedWorklogId=221084&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-221084 ]
ASF GitHub Bot logged work on EAGLE-1094: ----------------------------------------- Author: ASF GitHub Bot Created on: 01/Apr/19 05:00 Start Date: 01/Apr/19 05:00 Worklog Time Spent: 10m Work Description: bd2019us commented on pull request #1000: [EAGLE-1094] change JSONObject.getString() to optString() to avoid exception URL: https://github.com/apache/eagle/pull/1000 Be sure to do all of the following to help us incorporate your contribution quickly and easily: - [x] Make sure the PR title is formatted like: `[EAGLE-<Jira issue #>] Description of pull request` - [x] Make sure tests pass via `mvn clean verify`. This command causes style. - [x] Replace `<Jira issue #>` in the title with the actual Jira issue number, if there is one. --- ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 221084) Time Spent: 10m Remaining Estimate: 0h > JSONObject.getString() may cause exception, optString() should be used. > ----------------------------------------------------------------------- > > Key: EAGLE-1094 > URL: https://issues.apache.org/jira/browse/EAGLE-1094 > Project: Eagle > Issue Type: Bug > Reporter: bd2019us > Priority: Major > Labels: pull-request-available > Time Spent: 10m > Remaining Estimate: 0h > > Locations: > (1) > eagle-topology-check/eagle-topology-app/src/main/java/org/apache/eagle/topology/extractor/hdfs/HdfsTopologyEntityParser.java:158 > (2) > eagle-topology-check/eagle-topology-app/src/main/java/org/apache/eagle/topology/extractor/hdfs/HdfsTopologyEntityParser.java:165 > (3) > eagle-topology-check/eagle-topology-app/src/main/java/org/apache/eagle/topology/extractor/hdfs/HdfsTopologyEntityParser.java:180 > (4) > eagle-security/eagle-security-maprfs-web/src/main/java/org/apache/eagle/service/security/hdfs/resolver/MAPRFSVolumeResolver.java:117 > (5) > eagle-security/eagle-security-maprfs-web/src/main/java/org/apache/eagle/service/security/hdfs/rest/MapRNameResolver.java:65 > > JSONObject.getString(elem) would throw an exception if the key of "elem" does > not exist, which may cause the program crash. Therefore, another one > "optString()" should be used to avoid such kind of errors since it will > return a default value ("") and won't risk the program in crashing. -- This message was sent by Atlassian JIRA (v7.6.3#76005)