File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
src/library/scala/collection/immutable Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,9 @@ object Vector extends StrictOptimizedSeqFactory[Vector] {
81
81
}
82
82
83
83
private val defaultApplyPreferredMaxLength : Int =
84
- try System .getProperty(" scala.collection.immutable.Vector.defaultApplyPreferredMaxLength" ,
85
- " 250" ).toInt
84
+ // explicit StringOps to avoid initialization cycle with Predef (scala/bug#13009)
85
+ try new StringOps (System .getProperty(" scala.collection.immutable.Vector.defaultApplyPreferredMaxLength" ,
86
+ " 250" )).toInt
86
87
catch {
87
88
case _ : SecurityException => 250
88
89
}
Original file line number Diff line number Diff line change
1
+ object Test extends App {
2
+ val createPredef = new Runnable {
3
+ def run = {
4
+ val _ = Predef ;
5
+ }
6
+ }
7
+ val createVector = new Runnable {
8
+ def run = {
9
+ val _ = scala.collection.immutable.Vector ;
10
+ }
11
+ }
12
+ val t1 = new Thread (createPredef)
13
+ val t2 = new Thread (createVector)
14
+ t1.start()
15
+ t2.start()
16
+ t1.join()
17
+ t2.join()
18
+ }
You can’t perform that action at this time.
0 commit comments