[jira] [Updated] (EAGLE-1096) getJSONArray may cause exception, optJSONArray should be used

2019-04-13 Thread bd2019us (JIRA)


 [ 
https://issues.apache.org/jira/browse/EAGLE-1096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

bd2019us updated EAGLE-1096:

Attachment: (was: 1.patch)

> getJSONArray may cause exception, optJSONArray should be used
> -
>
> Key: EAGLE-1096
> URL: https://issues.apache.org/jira/browse/EAGLE-1096
> Project: Eagle
>  Issue Type: Bug
>Reporter: bd2019us
>Priority: Major
> Attachments: 1.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hello,
> The method call jsonBeansObject.getJSONArray("beans")  may throw 
> JSONException when the key does not exist, which will crash the program. To 
> ensure safety, optJSONArray is recommended to use, which will avoid the 
> exception in case no such key.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (EAGLE-1096) getJSONArray may cause exception, optJSONArray should be used

2019-04-13 Thread bd2019us (JIRA)


 [ 
https://issues.apache.org/jira/browse/EAGLE-1096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

bd2019us updated EAGLE-1096:

Attachment: 1.patch

> getJSONArray may cause exception, optJSONArray should be used
> -
>
> Key: EAGLE-1096
> URL: https://issues.apache.org/jira/browse/EAGLE-1096
> Project: Eagle
>  Issue Type: Bug
>Reporter: bd2019us
>Priority: Major
> Attachments: 1.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hello,
> The method call jsonBeansObject.getJSONArray("beans")  may throw 
> JSONException when the key does not exist, which will crash the program. To 
> ensure safety, optJSONArray is recommended to use, which will avoid the 
> exception in case no such key.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (EAGLE-1096) getJSONArray may cause exception, optJSONArray should be used

2019-04-13 Thread bd2019us (JIRA)
bd2019us created EAGLE-1096:
---

 Summary: getJSONArray may cause exception, optJSONArray should be 
used
 Key: EAGLE-1096
 URL: https://issues.apache.org/jira/browse/EAGLE-1096
 Project: Eagle
  Issue Type: Bug
Reporter: bd2019us


Hello,

The method call jsonBeansObject.getJSONArray("beans")  may throw JSONException 
when the key does not exist, which will crash the program. To ensure safety, 
optJSONArray is recommended to use, which will avoid the exception in case no 
such key.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (EAGLE-1094) JSONObject.getString() may cause exception, optString() should be used.

2019-03-31 Thread bd2019us (JIRA)


 [ 
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.

2019-03-31 Thread bd2019us (JIRA)


 [ 
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)


[jira] [Created] (EAGLE-1094) JSONObject.getString() may cause exception, optString() should be used.

2019-03-31 Thread bd2019us (JIRA)
bd2019us created EAGLE-1094:
---

 Summary: 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


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)