summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2010-12-16 19:50:43 +0000
committermichelou <michelou@epfl.ch>2010-12-16 19:50:43 +0000
commit46a978e022b1bc3d1b77e8b5402db6d3ab6dd28f (patch)
tree9b17b1f65519ad124586713961028b8430fe3c44 /test
parent4850e825a752e8f88223bebe0a5b998f9e22eb3b (diff)
downloadscala-46a978e022b1bc3d1b77e8b5402db6d3ab6dd28f.tar.gz
scala-46a978e022b1bc3d1b77e8b5402db6d3ab6dd28f.tar.bz2
scala-46a978e022b1bc3d1b77e8b5402db6d3ab6dd28f.zip
do not add entry in InnerClass attribute if out...
do not add entry in InnerClass attribute if outer name is null (according to comment for outerName method) in order to remove the following warning message reported by the dx tool (Android): warning: Ignoring InnerClasses attribute for an anonymous inner class (test$$anonfun$1) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t2849.scala24
1 files changed, 13 insertions, 11 deletions
diff --git a/test/files/run/t2849.scala b/test/files/run/t2849.scala
index 68094de736..cadf605ae0 100644
--- a/test/files/run/t2849.scala
+++ b/test/files/run/t2849.scala
@@ -1,11 +1,6 @@
-
-
-
import scala.collection.immutable.SortedSet
import scala.collection.immutable.TreeSet
-
-
object Test {
def main(args: Array[String]) {
@@ -13,15 +8,22 @@ object Test {
similarExample
}
+ //def freeMBytes = Runtime.getRuntime.freeMemory / 1048576
+ def totalMBytes = Runtime.getRuntime.totalMemory / 1048576
+
+ val N = if (totalMBytes > 1000) 10000 else 4000
+ val M = N / 10
+
def ticketExample {
var big = 100000
var aSortedSet: SortedSet[Int] = TreeSet(big)
- for (i <- 1 until 10000) {
+ for (i <- 1 until N) {
aSortedSet = (aSortedSet - big) ++ (TreeSet(i, big - 1))
- big = big - 1
- if (i % 1000 == 0) {
+ big -= 1
+ if (i % M == 0) {
+ //println("big: "+big+", free memory: "+freeMBytes)
aSortedSet.until(i)
}
}
@@ -32,10 +34,10 @@ object Test {
var aSortedSet: SortedSet[Int] = TreeSet(big)
- for (i <- 1 until 10000) {
+ for (i <- 1 until N) {
aSortedSet = (aSortedSet - big) ++ (TreeSet(i, big - 1)) + big
- big = big - 1
- if (i % 1000 == 0) {
+ big -= 1
+ if (i % M == 0) {
aSortedSet.until(i)
}
}