Re: Review Request 64677: RANGER-1934:Optimize the init method in BaseAuditHandler class to avoid ArrayIndexOutOfBoundsException

2017-12-20 Thread Qiang Zhang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64677/#review194284
---


Ship it!




Ship It!

- Qiang Zhang


On Dec. 20, 2017, 5:54 a.m., pengjianhua wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64677/
> ---
> 
> (Updated Dec. 20, 2017, 5:54 a.m.)
> 
> 
> Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
> hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
> Neethiraj, Velmurugan Periasamy, and Qiang Zhang.
> 
> 
> Bugs: RANGER-1934
> https://issues.apache.org/jira/browse/RANGER-1934
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Optimize the init method in BaseAuditHandler class to avoid 
> ArrayIndexOutOfBoundsException
> The follow in the init method "   List tokens = 
> MiscUtil.toArray(propPrefix, ".");
> String finalToken = tokens.get(tokens.size() - 1);".
> in the init method we should add " if (tokens.size() > 1)" to avoid 
> ArrayIndexOutOfBoundsException.
> 
> 
> Diffs
> -
> 
>   
> agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
>  b095000 
> 
> 
> Diff: https://reviews.apache.org/r/64677/diff/3/
> 
> 
> Testing
> ---
> 
> Tested it.
> 
> 
> Thanks,
> 
> pengjianhua
> 
>



Re: Review Request 64677: RANGER-1934:Optimize the init method in BaseAuditHandler class to avoid ArrayIndexOutOfBoundsException

2017-12-20 Thread Ramesh Mani

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64677/#review194272
---


Ship it!




Ship It!

- Ramesh Mani


On Dec. 20, 2017, 5:54 a.m., pengjianhua wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64677/
> ---
> 
> (Updated Dec. 20, 2017, 5:54 a.m.)
> 
> 
> Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
> hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
> Neethiraj, Velmurugan Periasamy, and Qiang Zhang.
> 
> 
> Bugs: RANGER-1934
> https://issues.apache.org/jira/browse/RANGER-1934
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Optimize the init method in BaseAuditHandler class to avoid 
> ArrayIndexOutOfBoundsException
> The follow in the init method "   List tokens = 
> MiscUtil.toArray(propPrefix, ".");
> String finalToken = tokens.get(tokens.size() - 1);".
> in the init method we should add " if (tokens.size() > 1)" to avoid 
> ArrayIndexOutOfBoundsException.
> 
> 
> Diffs
> -
> 
>   
> agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
>  b095000 
> 
> 
> Diff: https://reviews.apache.org/r/64677/diff/3/
> 
> 
> Testing
> ---
> 
> Tested it.
> 
> 
> Thanks,
> 
> pengjianhua
> 
>



Re: Review Request 64677: RANGER-1934:Optimize the init method in BaseAuditHandler class to avoid ArrayIndexOutOfBoundsException

2017-12-20 Thread Colm O hEigeartaigh

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64677/#review194223
---


Ship it!




Ship It!

- Colm O hEigeartaigh


On Dec. 20, 2017, 5:54 a.m., pengjianhua wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64677/
> ---
> 
> (Updated Dec. 20, 2017, 5:54 a.m.)
> 
> 
> Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
> hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
> Neethiraj, Velmurugan Periasamy, and Qiang Zhang.
> 
> 
> Bugs: RANGER-1934
> https://issues.apache.org/jira/browse/RANGER-1934
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Optimize the init method in BaseAuditHandler class to avoid 
> ArrayIndexOutOfBoundsException
> The follow in the init method "   List tokens = 
> MiscUtil.toArray(propPrefix, ".");
> String finalToken = tokens.get(tokens.size() - 1);".
> in the init method we should add " if (tokens.size() > 1)" to avoid 
> ArrayIndexOutOfBoundsException.
> 
> 
> Diffs
> -
> 
>   
> agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
>  b095000 
> 
> 
> Diff: https://reviews.apache.org/r/64677/diff/3/
> 
> 
> Testing
> ---
> 
> Tested it.
> 
> 
> Thanks,
> 
> pengjianhua
> 
>



Re: Review Request 64677: RANGER-1934:Optimize the init method in BaseAuditHandler class to avoid ArrayIndexOutOfBoundsException

2017-12-19 Thread pengjianhua


> On 十二月 19, 2017, 11:53 a.m., Colm O hEigeartaigh wrote:
> > Better to have "!tokens.isEmpty()" than "tokens.size() > 0". Also, the 
> > indentation inside the if statement is wrong "if (providerName == null) {".

Hi, I has updated the patch .thanks.


- pengjianhua


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64677/#review194136
---


On 十二月 20, 2017, 5:54 a.m., pengjianhua wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64677/
> ---
> 
> (Updated 十二月 20, 2017, 5:54 a.m.)
> 
> 
> Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
> hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
> Neethiraj, Velmurugan Periasamy, and Qiang Zhang.
> 
> 
> Bugs: RANGER-1934
> https://issues.apache.org/jira/browse/RANGER-1934
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Optimize the init method in BaseAuditHandler class to avoid 
> ArrayIndexOutOfBoundsException
> The follow in the init method "   List tokens = 
> MiscUtil.toArray(propPrefix, ".");
> String finalToken = tokens.get(tokens.size() - 1);".
> in the init method we should add " if (tokens.size() > 1)" to avoid 
> ArrayIndexOutOfBoundsException.
> 
> 
> Diffs
> -
> 
>   
> agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
>  b095000 
> 
> 
> Diff: https://reviews.apache.org/r/64677/diff/3/
> 
> 
> Testing
> ---
> 
> Tested it.
> 
> 
> Thanks,
> 
> pengjianhua
> 
>



Re: Review Request 64677: RANGER-1934:Optimize the init method in BaseAuditHandler class to avoid ArrayIndexOutOfBoundsException

2017-12-19 Thread pengjianhua

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64677/
---

(Updated 十二月 20, 2017, 5:54 a.m.)


Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
Neethiraj, Velmurugan Periasamy, and Qiang Zhang.


Bugs: RANGER-1934
https://issues.apache.org/jira/browse/RANGER-1934


Repository: ranger


Description
---

Optimize the init method in BaseAuditHandler class to avoid 
ArrayIndexOutOfBoundsException
The follow in the init method " List tokens = 
MiscUtil.toArray(propPrefix, ".");
String finalToken = tokens.get(tokens.size() - 1);".
in the init method we should add " if (tokens.size() > 1)" to avoid 
ArrayIndexOutOfBoundsException.


Diffs (updated)
-

  
agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
 b095000 


Diff: https://reviews.apache.org/r/64677/diff/3/

Changes: https://reviews.apache.org/r/64677/diff/2-3/


Testing
---

Tested it.


Thanks,

pengjianhua



Re: Review Request 64677: RANGER-1934:Optimize the init method in BaseAuditHandler class to avoid ArrayIndexOutOfBoundsException

2017-12-19 Thread Colm O hEigeartaigh

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64677/#review194136
---



Better to have "!tokens.isEmpty()" than "tokens.size() > 0". Also, the 
indentation inside the if statement is wrong "if (providerName == null) {".

- Colm O hEigeartaigh


On Dec. 19, 2017, 1:40 a.m., pengjianhua wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64677/
> ---
> 
> (Updated Dec. 19, 2017, 1:40 a.m.)
> 
> 
> Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
> hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
> Neethiraj, Velmurugan Periasamy, and Qiang Zhang.
> 
> 
> Bugs: RANGER-1934
> https://issues.apache.org/jira/browse/RANGER-1934
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Optimize the init method in BaseAuditHandler class to avoid 
> ArrayIndexOutOfBoundsException
> The follow in the init method "   List tokens = 
> MiscUtil.toArray(propPrefix, ".");
> String finalToken = tokens.get(tokens.size() - 1);".
> in the init method we should add " if (tokens.size() > 1)" to avoid 
> ArrayIndexOutOfBoundsException.
> 
> 
> Diffs
> -
> 
>   
> agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
>  b095000 
> 
> 
> Diff: https://reviews.apache.org/r/64677/diff/2/
> 
> 
> Testing
> ---
> 
> Tested it.
> 
> 
> Thanks,
> 
> pengjianhua
> 
>



Re: Review Request 64677: RANGER-1934:Optimize the init method in BaseAuditHandler class to avoid ArrayIndexOutOfBoundsException

2017-12-18 Thread pengjianhua


> On 十二月 19, 2017, 12:55 a.m., Qiang Zhang wrote:
> > agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
> > Lines 93 (patched)
> > 
> >
> > Please modify tokens.size() > 1 to tokens.size() > 0

Ok, I had updated the patch ,please review again.


- pengjianhua


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64677/#review194105
---


On 十二月 18, 2017, 7:47 a.m., pengjianhua wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64677/
> ---
> 
> (Updated 十二月 18, 2017, 7:47 a.m.)
> 
> 
> Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
> hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
> Neethiraj, Velmurugan Periasamy, and Qiang Zhang.
> 
> 
> Bugs: RANGER-1934
> https://issues.apache.org/jira/browse/RANGER-1934
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Optimize the init method in BaseAuditHandler class to avoid 
> ArrayIndexOutOfBoundsException
> The follow in the init method "   List tokens = 
> MiscUtil.toArray(propPrefix, ".");
> String finalToken = tokens.get(tokens.size() - 1);".
> in the init method we should add " if (tokens.size() > 1)" to avoid 
> ArrayIndexOutOfBoundsException.
> 
> 
> Diffs
> -
> 
>   
> agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
>  b095000 
> 
> 
> Diff: https://reviews.apache.org/r/64677/diff/1/
> 
> 
> Testing
> ---
> 
> Tested it.
> 
> 
> Thanks,
> 
> pengjianhua
> 
>



Re: Review Request 64677: RANGER-1934:Optimize the init method in BaseAuditHandler class to avoid ArrayIndexOutOfBoundsException

2017-12-18 Thread pengjianhua


> On 十二月 18, 2017, 10:05 a.m., Qiang Zhang wrote:
> > agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
> > Lines 95-99 (original), 96-100 (patched)
> > 
> >
> > They should not be included the following code segment.
> > if (tokens.size() > 1)

Hi,if (providerName == null),the following code not needed to execute if 
(providerName == null) {
List tokens = MiscUtil.toArray(propPrefix, ".");
if (tokens.size() > 0) {
String finalToken = tokens.get(tokens.size() - 1);
setName(finalToken);
LOG.info("Using providerName from property 
prefix. providerName="
+ getName());
}
}
 Because the follow code had executed before above code segment:
"String name = MiscUtil.getStringProperty(props, 
basePropertyName + "."
+ PROP_NAME);
if (name != null && !name.isEmpty()) {
setName(name);
}"
  " public void setName(String name) {
providerName = name;
}"
 So. add the following code segment."if (tokens.size() > 1)" is better


- pengjianhua


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64677/#review194054
---


On 十二月 18, 2017, 7:47 a.m., pengjianhua wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64677/
> ---
> 
> (Updated 十二月 18, 2017, 7:47 a.m.)
> 
> 
> Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
> hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
> Neethiraj, Velmurugan Periasamy, and Qiang Zhang.
> 
> 
> Bugs: RANGER-1934
> https://issues.apache.org/jira/browse/RANGER-1934
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Optimize the init method in BaseAuditHandler class to avoid 
> ArrayIndexOutOfBoundsException
> The follow in the init method "   List tokens = 
> MiscUtil.toArray(propPrefix, ".");
> String finalToken = tokens.get(tokens.size() - 1);".
> in the init method we should add " if (tokens.size() > 1)" to avoid 
> ArrayIndexOutOfBoundsException.
> 
> 
> Diffs
> -
> 
>   
> agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
>  b095000 
> 
> 
> Diff: https://reviews.apache.org/r/64677/diff/1/
> 
> 
> Testing
> ---
> 
> Tested it.
> 
> 
> Thanks,
> 
> pengjianhua
> 
>



Re: Review Request 64677: RANGER-1934:Optimize the init method in BaseAuditHandler class to avoid ArrayIndexOutOfBoundsException

2017-12-18 Thread Qiang Zhang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64677/#review194105
---




agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
Lines 93 (patched)


Please modify tokens.size() > 1 to tokens.size() > 0


- Qiang Zhang


On Dec. 18, 2017, 7:47 a.m., pengjianhua wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64677/
> ---
> 
> (Updated Dec. 18, 2017, 7:47 a.m.)
> 
> 
> Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
> hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
> Neethiraj, Velmurugan Periasamy, and Qiang Zhang.
> 
> 
> Bugs: RANGER-1934
> https://issues.apache.org/jira/browse/RANGER-1934
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Optimize the init method in BaseAuditHandler class to avoid 
> ArrayIndexOutOfBoundsException
> The follow in the init method "   List tokens = 
> MiscUtil.toArray(propPrefix, ".");
> String finalToken = tokens.get(tokens.size() - 1);".
> in the init method we should add " if (tokens.size() > 1)" to avoid 
> ArrayIndexOutOfBoundsException.
> 
> 
> Diffs
> -
> 
>   
> agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
>  b095000 
> 
> 
> Diff: https://reviews.apache.org/r/64677/diff/1/
> 
> 
> Testing
> ---
> 
> Tested it.
> 
> 
> Thanks,
> 
> pengjianhua
> 
>



Re: Review Request 64677: RANGER-1934:Optimize the init method in BaseAuditHandler class to avoid ArrayIndexOutOfBoundsException

2017-12-18 Thread Qiang Zhang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64677/#review194054
---




agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
Lines 95-99 (original), 96-100 (patched)


They should not be included the following code segment.
if (tokens.size() > 1)


- Qiang Zhang


On Dec. 18, 2017, 7:47 a.m., pengjianhua wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64677/
> ---
> 
> (Updated Dec. 18, 2017, 7:47 a.m.)
> 
> 
> Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
> hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
> Neethiraj, Velmurugan Periasamy, and Qiang Zhang.
> 
> 
> Bugs: RANGER-1934
> https://issues.apache.org/jira/browse/RANGER-1934
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Optimize the init method in BaseAuditHandler class to avoid 
> ArrayIndexOutOfBoundsException
> The follow in the init method "   List tokens = 
> MiscUtil.toArray(propPrefix, ".");
> String finalToken = tokens.get(tokens.size() - 1);".
> in the init method we should add " if (tokens.size() > 1)" to avoid 
> ArrayIndexOutOfBoundsException.
> 
> 
> Diffs
> -
> 
>   
> agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
>  b095000 
> 
> 
> Diff: https://reviews.apache.org/r/64677/diff/1/
> 
> 
> Testing
> ---
> 
> Tested it.
> 
> 
> Thanks,
> 
> pengjianhua
> 
>



Review Request 64677: RANGER-1934:Optimize the init method in BaseAuditHandler class to avoid ArrayIndexOutOfBoundsException

2017-12-17 Thread pengjianhua

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64677/
---

Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
Neethiraj, Velmurugan Periasamy, and Qiang Zhang.


Bugs: RANGER-1934
https://issues.apache.org/jira/browse/RANGER-1934


Repository: ranger


Description
---

Optimize the init method in BaseAuditHandler class to avoid 
ArrayIndexOutOfBoundsException
The follow in the init method " List tokens = 
MiscUtil.toArray(propPrefix, ".");
String finalToken = tokens.get(tokens.size() - 1);".
in the init method we should add " if (tokens.size() > 1)" to avoid 
ArrayIndexOutOfBoundsException.


Diffs
-

  
agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java
 b095000 


Diff: https://reviews.apache.org/r/64677/diff/1/


Testing
---

Tested it.


Thanks,

pengjianhua