-
Notifications
You must be signed in to change notification settings - Fork 414
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
OAK-11078: Remove usage of Guava checkArgument #1687
Conversation
@@ -244,8 +244,8 @@ public static String checkValidName(String asyncName){ | |||
if (IndexConstants.ASYNC_REINDEX_VALUE.equals(asyncName)){ | |||
return asyncName; | |||
} | |||
checkArgument(asyncName.endsWith("async"), "async name [%s] does not confirm to " + | |||
"naming pattern of ending with 'async'", asyncName); | |||
Validate.isTrue(asyncName.endsWith("async"), "async name [%s] does not confirm to naming pattern of ending with 'async'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/confirm/conform
@@ -700,7 +700,7 @@ private static final class TreeNode { | |||
} | |||
|
|||
TreeNode(MapFactory mapFactory, TreeNode parent, String name) { | |||
checkArgument(!name.contains("/"), | |||
Validate.isTrue(!name.contains("/"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does "{}" even work in a format string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, according to the documentation (even in checkArgument)
so yes, this needs to be fixed.
Before proceeding with this, I'd love to get some feedback.
JDK lacks this feature. We can either use something identical from commons-lang (which we use anyway, and which I did here), or roll our own.
Opinions?
(note that I also took the freedom to fix "{}" in format strings, and to avoid string concatenation)