-
Notifications
You must be signed in to change notification settings - Fork 395
Add insert methods to java.lang.StringBuilder #1106
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
Conversation
Can one of the admins verify this patch? |
Ok to test |
Test this please |
test this please |
@gzm0 commands must be all-lowercase |
Test FAILed. |
@@ -12,6 +12,15 @@ import org.scalajs.jasminetest.JasmineTest | |||
|
|||
object StringBufferTest extends JasmineTest { | |||
|
|||
def shouldThrow[T : Manifest](fn: => Unit) = |
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.
Use T : ClassTag
instead. Manifest
is deprecated since 2.10, and does not completely work in Scala.js. This is the reason for the failures in our Continuous Integration.
Could you also add the same set of methods to |
Ok, I'll make another commit with Manifest fix + StringBuffer inserts |
Amend your commit instead. |
Btw if I do :
the test compiles against real java JDK, not the ScalaJS JDK For instance if you try to do
You get :
but Isn't that a little weird ? |
That's how it's "supposed" to be. Scala.js projects are always compiled against the JVM version of the Java JDK and Scala standard library. That is because scalac expects some Java classes to really be Java classes in order not to crash. That is why we have to be always very careful to reproduce exactly the binary signature as the one of the Java SDK. The bug is however that our |
Ok, I'm glad to know this. Should I make a new PR with the commit ammend ? I'll leave the |
No, you should force-push the branch from which you created the PR (which makes me realize you created the PR from master, which is a bad thing to do). Force-pushing will update the PR. |
I force-pushed it, for next PR I'll make a feature branch |
LGTM |
retest this please |
Test FAILed. |
retest this please |
We need to add jsZip to the internet... |
Test FAILed. |
retest this please |
Test PASSed. |
Add insert methods to java.lang.StringBuilder
@l15k4 Was this also inspired by an existing JDK's code? If yes, we have to revert this :-( Btw, could you also please sign the CLA (see #1139). I also see that your commits are under the name @viagraphs. You should configure your GitHub account so it knows that the appropriate e-mail address is attached to your account. Otherwise we can't track the CLA status. |
Can one of the admins verify this patch? |
StringBuilder is missing insert methods, I tried to make it as similar as possible to
append
methods.Two things:
substring
instead ofsplitAt
cause it's obviously more effective way if you look at the implremoving
stuff in StringBufferTest is just renaming of a variable that had a misleading namenewBuf
- it's a builder, not buffer