Sonar fixes

- a few complexities
- final method calls from ctor
- raw exception throwing
- useless overrides
- loss of stack trace
This commit is contained in:
Gary Russell
2019-04-29 16:34:39 -04:00
committed by Artem Bilan
parent 7569d0ad79
commit 36c33bb5ab
45 changed files with 134 additions and 114 deletions

View File

@@ -611,7 +611,7 @@ public class JpaExecutor implements InitializingBean, BeanFactoryAware {
catch (NumberFormatException e) {
throw new IllegalArgumentException(
"Value " + evaluationResult + " passed as cannot be " +
"parsed to a number, expected to be numeric");
"parsed to a number, expected to be numeric", e);
}
}
else {

View File

@@ -59,7 +59,7 @@ public class BeanPropertyParameterSource implements ParameterSource {
return this.beanWrapper.getPropertyValue(paramName);
}
catch (NotReadablePropertyException ex) {
throw new IllegalArgumentException(ex.getMessage());
throw new IllegalArgumentException(ex.getMessage()); // NOSONAR - lost stack trace
}
}

View File

@@ -73,13 +73,13 @@ final class ExpressionEvaluatingParameterSourceUtils {
public static class ParameterExpressionEvaluator extends AbstractExpressionEvaluator {
@Override
public StandardEvaluationContext getEvaluationContext() {
public StandardEvaluationContext getEvaluationContext() { // NOSONAR - not useless, increases visibility
return super.getEvaluationContext();
}
@Override
@Nullable
public Object evaluateExpression(Expression expression, Object input) {
public Object evaluateExpression(Expression expression, Object input) { // NOSONAR - not useless, increases vis.
return super.evaluateExpression(expression, input);
}