This is an automated email from the ASF dual-hosted git repository.

peacewong pushed a commit to branch dev-1.3.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.3.1 by this push:
     new 4dd8c7a4f feat:Scala code format alarm clear in 
linkis-error-code-client (#3137)
4dd8c7a4f is described below

commit 4dd8c7a4f4164a75279ceb666061abb7b9e87f2b
Author: ruY <43773582+ruy9...@users.noreply.github.com>
AuthorDate: Wed Aug 31 18:08:23 2022 +0800

    feat:Scala code format alarm clear in linkis-error-code-client (#3137)
---
 .../apache/linkis/errorcode/client/result/ErrorCodeResult.scala   | 4 ++--
 .../apache/linkis/errorcode/client/utils/ErrorCodeMatcher.scala   | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/linkis-public-enhancements/linkis-error-code/linkis-error-code-client/src/main/scala/org/apache/linkis/errorcode/client/result/ErrorCodeResult.scala
 
b/linkis-public-enhancements/linkis-error-code/linkis-error-code-client/src/main/scala/org/apache/linkis/errorcode/client/result/ErrorCodeResult.scala
index 844b7007c..e4fe37ee0 100644
--- 
a/linkis-public-enhancements/linkis-error-code/linkis-error-code-client/src/main/scala/org/apache/linkis/errorcode/client/result/ErrorCodeResult.scala
+++ 
b/linkis-public-enhancements/linkis-error-code/linkis-error-code-client/src/main/scala/org/apache/linkis/errorcode/client/result/ErrorCodeResult.scala
@@ -32,8 +32,8 @@ class ErrorCodeGetAllResult extends ErrorCodeResult {
   def getErrorCodes: java.util.List[LinkisErrorCode] = errorCodes
 
   def setErrorCodes(errorCodes: java.util.List[util.LinkedHashMap[String, 
Object]]): Unit = {
-    import scala.collection.JavaConversions._
-    errorCodes.foreach(map => {
+    import scala.collection.JavaConverters._
+    errorCodes.asScala.foreach(map => {
       val errorCode = map.get("errorCode").asInstanceOf[String]
       val errorDesc = map.get("errorDesc").asInstanceOf[String]
       val errorType = map.get("errorType").asInstanceOf[Int]
diff --git 
a/linkis-public-enhancements/linkis-error-code/linkis-error-code-client/src/main/scala/org/apache/linkis/errorcode/client/utils/ErrorCodeMatcher.scala
 
b/linkis-public-enhancements/linkis-error-code/linkis-error-code-client/src/main/scala/org/apache/linkis/errorcode/client/utils/ErrorCodeMatcher.scala
index 97d3ef690..0fbdc81cd 100644
--- 
a/linkis-public-enhancements/linkis-error-code/linkis-error-code-client/src/main/scala/org/apache/linkis/errorcode/client/utils/ErrorCodeMatcher.scala
+++ 
b/linkis-public-enhancements/linkis-error-code/linkis-error-code-client/src/main/scala/org/apache/linkis/errorcode/client/utils/ErrorCodeMatcher.scala
@@ -29,13 +29,13 @@ object ErrorCodeMatcher extends Logging {
       log: String
   ): Option[(String, String)] = {
     Utils.tryCatch {
-      import scala.collection.JavaConversions._
-      errorCodes.foreach(e =>
+      import scala.collection.JavaConverters._
+      errorCodes.asScala.foreach(e =>
         if (e.getErrorRegex.findFirstIn(log).isDefined) {
           val matched = e.getErrorRegex.unapplySeq(log)
-          if (matched.nonEmpty)
+          if (matched.nonEmpty) {
             return Some(e.getErrorCode -> e.getErrorDesc.format(matched.get: 
_*))
-          else return Some(e.getErrorCode -> e.getErrorDesc)
+          } else return Some(e.getErrorCode -> e.getErrorDesc)
         }
       )
       None


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@linkis.apache.org
For additional commands, e-mail: commits-h...@linkis.apache.org

Reply via email to