[jira] [Updated] (EAGLE-1094) JSONObject.getString() may cause exception, optString() should be used.
[ https://issues.apache.org/jira/browse/EAGLE-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] bd2019us updated EAGLE-1094: Attachment: 1.patch > 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 > Attachments: 1.patch > > 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)
[jira] [Updated] (EAGLE-1094) JSONObject.getString() may cause exception, optString() should be used.
[ https://issues.apache.org/jira/browse/EAGLE-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] bd2019us updated EAGLE-1094: Labels: pull-request-available (was: ) > 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)