You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "wolfboys (via GitHub)" <gi...@apache.org> on 2023/02/13 12:58:27 UTC

[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #2327: Remove AssertUtils to fix license issues

wolfboys commented on code in PR #2327:
URL: https://github.com/apache/incubator-streampark/pull/2327#discussion_r1104438167


##########
streampark-common/src/main/scala/org/apache/streampark/common/util/Utils.scala:
##########
@@ -44,14 +53,20 @@ object Utils {
 
   def isEmpty(elem: Any): Boolean = !notEmpty(elem)
 
-  def uuid(): String = UUID.randomUUID().toString.replaceAll("-", "")
+  def required(expression: Boolean): Unit = {
+    if (!expression) {
+      throw new IllegalArgumentException
+    }
+  }
 
-  def require(requirement: Boolean, message: String): Unit = {
-    if (!requirement) {
-      throw new IllegalArgumentException(s"requirement failed: $message")
+  def required(expression: Boolean, errorMessage: Any): Unit = {

Review Comment:
   > How about `checkArgument` due to it throw `IllegalArgumentException` when `expression == false`?
   
   about the method name, I prefer `required`, shorter and more concise



-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org