summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-11-14 18:02:10 +0000
committerPaul Phillips <paulp@improving.org>2009-11-14 18:02:10 +0000
commit1cd31e2edd031c0d32266de54ef63ddb9233c047 (patch)
tree4659619c1b3532ce4b31b2f4b52f912d64dff188 /src/library
parent6c4064a77086ee82de861ec30dfd87fe120c6b0d (diff)
downloadscala-1cd31e2edd031c0d32266de54ef63ddb9233c047.tar.gz
scala-1cd31e2edd031c0d32266de54ef63ddb9233c047.tar.bz2
scala-1cd31e2edd031c0d32266de54ef63ddb9233c047.zip
Fixes and test cases for #2087 and #2400.
fixing a long-standing bug in fjbg and recompiling fjbg.jar, which had the side effect of revealing that the current fjbg jar had never been recompiled with target 1.5, so now it's smaller and (I imagine) faster.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/runtime/BoxesRunTime.java25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/library/scala/runtime/BoxesRunTime.java b/src/library/scala/runtime/BoxesRunTime.java
index 869eb375ac..b1cc464513 100644
--- a/src/library/scala/runtime/BoxesRunTime.java
+++ b/src/library/scala/runtime/BoxesRunTime.java
@@ -54,30 +54,7 @@ public class BoxesRunTime
}
public static Character boxToCharacter(char c) {
- // !!! Temporarily working around the "impossible" (?) fact that
- // c can have a negative value here. In any revision since r17461 try:
- // def foo = new (Short => Char) { def apply(x: Short) = x.toChar }
- // foo(-100)
- // and the -100 will get to Character, which will duly crash.
- // The bug was masked before because the Characters were created
- // with "new Character(c)", but now the static method uses the argument
- // as an index into a cache array, which can't be negative.
- //
- // It appears to be Short-specific; I can't get anything similar
- // out of Byte or Int.
- Character ret;
-
- // straightforward workarounds like bitmasking do not seem to
- // work here; is java optimizing out "impossible" tests/ops? I
- // don't know, but this is the safe way:
- try {
- ret = Character.valueOf(c);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- ret = new Character(c);
- }
-
- return ret;
+ return Character.valueOf(c);
}
public static Byte boxToByte(byte b) {