-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/61384/#review182196
-----------------------------------------------------------
There are two spaces here befor DEFAULT: "getMessage(exp) +
DEFAULT_ERROR_MESSAGE". You could also refactor getMessage a bit:
if (!errList.contains(excp.getMessage() + ". \n")) {
if (excp.getMessage() != null &&
!(excp.getMessage().equalsIgnoreCase(""))) {
errList.add(excp.getMessage() + ". \n");
}
}
We should just have one if statement here and replace the last two checks with
StringUtils.isNotEmpty(str) - and put it as the first part of the if statement.
- Colm O hEigeartaigh
On Aug. 2, 2017, 8:21 p.m., Zsombor Gegesy wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61384/
> -----------------------------------------------------------
>
> (Updated Aug. 2, 2017, 8:21 p.m.)
>
>
> Review request for ranger.
>
>
> Bugs: RANGER-1722
> https://issues.apache.org/jira/browse/RANGER-1722
>
>
> Repository: ranger
>
>
> Description
> -------
>
> The exception creation code is duplicated unnecessarily, which can be easily
> refactored to a simpler solution
>
>
> Diffs
> -----
>
> agents-common/src/main/java/org/apache/ranger/plugin/client/BaseClient.java
> e1f9796
>
>
> Diff: https://reviews.apache.org/r/61384/diff/1/
>
>
> Testing
> -------
>
> https://travis-ci.org/gzsombor/ranger/builds/260348900
>
>
> Thanks,
>
> Zsombor Gegesy
>
>