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

bowenliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 14b3e45bb [KYUUBI #5178] [DOC] Make MarkdownBuilder not extending 
Growable
14b3e45bb is described below

commit 14b3e45bb8d92cfc8110c95bf2e8037b9f4b5fba
Author: liangbowen <[email protected]>
AuthorDate: Fri Aug 18 08:28:34 2023 +0800

    [KYUUBI #5178] [DOC] Make MarkdownBuilder not extending Growable
    
    ### _Why are the changes needed?_
    
    - As `scala.collection.generic.Growable` is marked as deprecated and made 
`+=` is marked as a final method in Scala 2.13, MarkdownBuilder which extends 
Growable is a blocker issue for Scala 2.13 in the future
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run 
test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests)
 locally before make a pull request
    
    ### _Was this patch authored or co-authored using generative AI tooling?_
    
    Closes #5178 from bowenliang123/markdown-notgrow.
    
    Closes #5178
    
    c34b95649 [liangbowen] update
    565fdf6e5 [liangbowen] make MarkdownBuilder not extending Growable
    
    Authored-by: liangbowen <[email protected]>
    Signed-off-by: liangbowen <[email protected]>
---
 .../src/test/scala/org/apache/kyuubi/MarkdownUtils.scala       | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/MarkdownUtils.scala 
b/kyuubi-common/src/test/scala/org/apache/kyuubi/MarkdownUtils.scala
index 06c948903..2ac5e8c69 100644
--- a/kyuubi-common/src/test/scala/org/apache/kyuubi/MarkdownUtils.scala
+++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/MarkdownUtils.scala
@@ -21,7 +21,6 @@ import java.nio.charset.StandardCharsets
 import java.nio.file.{Files, Path, StandardOpenOption}
 
 import scala.collection.JavaConverters._
-import scala.collection.generic.Growable
 import scala.collection.mutable.ListBuffer
 
 import com.vladsch.flexmark.formatter.Formatter
@@ -60,11 +59,9 @@ object MarkdownUtils {
   }
 }
 
-class MarkdownBuilder extends Growable[String] {
+class MarkdownBuilder {
   private val buffer = new ListBuffer[String]
 
-  override def clear: Unit = buffer.clear
-
   /**
    * append a single line
    * with replacing EOL to empty string
@@ -72,7 +69,7 @@ class MarkdownBuilder extends Growable[String] {
    * @param str single line
    * @return
    */
-  override def +=(str: String): MarkdownBuilder.this.type = {
+  def +=(str: String): MarkdownBuilder = {
     buffer += str.stripMargin.linesIterator.mkString
     this
   }
@@ -86,7 +83,8 @@ class MarkdownBuilder extends Growable[String] {
    * @return
    */
   def ++=(multiline: String, marginChar: Char = '|'): MarkdownBuilder = {
-    this ++= multiline.stripMargin(marginChar).linesIterator
+    buffer ++= multiline.stripMargin(marginChar).linesIterator
+    this
   }
 
   /**

Reply via email to