summaryrefslogtreecommitdiff
path: root/test/files/jvm
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-12-11 14:57:06 +0000
committerPaul Phillips <paulp@improving.org>2010-12-11 14:57:06 +0000
commit262ee3a852f278f97b083a05376de0eab96c805d (patch)
tree482c62113aeb64e1bc7170610a958d58ec60cd19 /test/files/jvm
parent4cfcc156f404f574451d2ddcaf62326d32d0ef95 (diff)
downloadscala-262ee3a852f278f97b083a05376de0eab96c805d.tar.gz
scala-262ee3a852f278f97b083a05376de0eab96c805d.tar.bz2
scala-262ee3a852f278f97b083a05376de0eab96c805d.zip
When was the last time -Xcheckinit was run? It ...
When was the last time -Xcheckinit was run? It must have been a long time. All these changes are to address bugs revealed by -Xcheckinit, mostly in test cases, some in the compiler. I'm guessing the partest -Xcheckinit runs are hanging the first time they run into a failure, so if it starts "working" again after this commit don't get too confident. No review.
Diffstat (limited to 'test/files/jvm')
-rw-r--r--test/files/jvm/t2511.check3
-rw-r--r--test/files/jvm/t2511.scala7
-rw-r--r--test/files/jvm/t3003/Annot.java4
-rw-r--r--test/files/jvm/t3003/Test_1.scala9
4 files changed, 19 insertions, 4 deletions
diff --git a/test/files/jvm/t2511.check b/test/files/jvm/t2511.check
index ec747fa47d..004b8e2031 100644
--- a/test/files/jvm/t2511.check
+++ b/test/files/jvm/t2511.check
@@ -1 +1,2 @@
-null \ No newline at end of file
+null
+bippy
diff --git a/test/files/jvm/t2511.scala b/test/files/jvm/t2511.scala
index d4b5e83d0f..eb57dc503d 100644
--- a/test/files/jvm/t2511.scala
+++ b/test/files/jvm/t2511.scala
@@ -4,6 +4,7 @@ object Test {
trait IMyMessage extends Serializable {
@transient var message: String = null
+ var message2: String = null
}
class MyMessage extends IMyMessage
@@ -13,6 +14,7 @@ object Test {
val out = new ObjectOutputStream(buf)
val m = new MyMessage
m.message = "foo"
+ m.message2 = "bippy"
out.writeObject(m)
out.flush
buf.toByteArray
@@ -25,6 +27,9 @@ object Test {
def main(args: Array[String]) {
val m = unserialize(serialize)
- println(m.message)
+ // Xcheckinit freaks out here but its nullness is what we're testing
+ try println(m.message)
+ catch { case _: UninitializedFieldError => println("null") }
+ println(m.message2)
}
}
diff --git a/test/files/jvm/t3003/Annot.java b/test/files/jvm/t3003/Annot.java
index 1d5f206fd7..30dcb66bd7 100644
--- a/test/files/jvm/t3003/Annot.java
+++ b/test/files/jvm/t3003/Annot.java
@@ -1,4 +1,6 @@
-@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
public @interface Annot {
Class<?> optionType();
}
diff --git a/test/files/jvm/t3003/Test_1.scala b/test/files/jvm/t3003/Test_1.scala
index ec7f220c94..8ec08bebc6 100644
--- a/test/files/jvm/t3003/Test_1.scala
+++ b/test/files/jvm/t3003/Test_1.scala
@@ -3,6 +3,13 @@ class C {
}
object Test {
def main(args: Array[String]) {
- println(classOf[C].getDeclaredFields.toList.sortBy(f => f.getName).map(f => f.getAnnotations.toList))
+ val xs = (
+ classOf[C].getDeclaredFields.toList
+ . sortBy(f => f.getName)
+ . map(f => f.getAnnotations.toList)
+ . filterNot (_.isEmpty) // there are extra fields under -Xcheckinit
+ )
+
+ println(xs)
}
}