Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZOOKEEPER-4002:ZKAuditProvider throw NullPointerException if 'AUDIT_ENABLE' is false #1536

Closed
wants to merge 1 commit into from
Closed

Conversation

zengchao1212
Copy link
Contributor

No description provided.

auditLogger.logAuditEvent(createLogEvent(user, operation, znode, acl, createMode, session, ip, result));
if (isAuditEnabled()) {
auditLogger.logAuditEvent(createLogEvent(user, operation, znode, acl, createMode, session, ip, result));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this method, all the callers have a pre-check for the isAuditEnabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right,my mistake

auditLogger.logAuditEvent(createLogEvent(user, operation, result));
if (isAuditEnabled()) {
auditLogger.logAuditEvent(createLogEvent(user, operation, result));
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is the same, when 'AUDIT_ENABLE' is false, the program cannot run at here, so no NPE issue. Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants