Is there an implicit method to convert scala.collection.mutable.StringBuilder to java.lang.StringBuilder?
I am using a Java library (JCommander) in which one of the methods (usage) takes a java.jang.StringBuilder argument.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t start with a Scala
StringBuilderand then obtain the Java version. You can, however, wrap ajava.lang.StringBuilderin the Scala version. So:Since–not a guarantee, but true in practice right now (2.8, 2.9)–the Scala wrapper doesn’t store any state (instead just referring to the Java version), you’re safe to mix and match usage of the two.