kumaab commented on code in PR #442:
URL: https://github.com/apache/ranger/pull/442#discussion_r1880847561
##########
agents-common/src/main/java/org/apache/ranger/plugin/errors/ValidationErrorCode.java:
##########
@@ -170,40 +169,35 @@ public enum ValidationErrorCode {
GDS_DATASHARE_NAME_TOO_LONG(4130, "Invalid datashare name=[{0}]. Datashare
name should not be longer than 512 characters"),
GDS_PROJECT_NAME_TOO_LONG(4131, "Invalid project name=[{0}]. Project name
should not be longer than 512 characters"),
GDS_VALIDATION_ERR_SHARED_RESOURCE_RESOURCE_NULL(4132, "Resource value in
SharedResource [{0}] is null"),
- GDS_VALIDATION_ERR_SHARED_RESOURCE_MISSING_VALUE(4133, "Invalid resource:
empty or no value provided for {0}"),
- ;
-
+ GDS_VALIDATION_ERR_SHARED_RESOURCE_MISSING_VALUE(4133, "Invalid resource:
empty or no value provided for {0}");
private static final Logger LOG =
LoggerFactory.getLogger(ValidationErrorCode.class);
- final int _errorCode;
- final String _template;
+ final int errorCode;
+ final String template;
ValidationErrorCode(int errorCode, String template) {
- _errorCode = errorCode;
- _template = template;
+ this.errorCode = errorCode;
+ this.template = template;
}
public String getMessage(Object... items) {
- if (LOG.isDebugEnabled()) {
- LOG.debug(String.format("<== ValidationErrorCode.getMessage(%s)",
Arrays.toString(items)));
- }
+ LOG.debug("<== ValidationErrorCode.getMessage({})", items);
+
+ MessageFormat mf = new MessageFormat(template);
+ String result = mf.format(items);
- MessageFormat mf = new MessageFormat(_template);
- String result = mf.format(items);
+ LOG.debug("<== ValidationErrorCode.getMessage({}): {}}", items,
result);
Review Comment:
un-matched curly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]