You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ma...@apache.org on 2019/05/29 20:01:14 UTC
[ranger] branch master updated: RANGER-2451: fix for
ClassCastException in RangerPolicyEngineImpl.convertFromSingleResource()
This is an automated email from the ASF dual-hosted git repository.
madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git
The following commit(s) were added to refs/heads/master by this push:
new 37c48a7 RANGER-2451: fix for ClassCastException in RangerPolicyEngineImpl.convertFromSingleResource()
37c48a7 is described below
commit 37c48a7d04cde78ac023799eaa1ced7ade0fa36d
Author: nixonrodrigues <ni...@apache.org>
AuthorDate: Tue May 28 17:47:20 2019 +0530
RANGER-2451: fix for ClassCastException in RangerPolicyEngineImpl.convertFromSingleResource()
Signed-off-by: Madhan Neethiraj <ma...@apache.org>
---
.../org/apache/ranger/plugin/policyengine/RangerPolicyEngineImpl.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngineImpl.java b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngineImpl.java
index eab2c23..db5dde7 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngineImpl.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngineImpl.java
@@ -1764,8 +1764,8 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
for (Map.Entry<String, ? extends Object> entry : resource.entrySet()) {
List<String> value;
- if (entry.getValue() instanceof Collection) {
- value = (List<String>) entry.getValue();
+ if (entry.getValue() instanceof Collection && CollectionUtils.isNotEmpty((Collection) entry.getValue())) {
+ value = new ArrayList((Collection) entry.getValue());
} else if (entry.getValue() instanceof String) {
value = new ArrayList<>();
value.add((String) entry.getValue());