summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--bincompat-backward.whitelist.conf9
-rw-r--r--bincompat-forward.whitelist.conf97
-rw-r--r--build-ant-macros.xml45
-rw-r--r--build.number4
-rw-r--r--build.sbt40
-rwxr-xr-xbuild.xml218
-rw-r--r--dbuild-meta.json112
-rw-r--r--doc/LICENSE.md4
-rw-r--r--doc/License.rtf6
-rw-r--r--lib/forkjoin.jar.desired.sha11
-rwxr-xr-xscripts/jobs/integrate/bootstrap64
-rwxr-xr-xscripts/jobs/integrate/ide3
-rwxr-xr-xscripts/jobs/validate/test2
-rw-r--r--src/actors/scala/actors/AbstractActor.scala30
-rw-r--r--src/actors/scala/actors/Actor.scala411
-rw-r--r--src/actors/scala/actors/ActorCanReply.scala66
-rw-r--r--src/actors/scala/actors/ActorProxy.scala34
-rw-r--r--src/actors/scala/actors/ActorRef.scala53
-rw-r--r--src/actors/scala/actors/ActorTask.scala60
-rw-r--r--src/actors/scala/actors/CanReply.scala65
-rw-r--r--src/actors/scala/actors/Channel.scala136
-rw-r--r--src/actors/scala/actors/Combinators.scala48
-rw-r--r--src/actors/scala/actors/DaemonActor.scala24
-rw-r--r--src/actors/scala/actors/Debug.scala45
-rw-r--r--src/actors/scala/actors/Future.scala243
-rw-r--r--src/actors/scala/actors/IScheduler.scala70
-rw-r--r--src/actors/scala/actors/InputChannel.scala66
-rw-r--r--src/actors/scala/actors/InternalActor.scala546
-rw-r--r--src/actors/scala/actors/InternalReplyReactor.scala162
-rw-r--r--src/actors/scala/actors/KillActorControl.scala14
-rw-r--r--src/actors/scala/actors/LinkedNode.java25
-rw-r--r--src/actors/scala/actors/LinkedQueue.java185
-rw-r--r--src/actors/scala/actors/MQueue.scala250
-rw-r--r--src/actors/scala/actors/OutputChannel.scala48
-rw-r--r--src/actors/scala/actors/ReactChannel.scala121
-rw-r--r--src/actors/scala/actors/Reactor.scala307
-rw-r--r--src/actors/scala/actors/ReactorCanReply.scala90
-rw-r--r--src/actors/scala/actors/ReactorTask.scala74
-rw-r--r--src/actors/scala/actors/ReplyReactor.scala13
-rw-r--r--src/actors/scala/actors/ReplyReactorTask.scala40
-rw-r--r--src/actors/scala/actors/Scheduler.scala40
-rw-r--r--src/actors/scala/actors/SchedulerAdapter.scala68
-rw-r--r--src/actors/scala/actors/UncaughtException.scala34
-rw-r--r--src/actors/scala/actors/package.scala23
-rw-r--r--src/actors/scala/actors/remote/FreshNameCreator.scala36
-rw-r--r--src/actors/scala/actors/remote/JavaSerializer.scala63
-rw-r--r--src/actors/scala/actors/remote/NetKernel.scala147
-rw-r--r--src/actors/scala/actors/remote/Proxy.scala190
-rw-r--r--src/actors/scala/actors/remote/RemoteActor.scala132
-rw-r--r--src/actors/scala/actors/remote/Serializer.scala58
-rw-r--r--src/actors/scala/actors/remote/Service.scala24
-rw-r--r--src/actors/scala/actors/remote/TcpService.scala292
-rw-r--r--src/actors/scala/actors/scheduler/ActorGC.scala101
-rw-r--r--src/actors/scala/actors/scheduler/DaemonScheduler.scala34
-rw-r--r--src/actors/scala/actors/scheduler/DelegatingScheduler.scala74
-rw-r--r--src/actors/scala/actors/scheduler/DrainableForkJoinPool.scala11
-rw-r--r--src/actors/scala/actors/scheduler/ExecutorScheduler.scala95
-rw-r--r--src/actors/scala/actors/scheduler/ForkJoinScheduler.scala174
-rw-r--r--src/actors/scala/actors/scheduler/QuitControl.scala19
-rw-r--r--src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala197
-rw-r--r--src/actors/scala/actors/scheduler/SingleThreadedScheduler.scala69
-rw-r--r--src/actors/scala/actors/scheduler/TerminationMonitor.scala69
-rw-r--r--src/actors/scala/actors/scheduler/TerminationService.scala68
-rw-r--r--src/actors/scala/actors/scheduler/ThreadPoolConfig.scala50
-rw-r--r--src/actors/scala/actors/threadpool/AbstractCollection.java32
-rw-r--r--src/actors/scala/actors/threadpool/AbstractExecutorService.java292
-rw-r--r--src/actors/scala/actors/threadpool/AbstractQueue.java170
-rw-r--r--src/actors/scala/actors/threadpool/Arrays.java811
-rw-r--r--src/actors/scala/actors/threadpool/AtomicInteger.java210
-rw-r--r--src/actors/scala/actors/threadpool/BlockingQueue.java344
-rw-r--r--src/actors/scala/actors/threadpool/Callable.java35
-rw-r--r--src/actors/scala/actors/threadpool/CancellationException.java34
-rw-r--r--src/actors/scala/actors/threadpool/CompletionService.java97
-rw-r--r--src/actors/scala/actors/threadpool/ExecutionException.java65
-rw-r--r--src/actors/scala/actors/threadpool/Executor.java112
-rw-r--r--src/actors/scala/actors/threadpool/ExecutorCompletionService.java178
-rw-r--r--src/actors/scala/actors/threadpool/ExecutorService.java331
-rw-r--r--src/actors/scala/actors/threadpool/Executors.java667
-rw-r--r--src/actors/scala/actors/threadpool/Future.java142
-rw-r--r--src/actors/scala/actors/threadpool/FutureTask.java310
-rw-r--r--src/actors/scala/actors/threadpool/LinkedBlockingQueue.java843
-rw-r--r--src/actors/scala/actors/threadpool/Perf.java28
-rw-r--r--src/actors/scala/actors/threadpool/Queue.java191
-rw-r--r--src/actors/scala/actors/threadpool/RejectedExecutionException.java62
-rw-r--r--src/actors/scala/actors/threadpool/RejectedExecutionHandler.java34
-rw-r--r--src/actors/scala/actors/threadpool/RunnableFuture.java24
-rw-r--r--src/actors/scala/actors/threadpool/SynchronousQueue.java833
-rw-r--r--src/actors/scala/actors/threadpool/ThreadFactory.java41
-rw-r--r--src/actors/scala/actors/threadpool/ThreadPoolExecutor.java1968
-rw-r--r--src/actors/scala/actors/threadpool/TimeUnit.java407
-rw-r--r--src/actors/scala/actors/threadpool/TimeoutException.java38
-rw-r--r--src/actors/scala/actors/threadpool/helpers/FIFOWaitQueue.java85
-rw-r--r--src/actors/scala/actors/threadpool/helpers/NanoTimer.java29
-rw-r--r--src/actors/scala/actors/threadpool/helpers/ThreadHelpers.java66
-rw-r--r--src/actors/scala/actors/threadpool/helpers/Utils.java343
-rw-r--r--src/actors/scala/actors/threadpool/helpers/WaitQueue.java146
-rw-r--r--src/actors/scala/actors/threadpool/locks/CondVar.java191
-rw-r--r--src/actors/scala/actors/threadpool/locks/Condition.java434
-rw-r--r--src/actors/scala/actors/threadpool/locks/FIFOCondVar.java147
-rw-r--r--src/actors/scala/actors/threadpool/locks/Lock.java328
-rw-r--r--src/actors/scala/actors/threadpool/locks/ReadWriteLock.java104
-rw-r--r--src/actors/scala/actors/threadpool/locks/ReentrantLock.java959
-rw-r--r--src/actors/scala/actors/threadpool/locks/ReentrantReadWriteLock.java1341
-rw-r--r--src/build/bnd/scala-actors.bnd7
-rw-r--r--src/build/bnd/scala-compiler-doc.bnd3
-rw-r--r--src/build/bnd/scala-compiler-interactive.bnd3
-rw-r--r--src/build/bnd/scala-compiler.bnd3
-rw-r--r--src/build/bnd/scala-continuations-library.bnd7
-rw-r--r--src/build/bnd/scala-continuations-plugin.bnd7
-rw-r--r--src/build/bnd/scala-library.bnd3
-rw-r--r--src/build/bnd/scala-parser-combinators.bnd3
-rw-r--r--src/build/bnd/scala-reflect.bnd3
-rw-r--r--src/build/bnd/scala-swing.bnd3
-rw-r--r--src/build/bnd/scala-xml.bnd3
-rw-r--r--src/build/dbuild-meta-json-gen.scala29
-rw-r--r--src/build/maven/scala-actors-pom.xml51
-rw-r--r--src/build/maven/scala-dist-pom.xml6
-rw-r--r--src/build/maven/scala-library-all-pom.xml20
-rw-r--r--src/compiler/scala/tools/cmd/Property.scala3
-rw-r--r--src/compiler/scala/tools/nsc/Driver.scala26
-rw-r--r--src/compiler/scala/tools/nsc/GenericRunnerSettings.scala2
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala26
-rw-r--r--src/compiler/scala/tools/nsc/Main.scala3
-rwxr-xr-xsrc/compiler/scala/tools/nsc/ast/DocComments.scala19
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala22
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/GenICode.scala4
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/AsmUtils.scala18
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/BCodeAsmCommon.scala32
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala10
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala14
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/BCodeIdiomatic.scala3
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala6
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala25
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/BackendReporting.scala9
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala5
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenBCode.scala3
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzer.scala38
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/opt/BytecodeUtils.scala24
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala92
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala446
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala69
-rw-r--r--src/compiler/scala/tools/nsc/javac/JavaParsers.scala16
-rw-r--r--src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala7
-rw-r--r--src/compiler/scala/tools/nsc/settings/AbsScalaSettings.scala1
-rw-r--r--src/compiler/scala/tools/nsc/settings/MutableSettings.scala7
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaSettings.scala37
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaVersion.scala48
-rw-r--r--src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala4
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala4
-rw-r--r--src/compiler/scala/tools/nsc/transform/Constructors.scala14
-rw-r--r--src/compiler/scala/tools/nsc/transform/Delambdafy.scala9
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala4
-rw-r--r--src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala6
-rw-r--r--src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Checkable.scala4
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala20
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala127
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala17
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala4
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala104
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala4
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala33
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala31
-rw-r--r--src/compiler/scala/tools/reflect/WrappedProperties.scala5
-rw-r--r--src/compiler/scala/tools/util/PathResolver.scala14
-rw-r--r--src/eclipse/partest/.classpath2
-rw-r--r--src/eclipse/scaladoc/.classpath6
-rw-r--r--src/forkjoin/scala/concurrent/forkjoin/ForkJoinPool.java3759
-rw-r--r--src/forkjoin/scala/concurrent/forkjoin/ForkJoinTask.java1488
-rw-r--r--src/forkjoin/scala/concurrent/forkjoin/ForkJoinWorkerThread.java121
-rw-r--r--src/forkjoin/scala/concurrent/forkjoin/LinkedTransferQueue.java1335
-rw-r--r--src/forkjoin/scala/concurrent/forkjoin/RecursiveAction.java164
-rw-r--r--src/forkjoin/scala/concurrent/forkjoin/RecursiveTask.java68
-rw-r--r--src/forkjoin/scala/concurrent/forkjoin/ThreadLocalRandom.java197
-rw-r--r--src/forkjoin/scala/concurrent/forkjoin/TransferQueue.java133
-rw-r--r--src/forkjoin/scala/concurrent/forkjoin/package-info.java28
-rw-r--r--src/forkjoin/scala/concurrent/util/Unsafe.java35
-rw-r--r--src/intellij/actors.iml.SAMPLE14
-rw-r--r--src/intellij/forkjoin.iml.SAMPLE11
-rw-r--r--src/intellij/library.iml.SAMPLE1
-rw-r--r--src/intellij/scala.ipr.SAMPLE2
-rw-r--r--src/intellij/test-junit.iml.SAMPLE2
-rw-r--r--src/intellij/test.iml.SAMPLE2
-rw-r--r--src/interactive/scala/tools/nsc/interactive/Global.scala27
-rw-r--r--src/library/rootdoc.txt4
-rw-r--r--src/library/scala/PartialFunction.scala4
-rw-r--r--src/library/scala/Predef.scala41
-rw-r--r--src/library/scala/beans/BeanInfo.scala1
-rw-r--r--src/library/scala/collection/IterableViewLike.scala5
-rw-r--r--src/library/scala/collection/Iterator.scala123
-rw-r--r--src/library/scala/collection/MapLike.scala21
-rw-r--r--src/library/scala/collection/SeqViewLike.scala22
-rw-r--r--src/library/scala/collection/SetLike.scala15
-rw-r--r--src/library/scala/collection/TraversableLike.scala2
-rw-r--r--src/library/scala/collection/TraversableViewLike.scala22
-rw-r--r--src/library/scala/collection/concurrent/Map.scala11
-rw-r--r--src/library/scala/collection/concurrent/TrieMap.scala2
-rw-r--r--src/library/scala/collection/convert/WrapAsJava.scala56
-rw-r--r--src/library/scala/collection/convert/WrapAsScala.scala35
-rw-r--r--src/library/scala/collection/convert/Wrappers.scala9
-rw-r--r--src/library/scala/collection/generic/MutableSortedMapFactory.scala24
-rw-r--r--src/library/scala/collection/immutable/HashSet.scala30
-rw-r--r--src/library/scala/collection/immutable/List.scala4
-rw-r--r--src/library/scala/collection/immutable/ListMap.scala19
-rw-r--r--src/library/scala/collection/immutable/Map.scala22
-rw-r--r--src/library/scala/collection/immutable/PagedSeq.scala2
-rw-r--r--src/library/scala/collection/immutable/Range.scala19
-rw-r--r--src/library/scala/collection/immutable/Stream.scala102
-rw-r--r--src/library/scala/collection/immutable/StreamViewLike.scala2
-rw-r--r--src/library/scala/collection/immutable/StringLike.scala87
-rw-r--r--src/library/scala/collection/mutable/AnyRefMap.scala18
-rw-r--r--src/library/scala/collection/mutable/ArrayOps.scala5
-rw-r--r--src/library/scala/collection/mutable/ArraySeq.scala2
-rw-r--r--src/library/scala/collection/mutable/BufferLike.scala7
-rw-r--r--src/library/scala/collection/mutable/BufferProxy.scala2
-rw-r--r--src/library/scala/collection/mutable/ListBuffer.scala7
-rw-r--r--src/library/scala/collection/mutable/LongMap.scala20
-rw-r--r--src/library/scala/collection/mutable/MapLike.scala12
-rw-r--r--src/library/scala/collection/mutable/PriorityQueue.scala2
-rw-r--r--src/library/scala/collection/mutable/RedBlackTree.scala547
-rw-r--r--src/library/scala/collection/mutable/ResizableArray.scala2
-rw-r--r--src/library/scala/collection/mutable/SetLike.scala11
-rw-r--r--src/library/scala/collection/mutable/SortedMap.scala57
-rw-r--r--src/library/scala/collection/mutable/TreeMap.scala166
-rw-r--r--src/library/scala/collection/parallel/ParIterableLike.scala2
-rw-r--r--src/library/scala/collection/parallel/RemainsIterator.scala9
-rw-r--r--src/library/scala/collection/parallel/TaskSupport.scala4
-rw-r--r--src/library/scala/collection/parallel/Tasks.scala2
-rw-r--r--src/library/scala/collection/parallel/immutable/ParHashSet.scala2
-rw-r--r--src/library/scala/concurrent/BlockContext.scala15
-rw-r--r--src/library/scala/concurrent/ExecutionContext.scala36
-rw-r--r--src/library/scala/concurrent/Future.scala469
-rw-r--r--src/library/scala/concurrent/Promise.scala12
-rw-r--r--src/library/scala/concurrent/duration/Duration.scala2
-rw-r--r--src/library/scala/concurrent/forkjoin/package.scala60
-rw-r--r--src/library/scala/concurrent/impl/AbstractPromise.java40
-rw-r--r--src/library/scala/concurrent/impl/ExecutionContextImpl.scala211
-rw-r--r--src/library/scala/concurrent/impl/Future.scala34
-rw-r--r--src/library/scala/concurrent/impl/Promise.scala167
-rw-r--r--src/library/scala/concurrent/util/Unsafe.java38
-rw-r--r--src/library/scala/deprecatedName.scala4
-rw-r--r--src/library/scala/io/Source.scala14
-rw-r--r--src/library/scala/math/package.scala2
-rw-r--r--src/library/scala/runtime/BoxesRunTime.java2
-rw-r--r--src/library/scala/runtime/LambdaDeserializer.scala132
-rw-r--r--src/library/scala/runtime/ScalaRunTime.scala2
-rw-r--r--src/library/scala/runtime/java8/JFunction.java146
-rw-r--r--src/library/scala/runtime/java8/JFunction0$mcB$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction0$mcC$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction0$mcD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction0$mcF$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction0$mcI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction0$mcJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction0$mcS$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction0$mcV$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction0$mcZ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction0.java39
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcDD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcDF$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcDI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcDJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcFD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcFF$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcFI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcFJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcID$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcIF$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcII$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcIJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcJD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcJF$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcJI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcJJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcVD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcVF$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcVI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcVJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcZD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcZF$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcZI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1$mcZJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction1.java240
-rw-r--r--src/library/scala/runtime/java8/JFunction10.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction11.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction12.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction13.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction14.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction15.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction16.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction17.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction18.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction19.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcDDD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcDDI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcDDJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcDID$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcDII$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcDIJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcDJD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcDJI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcDJJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcFDD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcFDI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcFDJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcFID$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcFII$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcFIJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcFJD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcFJI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcFJJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcIDD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcIDI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcIDJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcIID$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcIII$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcIIJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcIJD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcIJI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcIJJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcJDD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcJDI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcJDJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcJID$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcJII$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcJIJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcJJD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcJJI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcJJJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcVDD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcVDI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcVDJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcVID$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcVII$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcVIJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcVJD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcVJI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcVJJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcZDD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcZDI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcZDJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcZID$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcZII$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcZIJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcZJD$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcZJI$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2$mcZJJ$sp.java13
-rw-r--r--src/library/scala/runtime/java8/JFunction2.java509
-rw-r--r--src/library/scala/runtime/java8/JFunction20.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction21.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction22.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction3.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction4.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction5.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction6.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction7.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction8.java22
-rw-r--r--src/library/scala/runtime/java8/JFunction9.java22
-rw-r--r--src/library/scala/runtime/java8/JProcedure0.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure1.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure10.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure11.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure12.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure13.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure14.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure15.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure16.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure17.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure18.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure19.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure2.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure20.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure21.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure22.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure3.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure4.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure5.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure6.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure7.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure8.java21
-rw-r--r--src/library/scala/runtime/java8/JProcedure9.java21
-rw-r--r--src/library/scala/sys/SystemProperties.scala15
-rw-r--r--src/library/scala/sys/process/BasicIO.scala2
-rw-r--r--src/library/scala/sys/process/ProcessImpl.scala134
-rw-r--r--src/library/scala/sys/process/package.scala30
-rw-r--r--src/library/scala/util/Either.scala2
-rw-r--r--src/library/scala/util/Try.scala146
-rw-r--r--src/library/scala/util/control/NoStackTrace.scala4
-rw-r--r--src/manual/scala/man1/scalac.scala7
-rw-r--r--src/partest-extras/scala/tools/partest/ASMConverters.scala78
-rw-r--r--src/reflect/scala/reflect/api/FlagSets.scala1
-rw-r--r--src/reflect/scala/reflect/api/Symbols.scala35
-rw-r--r--src/reflect/scala/reflect/internal/ClassfileConstants.scala4
-rw-r--r--src/reflect/scala/reflect/internal/Definitions.scala4
-rw-r--r--src/reflect/scala/reflect/internal/FlagSets.scala2
-rw-r--r--src/reflect/scala/reflect/internal/Flags.scala155
-rw-r--r--src/reflect/scala/reflect/internal/HasFlags.scala83
-rw-r--r--src/reflect/scala/reflect/internal/Mirrors.scala11
-rw-r--r--src/reflect/scala/reflect/internal/Reporting.scala17
-rw-r--r--src/reflect/scala/reflect/internal/StdNames.scala1
-rw-r--r--src/reflect/scala/reflect/internal/SymbolTable.scala2
-rw-r--r--src/reflect/scala/reflect/internal/Symbols.scala31
-rw-r--r--src/reflect/scala/reflect/internal/TreeGen.scala4
-rw-r--r--src/reflect/scala/reflect/internal/TreeInfo.scala1
-rw-r--r--src/reflect/scala/reflect/internal/Types.scala20
-rw-r--r--src/reflect/scala/reflect/internal/pickling/UnPickler.scala1
-rw-r--r--src/reflect/scala/reflect/internal/tpe/TypeMaps.scala9
-rw-r--r--src/reflect/scala/reflect/internal/transform/Erasure.scala11
-rw-r--r--src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala30
-rw-r--r--src/reflect/scala/reflect/runtime/JavaMirrors.scala1
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ILoop.scala5
-rw-r--r--src/repl/scala/tools/nsc/interpreter/JavapClass.scala600
-rwxr-xr-xsrc/scaladoc/scala/tools/nsc/doc/base/MemberLookupBase.scala8
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala24
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala10
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css2
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js20
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/model/MemberLookup.scala2
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala10
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryTypeSupport.scala2
-rwxr-xr-xsrc/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala2
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala2
-rw-r--r--src/scalap/scala/tools/scalap/scalax/rules/scalasig/ClassFileParser.scala6
-rw-r--r--test/benchmarking/AVL-insert-random.scala67
-rw-r--r--test/benchmarking/AVL-insert.scala67
-rw-r--r--test/benchmarking/ParCtrie-bfs.scala73
-rw-r--r--test/benchmarking/ParCtrie-map.scala21
-rw-r--r--test/benchmarking/ParCtrie-nums.scala39
-rw-r--r--test/benchmarking/ParCtrie-size.scala37
-rw-r--r--test/benchmarking/ParHashMap.scala33
-rw-r--r--test/benchmarking/ParVector-reduce.scala33
-rw-r--r--test/benchmarking/TreeSetInsert.scala70
-rw-r--r--test/benchmarking/TreeSetInsertRandom.scala65
-rw-r--r--test/benchmarking/TreeSetIterator.scala69
-rw-r--r--test/benchmarking/TreeSetRemove.scala69
-rw-r--r--test/benchmarking/TreeSetRemoveRandom.scala66
-rw-r--r--test/benchmarking/t6726-patmat-analysis.scala4005
-rwxr-xr-xtest/benchmarks/bench63
-rw-r--r--test/benchmarks/lib/jsr166_and_extra.jar.desired.sha11
-rw-r--r--test/benchmarks/source.list79
-rw-r--r--test/benchmarks/src/scala/collection/immutable/range-bench.scala61
-rw-r--r--test/benchmarks/src/scala/collection/mutable/hashtable-bench.scala61
-rw-r--r--test/benchmarks/src/scala/collection/parallel/Benchmarking.scala223
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/Bench.scala126
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Arrays.scala63
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Dummy.scala22
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/IntAccess.scala68
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/ObjectAccess.scala75
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Resetting.scala39
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/UnknownManif.scala38
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/generic/Dummy.scala83
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/generic/Operators.scala64
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala362
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala144
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala232
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Combine.scala66
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Construct.scala54
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Foreach.scala45
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/IntInit.scala31
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Iterate.scala51
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Lookup.scala57
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/MultipleCombine.scala87
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/ParallelHashTries.scala180
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Coder.scala162
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Dictionary.scala13
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Loader.scala66
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/misc/dict.txt58111
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/AggregateLight.scala39
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Companion.scala9
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CopyToArray.scala21
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Corresponds.scala47
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountHeavy.scala36
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountLight.scala22
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountList.scala30
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/DiffHalf.scala48
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/DropMany.scala47
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ExistsLight.scala49
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FilterLight.scala64
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FindLight.scala52
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FlatMapLight.scala24
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallHeavy.scala59
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallLight.scala46
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallQuickStop.scala46
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallStop80k.scala46
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala45
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala26
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/GroupBy.scala45
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/IndexWhere.scala47
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/IntersectHalf.scala48
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/LastIndexWhere.scala47
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MapLight.scala27
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MatrixMultiplication.scala84
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MinLight.scala28
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PadToDouble.scala53
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PartialMapLight.scala24
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PartitionLight.scala61
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PatchHalf.scala46
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PlusPlus.scala29
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceHeavy.scala22
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceLight.scala50
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceList.scala53
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceNew.scala30
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReducePrime.scala65
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/RemoveDuplicates.scala44
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Resettable.scala127
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Reverse.scala35
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReverseMap.scala48
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SameElementsLong.scala45
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanLight.scala46
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanMedium.scala55
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SegmentLength.scala42
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SequentialOps.scala562
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceFew.scala47
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceMany.scala47
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceMedium.scala47
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SpanLight.scala62
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SplitHalf.scala47
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SumLight.scala28
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/TakeMany.scala47
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/TakeWhileLight.scala61
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_range/RangeBenches.scala211
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_view/SeqViewBenches.scala51
-rw-r--r--test/benchmarks/src/scala/util/HashSpeedTest.scala253
-rw-r--r--test/disabled/coder/Coder.scala2
-rw-r--r--test/disabled/run/applet-prop.scala2
-rw-r--r--test/disabled/run/indylambda-specialization.scala15
-rw-r--r--test/files/jvm/actor-exceptions.check1
-rw-r--r--test/files/jvm/actor-exceptions.scala67
-rw-r--r--test/files/jvm/actor-executor.check20
-rw-r--r--test/files/jvm/actor-executor.scala78
-rw-r--r--test/files/jvm/actor-executor2.check21
-rw-r--r--test/files/jvm/actor-executor2.scala92
-rw-r--r--test/files/jvm/actor-executor3.check20
-rw-r--r--test/files/jvm/actor-executor3.scala66
-rw-r--r--test/files/jvm/actor-getstate.check2
-rw-r--r--test/files/jvm/actor-getstate.scala87
-rw-r--r--test/files/jvm/actor-link-getstate.check2
-rw-r--r--test/files/jvm/actor-link-getstate.scala65
-rw-r--r--test/files/jvm/actor-looping.check5
-rw-r--r--test/files/jvm/actor-looping.scala33
-rw-r--r--test/files/jvm/actor-normal-exit.check2
-rw-r--r--test/files/jvm/actor-normal-exit.scala38
-rw-r--r--test/files/jvm/actor-receivewithin.check16
-rw-r--r--test/files/jvm/actor-receivewithin.scala72
-rw-r--r--test/files/jvm/actor-sync-send-timeout.scala48
-rw-r--r--test/files/jvm/actor-termination.check2
-rw-r--r--test/files/jvm/actor-termination.scala19
-rw-r--r--test/files/jvm/actor-uncaught-exception.check2
-rw-r--r--test/files/jvm/actor-uncaught-exception.scala64
-rw-r--r--test/files/jvm/actor-uncaught-exception2.check2
-rw-r--r--test/files/jvm/actor-uncaught-exception2.scala63
-rw-r--r--test/files/jvm/daemon-actor-termination.check2
-rw-r--r--test/files/jvm/daemon-actor-termination.scala40
-rw-r--r--test/files/jvm/future-alarm.check20
-rw-r--r--test/files/jvm/future-alarm.scala23
-rw-r--r--test/files/jvm/future-awaitall-zero.check1
-rw-r--r--test/files/jvm/future-awaitall-zero.scala24
-rw-r--r--test/files/jvm/future-spec.check2
-rw-r--r--test/files/jvm/future-spec/FutureTests.scala275
-rw-r--r--test/files/jvm/future-termination.check1
-rw-r--r--test/files/jvm/future-termination.scala21
-rw-r--r--test/files/jvm/innerClassAttribute.check54
-rw-r--r--test/files/jvm/innerClassAttribute/Classes_1.scala37
-rw-r--r--test/files/jvm/innerClassAttribute/Test.scala177
-rw-r--r--test/files/jvm/javaReflection.check83
-rw-r--r--test/files/jvm/patmat_opt_ignore_underscore/test.scala3
-rw-r--r--test/files/jvm/patmat_opt_no_nullcheck/test.scala3
-rw-r--r--test/files/jvm/reactor-exceptionOnSend.check2
-rw-r--r--test/files/jvm/reactor-exceptionOnSend.scala58
-rw-r--r--test/files/jvm/reactor-producer-consumer.check10
-rw-r--r--test/files/jvm/reactor-producer-consumer.scala97
-rw-r--r--test/files/jvm/reactor.check22
-rw-r--r--test/files/jvm/reactor.scala72
-rw-r--r--test/files/jvm/replyablereactor.check5
-rw-r--r--test/files/jvm/replyablereactor.scala59
-rw-r--r--test/files/jvm/replyablereactor2.check5
-rw-r--r--test/files/jvm/replyablereactor2.scala58
-rw-r--r--test/files/jvm/replyablereactor3.check5
-rw-r--r--test/files/jvm/replyablereactor3.scala57
-rw-r--r--test/files/jvm/replyablereactor4.check5
-rw-r--r--test/files/jvm/replyablereactor4.scala57
-rw-r--r--test/files/jvm/replyreactor-react-sender.check1
-rw-r--r--test/files/jvm/replyreactor-react-sender.scala53
-rw-r--r--test/files/jvm/replyreactor.check1
-rw-r--r--test/files/jvm/replyreactor.scala43
-rw-r--r--test/files/jvm/scala-concurrent-tck.check1
-rw-r--r--test/files/jvm/scala-concurrent-tck.scala126
-rw-r--r--test/files/jvm/scheduler-adapter.check6
-rw-r--r--test/files/jvm/scheduler-adapter.scala54
-rw-r--r--test/files/jvm/t1449.check1
-rw-r--r--test/files/jvm/t1449.scala28
-rw-r--r--test/files/jvm/t1948.scala26
-rw-r--r--test/files/jvm/t2359.check5
-rw-r--r--test/files/jvm/t2359.scala48
-rw-r--r--test/files/jvm/t2530.check21
-rw-r--r--test/files/jvm/t2530.scala98
-rw-r--r--test/files/jvm/t3102.check2
-rw-r--r--test/files/jvm/t3102.scala39
-rw-r--r--test/files/jvm/t3356.check3
-rw-r--r--test/files/jvm/t3356.scala58
-rw-r--r--test/files/jvm/t3365.check5
-rw-r--r--test/files/jvm/t3365.scala68
-rw-r--r--test/files/jvm/t3407.check10
-rw-r--r--test/files/jvm/t3407.scala21
-rw-r--r--test/files/jvm/t3412-channel.check10
-rw-r--r--test/files/jvm/t3412-channel.scala40
-rw-r--r--test/files/jvm/t3412.check10
-rw-r--r--test/files/jvm/t3412.scala34
-rw-r--r--test/files/jvm/t3470.check3
-rw-r--r--test/files/jvm/t3470.scala32
-rw-r--r--test/files/jvm/t3838.check1
-rw-r--r--test/files/jvm/t3838.scala17
-rw-r--r--test/files/jvm/t7146.check7
-rw-r--r--test/files/jvm/t7146.scala28
-rw-r--r--test/files/jvm/t8582.check3
-rw-r--r--test/files/jvm/t8582.flags1
-rw-r--r--test/files/jvm/t9105.check4
-rw-r--r--test/files/jvm/try-type-tests.scala43
-rw-r--r--test/files/neg/beanInfoDeprecation.check6
-rw-r--r--test/files/neg/beanInfoDeprecation.flags1
-rw-r--r--test/files/neg/beanInfoDeprecation.scala2
-rw-r--r--test/files/neg/deprecated-target.check4
-rw-r--r--test/files/neg/deprecated-target.flags1
-rw-r--r--test/files/neg/deprecated-target.scala1
-rw-r--r--test/files/neg/incompatibleSettings.check6
-rw-r--r--test/files/neg/incompatibleSettings.flags1
-rw-r--r--test/files/neg/incompatibleSettings.scala1
-rw-r--r--test/files/neg/inlineIndyLambdaPrivate.check16
-rw-r--r--test/files/neg/inlineIndyLambdaPrivate.flags1
-rw-r--r--test/files/neg/inlineIndyLambdaPrivate/A_1.java9
-rw-r--r--test/files/neg/inlineIndyLambdaPrivate/Test_2.scala3
-rw-r--r--test/files/neg/logImplicits.check4
-rw-r--r--test/files/neg/names-defaults-neg.check48
-rw-r--r--test/files/neg/names-defaults-neg.scala4
-rw-r--r--test/files/neg/sealed-final-neg.flags2
-rw-r--r--test/files/neg/t4425.flags1
-rw-r--r--test/files/neg/t5639b.flags1
-rw-r--r--test/files/neg/t6013/Base.java2
-rw-r--r--test/files/neg/t6289.check6
-rw-r--r--test/files/neg/t8764.check6
-rw-r--r--test/files/neg/t8764.flags1
-rw-r--r--test/files/neg/t8764.scala9
-rw-r--r--test/files/neg/t8849.check7
-rw-r--r--test/files/neg/t8849.scala10
-rw-r--r--test/files/neg/warn-unused-imports.check46
-rw-r--r--test/files/neg/warn-unused-imports/sample_1.scala17
-rw-r--r--test/files/neg/warn-unused-imports/warn-unused-imports_2.scala (renamed from test/files/neg/warn-unused-imports.scala)30
-rw-r--r--test/files/pos/MailBox.scala2
-rw-r--r--test/files/pos/alladin763.scala37
-rw-r--r--test/files/pos/functions.scala4
-rw-r--r--test/files/pos/inline-access-levels.flags2
-rw-r--r--test/files/pos/inliner2.flags2
-rw-r--r--test/files/pos/sealed-final.flags2
-rw-r--r--test/files/pos/t3420.flags2
-rw-r--r--test/files/pos/t533.scala11
-rw-r--r--test/files/pos/t6778.scala5
-rw-r--r--test/files/pos/t7784.scala13
-rw-r--r--test/files/pos/t8410.flags2
-rw-r--r--test/files/pos/t8462.scala11
-rw-r--r--test/files/pos/t8862a.scala47
-rw-r--r--test/files/pos/t8862b.scala12
-rw-r--r--test/files/pos/t9074.scala24
-rw-r--r--test/files/pos/t9074b.scala15
-rw-r--r--test/files/pos/t9131.scala12
-rw-r--r--test/files/pos/t9326a.scala6
-rw-r--r--test/files/pos/t9392/client_2.scala4
-rw-r--r--test/files/pos/t9392/macro_1.scala16
-rw-r--r--test/files/pos/t9393/NamedImpl_1.java15
-rw-r--r--test/files/pos/t9393/NamedImpl_2.java15
-rw-r--r--test/files/pos/t9393/Named_1.java3
-rw-r--r--test/files/pos/t9393/Named_2.java3
-rw-r--r--test/files/pos/t9393/test_2.scala4
-rw-r--r--test/files/run/analyzerPlugins.check8
-rw-r--r--test/files/run/blame_eye_triple_eee-double.flags1
-rw-r--r--test/files/run/blame_eye_triple_eee-float.flags1
-rw-r--r--test/files/run/classfile-format-51.scala3
-rw-r--r--test/files/run/classfile-format-52.scala3
-rw-r--r--test/files/run/concurrent-stream.check3
-rw-r--r--test/files/run/concurrent-stream.scala37
-rw-r--r--test/files/run/constant-optimization.flags2
-rw-r--r--test/files/run/dead-code-elimination.flags2
-rw-r--r--test/files/run/delambdafy-specialized.flags2
-rw-r--r--test/files/run/delambdafyLambdaClassNames.check1
-rw-r--r--test/files/run/delambdafyLambdaClassNames.flags1
-rw-r--r--test/files/run/delambdafyLambdaClassNames/A_1.scala5
-rw-r--r--test/files/run/delambdafyLambdaClassNames/Test.scala4
-rw-r--r--test/files/run/delambdafy_t6028.check23
-rw-r--r--test/files/run/duration-coarsest.scala5
-rw-r--r--test/files/run/elidable-opt.flags2
-rw-r--r--test/files/run/elidable-opt.scala3
-rw-r--r--test/files/run/finalvar.flags2
-rw-r--r--test/files/run/future-flatmap-exec-count.check1
-rw-r--r--test/files/run/icode-reader-dead-code.scala2
-rw-r--r--test/files/run/inline-ex-handlers.check122
-rw-r--r--test/files/run/inline-ex-handlers.scala2
-rw-r--r--test/files/run/large_class.check4
-rw-r--r--test/files/run/large_code.check4
-rw-r--r--test/files/run/lub-visibility.check2
-rw-r--r--test/files/run/macroPlugins-namerHooks.check2
-rw-r--r--test/files/run/noInlineUnknownIndy.check13
-rw-r--r--test/files/run/noInlineUnknownIndy/A_1.java9
-rw-r--r--test/files/run/noInlineUnknownIndy/Test.scala28
-rw-r--r--test/files/run/nothingTypeDce.flags2
-rw-r--r--test/files/run/nothingTypeDce.scala3
-rw-r--r--test/files/run/nothingTypeNoFramesNoDce.check1
-rw-r--r--test/files/run/nothingTypeNoFramesNoDce.flags1
-rw-r--r--test/files/run/nothingTypeNoFramesNoDce.scala61
-rw-r--r--test/files/run/nothingTypeNoOpt.flags2
-rw-r--r--test/files/run/optimizer-array-load.flags2
-rw-r--r--test/files/run/repl-javap-app.check60
-rw-r--r--test/files/run/repl-javap-app.scala21
-rw-r--r--test/files/run/repl-javap-def.scala2
-rw-r--r--test/files/run/repl-javap-fun.scala16
-rw-r--r--test/files/run/repl-javap-lambdas.scala23
-rw-r--r--test/files/run/repl-javap-memfun.scala22
-rw-r--r--test/files/run/repl-javap-more-fun.scala17
-rw-r--r--test/files/run/repl-javap-outdir-funs.flags1
-rw-r--r--test/files/run/repl-javap-outdir-funs/foo_1.scala6
-rw-r--r--test/files/run/repl-javap-outdir-funs/run-repl_7.scala20
-rw-r--r--test/files/run/repl-javap.scala3
-rw-r--r--test/files/run/repl-parens.scala7
-rw-r--r--test/files/run/run-bug4840.flags1
-rw-r--r--test/files/run/scalapInvokedynamic.check5
-rw-r--r--test/files/run/scalapInvokedynamic.scala11
-rw-r--r--test/files/run/synchronized.flags2
-rw-r--r--test/files/run/t2106.check8
-rw-r--r--test/files/run/t2106.flags2
-rw-r--r--test/files/run/t2251b.check4
-rw-r--r--test/files/run/t3158.scala2
-rw-r--r--test/files/run/t3368-c.check24
-rw-r--r--test/files/run/t3509.flags2
-rw-r--r--test/files/run/t3569.flags2
-rw-r--r--test/files/run/t4285.flags2
-rw-r--r--test/files/run/t4332.scala2
-rw-r--r--test/files/run/t4935.flags2
-rw-r--r--test/files/run/t5313.scala2
-rw-r--r--test/files/run/t5535.scala7
-rw-r--r--test/files/run/t5789.scala9
-rw-r--r--test/files/run/t6102.check36
-rw-r--r--test/files/run/t6102.flags2
-rw-r--r--test/files/run/t6188.flags2
-rw-r--r--test/files/run/t6260-delambdafy.check2
-rw-r--r--test/files/run/t6260-delambdafy.flags1
-rw-r--r--test/files/run/t6260c.check6
-rw-r--r--test/files/run/t6288b-jump-position.check76
-rw-r--r--test/files/run/t6288b-jump-position.scala19
-rw-r--r--test/files/run/t6434.scala7
-rw-r--r--test/files/run/t6546.flags2
-rw-r--r--test/files/run/t6827.check12
-rw-r--r--test/files/run/t6827.scala20
-rw-r--r--test/files/run/t6955.scala2
-rw-r--r--test/files/run/t6956.scala2
-rw-r--r--test/files/run/t7008-scala-defined/Test_3.scala3
-rw-r--r--test/files/run/t7459b-optimize.flags2
-rw-r--r--test/files/run/t7521/Test.scala5
-rw-r--r--test/files/run/t7521/Wrapper.scala1
-rw-r--r--test/files/run/t7521b.check7
-rw-r--r--test/files/run/t7521b.scala20
-rw-r--r--test/files/run/t7582.flags2
-rw-r--r--test/files/run/t7582b.flags2
-rw-r--r--test/files/run/t7747-repl.scala7
-rw-r--r--test/files/run/t7775.scala43
-rw-r--r--test/files/run/t8549.scala18
-rw-r--r--test/files/run/t8575.scala32
-rw-r--r--test/files/run/t8575b.scala17
-rw-r--r--test/files/run/t8575c.scala23
-rw-r--r--test/files/run/t8601.flags2
-rw-r--r--test/files/run/t8601b.flags2
-rw-r--r--test/files/run/t8601c.flags2
-rw-r--r--test/files/run/t8601d.flags2
-rw-r--r--test/files/run/t8601e.flags2
-rw-r--r--test/files/run/t8710.scala17
-rw-r--r--test/files/run/t8764.check5
-rw-r--r--test/files/run/t8764.flags1
-rw-r--r--test/files/run/t8764.scala16
-rw-r--r--test/files/run/t8918-unary-ids.check7
-rw-r--r--test/files/run/t8918-unary-ids.scala49
-rw-r--r--test/files/run/t8944/A_1.scala1
-rw-r--r--test/files/run/t8944/A_2.scala6
-rw-r--r--test/files/run/t8944/Test_1.scala3
-rw-r--r--test/files/run/t8944b.scala9
-rw-r--r--test/files/run/t8944c.check5
-rw-r--r--test/files/run/t8944c.scala8
-rw-r--r--test/files/run/t8955.scala12
-rw-r--r--test/files/run/t8960.scala80
-rw-r--r--test/files/run/t9003.flags2
-rw-r--r--test/files/run/t9097.scala2
-rw-r--r--test/files/run/t9174.check17
-rw-r--r--test/files/run/t9174.scala11
-rw-r--r--test/files/run/t9200/Test.java6
-rw-r--r--test/files/run/t9200/test.scala12
-rw-r--r--test/files/run/t9387.scala20
-rw-r--r--test/files/run/t9387b.check1
-rw-r--r--test/files/run/t9387b.scala16
-rw-r--r--test/files/run/t9408.scala61
-rw-r--r--test/files/run/test-cpp.check20
-rw-r--r--test/files/run/test-cpp.scala2
-rw-r--r--test/files/scalacheck/MutableTreeMap.scala329
-rwxr-xr-xtest/files/scalacheck/concurrent-map.scala76
-rw-r--r--test/junit/scala/collection/IteratorTest.scala22
-rw-r--r--test/junit/scala/collection/SeqViewTest.scala16
-rw-r--r--test/junit/scala/collection/SetMapConsistencyTest.scala17
-rw-r--r--test/junit/scala/collection/convert/NullSafetyTest.scala279
-rw-r--r--test/junit/scala/collection/convert/WrapperSerializationTest.scala29
-rw-r--r--test/junit/scala/collection/immutable/StreamTest.scala110
-rw-r--r--test/junit/scala/collection/immutable/StringLikeTest.scala6
-rw-r--r--test/junit/scala/io/SourceTest.scala4
-rw-r--r--test/junit/scala/issues/BytecodeTests.scala63
-rw-r--r--test/junit/scala/runtime/LambdaDeserializerTest.java193
-rw-r--r--test/junit/scala/sys/process/t7350.scala298
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/IndyLambdaTest.scala55
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerTest.scala42
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/opt/ClosureOptimizerTest.scala74
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/opt/CompactLocalVariablesTest.scala4
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala4
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala37
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/opt/MethodLevelOpts.scala2
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/opt/UnreachableCodeTest.scala16
-rw-r--r--test/junit/scala/tools/nsc/settings/ScalaVersionTest.scala53
-rw-r--r--test/junit/scala/tools/nsc/settings/SettingsTest.scala4
-rw-r--r--test/junit/scala/tools/nsc/symtab/FlagsTest.scala96
-rw-r--r--test/long-running/jvm/memleak2_actor.scala39
-rwxr-xr-xtest/partest3
-rw-r--r--test/pending/jvm/actor-executor4.check21
-rw-r--r--test/pending/jvm/actor-executor4.scala64
-rw-r--r--test/pending/jvm/actor-receive-sender.check2
-rw-r--r--test/pending/jvm/actor-receive-sender.scala51
-rw-r--r--test/pending/jvm/actorgc_leak.check1
-rw-r--r--test/pending/jvm/actorgc_leak.scala63
-rw-r--r--test/pending/jvm/reactWithinZero.check2
-rw-r--r--test/pending/jvm/reactWithinZero.scala18
-rw-r--r--test/pending/jvm/receiveWithinZero.check2
-rw-r--r--test/pending/jvm/receiveWithinZero.scala18
-rw-r--r--test/pending/jvm/t1801.check6
-rw-r--r--test/pending/jvm/t1801.scala31
-rw-r--r--test/pending/jvm/t2515.check10
-rw-r--r--test/pending/jvm/t2515.scala43
-rw-r--r--test/pending/jvm/terminateLinked.check1
-rw-r--r--test/pending/jvm/terminateLinked.scala24
-rw-r--r--test/pending/jvm/timeout.check1
-rw-r--r--test/pending/jvm/timeout.scala38
-rw-r--r--test/pending/run/private-inline.check (renamed from test/files/run/private-inline.check)0
-rw-r--r--test/pending/run/private-inline.flags (renamed from test/files/run/private-inline.flags)0
-rw-r--r--test/pending/run/private-inline.scala (renamed from test/files/run/private-inline.scala)0
-rw-r--r--test/pending/run/t5698/client.scala9
-rw-r--r--test/pending/run/t5698/server.scala22
-rw-r--r--test/pending/run/t5698/testmsg.scala5
-rw-r--r--test/scaladoc/run/t7905.check1
-rw-r--r--test/scaladoc/run/t7905.scala36
-rw-r--r--test/scaladoc/scalacheck/HtmlFactoryTest.scala13
-rw-r--r--versions.properties24
854 files changed, 10530 insertions, 100453 deletions
diff --git a/README.md b/README.md
index e722c88e41..fc73de2273 100644
--- a/README.md
+++ b/README.md
@@ -62,7 +62,7 @@ scala/
## Requirements
-You'll need a Java SDK (6 or newer), Apache Ant (version 1.8.0 or above), and curl (for `./pull-binary-libs.sh`).
+You'll need a Java SDK (8 or newer), Apache Ant (version 1.9.3 or above), and curl (for `./pull-binary-libs.sh`).
## Git Hygiene
@@ -178,7 +178,7 @@ We typically alias `build/quick/bin/scalac -d sandbox` to `qsc` and `build/quick
Note: on most machines this requires more heap than is allocate by default. You can adjust the parameters with ANT_OPTS. Example command line:
```
-ANT_OPTS = "-Xms512M -Xmx2048M -Xss1M -XX:MaxPermSize=128M" ant docs
+ANT_OPTS = "-Xms512M -Xmx2048M -Xss1M" ant docs
```
- `ant dist` builds a distribution in 'dists/latest'.
diff --git a/bincompat-backward.whitelist.conf b/bincompat-backward.whitelist.conf
index a1706d103d..637bd586e0 100644
--- a/bincompat-backward.whitelist.conf
+++ b/bincompat-backward.whitelist.conf
@@ -186,6 +186,15 @@ filter {
matchName="scala.reflect.runtime.SynchronizedOps.newNestedScope"
problemName=MissingMethodProblem
},
+ // see github.com/scala/scala/pull/3925, SI-8627, SI-6440
+ {
+ matchName="scala.collection.TraversableLike.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.immutable.Stream.filteredTail"
+ problemName=MissingMethodProblem
+ },
// https://github.com/scala/scala/pull/3848 -- SI-8680
{
matchName="scala.collection.immutable.Stream.scala$collection$immutable$Stream$$loop$6"
diff --git a/bincompat-forward.whitelist.conf b/bincompat-forward.whitelist.conf
index 8fadb65f39..552c0d85f5 100644
--- a/bincompat-forward.whitelist.conf
+++ b/bincompat-forward.whitelist.conf
@@ -272,6 +272,103 @@ filter {
matchName="scala.reflect.api.PredefTypeCreator"
problemName=MissingClassProblem
},
+ // see github.com/scala/scala/pull/3925, SI-8627, SI-6440
+ {
+ matchName="scala.collection.IterableViewLike#AbstractTransformed.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.AbstractTraversable.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.TraversableViewLike#AbstractTransformed.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.TraversableLike.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.SeqViewLike#AbstractTransformed.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.immutable.TreeSet.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.immutable.Stream.filteredTail"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.immutable.Stream.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.immutable.Stream.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.immutable.StringOps.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.immutable.TreeMap.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.concurrent.TrieMap.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.mutable.ArrayOps#ofByte.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.mutable.ArrayOps#ofLong.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.mutable.ArrayOps#ofUnit.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.mutable.ArrayOps#ofInt.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.mutable.ArrayOps#ofChar.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.mutable.ArrayOps#ofRef.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.mutable.ArrayOps#ofDouble.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.mutable.ArrayOps#ofFloat.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.mutable.ArrayOps#ofBoolean.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.mutable.ArrayOps#ofShort.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.collection.mutable.TreeSet.filterImpl"
+ problemName=MissingMethodProblem
+ },
+ {
+ matchName="scala.reflect.io.AbstractFile.filterImpl"
+ problemName=MissingMethodProblem
+ },
// https://github.com/scala/scala/pull/3848 -- SI-8680
{
matchName="scala.collection.immutable.Stream.scala$collection$immutable$Stream$$loop$6"
diff --git a/build-ant-macros.xml b/build-ant-macros.xml
index ace86cac49..19429cdaa3 100644
--- a/build-ant-macros.xml
+++ b/build-ant-macros.xml
@@ -6,7 +6,7 @@
<attribute name="name"/>
<sequential>
<antcall target="@{name}">
- <param name="scalac.args.optimise" value="-optimise"/>
+ <param name="scalac.args.optimise" value="-Yopt:l:classpath"/>
</antcall>
</sequential>
</macrodef>
@@ -91,7 +91,6 @@
<macrodef name="simple-javac">
<attribute name="project"/>
- <!-- project: forkjoin -->
<attribute name="args" default=""/>
<attribute name="jar" default="yes"/>
<sequential>
@@ -105,7 +104,7 @@
<then>
<stopwatch name="@{project}.timer"/>
<mkdir dir="${@{project}-classes}"/>
- <javac debug="true" srcdir="${src.dir}/@{project}" destdir="${@{project}-classes}" classpath="${@{project}-classes}" includes="**/*.java" target="1.6" source="1.5" compiler="javac1.6">
+ <javac debug="true" srcdir="${src.dir}/@{project}" destdir="${@{project}-classes}" classpath="${@{project}-classes}" includes="**/*.java" target="1.8" source="1.8" compiler="javac1.8">
<compilerarg line="${javac.args} @{args}"/>
</javac>
<if>
@@ -126,13 +125,13 @@
<attribute name="stage"/>
<!-- current stage (locker, quick, strap) -->
<attribute name="project"/>
- <!-- project: library/reflect/compiler/actors -->
+ <!-- project: library/reflect/compiler -->
<attribute name="destproject" default="@{project}"/>
<!-- overrides the output directory; used when building multiple projects into the same directory-->
<attribute name="args" default=""/>
<attribute name="excludes" default=""/>
<sequential>
- <javac debug="true" srcdir="${src.dir}/@{project}" destdir="${build-@{stage}.dir}/classes/@{destproject}" includes="**/*.java" excludes="@{excludes}" target="1.6" source="1.5">
+ <javac debug="true" srcdir="${src.dir}/@{project}" destdir="${build-@{stage}.dir}/classes/@{destproject}" includes="**/*.java" excludes="@{excludes}" target="1.8" source="1.8">
<compilerarg line="${javac.args} @{args}"/>
<classpath refid="@{stage}.@{destproject}.build.path"/>
</javac>
@@ -193,7 +192,7 @@
<attribute name="stage"/>
<!-- current stage (locker, quick, strap) -->
<attribute name="project"/>
- <!-- project: library/reflect/compiler/actors -->
+ <!-- project: library/reflect/compiler -->
<attribute name="srcpath" default="NOT SET"/>
<!-- needed to compile the library -->
<attribute name="args" default=""/>
@@ -202,7 +201,9 @@
<!-- overrides the output directory; used when building multiple projects into the same directory-->
<attribute name="srcdir" default="@{project}"/>
<attribute name="java-excludes" default=""/>
+ <attribute name="mixed" default="NOPE"/>
<sequential>
+ <local name="mixed.true"/><condition property="mixed.true"><equals arg1="@{mixed}" arg2="true"/></condition>
<!-- TODO: detect zinc anywhere on PATH
use zinc for the quick stage if it's available;
would use it for locker but something is iffy in sbt: get a class cast error on global phase -->
@@ -220,12 +221,14 @@
<then>
<scalacfork taskname="@{stage}.@{project}" jvmargs="${scalacfork.jvmargs}" compilerpathref="@{with}.compiler.path" destdir="${build-@{stage}.dir}/classes/@{destproject}" srcdir="${src.dir}/@{srcdir}" params="${scalac.args.@{stage}} @{args}">
<include name="**/*.scala"/>
+ <include name="**/*.java" if="mixed.true"/>
<compilationpath refid="@{stage}.@{project}.build.path"/>
</scalacfork>
</then>
<else>
<scalacfork taskname="@{stage}.@{project}" jvmargs="${scalacfork.jvmargs}" compilerpathref="@{with}.compiler.path" destdir="${build-@{stage}.dir}/classes/@{destproject}" srcdir="${src.dir}/@{srcdir}" srcpath="@{srcpath}" params="${scalac.args.@{stage}} @{args}">
<include name="**/*.scala"/>
+ <include name="**/*.java" if="mixed.true"/>
<compilationpath refid="@{stage}.@{project}.build.path"/>
</scalacfork>
</else>
@@ -262,7 +265,7 @@
<attribute name="stage"/>
<!-- current stage (locker, quick, strap) -->
<attribute name="project"/>
- <!-- project: library/reflect/compiler/actors -->
+ <!-- project: library/reflect/compiler -->
<attribute name="srcpath" default="NOT SET"/>
<!-- needed to compile the library -->
<attribute name="args" default=""/>
@@ -270,6 +273,7 @@
<attribute name="includes" default="comp.includes"/>
<attribute name="java-excludes" default=""/>
<attribute name="version" default=""/>
+ <attribute name="mixed" default="NOPE"/>
<!-- non-empty for scaladoc: use @{version}.version.number in property file-->
<sequential>
<staged-uptodate stage="@{stage}" project="@{project}">
@@ -279,9 +283,18 @@
<do>
<stopwatch name="@{stage}.@{project}.timer"/>
<mkdir dir="${build-@{stage}.dir}/classes/@{project}"/>
- <staged-javac stage="@{stage}" project="@{project}" excludes="@{java-excludes}"/>
- <!-- always compile with javac for simplicity and regularity; it's cheap -->
- <staged-scalac with="@{with}" stage="@{stage}" project="@{project}" srcpath="@{srcpath}" args="@{args}" java-excludes="@{java-excludes}"/>
+ <if>
+ <equals arg1="@{mixed}" arg2="true"/>
+ <then>
+ <staged-scalac with="@{with}" stage="@{stage}" project="@{project}" srcpath="@{srcpath}" args="@{args}" java-excludes="@{java-excludes}" mixed="@{mixed}"/>
+ <staged-javac stage="@{stage}" project="@{project}" excludes="@{java-excludes}"/>
+ </then>
+ <else>
+ <staged-javac stage="@{stage}" project="@{project}" excludes="@{java-excludes}"/>
+ <!-- always compile with javac for simplicity and regularity; it's cheap -->
+ <staged-scalac with="@{with}" stage="@{stage}" project="@{project}" srcpath="@{srcpath}" args="@{args}" java-excludes="@{java-excludes}"/>
+ </else>
+ </if>
<if>
<equals arg1="@{version}" arg2=""/>
<then>
@@ -474,9 +487,8 @@
<filter token="SCALA_COMPILER_INTERACTIVE_VERSION" value="${scala-compiler-interactive.version.number}"/>
<filter token="XML_VERSION" value="${scala-xml.version.number}" />
<filter token="PARSER_COMBINATORS_VERSION" value="${scala-parser-combinators.version.number}" />
- <filter token="CONTINUATIONS_PLUGIN_VERSION" value="${scala-continuations-plugin.version.number}" />
- <filter token="CONTINUATIONS_LIBRARY_VERSION" value="${scala-continuations-library.version.number}" />
- <filter token="SCALA_SWING_VERSION" value="${scala-swing.version.number}" />
+ <filter token="SCALA_SWING_VERSION" value="${scala-swing.version.osgi}" />
+ <filter token="SOURCE_JARNAME" value="${@{project}.targetjar}"/>
</filterset>
</copy>
<bnd classpath="${@{project}.jar}" eclipse="false" failok="false" exceptions="true" files="${build-osgi.dir}/${@{project}.name}.bnd" output="${build-osgi.dir}"/>
@@ -600,14 +612,10 @@
<filter token="SCALA_FULL_VERSION" value="${scala.full.version}" />
<filter token="XML_VERSION" value="${scala-xml.version.number}" />
<filter token="PARSER_COMBINATORS_VERSION" value="${scala-parser-combinators.version.number}" />
- <filter token="CONTINUATIONS_PLUGIN_VERSION" value="${scala-continuations-plugin.version.number}" />
- <filter token="CONTINUATIONS_LIBRARY_VERSION" value="${scala-continuations-library.version.number}" />
- <filter token="SCALA_SWING_VERSION" value="${scala-swing.version.number}" />
+ <filter token="SCALA_SWING_VERSION" value="${scala-swing.version.number}" />
<filter token="RELEASE_REPOSITORY" value="${remote.release.repository}" />
<filter token="SNAPSHOT_REPOSITORY" value="${remote.snapshot.repository}" />
<filter token="JLINE_VERSION" value="${jline.version}" />
- <filter token="AKKA_ACTOR_VERSION" value="${akka-actor.version.number}" />
- <filter token="ACTORS_MIGRATION_VERSION" value="${actors-migration.version.number}" />
<!-- TODO modularize compiler.
<filter token="SCALA_COMPILER_DOC_VERSION" value="${scala-compiler-doc.version.number}" />
@@ -746,7 +754,6 @@
<deploy-one name="scala-compiler-interactive" local="@{local}" signed="@{signed}"/>
-->
- <deploy-one name="scala-actors" local="@{local}" signed="@{signed}"/>
<deploy-one name="scalap" local="@{local}" signed="@{signed}"/>
</sequential>
</macrodef>
diff --git a/build.number b/build.number
index cdba0b70ec..7c7e26fd09 100644
--- a/build.number
+++ b/build.number
@@ -3,8 +3,8 @@
# SNAPSHOT / nightly builds and local builds of source checkouts.
version.major=2
-version.minor=11
-version.patch=8
+version.minor=12
+version.patch=0
# This is the -N part of a version (2.9.1-1). If it's 0, it's dropped from maven versions. It should not be used again.
version.bnum=0
diff --git a/build.sbt b/build.sbt
index 7690df5430..d1342b123a 100644
--- a/build.sbt
+++ b/build.sbt
@@ -83,7 +83,7 @@ lazy val commonSettings = clearSourceAndResourceDirectories ++ Seq[Setting[_]](
// we always assume that Java classes are standalone and do not have any dependency
// on Scala classes
compileOrder := CompileOrder.JavaThenScala,
- javacOptions in Compile ++= Seq("-g", "-source", "1.5", "-target", "1.6"),
+ javacOptions in Compile ++= Seq("-g", "-source", "1.8", "-target", "1.8"),
// we don't want any unmanaged jars; as a reminder: unmanaged jar is a jar stored
// directly on the file system and it's not resolved through Ivy
// Ant's build stored unmanaged jars in `lib/` directory
@@ -142,6 +142,7 @@ lazy val library = configureAsSubproject(project)
.settings(generatePropertiesFileSettings: _*)
.settings(
name := "scala-library",
+ compileOrder := CompileOrder.Mixed, // needed for JFunction classes in scala.runtime.java8
scalacOptions in Compile ++= Seq[String]("-sourcepath", (scalaSource in Compile).value.toString),
// Workaround for a bug in `scaladoc` that it seems to not respect the `-sourcepath` option
// as a result of this bug, the compiler cannot even initialize Definitions without
@@ -155,7 +156,6 @@ lazy val library = configureAsSubproject(project)
Seq("-doc-no-compile", libraryAuxDir.toString)
},
includeFilter in unmanagedResources in Compile := libIncludes)
- .dependsOn (forkjoin)
lazy val reflect = configureAsSubproject(project)
.settings(generatePropertiesFileSettings: _*)
@@ -212,15 +212,6 @@ lazy val scaladoc = configureAsSubproject(project)
lazy val scalap = configureAsSubproject(project).
dependsOn(compiler)
-// deprecated Scala Actors project
-// TODO: it packages into actors.jar but it should be scala-actors.jar
-lazy val actors = configureAsSubproject(project)
- .settings(generatePropertiesFileSettings: _*)
- .settings(name := "scala-actors")
- .dependsOn(library)
-
-lazy val forkjoin = configureAsForkOfJavaProject(project)
-
lazy val partestExtras = configureAsSubproject(Project("partest-extras", file(".") / "src" / "partest-extras"))
.dependsOn(repl)
.settings(clearSourceAndResourceDirectories: _*)
@@ -259,7 +250,7 @@ lazy val partestJavaAgent = (project in file(".") / "src" / "partest-javaagent")
)
lazy val test = project.
- dependsOn(compiler, interactive, actors, repl, scalap, partestExtras, partestJavaAgent, scaladoc).
+ dependsOn(compiler, interactive, repl, scalap, partestExtras, partestJavaAgent, scaladoc).
configs(IntegrationTest).
settings(disableDocsAndPublishingTasks: _*).
settings(commonSettings: _*).
@@ -289,8 +280,8 @@ lazy val test = project.
)
lazy val root = (project in file(".")).
- aggregate(library, forkjoin, reflect, compiler, interactive, repl,
- scaladoc, scalap, actors, partestExtras, junit).settings(
+ aggregate(library, reflect, compiler, interactive, repl,
+ scaladoc, scalap, partestExtras, junit).settings(
sources in Compile := Seq.empty,
onLoadMessage := """|*** Welcome to the sbt build definition for Scala! ***
|This build definition has an EXPERIMENTAL status. If you are not
@@ -318,27 +309,6 @@ def configureAsSubproject(project: Project): Project = {
(project in base).settings(scalaSubprojectSettings: _*)
}
-/**
- * Configuration for subprojects that are forks of some Java projects
- * we depend on. At the moment there's just forkjoin.
- *
- * We do not publish artifacts for those projects but we package their
- * binaries in a jar of other project (compiler or library).
- *
- * For that reason we disable docs generation, packaging and publishing.
- */
-def configureAsForkOfJavaProject(project: Project): Project = {
- val base = file(".") / "src" / project.id
- (project in base).
- settings(commonSettings: _*).
- settings(disableDocsAndPublishingTasks: _*).
- settings(
- sourceDirectory in Compile := baseDirectory.value,
- javaSource in Compile := (sourceDirectory in Compile).value,
- sources in Compile in doc := Seq.empty,
- classDirectory in Compile := buildDirectory.value / "libs/classes" / thisProject.value.id
- )
-}
lazy val buildDirectory = settingKey[File]("The directory where all build products go. By default ./build")
lazy val copyrightString = settingKey[String]("Copyright string.")
diff --git a/build.xml b/build.xml
index ed4f3114d7..540daf98e6 100755
--- a/build.xml
+++ b/build.xml
@@ -19,7 +19,7 @@ ant $antArgs $scalacArgs $targets
antArgs tend to be:
-Darchives.skipxz=true
- -Dscalac.args.optimise=-optimise
+ -Dscalac.args.optimise=-Yopt:l:classpath
scalacArgs examples:
"-Dscalac.args=\"-Yrangepos\" -Dpartest.scalac_opts=\"-Yrangepos\""
@@ -75,17 +75,17 @@ TODO:
<target name="nightly"><optimized name="all.done"/></target>
<target name="nightly.checkall"> <antcall target="all.done"> <param name="partest.scalac_opts" value="-Ycheck:all"/></antcall></target>
- <!-- The IDE build requires actors/swing/continuations, so need to publish them during PR validation until they are modules -->
- <target name="publish-opt-nodocs" description="Publishes Scala (optimized) without generating docs/testing (library/reflect/compiler/actors/swing/continuations).">
+ <!-- The IDE build requires swing, so need to publish them during PR validation until they are modules -->
+ <target name="publish-opt-nodocs" description="Publishes Scala (optimized) without generating docs/testing (library/reflect/compiler/swing).">
<antcall target="publish">
<param name="docs.skip" value="1"/>
- <param name="scalac.args.optimise" value="-optimise"/>
+ <param name="scalac.args.optimise" value="-Yopt:l:classpath"/>
</antcall>
</target>
<target name="publish-core-opt-nodocs" description="Builds an untested, undocumented optimised core (library/reflect/compiler) and publishes to maven.">
<antcall target="publish-core">
<param name="docs.skip" value="1"/>
- <param name="scalac.args.optimise" value="-optimise"/>
+ <param name="scalac.args.optimise" value="-Yopt:l:classpath"/>
</antcall>
</target>
<target name="publish-core-local-nodocs" description="Builds an untested, undocumented core (library/reflect/compiler) and locally publishes to maven">
@@ -165,7 +165,6 @@ TODO:
<property name="build.dir" value="${basedir}/build"/>
<property name="build-deps.dir" value="${build.dir}/deps"/>
<property name="build-libs.dir" value="${build.dir}/libs"/>
- <property name="build-forkjoin.dir" value="${build-libs.dir}"/>
<property name="build-locker.dir" value="${build.dir}/locker"/>
<property name="build-quick.dir" value="${build.dir}/quick"/>
<property name="build-pack.dir" value="${build.dir}/pack"/>
@@ -193,7 +192,7 @@ TODO:
<!-- if ANT_OPTS is already set by the environment, it will be unaltered,
but if it is unset it will take this default value. -->
- <property name="env.ANT_OPTS" value="-Xms1536M -Xmx1536M -Xss1M -XX:MaxPermSize=192M -XX:+UseParallelGC" />
+ <property name="env.ANT_OPTS" value="-Xms1536M -Xmx1536M -Xss1M -XX:+UseParallelGC" />
<property name="scalacfork.jvmargs" value="${env.ANT_OPTS} ${jvm.opts}"/>
@@ -265,14 +264,9 @@ TODO:
-->
<if><not><isset property="maven-deps-done"></isset></not><then>
<mkdir dir="${user.home}/.m2/repository"/>
-
- <artifact:remoteRepository id="sonatype-release" url="https://oss.sonatype.org/content/repositories/releases"/>
- <artifact:remoteRepository id="sonatype-snapshots" url="https://oss.sonatype.org/content/repositories/snapshots"/>
- <artifact:remoteRepository id="extra-repo" url="${extra.repo.url}"/>
-
<!-- This task has an issue where if the user directory does not exist, so we create it above. UGH. -->
<artifact:dependencies pathId="extra.tasks.classpath" filesetId="extra.tasks.fileset">
- <dependency groupId="biz.aQute" artifactId="bnd" version="1.50.0"/>
+ <dependency groupId="biz.aQute.bnd" artifactId="biz.aQute.bnd" version="2.4.1"/>
</artifact:dependencies>
<artifact:dependencies pathId="jarjar.classpath">
@@ -280,27 +274,26 @@ TODO:
</artifact:dependencies>
<!-- JUnit -->
- <property name="junit.version" value="4.11"/>
+ <property name="junit.version" value="4.12"/>
<artifact:dependencies pathId="junit.classpath" filesetId="junit.fileset">
<dependency groupId="junit" artifactId="junit" version="${junit.version}"/>
</artifact:dependencies>
<copy-deps project="junit"/>
<!-- Pax runner -->
- <property name="pax.exam.version" value="3.5.0"/><!-- Last version which supports Java 6 -->
- <property name="osgi.felix.version" value="4.4.0"/>
- <property name="osgi.equinox.version" value="3.7.1"/>
+ <property name="pax.exam.version" value="4.5.0"/>
+ <property name="osgi.felix.version" value="5.0.1"/>
+ <property name="osgi.equinox.version" value="3.10.100.v20150521-1310"/>
<artifact:dependencies pathId="pax.exam.classpath" filesetId="pax.exam.fileset">
- <dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-container-native" version="${pax.exam.version}">
- <exclusion groupId="org.osgi" artifactId="org.osgi.core"/><!-- Avoid dragging in a dependency which requires Java >6 -->
- </dependency>
+ <dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-container-native" version="${pax.exam.version}"/>
<dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-junit4" version="${pax.exam.version}"/>
<dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-link-assembly" version="${pax.exam.version}"/>
- <dependency groupId="org.ops4j.pax.url" artifactId="pax-url-aether" version="2.2.0"/>
- <dependency groupId="org.ops4j.pax.swissbox" artifactId="pax-swissbox-tracker" version="1.8.0"/>
- <dependency groupId="ch.qos.logback" artifactId="logback-core" version="1.1.2"/>
- <dependency groupId="ch.qos.logback" artifactId="logback-classic" version="1.1.2"/>
+ <dependency groupId="org.ops4j.pax.url" artifactId="pax-url-aether" version="2.4.1"/>
+ <dependency groupId="org.ops4j.pax.swissbox" artifactId="pax-swissbox-tracker" version="1.8.1"/>
+ <dependency groupId="ch.qos.logback" artifactId="logback-core" version="1.1.3"/>
+ <dependency groupId="ch.qos.logback" artifactId="logback-classic" version="1.1.3"/>
<dependency groupId="junit" artifactId="junit" version="${junit.version}"/>
+ <dependency groupId="org.slf4j" artifactId="slf4j-api" version="1.7.12"/>
</artifact:dependencies>
<copy-deps project="pax.exam"/>
@@ -309,49 +302,16 @@ TODO:
</artifact:dependencies>
<artifact:dependencies pathId="osgi.framework.equinox">
- <dependency groupId="org.eclipse.osgi" artifactId="org.eclipse.osgi" version="${osgi.equinox.version}"/>
+ <dependency groupId="org.eclipse.tycho" artifactId="org.eclipse.osgi" version="${osgi.equinox.version}"/>
</artifact:dependencies>
<artifact:remoteRepository id="sonatype-release" url="https://oss.sonatype.org/content/repositories/releases"/>
<artifact:remoteRepository id="extra-repo" url="${extra.repo.url}"/>
- <!-- scala-java8-compat, used by the experimental -target jvm-1.8 support. -->
- <if><isset property="scala-java8-compat.package"/><then>
- <property name="scala-java8-compat.version" value="0.5.0"/>
- <property name="scala-java8-compat.binary.version" value="2.11"/>
- <artifact:dependencies pathId="scala-java8-compat.classpath" filesetId="scala-java8-compat.fileset">
- <dependency groupId="org.scala-lang.modules" artifactId="scala-java8-compat_${scala-java8-compat.binary.version}" version="${scala-java8-compat.version}">
- <exclusion groupId="org.scala-lang" artifactId="scala-library"/>
- </dependency>
- </artifact:dependencies>
- <property name="scala-java8-compat-classes" value="${build-quick.dir}/scala-java8-compat"/>
- <delete dir="${scala-java8-compat-classes}"/>
- <unzip dest="${scala-java8-compat-classes}">
- <fileset refid="scala-java8-compat.fileset"/>
- <patternset>
- <include name="**/*.class"/>
- </patternset>
- </unzip>
- <path id="scala-java8-compat.libs">
- <pathelement location="${scala-java8-compat-classes}"/>
- </path>
- <fileset id="scala-java8-compat.fileset" dir="${scala-java8-compat-classes}">
- <include name="**/*"/>
- </fileset>
- </then>
- <else>
- <path id="scala-java8-compat.libs"/>
- <fileset id="scala-java8-compat.fileset" dir="." excludes="**"/>
- </else>
- </if>
-
<!-- prepare, for each of the names below, the property "@{name}.cross", set to the
necessary cross suffix (usually something like "_2.11.0-M6". -->
<prepareCross name="scala-xml" />
<prepareCross name="scala-parser-combinators" />
- <property name="scala-continuations-plugin.cross.suffix" value="_${scala.full.version}"/>
- <prepareCross name="scala-continuations-plugin" />
- <prepareCross name="scala-continuations-library"/>
<prepareCross name="scala-swing"/>
<prepareCross name="partest"/>
<prepareCross name="scalacheck"/>
@@ -390,8 +350,6 @@ TODO:
<artifact:remoteRepository refid="extra-repo"/>
<dependency groupId="org.scala-lang.modules" artifactId="scala-xml${scala-xml.cross}" version="${scala-xml.version.number}"/>
<dependency groupId="org.scala-lang.modules" artifactId="scala-parser-combinators${scala-parser-combinators.cross}" version="${scala-parser-combinators.version.number}"/>
- <dependency groupId="org.scala-lang.plugins" artifactId="scala-continuations-plugin${scala-continuations-plugin.cross}" version="${scala-continuations-plugin.version.number}"/>
- <dependency groupId="org.scala-lang.plugins" artifactId="scala-continuations-library${scala-continuations-library.cross}" version="${scala-continuations-library.version.number}"/>
<dependency groupId="org.scala-lang.modules" artifactId="scala-swing${scala-swing.cross}" version="${scala-swing.version.number}"/>
</artifact:dependencies>
@@ -410,8 +368,6 @@ TODO:
<propertyForCrossedArtifact name="scala-parser-combinators" jar="org.scala-lang.modules:scala-parser-combinators"/>
<propertyForCrossedArtifact name="scala-xml" jar="org.scala-lang.modules:scala-xml"/>
- <propertyForCrossedArtifact name="scala-continuations-plugin" jar="org.scala-lang.plugins:scala-continuations-plugin"/>
- <propertyForCrossedArtifact name="scala-continuations-library" jar="org.scala-lang.plugins:scala-continuations-library"/>
<propertyForCrossedArtifact name="scala-swing" jar="org.scala-lang.modules:scala-swing"/>
<!-- BND support -->
@@ -488,20 +444,12 @@ TODO:
<!-- some default in case something went wrong getting the revision -->
<property name="version.number" value="-unknown-"/>
- <condition property="has.java6">
- <equals arg1="${ant.java.version}" arg2="1.6"/>
- </condition>
- <condition property="has.java7">
- <equals arg1="${ant.java.version}" arg2="1.7"/>
- </condition>
<condition property="has.java8">
<equals arg1="${ant.java.version}" arg2="1.8"/>
</condition>
<condition property="has.unsupported.jdk">
<not><or>
<isset property="has.java8" />
- <isset property="has.java7" />
- <isset property="has.java6" />
</or></not>
</condition>
@@ -602,14 +550,9 @@ TODO:
<echo message="Updating `versions.properties`:"/>
<echo message="starr.version = ${starr.version}"/>
<echo message="scala.binary.version = ${scala.binary.version}"/>
- <echo message="scala.full.version = ${scala.full.version}"/>
<echo message="scala-xml.version.number = ${scala-xml.version.number}"/>
<echo message="scala-parser-combinators.version.number = ${scala-parser-combinators.version.number}"/>
- <echo message="scala-continuations-plugin.version.number = ${scala-continuations-plugin.version.number}"/>
- <echo message="scala-continuations-library.version.number = ${scala-continuations-library.version.number}"/>
<echo message="scala-swing.version.number = ${scala-swing.version.number}"/>
- <echo message="akka-actor.version.number = ${akka-actor.version.number}"/>
- <echo message="actors-migration.version.number = ${actors-migration.version.number}"/>
<echo message="jline.version = ${jline.version}"/>
<echo message="partest.version.number = ${partest.version.number}"/>
<echo message="scalacheck.version.number = ${scalacheck.version.number}"/>
@@ -617,23 +560,15 @@ TODO:
<propertyfile file="versions.properties">
<entry key="starr.version" value="${starr.version}"/>
<entry key="scala.binary.version" value="${scala.binary.version}"/>
- <entry key="scala.full.version" value="${scala.full.version}"/>
<entry key="scala-xml.version.number" value="${scala-xml.version.number}"/>
<entry key="scala-parser-combinators.version.number" value="${scala-parser-combinators.version.number}"/>
- <entry key="scala-continuations-plugin.version.number" value="${scala-continuations-plugin.version.number}"/>
- <entry key="scala-continuations-library.version.number" value="${scala-continuations-library.version.number}"/>
<entry key="scala-swing.version.number" value="${scala-swing.version.number}"/>
- <entry key="akka-actor.version.number" value="${akka-actor.version.number}"/>
- <entry key="actors-migration.version.number" value="${actors-migration.version.number}"/>
<entry key="jline.version" value="${jline.version}"/>
<entry key="partest.version.number" value="${partest.version.number}"/>
<entry key="scalacheck.version.number" value="${scalacheck.version.number}"/>
</propertyfile>
</then></if>
- <path id="forkjoin.classpath" path="${build-forkjoin.dir}/classes/forkjoin"/>
- <property name="forkjoin-classes" refid="forkjoin.classpath"/>
-
<!-- the following properties fully define staged-docs, staged-pack, make-bundle, copy-bundle and mvn-package for each of the projects -->
<property name="library.description" value="Scala Standard Library"/>
<property name="library.docroot" value="rootdoc.txt"/>
@@ -660,34 +595,23 @@ TODO:
<property name="scaladoc.version" value="${scala-compiler-doc.version.number}"/>
<property name="scaladoc.targetjar" value="scala-compiler-doc_${scala.binary.version}-${scala-compiler-doc.version.number}.jar"/>
- <property name="actors.description" value="Scala Actors Library"/>
-
<property name="swing.description" value="Scala Swing Library"/>
<property name="swing.package" value="modules."/>
+ <property name="swing.targetjar" value="scala-swing${scala-swing.cross}-${scala-swing.version.number}.jar"/>
<property name="swing.jar" value="${scala-swing}"/>
<property name="swing.src" value="false"/>
<property name="swing.srcjar" value="${scala-swing-sources}"/>
- <property name="continuations-plugin.description" value="Scala Delimited Continuations Compiler Plugin"/>
- <property name="continuations-plugin.package" value="plugins." />
- <property name="continuations-plugin.jar" value="${scala-continuations-plugin}"/>
- <property name="continuations-plugin.src" value="false"/>
- <property name="continuations-plugin.srcjar" value="${scala-continuations-plugin-sources}"/>
-
- <property name="continuations-library.description" value="Scala Delimited Continuations Library"/>
- <property name="continuations-library.package" value="plugins." />
- <property name="continuations-library.jar" value="${scala-continuations-library}"/>
- <property name="continuations-library.src" value="false"/>
- <property name="continuations-library.srcjar" value="${scala-continuations-library-sources}"/>
-
<property name="parser-combinators.description" value="Scala Parser Combinators Library"/>
<property name="parser-combinators.package" value="modules."/>
+ <property name="parser-combinators.targetjar" value="scala-parser-combinators${scala-parser-combinators.cross}-${scala-parser-combinators.version.number}.jar"/>
<property name="parser-combinators.jar" value="${scala-parser-combinators}"/>
<property name="parser-combinators.src" value="false"/>
<property name="parser-combinators.srcjar" value="${scala-parser-combinators-sources}"/>
<property name="xml.description" value="Scala XML Library"/>
<property name="xml.package" value="modules."/>
+ <property name="xml.targetjar" value="scala-xml${scala-xml.cross}-${scala-xml.version.number}.jar"/>
<property name="xml.jar" value="${scala-xml}"/>
<property name="xml.src" value="false"/>
<property name="xml.srcjar" value="${scala-xml-sources}"/>
@@ -699,8 +623,8 @@ TODO:
<property name="partest-extras.description" value="Scala Compiler Testing Tool (compiler-specific extras)"/>
<property name="partest-javaagent.description" value="Scala Compiler Testing Tool (compiler-specific java agent)"/>
- <!-- projects without project-specific options: forkjoin, manual, bin, repl -->
- <for list="actors,compiler,interactive,scaladoc,library,parser-combinators,partest,partest-extras,partest-javaagent,reflect,scalap,swing,xml,continuations-plugin,continuations-library,repl-jline" param="project">
+ <!-- projects without project-specific options: manual, bin, repl -->
+ <for list="compiler,interactive,scaladoc,library,parser-combinators,partest,partest-extras,partest-javaagent,reflect,scalap,swing,xml,repl-jline" param="project">
<sequential>
<!-- description is mandatory -->
<init-project-prop project="@{project}" name="package" default=""/> <!-- used by mvn-package, copy-bundle, make-bundle -->
@@ -749,7 +673,7 @@ TODO:
There must be a variable of the shape @{stage}.@{project}.build.path
for all @{stage} in locker, quick, strap
and all @{project} in library, reflect, compiler
- when stage is quick, @{project} also includes: actors, repl, scalap
+ when stage is quick, @{project} also includes: repl, scalap
NOTE: interactive, scaladoc, are only used upto quick; they are still packed into the compiler jar
-->
@@ -757,9 +681,7 @@ TODO:
<!-- LOCKER -->
<path id="locker.library.build.path">
<pathelement location="${build-locker.dir}/classes/library"/>
- <path refid="forkjoin.classpath"/>
<path refid="aux.libs"/>
- <path refid="scala-java8-compat.libs"/>
</path>
<path id="locker.reflect.build.path">
@@ -779,14 +701,7 @@ TODO:
<!-- QUICK -->
<path id="quick.library.build.path">
<pathelement location="${build-quick.dir}/classes/library"/>
- <path refid="forkjoin.classpath"/>
<path refid="aux.libs"/>
- <path refid="scala-java8-compat.libs"/>
- </path>
-
- <path id="quick.actors.build.path">
- <path refid="quick.library.build.path"/>
- <pathelement location="${build-quick.dir}/classes/actors"/>
</path>
<path id="quick.reflect.build.path">
@@ -818,7 +733,13 @@ TODO:
<path id="quick.partest-extras.build.path">
<path refid="asm.classpath"/>
- <path refid="partest.classpath"/>
+ <restrict>
+ <path refid="partest.classpath"/>
+ <rsel:not><rsel:or>
+ <rsel:name name="scala-library*.jar"/>
+ </rsel:or></rsel:not>
+ </restrict>
+
<path refid="quick.compiler.build.path"/>
<pathelement location="${build-quick.dir}/classes/repl"/>
<!-- for the java dependency: Profiler.java -->
@@ -843,7 +764,6 @@ TODO:
<path id="quick.bin.tool.path">
<path refid="quick.repl.build.path"/>
- <path refid="quick.actors.build.path"/>
<pathelement location="${build-quick.dir}/classes/scalap"/>
<pathelement location="${build-quick.dir}/classes/scaladoc"/>
<path refid="external-modules-nocore"/>
@@ -855,7 +775,6 @@ TODO:
<pathelement location="${reflect.jar}"/>
<pathelement location="${compiler.jar}"/>
<pathelement location="${ant.jar}"/>
- <path refid="forkjoin.classpath"/>
<path refid="aux.libs"/>
</path>
@@ -863,7 +782,6 @@ TODO:
<pathelement location="${library.jar}"/>
<pathelement location="${xml.jar}"/>
<pathelement location="${parser-combinators.jar}"/>
- <pathelement location="${actors.jar}"/>
<pathelement location="${reflect.jar}"/>
<pathelement location="${compiler.jar}"/>
<!-- TODO modularize compiler: <pathelement location="${scaladoc.jar}"/> -->
@@ -874,12 +792,6 @@ TODO:
<path id="pack.library.files">
<fileset dir="${build-quick.dir}/classes/library"/>
- <fileset dir="${forkjoin-classes}"/>
- <fileset refid="scala-java8-compat.fileset"/>
- </path>
-
- <path id="pack.actors.files">
- <fileset dir="${build-quick.dir}/classes/actors"/>
</path>
<path id="pack.repl-jline.files"> <fileset dir="${build-quick.dir}/classes/repl-jline"/> </path>
@@ -909,7 +821,6 @@ TODO:
<!-- STRAP -->
<path id="strap.library.build.path">
<pathelement location="${build-strap.dir}/classes/library"/>
- <path refid="forkjoin.classpath"/>
<path refid="aux.libs"/>
</path>
@@ -931,7 +842,6 @@ TODO:
<path id="docs.scaladoc.build.path"> <path refid="quick.scaladoc.build.path"/> </path>
<path id="docs.interactive.build.path"> <path refid="quick.interactive.build.path"/> </path>
<path id="docs.scalap.build.path"> <path refid="quick.scalap.build.path"/> </path>
- <path id="docs.actors.build.path"> <path refid="quick.actors.build.path"/> </path>
<!-- run-time classpath for scaladoc TODO: resolve through maven -->
<path id="scaladoc.classpath">
@@ -987,9 +897,8 @@ TODO:
<pathelement location="${interactive.jar}"/>
-->
- <!-- TODO: move scalap & actors out of repo -->
+ <!-- TODO: move scalap out of repo -->
<pathelement location="${scalap.jar}"/>
- <pathelement location="${actors.jar}"/>
<!-- partest's dependencies, which marks most of its dependencies as provided,
(but not scala-library, so we filter that one out...)
@@ -1012,7 +921,6 @@ TODO:
<rsel:name name="scala-library*.jar"/>
<rsel:name name="scala-compiler*.jar"/>
<rsel:name name="scala-reflect*.jar"/>
- <rsel:name name="scala-actors*.jar"/>
<rsel:name name="scala-parser-combinators*.jar"/>
<rsel:name name="scala-xml*.jar"/>
</rsel:or></rsel:not>
@@ -1040,9 +948,7 @@ TODO:
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-library.jar"/>
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-reflect.jar"/>
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-compiler.jar"/>
- <pathelement location="${build-osgi.dir}/org.scala-lang.scala-actors.jar"/>
<path refid="pax.exam.classpath"/>
- <path refid="forkjoin.classpath"/>
</path>
<path id="test.osgi.compiler.build.path.felix">
@@ -1113,8 +1019,6 @@ TODO:
LOCAL DEPENDENCIES
============================================================================ -->
- <target name="forkjoin.done" depends="init"> <simple-javac project="forkjoin" args="-XDignore.symbol.file" jar="no"/></target>
-
<!-- For local development only. We only allow released versions of Scala for STARR.
This builds quick (core only) and publishes it with a generated version number,
saving it as starr.version in build.properties, so this compiler will be used as STARR in your next build
@@ -1126,7 +1030,7 @@ TODO:
<antcall target="publish-core-local">
<param name="maven.version.suffix" value="-STARR-${git.commit.sha}-SNAPSHOT"/>
<param name="docs.skip" value="1"/>
- <param name="scalac.args.optimise" value="-optimise"/>
+ <param name="scalac.args.optimise" value="-Yopt:l:classpath"/>
<param name="update.starr.version" value="alright then"/>
</antcall>
</target>
@@ -1135,11 +1039,12 @@ TODO:
<!-- ===========================================================================
LOCAL REFERENCE BUILD (LOCKER)
============================================================================ -->
- <target name="locker.start" depends="forkjoin.done">
+ <target name="locker.start" depends="init">
<condition property="locker.locked"><available file="${build-locker.dir}/locker.locked"/></condition></target>
<target name="locker.lib" depends="locker.start" unless="locker.locked">
- <staged-build with="starr" stage="locker" project="library" srcpath="${src.dir}/library" includes="lib.includes"/></target>
+ <!-- "mixed" needed for JFunction classes in scala.runtime.java8 -->
+ <staged-build with="starr" stage="locker" project="library" srcpath="${src.dir}/library" includes="lib.includes" mixed="true"/></target>
<target name="locker.reflect" depends="locker.lib" unless="locker.locked">
<staged-build with="starr" stage="locker" project="reflect"/></target>
@@ -1160,7 +1065,8 @@ TODO:
<target name="quick.start" depends="locker.done"/>
<target name="quick.lib" depends="quick.start">
- <staged-build with="locker" stage="quick" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes"/></target>
+ <!-- "mixed" needed for JFunction classes in scala.runtime.java8 -->
+ <staged-build with="locker" stage="quick" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes" mixed="true"/></target>
<target name="quick.reflect" depends="quick.lib">
<staged-build with="locker" stage="quick" project="reflect"/> </target>
@@ -1204,9 +1110,6 @@ TODO:
<target name="quick.scalap" depends="quick.repl">
<staged-build with="locker" stage="quick" project="scalap"/> </target>
- <target name="quick.actors" depends="quick.lib">
- <staged-build with="locker" stage="quick" project="actors"/> </target>
-
<target name="quick.modules" depends="quick.repl, quick.scaladoc, quick.interactive, quick.scalap"/>
@@ -1222,7 +1125,7 @@ TODO:
<!-- ===========================================================================
PACKED QUICK BUILD (PACK)
============================================================================ -->
- <target name="pack.lib" depends="quick.lib, forkjoin.done"> <staged-pack project="library"/></target>
+ <target name="pack.lib" depends="quick.lib"> <staged-pack project="library"/></target>
<target name="pack.reflect" depends="quick.reflect"> <staged-pack project="reflect"/> </target>
@@ -1258,14 +1161,12 @@ TODO:
<target name="pack.interactive" depends="quick.interactive"> <staged-pack project="interactive"/> </target>
-->
- <target name="pack.actors" depends="quick.actors"> <staged-pack project="actors"/> </target>
-
<target name="pack.scalap" depends="quick.scalap"> <staged-pack project="scalap"/> </target>
<target name="pack.core" depends="pack.reflect, pack.comp, pack.lib"/>
<!-- TODO modularize compiler: pack.scaladoc, pack.interactive, -->
- <target name="pack.modules" depends="pack.actors, pack.scalap">
+ <target name="pack.modules" depends="pack.scalap">
<copy todir="${build-pack.dir}/lib">
<path refid="external-modules-nocore" />
<mapper type="flatten" />
@@ -1299,7 +1200,8 @@ TODO:
BOOTSTRAPPING BUILD (STRAP)
============================================================================ -->
<target name="strap.done" depends="pack.done">
- <staged-build with="pack" stage="strap" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes"/>
+ <!-- "mixed" needed for JFunction classes in scala.runtime.java8 -->
+ <staged-build with="pack" stage="strap" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes" mixed="true"/>
<staged-build with="pack" stage="strap" project="reflect"/>
<staged-build with="pack" stage="strap" project="compiler"/>
</target>
@@ -1371,10 +1273,6 @@ TODO:
<include name="${scaladoc.jar}"/>
-->
- <file name="${actors.jar}"/>
-
- <file name="${continuations-plugin.jar}"/>
- <file name="${continuations-library.jar}"/>
<file name="${parser-combinators.jar}"/>
<file name="${xml.jar}"/>
<file name="${swing.jar}"/>
@@ -1399,13 +1297,6 @@ TODO:
</make-bundle>
-->
- <make-bundle project="actors">
- <fileset dir="${src.dir}/actors"/>
- </make-bundle>
-
-
- <make-bundle project="continuations-plugin"/>
- <make-bundle project="continuations-library"/>
<make-bundle project="parser-combinators"/>
<make-bundle project="xml"/>
<make-bundle project="swing"/>
@@ -1530,9 +1421,9 @@ TODO:
srcdir="${test.junit.src}"
destdir="${test.junit.classes}"
classpathref="test.junit.compiler.build.path"
- target="1.6"
- source="1.5"
- compiler="javac1.6"
+ target="1.8"
+ source="1.8"
+ compiler="javac1.8"
includes="**/*.java"/>
<scalacfork
destdir="${test.junit.classes}"
@@ -1552,6 +1443,10 @@ TODO:
<mkdir dir="${test.junit.classes}"/>
<echo message="Note: details of failed tests will be output to ${build-junit.dir}"/>
+ <propertyfile file = "${test.junit.classes}/classpath.properties">
+ <entry key = "test.junit.compiler.build.path" value="${toString:test.junit.compiler.build.path}"/>
+ </propertyfile>
+
<if><isset property="test.method" /><then><property name="test.methods" value="${test.method}" /></then></if>
<junit fork="yes" haltonfailure="yes" printsummary="on">
<classpath refid="test.junit.compiler.build.path"/>
@@ -1647,8 +1542,9 @@ TODO:
<target name="test.bc-opt" description="Optimized version of test.bc."> <optimized name="test.bc"/></target>
<target name="test.bc" depends="bc.prepare, pack.lib, pack.reflect" unless="test.bc.skip">
- <bc.check project="library"/>
- <bc.check project="reflect"/>
+ <echo message="binary compatibility testing disabled in the 2.12.x branch"/>
+ <!-- <bc.check project="library"/> -->
+ <!-- <bc.check project="reflect"/> -->
</target>
<!-- ===========================================================================
@@ -1715,12 +1611,6 @@ TODO:
</target>
-->
- <target name="docs.actors" depends="docs.start" unless="docs.skip">
- <staged-docs project="actors">
- <include name="**/*.scala"/>
- </staged-docs>
- </target>
-
<target name="docs.scalap" depends="docs.start" unless="docs.skip">
<staged-docs project="scalap">
<include name="**/*.scala"/>
@@ -1729,7 +1619,7 @@ TODO:
<target name="docs.core" depends="docs.lib, docs.reflect, docs.comp" unless="docs.skip"/>
<!-- TODO modularize compiler: docs.scaladoc, docs.interactive, -->
- <target name="docs.done" depends="docs.core, docs.actors, docs.scalap" unless="docs.skip"/>
+ <target name="docs.done" depends="docs.core, docs.scalap" unless="docs.skip"/>
<!-- doc/ and man/ -->
<target name="pack.doc" depends="scaladoc.task" unless="docs.skip"> <!-- depends on scaladoc.task for scalac taskdef -->
@@ -1804,8 +1694,6 @@ MAIN DISTRIBUTION PACKAGING
<mvn-package project="scaladoc"/>
-->
- <mvn-package project="actors"/>
-
<!-- don't bother fitting scalap into the mould: it will move out soon -->
<copy tofile="${dist.maven}/scalap/scalap-pom.xml" file="${src.dir}/build/maven/scalap-pom.xml" overwrite="true"/>
<copy tofile="${dist.maven}/scalap/scalap.jar" file="${scalap.jar}" overwrite="true"/>
diff --git a/dbuild-meta.json b/dbuild-meta.json
index 90d0104ec1..4806f9fa5a 100644
--- a/dbuild-meta.json
+++ b/dbuild-meta.json
@@ -1,100 +1,82 @@
{
- "version": "2.11.0",
- "subproj": [],
- "projects": [
+ "projects" : [
{
- "artifacts": [
+ "artifacts" : [
{
- "extension": "jar",
- "name": "scala-library",
- "organization": "org.scala-lang"
+ "extension" : "jar",
+ "name" : "scala-library",
+ "organization" : "org.scala-lang"
}
],
- "dependencies": [],
- "name": "scala-library",
- "organization": "org.scala-lang"
+ "dependencies" : [],
+ "name" : "scala-library",
+ "organization" : "org.scala-lang"
},
{
- "artifacts": [
+ "artifacts" : [
{
- "extension": "jar",
- "name": "scala-reflect",
- "organization": "org.scala-lang"
+ "extension" : "jar",
+ "name" : "scala-reflect",
+ "organization" : "org.scala-lang"
}
],
- "dependencies": [
+ "dependencies" : [
{
- "extension": "jar",
- "name": "scala-library",
- "organization": "org.scala-lang"
+ "extension" : "jar",
+ "name" : "scala-library",
+ "organization" : "org.scala-lang"
}
],
- "name": "scala-reflect",
- "organization": "org.scala-lang"
+ "name" : "scala-reflect",
+ "organization" : "org.scala-lang"
},
{
- "artifacts": [
+ "artifacts" : [
{
- "extension": "jar",
- "name": "scala-compiler",
- "organization": "org.scala-lang"
+ "extension" : "jar",
+ "name" : "scala-compiler",
+ "organization" : "org.scala-lang"
}
],
- "dependencies": [
+ "dependencies" : [
{
- "extension": "jar",
- "name": "scala-reflect",
- "organization": "org.scala-lang"
+ "extension" : "jar",
+ "name" : "scala-reflect",
+ "organization" : "org.scala-lang"
},
{
- "extension": "jar",
- "name": "scala-xml",
- "organization": "org.scala-lang.modules"
+ "extension" : "jar",
+ "name" : "scala-xml",
+ "organization" : "org.scala-lang.modules"
},
{
- "extension": "jar",
- "name": "scala-parser-combinators",
- "organization": "org.scala-lang.modules"
+ "extension" : "jar",
+ "name" : "scala-parser-combinators",
+ "organization" : "org.scala-lang.modules"
}
],
- "name": "scala-compiler",
- "organization": "org.scala-lang"
+ "name" : "scala-compiler",
+ "organization" : "org.scala-lang"
},
{
- "artifacts": [
+ "artifacts" : [
{
- "extension": "jar",
- "name": "scala-actors",
- "organization": "org.scala-lang"
+ "extension" : "jar",
+ "name" : "scalap",
+ "organization" : "org.scala-lang"
}
],
- "dependencies": [
+ "dependencies" : [
{
- "extension": "jar",
- "name": "scala-library",
- "organization": "org.scala-lang"
+ "extension" : "jar",
+ "name" : "scala-compiler",
+ "organization" : "org.scala-lang"
}
],
- "name": "scala-actors",
- "organization": "org.scala-lang"
- },
- {
- "artifacts": [
- {
- "extension": "jar",
- "name": "scalap",
- "organization": "org.scala-lang"
- }
- ],
- "dependencies": [
- {
- "extension": "jar",
- "name": "scala-compiler",
- "organization": "org.scala-lang"
- }
- ],
- "name": "scalap",
- "organization": "org.scala-lang"
+ "name" : "scalap",
+ "organization" : "org.scala-lang"
}
- ]
+ ],
+ "subproj" : [],
+ "version" : "2.12.0"
}
diff --git a/doc/LICENSE.md b/doc/LICENSE.md
index 55e82f64ba..f38bf4c519 100644
--- a/doc/LICENSE.md
+++ b/doc/LICENSE.md
@@ -61,8 +61,4 @@ This license is used by the following third-party libraries:
* sizzle
* tools tooltip
-### Public Domain
-The following libraries are freely available in the public domain:
-
- * forkjoin
diff --git a/doc/License.rtf b/doc/License.rtf
index c475bda3ef..35ff645feb 100644
--- a/doc/License.rtf
+++ b/doc/License.rtf
@@ -57,9 +57,3 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \'93AS IS\'9
\'95 jquery-layout\
\'95 sizzle\
\'95 tools tooltip\
-
-\fs30 \
-Public Domain\
-
-\fs26 The following libraries are freely available in the public domain:\
- \'95 forkjoin} \ No newline at end of file
diff --git a/lib/forkjoin.jar.desired.sha1 b/lib/forkjoin.jar.desired.sha1
deleted file mode 100644
index 8bb86f397d..0000000000
--- a/lib/forkjoin.jar.desired.sha1
+++ /dev/null
@@ -1 +0,0 @@
-ddd7d5398733c4fbbb8355c049e258d47af636cf ?forkjoin.jar
diff --git a/scripts/jobs/integrate/bootstrap b/scripts/jobs/integrate/bootstrap
index 5048f3fdb9..706a20daf4 100755
--- a/scripts/jobs/integrate/bootstrap
+++ b/scripts/jobs/integrate/bootstrap
@@ -187,7 +187,7 @@ sbtBuild() {
sbtResolve() {
cd $baseDir/resolutionScratch_
touch build.sbt
- # Can be set to `full` if a module requires cross-versioning against the full Scala version, like the continuations plugin.
+ # Can be set to `full` if a module requires cross-versioning against the full Scala version, like the continuations plugin used to.
cross=${4-binary}
echo "### sbtResolve: $sbtCmd $sbtArgs " "${scalaVersionTasks[@]}" "\"$1\" % \"$2\" % \"$3\" cross CrossVersion.$cross"
$sbtCmd $sbtArgs "${scalaVersionTasks[@]}" \
@@ -251,27 +251,6 @@ buildPartest() {
# fi
# }
-buildContinuations() {
- if [ "$CONT_PLUG_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.plugins" "scala-continuations-plugin" $CONTINUATIONS_VER full )
- then echo "Found scala-continuations-plugin $CONTINUATIONS_VER; not building."
- else
- update scala scala-continuations $CONTINUATIONS_REF && gfxd
-
- $sbtCmd $sbtArgs 'project plugin' "${scalaVersionTasks[@]}" "${publishTasks[@]}" \
- 'set version := "'$CONTINUATIONS_VER'"' $clean "compile:package" test "${buildTasks[@]}" # https://github.com/scala/scala-continuations/pull/4
- CONT_PLUG_BUILT="yes"
- fi
-
- if [ "$CONT_LIB_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.plugins" "scala-continuations-library" $CONTINUATIONS_VER )
- then echo "Found scala-continuations-library $CONTINUATIONS_VER; not building."
- else
- update scala scala-continuations $CONTINUATIONS_REF && gfxd
- $sbtCmd $sbtArgs 'project library' "${scalaVersionTasks[@]}" "${publishTasks[@]}" \
- 'set version := "'$CONTINUATIONS_VER'"' $clean test "${buildTasks[@]}"
- CONT_LIB_BUILT="yes"
- fi
-}
-
buildSwing() {
if [ "$SWING_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang.modules" "scala-swing" $SWING_VER )
then echo "Found scala-swing $SWING_VER; not building."
@@ -282,18 +261,6 @@ buildSwing() {
fi
}
-buildActorsMigration(){
- if [ "$ACTORS_MIGRATION_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scala-lang" "scala-actors-migration" $ACTORS_MIGRATION_VER )
- then echo "Found scala-actors-migration $ACTORS_MIGRATION_VER; not building."
- else
- update scala actors-migration "$ACTORS_MIGRATION_REF" && gfxd
- # not running tests because
- # [error] Test scala.actors.migration.NestedReact.testNestedReactAkka failed: java.util.concurrent.TimeoutException: Futures timed out after [20 seconds]
- sbtBuild 'set version := "'$ACTORS_MIGRATION_VER'"' 'set VersionKeys.continuationsVersion := "'$CONTINUATIONS_VER'"' $clean "${buildTasks[@]}"
- ACTORS_MIGRATION_BUILT="yes"
- fi
-}
-
# should only be called with publishTasks publishing to private-repo
buildScalacheck(){
if [ "$SCALACHECK_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scalacheck" "scalacheck" $SCALACHECK_VER )
@@ -311,9 +278,7 @@ buildModules() {
buildTasks=($publishPrivateTask)
buildXML
buildParsers
- buildContinuations
buildSwing
- buildActorsMigration
buildScalacheck
buildPartest
# buildPartestIface
@@ -324,9 +289,7 @@ buildPublishedModules() {
buildTasks=($publishSonatypeTaskModules)
buildXML
buildParsers
- buildContinuations
buildSwing
- buildActorsMigration
buildPartest
# buildPartestIface
}
@@ -367,7 +330,7 @@ scalaVerToBinary() {
determineScalaVersion() {
cd $WORKSPACE
parseScalaProperties "versions.properties"
- echo "repo_ref=2.11.x" >> $baseDir/jenkins.properties # for the -dist downstream jobs that build the actual archives
+ echo "repo_ref=2.12.x" >> $baseDir/jenkins.properties # for the -dist downstream jobs that build the actual archives
# each of the branches below defines the following vars: SCALA_VER_BASE, SCALA_VER_SUFFIX, SCALADOC_SOURCE_LINKS_VER, publishToSonatype
@@ -433,17 +396,13 @@ deriveModuleVersions() {
# use versions.properties as defaults when no version specified on the command line
XML_VER=${XML_VER-$scala_xml_version_number}
PARSERS_VER=${PARSERS_VER-$scala_parser_combinators_version_number}
- CONTINUATIONS_VER=${CONTINUATIONS_VER-$scala_continuations_plugin_version_number}
SWING_VER=${SWING_VER-$scala_swing_version_number}
- ACTORS_MIGRATION_VER=${ACTORS_MIGRATION_VER-$actors_migration_version_number}
PARTEST_VER=${PARTEST_VER-$partest_version_number}
SCALACHECK_VER=${SCALACHECK_VER-$scalacheck_version_number}
XML_REF="v$XML_VER"
PARSERS_REF="v$PARSERS_VER"
- CONTINUATIONS_REF="v$CONTINUATIONS_VER"
SWING_REF="v$SWING_VER"
- ACTORS_MIGRATION_REF="v$ACTORS_MIGRATION_VER"
PARTEST_REF="v$PARTEST_VER"
# PARTEST_IFACE_REF="v$PARTEST_IFACE_VER"
SCALACHECK_REF="$SCALACHECK_VER" # no `v` in their tags
@@ -451,25 +410,19 @@ deriveModuleVersions() {
# use HEAD as default when no revision is specified on the command line
XML_REF=${XML_REF-"HEAD"}
PARSERS_REF=${PARSERS_REF-"HEAD"}
- CONTINUATIONS_REF=${CONTINUATIONS_REF-"HEAD"}
SWING_REF=${SWING_REF-"HEAD"}
- ACTORS_MIGRATION_REF=${ACTORS_MIGRATION_REF-"HEAD"}
PARTEST_REF=${PARTEST_REF-"HEAD"}
# PARTEST_IFACE_REF=${PARTEST_IFACE_REF-"HEAD"}
SCALACHECK_REF=${SCALACHECK_REF-"HEAD"}
XML_VER=$(deriveVersion scala scala-xml "$XML_REF")
PARSERS_VER=$(deriveVersion scala scala-parser-combinators "$PARSERS_REF")
- CONTINUATIONS_VER=$(deriveVersion scala scala-continuations "$CONTINUATIONS_REF")
SWING_VER=$(deriveVersion scala scala-swing "$SWING_REF")
- ACTORS_MIGRATION_VER=$(deriveVersion scala actors-migration "$ACTORS_MIGRATION_REF")
PARTEST_VER=$(deriveVersion scala scala-partest "$PARTEST_REF")
SCALACHECK_VER=$(deriveVersionAnyTag rickynils scalacheck "$SCALACHECK_REF")
fi
echo "Module versions (versioning strategy: $moduleVersioning):"
- echo "ACTORS_MIGRATION = $ACTORS_MIGRATION_VER at $ACTORS_MIGRATION_REF"
- echo "CONTINUATIONS = $CONTINUATIONS_VER at $CONTINUATIONS_REF"
echo "PARSERS = $PARSERS_VER at $PARSERS_REF"
echo "PARTEST = $PARTEST_VER at $PARTEST_REF"
echo "SCALACHECK = $SCALACHECK_VER at $SCALACHECK_REF"
@@ -508,9 +461,6 @@ constructUpdatedModuleVersions() {
# force the new module versions for building the core. these may be different from the values in versions.properties,
# either because the variables (XML_VER) were provided, or because we're building the modules from HEAD.
# in the common case, the values are the same as in versions.properties.
- updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dactors-migration.version.number=$ACTORS_MIGRATION_VER")
- updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dscala-continuations-library.version.number=$CONTINUATIONS_VER")
- updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dscala-continuations-plugin.version.number=$CONTINUATIONS_VER")
updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dscala-parser-combinators.version.number=$PARSERS_VER")
updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dscala-swing.version.number=$SWING_VER")
updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dscala-xml.version.number=$XML_VER")
@@ -518,8 +468,7 @@ constructUpdatedModuleVersions() {
updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dpartest.version.number=$PARTEST_VER")
updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dscalacheck.version.number=$SCALACHECK_VER")
- # allow overriding the akka-actors and jline version using a jenkins build parameter
- if [ ! -z "$AKKA_ACTOR_VER" ]; then updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dakka-actor.version.number=$AKKA_ACTOR_VER"); fi
+ # allow overriding the jline version using a jenkins build parameter
if [ ! -z "$JLINE_VER" ] ; then updatedModuleVersions=("${updatedModuleVersions[@]}" "-Djline.version=$JLINE_VER"); fi
if [ ! -z "$SCALA_BINARY_VER" ]; then updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dscala.binary.version=$SCALA_BINARY_VER"); fi
@@ -544,7 +493,7 @@ bootstrap() {
-Dremote.snapshot.repository=NOPE\
-Dremote.release.repository=$releaseTempRepoUrl\
-Drepository.credentials.id=$releaseTempRepoCred\
- -Dscalac.args.optimise=-optimise\
+ -Dscalac.args.optimise=-Yopt:l:classpath\
-Ddocs.skip=1\
-Dlocker.skip=1\
$publishLockerPrivateTask >> $baseDir/logs/builds 2>&1
@@ -575,10 +524,7 @@ bootstrap() {
cd $baseDir
rm -rf build/ # must leave everything else in $baseDir for downstream jobs
- # scala.full.version determines the dependency of scala-dist on the continuations plugin,
- # which is fully cross-versioned (for $SCALA_VER, the version we're releasing)
ant -Dstarr.version=$SCALA_VER\
- -Dscala.full.version=$SCALA_VER\
-Dextra.repo.url=$releaseTempRepoUrl\
-Dmaven.version.suffix=$SCALA_VER_SUFFIX\
${updatedModuleVersions[@]} \
@@ -587,7 +533,7 @@ bootstrap() {
-Dremote.snapshot.repository=NOPE\
-Dremote.release.repository=$releaseTempRepoUrl\
-Drepository.credentials.id=$releaseTempRepoCred\
- -Dscalac.args.optimise=-optimise\
+ -Dscalac.args.optimise=-Yopt:l:classpath\
$antBuildTask $publishPrivateTask
# clear ivy cache (and to be sure, local as well), so the next round of sbt builds sees the fresh scala
diff --git a/scripts/jobs/integrate/ide b/scripts/jobs/integrate/ide
index 1651ad2892..c39facbc3d 100755
--- a/scripts/jobs/integrate/ide
+++ b/scripts/jobs/integrate/ide
@@ -3,6 +3,9 @@
# requires env: scalaVersion (specifies binary already built from above checkout), WORKSPACE (provided by jenkins), repo_ref (HEAD of the scala checkout),
# requires files: $baseDir/versions.properties (from checkout -- defines version numbers for modules used to build scala for dbuild...)
+echo "IDE integration not yet available on 2.12.x. Punting."
+exit 0
+
# TODO: remove when integration is up and running
if [ "woele$_scabot_last" != "woele1" ]; then echo "Scabot didn't mark this as last commit -- skipping."; exit 0; fi
diff --git a/scripts/jobs/validate/test b/scripts/jobs/validate/test
index bedef2e458..d63d39c65d 100755
--- a/scripts/jobs/validate/test
+++ b/scripts/jobs/validate/test
@@ -10,7 +10,7 @@ case $prDryRun in
# build quick using STARR built upstream, as specified by scalaVersion
# (in that sense it's locker, since it was built with starr by that upstream job)
ant -Dstarr.version=$scalaVersion \
- -Dscalac.args.optimise=-optimise \
+ -Dscalac.args.optimise=-Yopt:l:classpath \
-Dlocker.skip=1 -Dextra.repo.url=$prRepoUrl \
$testExtraArgs ${testTarget-test.core docs.done}
;;
diff --git a/src/actors/scala/actors/AbstractActor.scala b/src/actors/scala/actors/AbstractActor.scala
deleted file mode 100644
index 28fe689e91..0000000000
--- a/src/actors/scala/actors/AbstractActor.scala
+++ /dev/null
@@ -1,30 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-
-import scala.language.higherKinds
-
-/**
- * @author Philipp Haller
- *
- * @define actor actor
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait AbstractActor extends OutputChannel[Any] with CanReply[Any, Any] {
-
- type Future[+R] <: scala.actors.Future[R]
-
- private[actors] def exiting: Boolean = false
-
- private[actors] def linkTo(to: AbstractActor): Unit
-
- private[actors] def unlinkFrom(from: AbstractActor): Unit
-
- private[actors] def exit(from: AbstractActor, reason: AnyRef): Unit
-}
diff --git a/src/actors/scala/actors/Actor.scala b/src/actors/scala/actors/Actor.scala
deleted file mode 100644
index 293335f720..0000000000
--- a/src/actors/scala/actors/Actor.scala
+++ /dev/null
@@ -1,411 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-
-import scala.util.control.ControlThrowable
-import java.util.{Timer, TimerTask}
-import scala.language.implicitConversions
-
-/**
- * Provides functions for the definition of actors, as well as actor
- * operations, such as `receive`, `react`, `reply`, etc.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-object Actor extends Combinators {
-
- /** State of an actor.
- *
- * - '''New''' -
- * Not yet started
- * - '''Runnable''' -
- * Executing
- * - '''Suspended''' -
- * Suspended, waiting in a `react`
- * - '''TimedSuspended''' -
- * Suspended, waiting in a `reactWithin`
- * - '''Blocked''' -
- * Blocked waiting in a `receive`
- * - '''TimedBlocked''' -
- * Blocked waiting in a `receiveWithin`
- * - '''Terminated''' -
- * Actor has terminated
- */
- object State extends Enumeration {
- val New,
- Runnable,
- Suspended,
- TimedSuspended,
- Blocked,
- TimedBlocked,
- Terminated = Value
- }
-
- private[actors] val tl = new ThreadLocal[InternalReplyReactor]
-
- // timer thread runs as daemon
- private[actors] val timer = new Timer(true)
-
- private[actors] val suspendException = new SuspendActorControl
-
- /**
- * Returns the currently executing actor. Should be used instead
- * of `'''this'''` in all blocks of code executed by actors.
- *
- * @return returns the currently executing actor.
- */
- def self: Actor = self(Scheduler).asInstanceOf[Actor]
-
- private[actors] def self(sched: IScheduler): InternalActor =
- rawSelf(sched).asInstanceOf[InternalActor]
-
- private[actors] def rawSelf: InternalReplyReactor =
- rawSelf(Scheduler)
-
- private[actors] def rawSelf(sched: IScheduler): InternalReplyReactor = {
- val s = tl.get
- if (s eq null) {
- val r = new ActorProxy(Thread.currentThread, sched)
- tl.set(r)
- r
- } else
- s
- }
-
- private def parentScheduler: IScheduler = {
- val s = tl.get
- if (s eq null) Scheduler else s.scheduler
- }
-
- /**
- * Resets an actor proxy associated with the current thread.
- * It replaces the implicit `ActorProxy` instance
- * of the current thread (if any) with a new instance.
- *
- * This permits to re-use the current thread as an actor
- * even if its `ActorProxy` has died for some reason.
- */
- def resetProxy() {
- val a = tl.get
- if ((null ne a) && a.isInstanceOf[ActorProxy])
- tl.set(new ActorProxy(Thread.currentThread, parentScheduler))
- }
-
- /**
- * Removes any reference to an `Actor` instance
- * currently stored in thread-local storage.
- *
- * This allows to release references from threads that are potentially
- * long-running or being re-used (e.g. inside a thread pool). Permanent
- * references in thread-local storage are a potential memory leak.
- */
- def clearSelf() {
- tl set null
- }
-
- /**
- * Factory method for creating and starting an actor.
- *
- * @example {{{
- * import scala.actors.Actor._
- * ...
- * val a = actor {
- * ...
- * }
- * }}}
- *
- * @param body the code block to be executed by the newly created actor
- * @return the newly created actor. Note that it is automatically started.
- */
- def actor(body: => Unit): Actor = {
- val a = new Actor {
- def act() = body
- override final val scheduler: IScheduler = parentScheduler
- }
- a.start()
- a
- }
-
- /**
- * Factory method for creating actors whose
- * body is defined using a `Responder`.
- *
- * @example {{{
- * import scala.actors.Actor._
- * import Responder.exec
- * ...
- * val a = reactor {
- * for {
- * res <- b !! MyRequest;
- * if exec(println("result: "+res))
- * } yield {}
- * }
- * }}}
- *
- * @param body the `Responder` to be executed by the newly created actor
- * @return the newly created actor. Note that it is automatically started.
- */
- def reactor(body: => Responder[Unit]): Actor = {
- val a = new Actor {
- def act() {
- Responder.run(body)
- }
- override final val scheduler: IScheduler = parentScheduler
- }
- a.start()
- a
- }
-
- /**
- * Receives the next message from the mailbox of the current actor `self`.
- */
- def ? : Any = self.?
-
- /**
- * Receives a message from the mailbox of `self`. Blocks if no message
- * matching any of the cases of `f` can be received.
- *
- * @example {{{
- * receive {
- * case "exit" => println("exiting")
- * case 42 => println("got the answer")
- * case x:Int => println("got an answer")
- * }
- * }}}
- *
- * @param f a partial function specifying patterns and actions
- * @return the result of processing the received message
- */
- def receive[A](f: PartialFunction[Any, A]): A =
- self.receive(f)
-
- /**
- * Receives a message from the mailbox of `self`. Blocks at most `msec`
- * milliseconds if no message matching any of the cases of `f` can be
- * received. If no message could be received the `TIMEOUT` action is
- * executed if specified.
- *
- * @param msec the time span before timeout
- * @param f a partial function specifying patterns and actions
- * @return the result of processing the received message
- */
- def receiveWithin[R](msec: Long)(f: PartialFunction[Any, R]): R =
- self.receiveWithin(msec)(f)
-
- /**
- * Lightweight variant of `receive`.
- *
- * Actions in `f` have to contain the rest of the computation of `self`,
- * as this method will never return.
- *
- * A common method of continuing the computation is to send a message
- * to another actor:
- * {{{
- * react {
- * case Get(from) =>
- * react {
- * case Put(x) => from ! x
- * }
- * }
- * }}}
- *
- * Another common method is to use `loop` to continuously `react` to messages:
- * {{{
- * loop {
- * react {
- * case Msg(data) => // process data
- * }
- * }
- * }}}
- *
- * @param f a partial function specifying patterns and actions
- * @return this function never returns
- */
- def react(f: PartialFunction[Any, Unit]): Nothing =
- rawSelf.react(f)
-
- /**
- * Lightweight variant of `receiveWithin`.
- *
- * Actions in `f` have to contain the rest of the computation of `self`,
- * as this method will never return.
- *
- * @param msec the time span before timeout
- * @param f a partial function specifying patterns and actions
- * @return this function never returns
- */
- def reactWithin(msec: Long)(f: PartialFunction[Any, Unit]): Nothing =
- self.reactWithin(msec)(f)
-
- def eventloop(f: PartialFunction[Any, Unit]): Nothing =
- rawSelf.react(new RecursiveProxyHandler(rawSelf, f))
-
- private class RecursiveProxyHandler(a: InternalReplyReactor, f: PartialFunction[Any, Unit])
- extends PartialFunction[Any, Unit] {
- def isDefinedAt(m: Any): Boolean =
- true // events are immediately removed from the mailbox
- def apply(m: Any) {
- if (f.isDefinedAt(m)) f(m)
- a.react(this)
- }
- }
-
- /**
- * Returns the actor which sent the last received message.
- */
- def sender: OutputChannel[Any] =
- rawSelf.internalSender
-
- /**
- * Sends `msg` to the actor waiting in a call to `!?`.
- */
- def reply(msg: Any): Unit =
- rawSelf.reply(msg)
-
- /**
- * Sends `()` to the actor waiting in a call to `!?`.
- */
- def reply(): Unit =
- rawSelf.reply(())
-
- /**
- * Returns the number of messages in `self`'s mailbox
- *
- * @return the number of messages in `self`'s mailbox
- */
- def mailboxSize: Int = rawSelf.mailboxSize
-
- /**
- * Converts a synchronous event-based operation into
- * an asynchronous `Responder`.
- *
- * @example {{{
- * val adder = reactor {
- * for {
- * _ <- respondOn(react) { case Add(a, b) => reply(a+b) }
- * } yield {}
- * }
- * }}}
- */
- def respondOn[A, B](fun: PartialFunction[A, Unit] => Nothing):
- PartialFunction[A, B] => Responder[B] =
- (caseBlock: PartialFunction[A, B]) => new Responder[B] {
- def respond(k: B => Unit) = fun(caseBlock andThen k)
- }
-
- private[actors] trait Body[a] {
- def andThen[b](other: => b): Unit
- }
-
- implicit def mkBody[a](body: => a) = new InternalActor.Body[a] {
- def andThen[b](other: => b): Unit = rawSelf.seq(body, other)
- }
-
- /**
- * Links `self` to actor `to`.
- *
- * @param to the actor to link to
- * @return the parameter actor
- */
- def link(to: AbstractActor): AbstractActor = self.link(to)
-
- /**
- * Links `self` to the actor defined by `body`.
- *
- * @param body the body of the actor to link to
- * @return the parameter actor
- */
- def link(body: => Unit): Actor = self.link(body)
-
- /**
- * Unlinks `self` from actor `from`.
- *
- * @param from the actor to unlink from
- */
- def unlink(from: AbstractActor): Unit = self.unlink(from)
-
- /**
- * Terminates execution of `self` with the following effect on
- * linked actors:
- *
- * For each linked actor `a` with `trapExit` set to `'''true'''`,
- * send message `Exit(self, reason)` to `a`.
- *
- * For each linked actor `a` with `trapExit` set to `'''false'''`
- * (default), call `a.exit(reason)` if `reason != 'normal`.
- */
- def exit(reason: AnyRef): Nothing = self.exit(reason)
-
- /**
- * Terminates execution of `self` with the following effect on
- * linked actors:
- *
- * For each linked actor `a` with `trapExit` set to `'''true'''`,
- * send message `Exit(self, 'normal)` to `a`.
- */
- def exit(): Nothing = rawSelf.exit()
-
-}
-
-/** Provides lightweight, concurrent actors. Actors are created by extending
- * the `Actor` trait (alternatively, one of the factory methods in its
- * companion object can be used). The behavior of an `Actor` subclass is
- * defined by implementing its `act` method:
- * {{{
- * class MyActor extends Actor {
- * def act() {
- * // actor behavior goes here
- * }
- * }
- * }}}
- * A new `Actor` instance is started by invoking its `start` method.
- *
- * '''Note:''' care must be taken when invoking thread-blocking methods other
- * than those provided by the `Actor` trait or its companion object (such as
- * `receive`). Blocking the underlying thread inside an actor may lead to
- * starvation of other actors. This also applies to actors hogging their
- * thread for a long time between invoking `receive`/`react`.
- *
- * If actors use blocking operations (for example, methods for blocking I/O),
- * there are several options:
- *
- * - The run-time system can be configured to use a larger thread pool size
- * (for example, by setting the `actors.corePoolSize` JVM property).
- * - The `scheduler` method of the `Actor` trait can be overridden to return a
- * `ResizableThreadPoolScheduler`, which resizes its thread pool to
- * avoid starvation caused by actors that invoke arbitrary blocking methods.
- * - The `actors.enableForkJoin` JVM property can be set to `false`, in which
- * case a `ResizableThreadPoolScheduler` is used by default to execute actors.
- *
- * The main ideas of the implementation are explained in the two papers
- *
- * - [[http://lampwww.epfl.ch/~odersky/papers/jmlc06.pdf Event-Based
- * Programming without Inversion of Control]],
- * Philipp Haller and Martin Odersky, ''Proc. JMLC 2006'', and
- * - [[http://lamp.epfl.ch/~phaller/doc/haller07coord.pdf Actors that
- * Unify Threads and Events]],
- * Philipp Haller and Martin Odersky, ''Proc. COORDINATION 2007''.
- *
- * @author Philipp Haller
- *
- * @define actor actor
- * @define channel actor's mailbox
- */
-@SerialVersionUID(-781154067877019505L)
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait Actor extends InternalActor with ReplyReactor {
-
- override def start(): Actor = synchronized {
- super.start()
- this
- }
-
- }
-
diff --git a/src/actors/scala/actors/ActorCanReply.scala b/src/actors/scala/actors/ActorCanReply.scala
deleted file mode 100644
index 07191ec65c..0000000000
--- a/src/actors/scala/actors/ActorCanReply.scala
+++ /dev/null
@@ -1,66 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-import scala.concurrent.SyncVar
-
-/**
- * Provides message send operations that
- * may result in a response from the receiver.
- *
- * @author Philipp Haller
- */
-private[actors] trait ActorCanReply extends ReactorCanReply {
- this: AbstractActor with InternalReplyReactor =>
-
- override def !?(msg: Any): Any = {
- val replyCh = new Channel[Any](Actor.self(scheduler))
- send(msg, replyCh)
- replyCh.?
- }
-
- override def !?(msec: Long, msg: Any): Option[Any] = {
- val replyCh = new Channel[Any](Actor.self(scheduler))
- send(msg, replyCh)
- replyCh.receiveWithin(msec) {
- case TIMEOUT => None
- case x => Some(x)
- }
- }
-
- override def !![A](msg: Any, handler: PartialFunction[Any, A]): Future[A] = {
- val c = new Channel[A](Actor.self(scheduler))
- val fun = (res: SyncVar[A]) => {
- val ftch = new Channel[A](Actor.self(scheduler))
- send(msg, new OutputChannel[Any] {
- def !(msg: Any) =
- ftch ! handler(msg)
- def send(msg: Any, replyTo: OutputChannel[Any]) =
- ftch.send(handler(msg), replyTo)
- def forward(msg: Any) =
- ftch.forward(handler(msg))
- def receiver =
- ftch.receiver
- })
- ftch.react {
- case any => res.set(any)
- }
- }
- val a = new FutureActor[A](fun, c)
- a.start()
- a
- }
-
- override def !!(msg: Any): Future[Any] = {
- val noTransform: PartialFunction[Any, Any] = { case x => x }
- this !! (msg, noTransform)
- }
-
-}
diff --git a/src/actors/scala/actors/ActorProxy.scala b/src/actors/scala/actors/ActorProxy.scala
deleted file mode 100644
index 5e1d3e61de..0000000000
--- a/src/actors/scala/actors/ActorProxy.scala
+++ /dev/null
@@ -1,34 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-import java.lang.Thread
-
-/**
- * Provides a dynamic actor proxy for normal Java threads.
- *
- * @author Philipp Haller
- */
-private[actors] class ActorProxy(t: Thread, override final val scheduler: IScheduler) extends Actor {
-
- def act() {}
-
- /**
- * Terminates with exit reason `'normal`.
- */
- override def exit(): Nothing = {
- shouldExit = false
- // links
- if (!links.isEmpty)
- exitLinked()
- throw new InterruptedException
- }
-
-}
diff --git a/src/actors/scala/actors/ActorRef.scala b/src/actors/scala/actors/ActorRef.scala
deleted file mode 100644
index 0da167aede..0000000000
--- a/src/actors/scala/actors/ActorRef.scala
+++ /dev/null
@@ -1,53 +0,0 @@
-package scala.actors
-
-import java.util.concurrent.TimeoutException
-import scala.concurrent.duration.Duration
-
-/**
- * Trait used for migration of Scala actors to Akka.
- */
-@deprecated("ActorRef ought to be used only with the Actor Migration Kit.", "2.10.0")
-trait ActorRef {
-
- /**
- * Sends a one-way asynchronous message. E.g. fire-and-forget semantics.
- * <p/>
- *
- * If invoked from within an actor then the actor reference is implicitly passed on as the implicit 'sender' argument.
- * <p/>
- *
- * This actor 'sender' reference is then available in the receiving actor in the 'sender' member variable,
- * if invoked from within an Actor. If not then no sender is available.
- * <pre>
- * actor ! message
- * </pre>
- * <p/>
- */
- def !(message: Any)(implicit sender: ActorRef = null): Unit
-
- /**
- * Sends a message asynchronously, returning a future which may eventually hold the reply.
- */
- private[actors] def ?(message: Any, timeout: Duration): scala.concurrent.Future[Any]
-
- /**
- * Forwards the message and passes the original sender actor as the sender.
- * <p/>
- * Works with '!' and '?'.
- */
- def forward(message: Any)
-
- private[actors] def localActor: AbstractActor
-
-}
-
-/**
- * This is what is used to complete a Future that is returned from an ask/? call,
- * when it times out.
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-class AskTimeoutException(message: String, cause: Throwable) extends TimeoutException {
- def this(message: String) = this(message, null: Throwable)
-}
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-object PoisonPill
diff --git a/src/actors/scala/actors/ActorTask.scala b/src/actors/scala/actors/ActorTask.scala
deleted file mode 100644
index 21d7a0a1ad..0000000000
--- a/src/actors/scala/actors/ActorTask.scala
+++ /dev/null
@@ -1,60 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-
-package scala.actors
-
-/**
- * @author Philipp Haller
- * @note This class inherits a public var called 'msg' from ReactorTask,
- * and also defines a constructor parameter which shadows it (which makes any
- * changes to the underlying var invisible.) I can't figure out what's supposed
- * to happen, so I renamed the constructor parameter to at least be less confusing.
- */
-private[actors] class ActorTask(actor: InternalActor,
- fun: () => Unit,
- handler: PartialFunction[Any, Any],
- initialMsg: Any)
- extends ReplyReactorTask(actor, fun, handler, initialMsg) {
-
- protected override def beginExecution() {
- super.beginExecution()
- actor.synchronized { // shouldExit guarded by actor
- if (actor.shouldExit)
- actor.exit()
- }
- }
-
- protected override def terminateExecution(e: Throwable) {
- val senderInfo = try { Some(actor.internalSender) } catch {
- case _: Exception => None
- }
- // !!! If this is supposed to be setting the current contents of the
- // inherited mutable var rather than always the value given in the constructor,
- // then it should be changed from initialMsg to msg.
- val uncaught = UncaughtException(actor,
- if (initialMsg != null) Some(initialMsg) else None,
- senderInfo,
- Thread.currentThread,
- e)
-
- val todo = actor.synchronized {
- val res = if (!actor.links.isEmpty)
- actor.exitLinked(uncaught)
- else {
- super.terminateExecution(e)
- () => {}
- }
- res
- }
-
- todo()
- }
-
-}
diff --git a/src/actors/scala/actors/CanReply.scala b/src/actors/scala/actors/CanReply.scala
deleted file mode 100644
index 3f2c53f423..0000000000
--- a/src/actors/scala/actors/CanReply.scala
+++ /dev/null
@@ -1,65 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-
-import scala.language.higherKinds
-
-/**
- * Defines result-bearing message send operations.
- *
- * @author Philipp Haller
- *
- * @define actor `CanReply`
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait CanReply[-T, +R] {
-
- type Future[+P] <: () => P
-
- /**
- * Sends `msg` to this $actor and awaits reply (synchronous).
- *
- * @param msg the message to be sent
- * @return the reply
- */
- def !?(msg: T): R
-
- /**
- * Sends `msg` to this $actor and awaits reply (synchronous) within
- * `msec` milliseconds.
- *
- * @param msec the time span before timeout
- * @param msg the message to be sent
- * @return `None` in case of timeout, otherwise
- * `Some(x)` where `x` is the reply
- */
- def !?(msec: Long, msg: T): Option[R]
-
- /**
- * Sends `msg` to this $actor and immediately returns a future representing
- * the reply value.
- *
- * @param msg the message to be sent
- * @return the future
- */
- def !!(msg: T): Future[R]
-
- /**
- * Sends `msg` to this $actor and immediately returns a future representing
- * the reply value. The reply is post-processed using the partial function
- * `handler`. This also allows to recover a more precise type for the reply
- * value.
- *
- * @param msg the message to be sent
- * @param handler the function to be applied to the response
- * @return the future
- */
- def !![P](msg: T, handler: PartialFunction[R, P]): Future[P]
-
-}
diff --git a/src/actors/scala/actors/Channel.scala b/src/actors/scala/actors/Channel.scala
deleted file mode 100644
index ddf7b329c8..0000000000
--- a/src/actors/scala/actors/Channel.scala
+++ /dev/null
@@ -1,136 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-
-import scala.concurrent.SyncVar
-
-/**
- * Used to pattern match on values that were sent to some channel `Chan,,n,,`
- * by the current actor `self`.
- *
- * @example {{{
- * receive {
- * case Chan1 ! msg1 => ...
- * case Chan2 ! msg2 => ...
- * }
- * }}}
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-case class ! [a](ch: Channel[a], msg: a)
-
-/**
- * Provides a means for typed communication among actors. Only the
- * actor creating an instance of a `Channel` may receive from it.
- *
- * @author Philipp Haller
- *
- * @define actor channel
- * @define channel channel
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-class Channel[Msg](val receiver: InternalActor) extends InputChannel[Msg] with OutputChannel[Msg] with CanReply[Msg, Any] {
-
- type Future[+P] = scala.actors.Future[P]
-
- def this() = this(Actor.self)
-
- def !(msg: Msg) {
- receiver ! scala.actors.!(this, msg)
- }
-
- def send(msg: Msg, replyTo: OutputChannel[Any]) {
- receiver.send(scala.actors.!(this, msg), replyTo)
- }
-
- def forward(msg: Msg) {
- receiver forward scala.actors.!(this, msg)
- }
-
- def receive[R](f: PartialFunction[Msg, R]): R = {
- val C = this.asInstanceOf[Channel[Any]]
- receiver.receive {
- case C ! msg if (f.isDefinedAt(msg.asInstanceOf[Msg])) => f(msg.asInstanceOf[Msg])
- }
- }
-
- def ? : Msg = receive {
- case x => x
- }
-
- def receiveWithin[R](msec: Long)(f: PartialFunction[Any, R]): R = {
- val C = this.asInstanceOf[Channel[Any]]
- receiver.receiveWithin(msec) {
- case C ! msg if (f.isDefinedAt(msg)) => f(msg)
- case TIMEOUT => f(TIMEOUT)
- }
- }
-
- def react(f: PartialFunction[Msg, Unit]): Nothing = {
- val C = this.asInstanceOf[Channel[Any]]
- receiver.react {
- case C ! msg if (f.isDefinedAt(msg.asInstanceOf[Msg])) => f(msg.asInstanceOf[Msg])
- }
- }
-
- def reactWithin(msec: Long)(f: PartialFunction[Any, Unit]): Nothing = {
- val C = this.asInstanceOf[Channel[Any]]
- receiver.reactWithin(msec) {
- case C ! msg if (f.isDefinedAt(msg)) => f(msg)
- case TIMEOUT => f(TIMEOUT)
- }
- }
-
- def !?(msg: Msg): Any = {
- val replyCh = new Channel[Any](Actor.self(receiver.scheduler))
- receiver.send(scala.actors.!(this, msg), replyCh)
- replyCh.receive {
- case x => x
- }
- }
-
- def !?(msec: Long, msg: Msg): Option[Any] = {
- val replyCh = new Channel[Any](Actor.self(receiver.scheduler))
- receiver.send(scala.actors.!(this, msg), replyCh)
- replyCh.receiveWithin(msec) {
- case TIMEOUT => None
- case x => Some(x)
- }
- }
-
- def !![A](msg: Msg, handler: PartialFunction[Any, A]): Future[A] = {
- val c = new Channel[A](Actor.self(receiver.scheduler))
- val fun = (res: SyncVar[A]) => {
- val ftch = new Channel[A](Actor.self(receiver.scheduler))
- receiver.send(scala.actors.!(this, msg), new OutputChannel[Any] {
- def !(msg: Any) =
- ftch ! handler(msg)
- def send(msg: Any, replyTo: OutputChannel[Any]) =
- ftch.send(handler(msg), replyTo)
- def forward(msg: Any) =
- ftch.forward(handler(msg))
- def receiver =
- ftch.receiver
- })
- ftch.react {
- case any => res.set(any)
- }
- }
- val a = new FutureActor[A](fun, c)
- a.start()
- a
- }
-
- def !!(msg: Msg): Future[Any] = {
- val noTransform: PartialFunction[Any, Any] = { case x => x }
- this !! (msg, noTransform)
- }
-
-}
diff --git a/src/actors/scala/actors/Combinators.scala b/src/actors/scala/actors/Combinators.scala
deleted file mode 100644
index 64dbaf06e4..0000000000
--- a/src/actors/scala/actors/Combinators.scala
+++ /dev/null
@@ -1,48 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-// $Id$
-
-package scala.actors
-
-import scala.language.implicitConversions
-
-private[actors] trait Combinators {
-
- /**
- * Enables the composition of suspendable closures using `andThen`,
- * `loop`, `loopWhile`, etc.
- */
- implicit def mkBody[a](body: => a): InternalActor.Body[a]
-
- /**
- * Repeatedly executes `body`.
- *
- * @param body the block to be executed
- */
- def loop(body: => Unit): Unit = body andThen loop(body)
-
- /**
- * Repeatedly executes `body` while the condition `cond` is `true`.
- *
- * @param cond the condition to test
- * @param body the block to be executed
- */
- def loopWhile(cond: => Boolean)(body: => Unit): Unit =
- if (cond) { body andThen loopWhile(cond)(body) }
- else continue
-
- /**
- * Continues with the execution of the closure registered as
- * continuation following `andThen`. Continues with the execution
- * of the next loop iteration when invoked inside the body of `loop`
- * or `loopWhile`.
- */
- def continue(): Unit = throw new KillActorControl
-
-}
diff --git a/src/actors/scala/actors/DaemonActor.scala b/src/actors/scala/actors/DaemonActor.scala
deleted file mode 100644
index 04a4b4a40c..0000000000
--- a/src/actors/scala/actors/DaemonActor.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-
-import scheduler.DaemonScheduler
-
-/**
- * Base trait for actors with daemon semantics.
- *
- * Unlike a regular `Actor`, an active `DaemonActor` will not
- * prevent an application terminating, much like a daemon thread.
- *
- * @author Erik Engbrecht
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait DaemonActor extends Actor {
- override def scheduler: IScheduler = DaemonScheduler
-}
diff --git a/src/actors/scala/actors/Debug.scala b/src/actors/scala/actors/Debug.scala
deleted file mode 100644
index 31ef53bdbe..0000000000
--- a/src/actors/scala/actors/Debug.scala
+++ /dev/null
@@ -1,45 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-/**
- * Provides methods for generating debugging output.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-object Debug extends Logger("") {}
-
-private[actors] class Logger(tag: String) {
- private var lev = 2
-
- def level = lev
- def level_= (lev: Int) = { this.lev = lev }
-
- private val tagString = if (tag == "") "" else " ["+tag+"]"
-
- def info(s: String) =
- if (lev > 2) System.out.println("Info" + tagString + ": " + s)
-
- def warning(s: String) =
- if (lev > 1) System.err.println("Warning" + tagString + ": " + s)
-
- def error(s: String) =
- if (lev > 0) System.err.println("Error" + tagString + ": " + s)
-
- def doInfo(b: => Unit) =
- if (lev > 2) b
-
- def doWarning(b: => Unit) =
- if (lev > 1) b
-
- def doError(b: => Unit) =
- if (lev > 0) b
-}
diff --git a/src/actors/scala/actors/Future.scala b/src/actors/scala/actors/Future.scala
deleted file mode 100644
index 4421c7a07a..0000000000
--- a/src/actors/scala/actors/Future.scala
+++ /dev/null
@@ -1,243 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-import scala.actors.scheduler.DaemonScheduler
-import scala.concurrent.SyncVar
-
-/** A function of arity 0, returing a value of type `T` that,
- * when applied, blocks the current actor (`Actor.self`)
- * until the future's value is available.
- *
- * A future can be queried to find out whether its value
- * is already available without blocking.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the scala.concurrent.Future instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-abstract class Future[+T] extends Responder[T] with Function0[T] {
-
- @volatile
- private[actors] var fvalue: Option[Any] = None
- private[actors] def fvalueTyped = fvalue.get.asInstanceOf[T]
-
- /** Tests whether the future's result is available.
- *
- * @return `true` if the future's result is available,
- * `false` otherwise.
- */
- def isSet: Boolean
-
- /** Returns an input channel that can be used to receive the future's result.
- *
- * @return the future's input channel
- */
- def inputChannel: InputChannel[T]
-
-}
-
-private case object Eval
-
-private class FutureActor[T](fun: SyncVar[T] => Unit, channel: Channel[T]) extends Future[T] with DaemonActor {
-
- var enableChannel = false // guarded by this
-
- def isSet = !fvalue.isEmpty
-
- def apply(): T = {
- if (fvalue.isEmpty) {
- this !? Eval
- }
- fvalueTyped
- }
-
- def respond(k: T => Unit) {
- if (isSet) k(fvalueTyped)
- else {
- val ft = this !! Eval
- ft.inputChannel.react {
- case _ => k(fvalueTyped)
- }
- }
- }
-
- def inputChannel: InputChannel[T] = {
- synchronized {
- if (!enableChannel) {
- if (isSet)
- channel ! fvalueTyped
- enableChannel = true
- }
- }
- channel
- }
-
- def act() {
- val res = new SyncVar[T]
-
- {
- fun(res)
- } andThen {
-
- synchronized {
- val v = res.get
- fvalue = Some(v)
- if (enableChannel)
- channel ! v
- }
-
- loop {
- react {
- // This is calling ReplyReactor#reply(msg: Any).
- // Was: reply(). Now: reply(()).
- case Eval => reply(())
- }
- }
- }
- }
-}
-
-/** Methods that operate on futures.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the object scala.concurrent.Future instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-object Futures {
-
- /** Arranges for the asynchronous execution of `body`,
- * returning a future representing the result.
- *
- * @param body the computation to be carried out asynchronously
- * @return the future representing the result of the
- * computation
- */
- def future[T](body: => T): Future[T] = {
- val c = new Channel[T](Actor.self(DaemonScheduler))
- val a = new FutureActor[T](_.set(body), c)
- a.start()
- a
- }
-
- /** Creates a future that resolves after a given time span.
- *
- * @param timespan the time span in ms after which the future resolves
- * @return the future
- */
- def alarm(timespan: Long): Future[Unit] = {
- val c = new Channel[Unit](Actor.self(DaemonScheduler))
- val fun = (res: SyncVar[Unit]) => {
- Actor.reactWithin(timespan) {
- case TIMEOUT => res.set({})
- }
- }
- val a = new FutureActor[Unit](fun, c)
- a.start()
- a
- }
-
- /** Waits for the first result returned by one of two
- * given futures.
- *
- * @param ft1 the first future
- * @param ft2 the second future
- * @return the result of the future that resolves first
- */
- def awaitEither[A, B >: A](ft1: Future[A], ft2: Future[B]): B = {
- val FutCh1 = ft1.inputChannel
- val FutCh2 = ft2.inputChannel
- Actor.receive {
- case FutCh1 ! arg1 => arg1.asInstanceOf[B]
- case FutCh2 ! arg2 => arg2.asInstanceOf[B]
- }
- }
-
- /** Waits until either all futures are resolved or a given
- * time span has passed. Results are collected in a list of
- * options. The result of a future that resolved during the
- * time span is its value wrapped in `Some`. The result of a
- * future that did not resolve during the time span is `None`.
- *
- * Note that some of the futures might already have been awaited,
- * in which case their value is returned wrapped in `Some`.
- * Passing a timeout of 0 causes `awaitAll` to return immediately.
- *
- * @param timeout the time span in ms after which waiting is
- * aborted
- * @param fts the futures to be awaited
- * @return the list of optional future values
- * @throws java.lang.IllegalArgumentException if timeout is negative,
- * or timeout + `System.currentTimeMillis()` is negative.
- */
- def awaitAll(timeout: Long, fts: Future[Any]*): List[Option[Any]] = {
- val resultsMap: scala.collection.mutable.Map[Int, Option[Any]] = new scala.collection.mutable.HashMap[Int, Option[Any]]
-
- var cnt = 0
- val mappedFts = fts.map(ft =>
- ({cnt+=1; cnt-1}, ft))
-
- val unsetFts = mappedFts.filter((p: Tuple2[Int, Future[Any]]) => {
- if (p._2.isSet) { resultsMap(p._1) = Some(p._2()); false }
- else { resultsMap(p._1) = None; true }
- })
-
- val partFuns = unsetFts.map((p: Tuple2[Int, Future[Any]]) => {
- val FutCh = p._2.inputChannel
- val singleCase: PartialFunction[Any, Tuple2[Int, Any]] = {
- case FutCh ! any => (p._1, any)
- }
- singleCase
- })
-
- val thisActor = Actor.self
- val timerTask = new java.util.TimerTask {
- def run() { thisActor ! TIMEOUT }
- }
- Actor.timer.schedule(timerTask, timeout)
-
- def awaitWith(partFuns: Seq[PartialFunction[Any, Tuple2[Int, Any]]]) {
- val reaction: PartialFunction[Any, Unit] = new PartialFunction[Any, Unit] {
- def isDefinedAt(msg: Any) = msg match {
- case TIMEOUT => true
- case _ => partFuns exists (_ isDefinedAt msg)
- }
- def apply(msg: Any): Unit = msg match {
- case TIMEOUT => // do nothing
- case _ => {
- val pfOpt = partFuns find (_ isDefinedAt msg)
- val pf = pfOpt.get // succeeds always
- val (idx, subres) = pf(msg)
- resultsMap(idx) = Some(subres)
-
- val partFunsRest = partFuns filter (_ != pf)
- // wait on rest of partial functions
- if (partFunsRest.length > 0)
- awaitWith(partFunsRest)
- }
- }
- }
- Actor.receive(reaction)
- }
-
- if (partFuns.length > 0)
- awaitWith(partFuns)
-
- var results: List[Option[Any]] = Nil
- val size = resultsMap.size
- for (i <- 0 until size) {
- results = resultsMap(size - i - 1) :: results
- }
-
- // cancel scheduled timer task
- timerTask.cancel()
-
- results
- }
-
-}
diff --git a/src/actors/scala/actors/IScheduler.scala b/src/actors/scala/actors/IScheduler.scala
deleted file mode 100644
index 9d61d48561..0000000000
--- a/src/actors/scala/actors/IScheduler.scala
+++ /dev/null
@@ -1,70 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-/**
- * A common interface for all schedulers used to execute actor tasks.
- *
- * Subclasses of `Actor` that override its `scheduler` member must provide
- * an `IScheduler` implementation.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait IScheduler {
-
- /** Submits a closure for execution.
- *
- * @param fun the closure to be executed
- */
- def execute(fun: => Unit): Unit
-
- /** Submits a `Runnable` for execution.
- *
- * @param task the task to be executed
- */
- def execute(task: Runnable): Unit
-
- def executeFromActor(task: Runnable): Unit =
- execute(task)
-
- /** Shuts down the scheduler. */
- def shutdown(): Unit
-
- /** When the scheduler is active, it can execute tasks.
- *
- * @return `'''true'''`, if the scheduler is active, otherwise false.
- */
- def isActive: Boolean
-
- /** Registers a newly created actor with this scheduler.
- *
- * @param a the actor to be registered
- */
- def newActor(a: TrackedReactor): Unit
-
- /** Unregisters an actor from this scheduler, because it
- * has terminated.
- *
- * @param a the actor to be registered
- */
- def terminated(a: TrackedReactor): Unit
-
- /** Registers a closure to be executed when the specified
- * actor terminates.
- *
- * @param a the actor
- * @param f the closure to be registered
- */
- def onTerminate(a: TrackedReactor)(f: => Unit): Unit
-
- def managedBlock(blocker: scala.concurrent.ManagedBlocker): Unit
-
-}
diff --git a/src/actors/scala/actors/InputChannel.scala b/src/actors/scala/actors/InputChannel.scala
deleted file mode 100644
index d2dd6d24df..0000000000
--- a/src/actors/scala/actors/InputChannel.scala
+++ /dev/null
@@ -1,66 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-/**
- * A common interface for all channels from which values can be received.
- *
- * @author Philipp Haller
- *
- * @define channel `InputChannel`
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait InputChannel[+Msg] {
-
- /**
- * Receives a message from this $channel.
- *
- * @param f a partial function with message patterns and actions
- * @return result of processing the received value
- */
- def receive[R](f: PartialFunction[Msg, R]): R
-
- /**
- * Receives a message from this $channel within
- * a certain time span.
- *
- * @param msec the time span before timeout
- * @param f a partial function with message patterns and actions
- * @return result of processing the received value
- */
- def receiveWithin[R](msec: Long)(f: PartialFunction[Any, R]): R
-
- /**
- * Receives a message from this $channel.
- *
- * This method never returns. Therefore, the rest of the computation
- * has to be contained in the actions of the partial function.
- *
- * @param f a partial function with message patterns and actions
- */
- def react(f: PartialFunction[Msg, Unit]): Nothing
-
- /**
- * Receives a message from this $channel within
- * a certain time span.
- *
- * This method never returns. Therefore, the rest of the computation
- * has to be contained in the actions of the partial function.
- *
- * @param msec the time span before timeout
- * @param f a partial function with message patterns and actions
- */
- def reactWithin(msec: Long)(f: PartialFunction[Any, Unit]): Nothing
-
- /**
- * Receives the next message from this $channel.
- */
- def ? : Msg
-}
diff --git a/src/actors/scala/actors/InternalActor.scala b/src/actors/scala/actors/InternalActor.scala
deleted file mode 100644
index 5045ea56e8..0000000000
--- a/src/actors/scala/actors/InternalActor.scala
+++ /dev/null
@@ -1,546 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-package scala.actors
-import java.util.TimerTask
-import scala.util.control.ControlThrowable
-
-private[actors] object InternalActor {
- private[actors] trait Body[a] {
- def andThen[b](other: => b): Unit
- }
-}
-
-private[actors] trait InternalActor extends AbstractActor with InternalReplyReactor with ActorCanReply with InputChannel[Any] with Serializable {
-
- /* The following two fields are only used when the actor
- * suspends by blocking its underlying thread, for example,
- * when waiting in a receive or synchronous send.
- */
- @volatile
- private[actors] var isSuspended = false
-
- /* This field is used to communicate the received message from
- * the invocation of send to the place where the thread of
- * the receiving actor resumes inside receive/receiveWithin.
- */
- @volatile
- private var received: Option[Any] = None
-
- protected[actors] override def scheduler: IScheduler = Scheduler
-
- private[actors] override def startSearch(msg: Any, replyTo: OutputChannel[Any], handler: PartialFunction[Any, Any]) =
- if (isSuspended) {
- () =>
- synchronized {
- mailbox.append(msg, replyTo)
- resumeActor()
- }
- } else super.startSearch(msg, replyTo, handler)
-
- // we override this method to check `shouldExit` before suspending
- private[actors] override def searchMailbox(startMbox: MQueue[Any],
- handler: PartialFunction[Any, Any],
- resumeOnSameThread: Boolean) {
- var tmpMbox = startMbox
- var done = false
- while (!done) {
- val qel = tmpMbox.extractFirst((msg: Any, replyTo: OutputChannel[Any]) => {
- senders = List(replyTo)
- handler.isDefinedAt(msg)
- })
- if (tmpMbox ne mailbox)
- tmpMbox.foreach((m, s) => mailbox.append(m, s))
- if (null eq qel) {
- synchronized {
- // in mean time new stuff might have arrived
- if (!sendBuffer.isEmpty) {
- tmpMbox = new MQueue[Any]("Temp")
- drainSendBuffer(tmpMbox)
- // keep going
- } else {
- // very important to check for `shouldExit` at this point
- // since linked actors might have set it after we checked
- // last time (e.g., at the beginning of `react`)
- if (shouldExit) exit()
- waitingFor = handler
- // see Reactor.searchMailbox
- throw Actor.suspendException
- }
- }
- } else {
- resumeReceiver((qel.msg, qel.session), handler, resumeOnSameThread)
- done = true
- }
- }
- }
-
- private[actors] override def makeReaction(fun: () => Unit, handler: PartialFunction[Any, Any], msg: Any): Runnable =
- new ActorTask(this, fun, handler, msg)
-
- /** See the companion object's `receive` method. */
- def receive[R](f: PartialFunction[Any, R]): R = {
- assert(Actor.self(scheduler) == this, "receive from channel belonging to other actor")
-
- synchronized {
- if (shouldExit) exit() // links
- drainSendBuffer(mailbox)
- }
-
- var done = false
- while (!done) {
- val qel = mailbox.extractFirst((m: Any, replyTo: OutputChannel[Any]) => {
- senders = replyTo :: senders
- val matches = f.isDefinedAt(m)
- senders = senders.tail
- matches
- })
- if (null eq qel) {
- synchronized {
- // in mean time new stuff might have arrived
- if (!sendBuffer.isEmpty) {
- drainSendBuffer(mailbox)
- // keep going
- } else {
- waitingFor = f
- isSuspended = true
- scheduler.managedBlock(blocker)
- drainSendBuffer(mailbox)
- // keep going
- }
- }
- } else {
- received = Some(qel.msg)
- senders = qel.session :: senders
- done = true
- }
- }
-
- val result = f(received.get)
- received = None
- senders = senders.tail
- result
- }
-
- /** See the companion object's `receiveWithin` method. */
- def receiveWithin[R](msec: Long)(f: PartialFunction[Any, R]): R = {
- assert(Actor.self(scheduler) == this, "receive from channel belonging to other actor")
-
- synchronized {
- if (shouldExit) exit() // links
- drainSendBuffer(mailbox)
- }
-
- // first, remove spurious TIMEOUT message from mailbox if any
- mailbox.extractFirst((m: Any, replyTo: OutputChannel[Any]) => m == TIMEOUT)
-
- val receiveTimeout = () => {
- if (f.isDefinedAt(TIMEOUT)) {
- received = Some(TIMEOUT)
- senders = this :: senders
- } else
- sys.error("unhandled timeout")
- }
-
- var done = false
- while (!done) {
- val qel = mailbox.extractFirst((m: Any, replyTo: OutputChannel[Any]) => {
- senders = replyTo :: senders
- val matches = f.isDefinedAt(m)
- senders = senders.tail
- matches
- })
- if (null eq qel) {
- val todo = synchronized {
- // in mean time new stuff might have arrived
- if (!sendBuffer.isEmpty) {
- drainSendBuffer(mailbox)
- // keep going
- () => {}
- } else if (msec == 0L) {
- done = true
- receiveTimeout
- } else {
- if (onTimeout.isEmpty) {
- if (!f.isDefinedAt(TIMEOUT))
- sys.error("unhandled timeout")
-
- val thisActor = this
- onTimeout = Some(new TimerTask {
- def run() {
- thisActor.send(TIMEOUT, thisActor)
- }
- })
- Actor.timer.schedule(onTimeout.get, msec)
- }
-
- // It is possible that !onTimeout.isEmpty, but TIMEOUT is not yet in mailbox
- // See SI-4759
- waitingFor = f
- received = None
- isSuspended = true
- scheduler.managedBlock(blocker)
- drainSendBuffer(mailbox)
- // keep going
- () => {}
- }
- }
- todo()
- } else {
- synchronized {
- if (!onTimeout.isEmpty) {
- onTimeout.get.cancel()
- onTimeout = None
- }
- }
- received = Some(qel.msg)
- senders = qel.session :: senders
- done = true
- }
- }
-
- val result = f(received.get)
- received = None
- senders = senders.tail
- result
- }
-
- /** See the companion object's `react` method. */
- override def react(handler: PartialFunction[Any, Unit]): Nothing = {
- synchronized {
- if (shouldExit) exit()
- }
- super.react(handler)
- }
-
- /** See the companion object's `reactWithin` method. */
- override def reactWithin(msec: Long)(handler: PartialFunction[Any, Unit]): Nothing = {
- synchronized {
- if (shouldExit) exit()
- }
- super.reactWithin(msec)(handler)
- }
-
- /** Receives the next message from the mailbox */
- def ? : Any = receive {
- case x => x
- }
-
- // guarded by lock of this
- // never throws SuspendActorControl
- private[actors] override def scheduleActor(f: PartialFunction[Any, Any], msg: Any) =
- if (f eq null) {
- // do nothing (timeout is handled instead)
- } else {
- val task = new ActorTask(this, null, f, msg)
- scheduler executeFromActor task
- }
-
- /* Used for notifying scheduler when blocking inside receive/receiveWithin. */
- private object blocker extends scala.concurrent.ManagedBlocker {
- def block() = {
- InternalActor.this.suspendActor()
- true
- }
- def isReleasable =
- !InternalActor.this.isSuspended
- }
-
- private def suspendActor() = synchronized {
- while (isSuspended) {
- try {
- wait()
- } catch {
- case _: InterruptedException =>
- }
- }
- // links: check if we should exit
- if (shouldExit) exit()
- }
-
- private def resumeActor() {
- isSuspended = false
- notify()
- }
-
- private[actors] override def exiting = synchronized {
- _state == Actor.State.Terminated
- }
-
- // guarded by this
- private[actors] override def dostart() {
- // Reset various flags.
- //
- // Note that we do *not* reset `trapExit`. The reason is that
- // users should be able to set the field in the constructor
- // and before `act` is called.
- exitReason = 'normal
- shouldExit = false
-
- super.dostart()
- }
-
- override def start(): InternalActor = synchronized {
- super.start()
- this
- }
-
- /** State of this actor */
- override def getState: Actor.State.Value = synchronized {
- if (isSuspended) {
- if (onTimeout.isEmpty)
- Actor.State.Blocked
- else
- Actor.State.TimedBlocked
- } else
- super.getState
- }
-
- // guarded by this
- private[actors] var links: List[AbstractActor] = Nil
-
- /**
- * Links <code>self</code> to actor <code>to</code>.
- *
- * @param to the actor to link to
- * @return the parameter actor
- */
- def link(to: AbstractActor): AbstractActor = {
- assert(Actor.self(scheduler) == this, "link called on actor different from self")
- this linkTo to
- to linkTo this
- to
- }
-
- /**
- * Links <code>self</code> to actor <code>to</code>.
- *
- * @param to the actor to link to
- * @return the parameter actor
- */
- def link(to: ActorRef): ActorRef = {
- this.link(to.localActor)
- to
- }
-
- /**
- * Unidirectional linking. For migration purposes only
- */
- private[actors] def watch(subject: ActorRef): ActorRef = {
- assert(Actor.self(scheduler) == this, "link called on actor different from self")
- subject.localActor linkTo this
- subject
- }
-
- /**
- * Unidirectional linking. For migration purposes only
- */
- private[actors] def unwatch(subject: ActorRef): ActorRef = {
- assert(Actor.self(scheduler) == this, "link called on actor different from self")
- subject.localActor unlinkFrom this
- subject
- }
-
- /**
- * Links <code>self</code> to the actor defined by <code>body</code>.
- *
- * @param body the body of the actor to link to
- * @return the parameter actor
- */
- def link(body: => Unit): Actor = {
- assert(Actor.self(scheduler) == this, "link called on actor different from self")
- val a = new Actor {
- def act() = body
- override final val scheduler: IScheduler = InternalActor.this.scheduler
- }
- link(a)
- a.start()
- a
- }
-
- private[actors] def linkTo(to: AbstractActor) = synchronized {
- links = to :: links
- }
-
- /**
- * Unlinks <code>self</code> from actor <code>from</code>.
- */
- def unlink(from: AbstractActor) {
- assert(Actor.self(scheduler) == this, "unlink called on actor different from self")
- this unlinkFrom from
- from unlinkFrom this
- }
-
- /**
- * Unlinks <code>self</code> from actor <code>from</code>.
- */
- def unlink(from: ActorRef) {
- unlink(from.localActor)
- }
-
- private[actors] def unlinkFrom(from: AbstractActor) = synchronized {
- links = links.filterNot(from.==)
- }
-
- @volatile
- private[actors] var _trapExit = false
-
- def trapExit = _trapExit
-
- def trapExit_=(value: Boolean) = _trapExit = value
-
- // guarded by this
- private var exitReason: AnyRef = 'normal
- // guarded by this
- private[actors] var shouldExit = false
-
- /**
- * <p>
- * Terminates execution of <code>self</code> with the following
- * effect on linked actors:
- * </p>
- * <p>
- * For each linked actor <code>a</code> with
- * <code>trapExit</code> set to <code>true</code>, send message
- * <code>Exit(self, reason)</code> to <code>a</code>.
- * </p>
- * <p>
- * For each linked actor <code>a</code> with
- * <code>trapExit</code> set to <code>false</code> (default),
- * call <code>a.exit(reason)</code> if
- * <code>reason != 'normal</code>.
- * </p>
- */
- protected[actors] def exit(reason: AnyRef): Nothing = {
- synchronized {
- exitReason = reason
- }
- exit()
- }
-
- /**
- * Terminates with exit reason <code>'normal</code>.
- */
- protected[actors] override def exit(): Nothing = {
- val todo = synchronized {
- if (!links.isEmpty)
- exitLinked()
- else
- () => {}
- }
- todo()
- super.exit()
- }
-
- // Assume !links.isEmpty
- // guarded by this
- private[actors] def exitLinked(): () => Unit = {
- _state = Actor.State.Terminated
- // reset waitingFor, otherwise getState returns Suspended
- waitingFor = Reactor.waitingForNone
- // remove this from links
- val mylinks = links.filterNot(this.==)
- // unlink actors
- mylinks.foreach(unlinkFrom(_))
- // return closure that locks linked actors
- () => {
- mylinks.foreach((linked: AbstractActor) => {
- linked.synchronized {
- if (!linked.exiting) {
- linked.unlinkFrom(this)
- linked.exit(this, exitReason)
- }
- }
- })
- }
- }
-
- // Assume !links.isEmpty
- // guarded by this
- private[actors] def exitLinked(reason: AnyRef): () => Unit = {
- exitReason = reason
- exitLinked()
- }
-
- // Assume !this.exiting
- private[actors] def exit(from: AbstractActor, reason: AnyRef) {
- if (trapExit) {
- this ! Exit(from, reason)
- } else if (reason != 'normal)
- stop(reason)
- }
-
- /* Requires qualified private, because <code>RemoteActor</code> must
- * register a termination handler.
- */
- private[actors] def onTerminate(f: => Unit) {
- scheduler.onTerminate(this) { f }
- }
-
-
- private[actors] def stop(reason: AnyRef): Unit = {
- synchronized {
- shouldExit = true
- exitReason = reason
- // resume this Actor in a way that
- // causes it to exit
- // (because shouldExit == true)
- if (isSuspended)
- resumeActor()
- else if (waitingFor ne Reactor.waitingForNone) {
- waitingFor = Reactor.waitingForNone
- // it doesn't matter what partial function we are passing here
- val task = new ActorTask(this, null, waitingFor, null)
- scheduler execute task
- /* Here we should not throw a SuspendActorControl,
- since the current method is called from an actor that
- is in the process of exiting.
-
- Therefore, the contract for scheduleActor is that
- it never throws a SuspendActorControl.
- */
- }
- }
- }
-}
-
-/**
- * Used as the timeout pattern in
- * <a href="Actor.html#receiveWithin(Long)" target="contentFrame">
- * <code>receiveWithin</code></a> and
- * <a href="Actor.html#reactWithin(Long)" target="contentFrame">
- * <code>reactWithin</code></a>.
- *
- * @example {{{
- * receiveWithin(500) {
- * case (x, y) => ...
- * case TIMEOUT => ...
- * }
- * }}}
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-case object TIMEOUT
-
-/**
- * Sent to an actor
- * with `trapExit` set to `true` whenever one of its linked actors
- * terminates.
- *
- * @param from the actor that terminated
- * @param reason the reason that caused the actor to terminate
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-case class Exit(from: AbstractActor, reason: AnyRef)
-
-/**
- * Manages control flow of actor executions.
- *
- * @author Philipp Haller
- */
-private[actors] class SuspendActorControl extends ControlThrowable
diff --git a/src/actors/scala/actors/InternalReplyReactor.scala b/src/actors/scala/actors/InternalReplyReactor.scala
deleted file mode 100644
index c744984fd8..0000000000
--- a/src/actors/scala/actors/InternalReplyReactor.scala
+++ /dev/null
@@ -1,162 +0,0 @@
-package scala.actors
-
-import java.util.{TimerTask}
-
-/**
- * Extends the [[scala.actors.Reactor]]
- * trait with methods to reply to the sender of a message.
- * Sending a message to a <code>ReplyReactor</code> implicitly
- * passes a reference to the sender together with the message.
- *
- * @author Philipp Haller
- *
- * @define actor `ReplyReactor`
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait InternalReplyReactor extends Reactor[Any] with ReactorCanReply {
-
- /* A list of the current senders. The head of the list is
- * the sender of the message that was received last.
- */
- @volatile
- private[actors] var senders: List[OutputChannel[Any]] = List()
-
- /* This option holds a TimerTask when the actor waits in a
- * reactWithin. The TimerTask is cancelled when the actor
- * resumes.
- *
- * guarded by this
- */
- private[actors] var onTimeout: Option[TimerTask] = None
-
- /**
- * Returns the $actor which sent the last received message.
- */
- protected[actors] def internalSender: OutputChannel[Any] = senders.head
-
- /**
- * Replies with <code>msg</code> to the sender.
- */
- protected[actors] def reply(msg: Any) {
- internalSender ! msg
- }
-
- override def !(msg: Any) {
- send(msg, Actor.rawSelf(scheduler))
- }
-
- override def forward(msg: Any) {
- send(msg, Actor.sender)
- }
-
- private[actors] override def resumeReceiver(item: (Any, OutputChannel[Any]), handler: PartialFunction[Any, Any], onSameThread: Boolean) {
- synchronized {
- if (!onTimeout.isEmpty) {
- onTimeout.get.cancel()
- onTimeout = None
- }
- }
- senders = List(item._2)
- super.resumeReceiver(item, handler, onSameThread)
- }
-
- private[actors] override def searchMailbox(startMbox: MQueue[Any],
- handler: PartialFunction[Any, Any],
- resumeOnSameThread: Boolean) {
- var tmpMbox = startMbox
- var done = false
- while (!done) {
- val qel = tmpMbox.extractFirst((msg: Any, replyTo: OutputChannel[Any]) => {
- senders = List(replyTo)
- handler.isDefinedAt(msg)
- })
- if (tmpMbox ne mailbox)
- tmpMbox.foreach((m, s) => mailbox.append(m, s))
- if (null eq qel) {
- synchronized {
- // in mean time new stuff might have arrived
- if (!sendBuffer.isEmpty) {
- tmpMbox = new MQueue[Any]("Temp")
- drainSendBuffer(tmpMbox)
- // keep going
- } else {
- waitingFor = handler
- // see Reactor.searchMailbox
- throw Actor.suspendException
- }
- }
- } else {
- resumeReceiver((qel.msg, qel.session), handler, resumeOnSameThread)
- done = true
- }
- }
- }
-
- private[actors] override def makeReaction(fun: () => Unit, handler: PartialFunction[Any, Any], msg: Any): Runnable =
- new ReplyReactorTask(this, fun, handler, msg)
-
- protected[actors] override def react(handler: PartialFunction[Any, Unit]): Nothing = {
- assert(Actor.rawSelf(scheduler) == this, "react on channel belonging to other actor")
- super.react(handler)
- }
-
-
- /**
- * Receives a message from this $actor's mailbox within a certain
- * time span.
- *
- * This method never returns. Therefore, the rest of the computation
- * has to be contained in the actions of the partial function.
- *
- * @param msec the time span before timeout
- * @param handler a partial function with message patterns and actions
- */
- protected[actors] def reactWithin(msec: Long)(handler: PartialFunction[Any, Unit]): Nothing = {
- assert(Actor.rawSelf(scheduler) == this, "react on channel belonging to other actor")
-
- synchronized { drainSendBuffer(mailbox) }
-
- // first, remove spurious TIMEOUT message from mailbox if any
- mailbox.extractFirst((m: Any, replyTo: OutputChannel[Any]) => m == TIMEOUT)
-
- while (true) {
- val qel = mailbox.extractFirst((m: Any, replyTo: OutputChannel[Any]) => {
- senders = List(replyTo)
- handler isDefinedAt m
- })
- if (null eq qel) {
- synchronized {
- // in mean time new messages might have arrived
- if (!sendBuffer.isEmpty) {
- drainSendBuffer(mailbox)
- // keep going
- } else if (msec == 0L) {
- // throws Actor.suspendException
- resumeReceiver((TIMEOUT, this), handler, false)
- } else {
- waitingFor = handler
- val thisActor = this
- onTimeout = Some(new TimerTask {
- def run() { thisActor.send(TIMEOUT, thisActor) }
- })
- Actor.timer.schedule(onTimeout.get, msec)
- throw Actor.suspendException
- }
- }
- } else
- resumeReceiver((qel.msg, qel.session), handler, false)
- }
- throw Actor.suspendException
- }
-
- override def getState: Actor.State.Value = synchronized {
- if (waitingFor ne Reactor.waitingForNone) {
- if (onTimeout.isEmpty)
- Actor.State.Suspended
- else
- Actor.State.TimedSuspended
- } else
- _state
- }
-
-}
diff --git a/src/actors/scala/actors/KillActorControl.scala b/src/actors/scala/actors/KillActorControl.scala
deleted file mode 100644
index 0f94bbc8dc..0000000000
--- a/src/actors/scala/actors/KillActorControl.scala
+++ /dev/null
@@ -1,14 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-
-import scala.util.control.ControlThrowable
-import java.lang.{InterruptedException, Runnable}
-
-private[actors] class KillActorControl extends ControlThrowable
diff --git a/src/actors/scala/actors/LinkedNode.java b/src/actors/scala/actors/LinkedNode.java
deleted file mode 100644
index bf8ca02a74..0000000000
--- a/src/actors/scala/actors/LinkedNode.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- File: LinkedNode.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 11Jun1998 dl Create public version
- 25may2000 dl Change class access to public
- 26nov2001 dl Added no-arg constructor, all public access.
-*/
-
-package scala.actors;
-
-/** A standard linked list node used in various queue classes **/
-public class LinkedNode {
- public Object value;
- public LinkedNode next;
- public LinkedNode() {}
- public LinkedNode(Object x) { value = x; }
- public LinkedNode(Object x, LinkedNode n) { value = x; next = n; }
-}
diff --git a/src/actors/scala/actors/LinkedQueue.java b/src/actors/scala/actors/LinkedQueue.java
deleted file mode 100644
index 3f7b93c386..0000000000
--- a/src/actors/scala/actors/LinkedQueue.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- File: LinkedQueue.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 11Jun1998 dl Create public version
- 25aug1998 dl added peek
- 10dec1998 dl added isEmpty
- 10oct1999 dl lock on node object to ensure visibility
-*/
-
-package scala.actors;
-
-/**
- * A linked list based channel implementation.
- * The algorithm avoids contention between puts
- * and takes when the queue is not empty.
- * Normally a put and a take can proceed simultaneously.
- * (Although it does not allow multiple concurrent puts or takes.)
- * This class tends to perform more efficiently than
- * other Channel implementations in producer/consumer
- * applications.
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-
-public class LinkedQueue {
-
-
- /**
- * Dummy header node of list. The first actual node, if it exists, is always
- * at head_.next. After each take, the old first node becomes the head.
- **/
- protected LinkedNode head_;
-
- /**
- * Helper monitor for managing access to last node.
- **/
- protected final Object putLock_ = new Object();
-
- /**
- * The last node of list. Put() appends to list, so modifies last_
- **/
- protected LinkedNode last_;
-
- /**
- * The number of threads waiting for a take.
- * Notifications are provided in put only if greater than zero.
- * The bookkeeping is worth it here since in reasonably balanced
- * usages, the notifications will hardly ever be necessary, so
- * the call overhead to notify can be eliminated.
- **/
- protected int waitingForTake_ = 0;
-
- public LinkedQueue() {
- head_ = new LinkedNode(null);
- last_ = head_;
- }
-
- /** Main mechanics for put/offer **/
- protected void insert(Object x) {
- synchronized(putLock_) {
- LinkedNode p = new LinkedNode(x);
- synchronized(last_) {
- last_.next = p;
- last_ = p;
- }
- if (waitingForTake_ > 0)
- putLock_.notify();
- }
- }
-
- /** Main mechanics for take/poll **/
- protected synchronized Object extract() {
- synchronized(head_) {
- Object x = null;
- LinkedNode first = head_.next;
- if (first != null) {
- x = first.value;
- first.value = null;
- head_ = first;
- }
- return x;
- }
- }
-
-
- public void put(Object x) throws InterruptedException {
- if (x == null) throw new IllegalArgumentException();
- if (Thread.interrupted()) throw new InterruptedException();
- insert(x);
- }
-
- public boolean offer(Object x, long msecs) throws InterruptedException {
- if (x == null) throw new IllegalArgumentException();
- if (Thread.interrupted()) throw new InterruptedException();
- insert(x);
- return true;
- }
-
- public Object take() throws InterruptedException {
- if (Thread.interrupted()) throw new InterruptedException();
- // try to extract. If fail, then enter wait-based retry loop
- Object x = extract();
- if (x != null)
- return x;
- else {
- synchronized(putLock_) {
- try {
- ++waitingForTake_;
- for (;;) {
- x = extract();
- if (x != null) {
- --waitingForTake_;
- return x;
- }
- else {
- putLock_.wait();
- }
- }
- }
- catch(InterruptedException ex) {
- --waitingForTake_;
- putLock_.notify();
- throw ex;
- }
- }
- }
- }
-
- public Object peek() {
- synchronized(head_) {
- LinkedNode first = head_.next;
- if (first != null)
- return first.value;
- else
- return null;
- }
- }
-
-
- public boolean isEmpty() {
- synchronized(head_) {
- return head_.next == null;
- }
- }
-
- public Object poll(long msecs) throws InterruptedException {
- if (Thread.interrupted()) throw new InterruptedException();
- Object x = extract();
- if (x != null)
- return x;
- else {
- synchronized(putLock_) {
- try {
- long waitTime = msecs;
- long start = (msecs <= 0)? 0 : System.currentTimeMillis();
- ++waitingForTake_;
- for (;;) {
- x = extract();
- if (x != null || waitTime <= 0) {
- --waitingForTake_;
- return x;
- }
- else {
- putLock_.wait(waitTime);
- waitTime = msecs - (System.currentTimeMillis() - start);
- }
- }
- }
- catch(InterruptedException ex) {
- --waitingForTake_;
- putLock_.notify();
- throw ex;
- }
- }
- }
- }
-}
-
-
diff --git a/src/actors/scala/actors/MQueue.scala b/src/actors/scala/actors/MQueue.scala
deleted file mode 100644
index d766ecc6e8..0000000000
--- a/src/actors/scala/actors/MQueue.scala
+++ /dev/null
@@ -1,250 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-
-private[actors] class MQueueElement[Msg >: Null](val msg: Msg, val session: OutputChannel[Any], var next: MQueueElement[Msg]) {
- def this() = this(null, null, null)
- def this(msg: Msg, session: OutputChannel[Any]) = this(msg, session, null)
-}
-
-private[actors] class MQueue[Msg >: Null](protected val label: String) {
- protected var first: MQueueElement[Msg] = null
- protected var last: MQueueElement[Msg] = null // last eq null iff list is empty
- private var _size = 0
-
- def size = _size
- final def isEmpty = last eq null
-
- protected def changeSize(diff: Int) {
- _size += diff
- }
-
- def prepend(other: MQueue[Msg]) {
- if (!other.isEmpty) {
- other.last.next = first
- first = other.first
- }
- }
-
- def clear() {
- first = null
- last = null
- _size = 0
- }
-
-
- def append(msg: Msg, session: OutputChannel[Any]) {
- changeSize(1) // size always increases by 1
- val el = new MQueueElement(msg, session)
-
- if (isEmpty) first = el
- else last.next = el
-
- last = el
- }
-
- def append(el: MQueueElement[Msg]) {
- changeSize(1) // size always increases by 1
-
- if (isEmpty) first = el
- else last.next = el
-
- last = el
- }
-
- def foreach(f: (Msg, OutputChannel[Any]) => Unit) {
- var curr = first
- while (curr != null) {
- f(curr.msg, curr.session)
- curr = curr.next
- }
- }
-
- def foreachAppend(target: MQueue[Msg]) {
- var curr = first
- while (curr != null) {
- target.append(curr)
- curr = curr.next
- }
- }
-
- def foreachDequeue(target: MQueue[Msg]) {
- var curr = first
- while (curr != null) {
- target.append(curr)
- curr = curr.next
- }
- first = null
- last = null
- _size = 0
- }
-
- def foldLeft[B](z: B)(f: (B, Msg) => B): B = {
- var acc = z
- var curr = first
- while (curr != null) {
- acc = f(acc, curr.msg)
- curr = curr.next
- }
- acc
- }
-
- /** Returns the n-th message that satisfies the predicate `p`
- * without removing it.
- */
- def get(n: Int)(p: Msg => Boolean): Option[Msg] = {
- var pos = 0
-
- def test(msg: Msg): Boolean =
- p(msg) && (pos == n || { pos += 1; false })
-
- var curr = first
- while (curr != null)
- if (test(curr.msg)) return Some(curr.msg) // early return
- else curr = curr.next
-
- None
- }
-
- /** Removes the n-th message that satisfies the predicate <code>p</code>.
- */
- def remove(n: Int)(p: (Msg, OutputChannel[Any]) => Boolean): Option[(Msg, OutputChannel[Any])] =
- removeInternal(n)(p) map (x => (x.msg, x.session))
-
- /** Extracts the first message that satisfies the predicate `p`
- * or `'''null'''` if `p` fails for all of them.
- */
- def extractFirst(p: (Msg, OutputChannel[Any]) => Boolean): MQueueElement[Msg] =
- removeInternal(0)(p).orNull
-
- def extractFirst(pf: PartialFunction[Msg, Any]): MQueueElement[Msg] = {
- if (isEmpty) // early return
- return null
-
- // special handling if returning the head
- if (pf.isDefinedAt(first.msg)) {
- val res = first
- first = first.next
- if (res eq last)
- last = null
-
- changeSize(-1)
- res
- }
- else {
- var curr = first.next // init to element #2
- var prev = first
-
- while (curr != null) {
- if (pf.isDefinedAt(curr.msg)) {
- prev.next = curr.next
- if (curr eq last)
- last = prev
-
- changeSize(-1)
- return curr // early return
- }
- else {
- prev = curr
- curr = curr.next
- }
- }
- // not found
- null
- }
- }
-
- private def removeInternal(n: Int)(p: (Msg, OutputChannel[Any]) => Boolean): Option[MQueueElement[Msg]] = {
- var pos = 0
-
- def foundMsg(x: MQueueElement[Msg]) = {
- changeSize(-1)
- Some(x)
- }
- def test(msg: Msg, session: OutputChannel[Any]): Boolean =
- p(msg, session) && (pos == n || { pos += 1 ; false })
-
- if (isEmpty) // early return
- return None
-
- // special handling if returning the head
- if (test(first.msg, first.session)) {
- val res = first
- first = first.next
- if (res eq last)
- last = null
-
- foundMsg(res)
- }
- else {
- var curr = first.next // init to element #2
- var prev = first
-
- while (curr != null) {
- if (test(curr.msg, curr.session)) {
- prev.next = curr.next
- if (curr eq last)
- last = prev
-
- return foundMsg(curr) // early return
- }
- else {
- prev = curr
- curr = curr.next
- }
- }
- // not found
- None
- }
- }
-}
-
-/** Debugging trait.
- */
-private[actors] trait MessageQueueTracer extends MQueue[Any]
-{
- private val queueNumber = MessageQueueTracer.getQueueNumber
-
- override def append(msg: Any, session: OutputChannel[Any]) {
- super.append(msg, session)
- printQueue("APPEND %s" format msg)
- }
- override def get(n: Int)(p: Any => Boolean): Option[Any] = {
- val res = super.get(n)(p)
- printQueue("GET %s" format res)
- res
- }
- override def remove(n: Int)(p: (Any, OutputChannel[Any]) => Boolean): Option[(Any, OutputChannel[Any])] = {
- val res = super.remove(n)(p)
- printQueue("REMOVE %s" format res)
- res
- }
- override def extractFirst(p: (Any, OutputChannel[Any]) => Boolean): MQueueElement[Any] = {
- val res = super.extractFirst(p)
- printQueue("EXTRACT_FIRST %s" format res)
- res
- }
-
- private def printQueue(msg: String) = {
- def firstMsg = if (first eq null) "null" else first.msg
- def lastMsg = if (last eq null) "null" else last.msg
-
- println("[%s size=%d] [%s] first = %s, last = %s".format(this, size, msg, firstMsg, lastMsg))
- }
- override def toString() = "%s:%d".format(label, queueNumber)
-}
-
-private[actors] object MessageQueueTracer {
- // for tracing purposes
- private var queueNumberAssigner = 0
- private def getQueueNumber = synchronized {
- queueNumberAssigner += 1
- queueNumberAssigner
- }
-}
diff --git a/src/actors/scala/actors/OutputChannel.scala b/src/actors/scala/actors/OutputChannel.scala
deleted file mode 100644
index f0f475e123..0000000000
--- a/src/actors/scala/actors/OutputChannel.scala
+++ /dev/null
@@ -1,48 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-
-/**
- * A common interface for all channels to which values can be sent.
- *
- * @author Philipp Haller
- *
- * @define actor `OutputChannel`
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait OutputChannel[-Msg] {
-
- /**
- * Sends `msg` to this $actor (asynchronous).
- *
- * @param msg the message to send
- */
- def !(msg: Msg): Unit
-
- /**
- * Sends `msg` to this $actor (asynchronous) supplying
- * explicit reply destination.
- *
- * @param msg the message to send
- * @param replyTo the reply destination
- */
- def send(msg: Msg, replyTo: OutputChannel[Any]): Unit
-
- /**
- * Forwards `msg` to this $actor (asynchronous).
- *
- * @param msg the message to forward
- */
- def forward(msg: Msg): Unit
-
- /**
- * Returns the `Actor` that is receiving from this $actor.
- */
- def receiver: InternalActor
-}
diff --git a/src/actors/scala/actors/ReactChannel.scala b/src/actors/scala/actors/ReactChannel.scala
deleted file mode 100644
index 7e34681fb6..0000000000
--- a/src/actors/scala/actors/ReactChannel.scala
+++ /dev/null
@@ -1,121 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-/**
- * @author Philipp Haller
- */
-private[actors] class ReactChannel[Msg](receiver: InternalReplyReactor) extends InputChannel[Msg] {
-
- private case class SendToReactor(channel: ReactChannel[Msg], msg: Msg)
-
- /**
- * Sends a message to this <code>ReactChannel</code>.
- *
- * @param msg the message to be sent
- */
- def !(msg: Msg) {
- receiver ! SendToReactor(this, msg)
- }
-
- /**
- * Sends a message to this `ReactChannel` (asynchronous) supplying
- * explicit reply destination.
- *
- * @param msg the message to send
- * @param replyTo the reply destination
- */
- def send(msg: Msg, replyTo: OutputChannel[Any]) {
- receiver.send(SendToReactor(this, msg), replyTo)
- }
-
- /**
- * Forwards `msg` to `'''this'''` keeping the last sender as sender
- * instead of `self`.
- */
- def forward(msg: Msg) {
- receiver forward SendToReactor(this, msg)
- }
-
- /**
- * Receives a message from this `ReactChannel`.
- *
- * This method ''never'' returns. Therefore, the rest of the computation
- * has to be contained in the actions of the partial function.
- *
- * @param f a partial function with message patterns and actions
- */
- def react(f: PartialFunction[Msg, Unit]): Nothing = {
- val C = this
- receiver.react {
- case SendToReactor(C, msg) if (f.isDefinedAt(msg.asInstanceOf[Msg])) =>
- f(msg.asInstanceOf[Msg])
- }
- }
-
- /**
- * Receives a message from this `ReactChannel` within a certain time span.
- *
- * This method ''never'' returns. Therefore, the rest of the computation
- * has to be contained in the actions of the partial function.
- *
- * @param msec the time span before timeout
- * @param f a partial function with message patterns and actions
- */
- def reactWithin(msec: Long)(f: PartialFunction[Any, Unit]): Nothing = {
- val C = this
- val recvActor = receiver.asInstanceOf[Actor]
- recvActor.reactWithin(msec) {
- case C ! msg if (f.isDefinedAt(msg.asInstanceOf[Msg])) =>
- f(msg.asInstanceOf[Msg])
- case TIMEOUT => f(TIMEOUT)
- }
- }
-
- /**
- * Receives a message from this `ReactChannel`.
- *
- * @param f a partial function with message patterns and actions
- * @return result of processing the received value
- */
- def receive[R](f: PartialFunction[Msg, R]): R = {
- val C = this
- val recvActor = receiver.asInstanceOf[Actor]
- recvActor.receive {
- case C ! msg if (f.isDefinedAt(msg.asInstanceOf[Msg])) =>
- f(msg.asInstanceOf[Msg])
- }
- }
-
- /**
- * Receives a message from this `ReactChannel` within a certain time span.
- *
- * @param msec the time span before timeout
- * @param f a partial function with message patterns and actions
- * @return result of processing the received value
- */
- def receiveWithin[R](msec: Long)(f: PartialFunction[Any, R]): R = {
- val C = this
- val recvActor = receiver.asInstanceOf[Actor]
- recvActor.receiveWithin(msec) {
- case C ! msg if (f.isDefinedAt(msg.asInstanceOf[Msg])) =>
- f(msg.asInstanceOf[Msg])
- case TIMEOUT => f(TIMEOUT)
- }
- }
-
- /**
- * Receives the next message from this `ReactChannel`.
- */
- def ? : Msg = receive {
- case x => x
- }
-
-}
diff --git a/src/actors/scala/actors/Reactor.scala b/src/actors/scala/actors/Reactor.scala
deleted file mode 100644
index aa985b3a17..0000000000
--- a/src/actors/scala/actors/Reactor.scala
+++ /dev/null
@@ -1,307 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-import scala.actors.scheduler.{DelegatingScheduler, ExecutorScheduler,
- ForkJoinScheduler, ThreadPoolConfig}
-import java.util.concurrent.{ThreadPoolExecutor, TimeUnit, LinkedBlockingQueue}
-import scala.language.implicitConversions
-
-private[actors] object Reactor {
-
- val scheduler = new DelegatingScheduler {
- def makeNewScheduler: IScheduler = {
- val sched = if (!ThreadPoolConfig.useForkJoin) {
- // default is non-daemon
- val workQueue = new LinkedBlockingQueue[Runnable]
- ExecutorScheduler(
- new ThreadPoolExecutor(ThreadPoolConfig.corePoolSize,
- ThreadPoolConfig.maxPoolSize,
- 60000L,
- TimeUnit.MILLISECONDS,
- workQueue,
- new ThreadPoolExecutor.CallerRunsPolicy))
- } else {
- // default is non-daemon, non-fair
- val s = new ForkJoinScheduler(ThreadPoolConfig.corePoolSize, ThreadPoolConfig.maxPoolSize, false, false)
- s.start()
- s
- }
- Debug.info(this+": starting new "+sched+" ["+sched.getClass+"]")
- sched
- }
- }
-
- val waitingForNone: PartialFunction[Any, Unit] = new PartialFunction[Any, Unit] {
- def isDefinedAt(x: Any) = false
- def apply(x: Any) {}
- }
-}
-
-/**
- * Super trait of all actor traits.
- *
- * @author Philipp Haller
- *
- * @define actor reactor
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait Reactor[Msg >: Null] extends OutputChannel[Msg] with Combinators {
-
- /* The $actor's mailbox. */
- private[actors] val mailbox = new MQueue[Msg]("Reactor")
-
- // guarded by this
- private[actors] val sendBuffer = new MQueue[Msg]("SendBuffer")
-
- /* Whenever this $actor executes on some thread, `waitingFor` is
- * guaranteed to be equal to `Reactor.waitingForNone`.
- *
- * In other words, whenever `waitingFor` is not equal to
- * `Reactor.waitingForNone`, this $actor is guaranteed not to execute
- * on some thread.
- *
- * If the $actor waits in a `react`, `waitingFor` holds the
- * message handler that `react` was called with.
- *
- * guarded by this
- */
- private[actors] var waitingFor: PartialFunction[Msg, Any] =
- Reactor.waitingForNone
-
- // guarded by this
- private[actors] var _state: Actor.State.Value = Actor.State.New
-
- /**
- * The $actor's behavior is specified by implementing this method.
- */
- def act(): Unit
-
- /**
- * This partial function is applied to exceptions that propagate out of
- * this $actor's body.
- */
- protected[actors] def exceptionHandler: PartialFunction[Exception, Unit] =
- Map()
-
- protected[actors] def scheduler: IScheduler =
- Reactor.scheduler
-
- protected[actors] def mailboxSize: Int =
- mailbox.size
-
- def send(msg: Msg, replyTo: OutputChannel[Any]) {
- val todo = synchronized {
- if (waitingFor ne Reactor.waitingForNone) {
- val savedWaitingFor = waitingFor
- waitingFor = Reactor.waitingForNone
- startSearch(msg, replyTo, savedWaitingFor)
- } else {
- sendBuffer.append(msg, replyTo)
- () => { /* do nothing */ }
- }
- }
- todo()
- }
-
- private[actors] def startSearch(msg: Msg, replyTo: OutputChannel[Any], handler: PartialFunction[Msg, Any]) =
- () => scheduler execute makeReaction(() => {
- val startMbox = new MQueue[Msg]("Start")
- synchronized { startMbox.append(msg, replyTo) }
- searchMailbox(startMbox, handler, true)
- })
-
- private[actors] final def makeReaction(fun: () => Unit): Runnable =
- makeReaction(fun, null, null)
-
- /* This method is supposed to be overridden. */
- private[actors] def makeReaction(fun: () => Unit, handler: PartialFunction[Msg, Any], msg: Msg): Runnable =
- new ReactorTask(this, fun, handler, msg)
-
- private[actors] def resumeReceiver(item: (Msg, OutputChannel[Any]), handler: PartialFunction[Msg, Any], onSameThread: Boolean) {
- if (onSameThread)
- makeReaction(null, handler, item._1).run()
- else
- scheduleActor(handler, item._1)
-
- /* Here, we throw a SuspendActorControl to avoid
- terminating this actor when the current ReactorTask
- is finished.
-
- The SuspendActorControl skips the termination code
- in ReactorTask.
- */
- throw Actor.suspendException
- }
-
- def !(msg: Msg) {
- send(msg, null)
- }
-
- def forward(msg: Msg) {
- send(msg, null)
- }
-
- def receiver: Actor = this.asInstanceOf[Actor]
-
- // guarded by this
- private[actors] def drainSendBuffer(mbox: MQueue[Msg]) {
- sendBuffer.foreachDequeue(mbox)
- }
-
- private[actors] def searchMailbox(startMbox: MQueue[Msg],
- handler: PartialFunction[Msg, Any],
- resumeOnSameThread: Boolean) {
- var tmpMbox = startMbox
- var done = false
- while (!done) {
- val qel = tmpMbox.extractFirst(handler)
- if (tmpMbox ne mailbox)
- tmpMbox.foreachAppend(mailbox)
- if (null eq qel) {
- synchronized {
- // in mean time new stuff might have arrived
- if (!sendBuffer.isEmpty) {
- tmpMbox = new MQueue[Msg]("Temp")
- drainSendBuffer(tmpMbox)
- // keep going
- } else {
- waitingFor = handler
- /* Here, we throw a SuspendActorControl to avoid
- terminating this actor when the current ReactorTask
- is finished.
-
- The SuspendActorControl skips the termination code
- in ReactorTask.
- */
- throw Actor.suspendException
- }
- }
- } else {
- resumeReceiver((qel.msg, qel.session), handler, resumeOnSameThread)
- done = true
- }
- }
- }
-
- /**
- * Receives a message from this $actor's mailbox.
- *
- * This method never returns. Therefore, the rest of the computation
- * has to be contained in the actions of the partial function.
- *
- * @param handler a partial function with message patterns and actions
- */
- protected def react(handler: PartialFunction[Msg, Unit]): Nothing = {
- synchronized { drainSendBuffer(mailbox) }
- searchMailbox(mailbox, handler, false)
- throw Actor.suspendException
- }
-
- /* This method is guaranteed to be executed from inside
- * an $actor's act method.
- *
- * assume handler != null
- *
- * never throws SuspendActorControl
- */
- private[actors] def scheduleActor(handler: PartialFunction[Msg, Any], msg: Msg) {
- scheduler executeFromActor makeReaction(null, handler, msg)
- }
-
- private[actors] def preAct() = {}
-
- // guarded by this
- private[actors] def dostart() {
- _state = Actor.State.Runnable
- scheduler newActor this
- scheduler execute makeReaction(() => {
- preAct()
- act()
- }, null, null)
- }
-
- /**
- * Starts this $actor. This method is idempotent.
- */
- def start(): Reactor[Msg] = synchronized {
- if (_state == Actor.State.New)
- dostart()
- this
- }
-
- /**
- * Restarts this $actor.
- *
- * @throws java.lang.IllegalStateException if the $actor is not in state `Actor.State.Terminated`
- */
- def restart(): Unit = synchronized {
- if (_state == Actor.State.Terminated)
- dostart()
- else
- throw new IllegalStateException("restart only in state "+Actor.State.Terminated)
- }
-
- /** Returns the execution state of this $actor.
- *
- * @return the execution state
- */
- def getState: Actor.State.Value = synchronized {
- if (waitingFor ne Reactor.waitingForNone)
- Actor.State.Suspended
- else
- _state
- }
-
- implicit def mkBody[A](body: => A) = new InternalActor.Body[A] {
- def andThen[B](other: => B): Unit = Reactor.this.seq(body, other)
- }
-
- /* This closure is used to implement control-flow operations
- * built on top of `seq`. Note that the only invocation of
- * `kill` is supposed to be inside `ReactorTask.run`.
- */
- @volatile
- private[actors] var kill: () => Unit =
- () => { exit() }
-
- private[actors] def seq[a, b](first: => a, next: => b): Unit = {
- val killNext = this.kill
- this.kill = () => {
- this.kill = killNext
-
- // to avoid stack overflow:
- // instead of directly executing `next`,
- // schedule as continuation
- scheduleActor({ case _ => next }, null)
- throw Actor.suspendException
- }
- first
- throw new KillActorControl
- }
-
- protected[actors] def exit(): Nothing = {
- terminated()
- throw Actor.suspendException
- }
-
- private[actors] def internalPostStop() = {}
-
- private[actors] def terminated() {
- synchronized {
- _state = Actor.State.Terminated
- // reset waitingFor, otherwise getState returns Suspended
- waitingFor = Reactor.waitingForNone
- }
- internalPostStop()
- scheduler.terminated(this)
- }
-
-}
diff --git a/src/actors/scala/actors/ReactorCanReply.scala b/src/actors/scala/actors/ReactorCanReply.scala
deleted file mode 100644
index e30efcbed8..0000000000
--- a/src/actors/scala/actors/ReactorCanReply.scala
+++ /dev/null
@@ -1,90 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-/**
- * Provides message send operations that
- * may result in a response from the receiver.
- *
- * @author Philipp Haller
- */
-private[actors] trait ReactorCanReply extends CanReply[Any, Any] {
- _: InternalReplyReactor =>
-
- type Future[+P] = scala.actors.Future[P]
-
- def !?(msg: Any): Any =
- (this !! msg)()
-
- def !?(msec: Long, msg: Any): Option[Any] = {
- val myself = Actor.rawSelf(this.scheduler)
- val res = new scala.concurrent.SyncVar[Any]
- val out = new OutputChannel[Any] {
- def !(msg: Any) =
- res set msg
- def send(msg: Any, replyTo: OutputChannel[Any]) =
- res set msg
- def forward(msg: Any) =
- res set msg
- def receiver =
- myself.asInstanceOf[Actor]
- }
- this.send(msg, out)
- res.get(msec)
- }
-
- def !!(msg: Any): Future[Any] =
- this !! (msg, { case x => x })
-
- def !![A](msg: Any, handler: PartialFunction[Any, A]): Future[A] = {
- val myself = Actor.rawSelf(this.scheduler)
- val ftch = new ReactChannel[A](myself)
- val res = new scala.concurrent.SyncVar[A]
-
- val out = new OutputChannel[Any] {
- def !(msg: Any) = {
- val msg1 = handler(msg)
- ftch ! msg1
- res set msg1
- }
- def send(msg: Any, replyTo: OutputChannel[Any]) = {
- val msg1 = handler(msg)
- ftch.send(msg1, replyTo)
- res set msg1
- }
- def forward(msg: Any) = {
- val msg1 = handler(msg)
- ftch forward msg1
- res set msg1
- }
- def receiver =
- myself.asInstanceOf[Actor]
- }
-
- this.send(msg, out)
-
- new Future[A] {
- def apply() = {
- if (!isSet)
- fvalue = Some(res.get)
-
- fvalueTyped
- }
- def respond(k: A => Unit): Unit =
- if (isSet) k(fvalueTyped)
- else inputChannel.react {
- case any => fvalue = Some(any); k(fvalueTyped)
- }
- def isSet =
- !fvalue.isEmpty
- def inputChannel = ftch
- }
- }
-}
diff --git a/src/actors/scala/actors/ReactorTask.scala b/src/actors/scala/actors/ReactorTask.scala
deleted file mode 100644
index 1ca061b40d..0000000000
--- a/src/actors/scala/actors/ReactorTask.scala
+++ /dev/null
@@ -1,74 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-import java.lang.Runnable
-import java.util.concurrent.Callable
-
-import scala.concurrent.forkjoin.RecursiveAction
-
-/**
- * @author Philipp Haller
- */
-private[actors] class ReactorTask[Msg >: Null](var reactor: Reactor[Msg],
- var fun: () => Any,
- var handler: PartialFunction[Msg, Any],
- var msg: Msg)
- extends RecursiveAction with Callable[Unit] with Runnable {
-
- def run() {
- try {
- beginExecution()
- try {
- if (fun eq null)
- handler(msg)
- else
- fun()
- } catch {
- case _: KillActorControl =>
- // do nothing
-
- case e: Exception if reactor.exceptionHandler.isDefinedAt(e) =>
- reactor.exceptionHandler(e)
- }
- reactor.kill()
- }
- catch {
- case _: SuspendActorControl =>
- // do nothing (continuation is already saved)
-
- case e: Throwable =>
- terminateExecution(e)
- reactor.terminated()
- if (!e.isInstanceOf[Exception])
- throw e
- } finally {
- suspendExecution()
- this.reactor = null
- this.fun = null
- this.handler = null
- this.msg = null
- }
- }
-
- def call() = run()
-
- def compute() = run()
-
- protected def beginExecution() {}
-
- protected def suspendExecution() {}
-
- protected def terminateExecution(e: Throwable) {
- Console.err.println(reactor+": caught "+e)
- e.printStackTrace()
- }
-
-}
diff --git a/src/actors/scala/actors/ReplyReactor.scala b/src/actors/scala/actors/ReplyReactor.scala
deleted file mode 100644
index 01e6da000f..0000000000
--- a/src/actors/scala/actors/ReplyReactor.scala
+++ /dev/null
@@ -1,13 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-package scala.actors
-
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait ReplyReactor extends InternalReplyReactor {
- protected[actors] def sender: OutputChannel[Any] = super.internalSender
-}
diff --git a/src/actors/scala/actors/ReplyReactorTask.scala b/src/actors/scala/actors/ReplyReactorTask.scala
deleted file mode 100644
index ea9070fab7..0000000000
--- a/src/actors/scala/actors/ReplyReactorTask.scala
+++ /dev/null
@@ -1,40 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-// $Id$
-
-package scala.actors
-
-/**
- * @author Philipp Haller
- * @note This class inherits a public var called 'reactor' from ReactorTask,
- * and also defines a constructor parameter which shadows it (which makes any
- * changes to the underlying var invisible.) I can't figure out what's supposed
- * to happen, so I renamed the constructor parameter to at least be less confusing.
- */
-private[actors] class ReplyReactorTask(replyReactor: InternalReplyReactor,
- fun: () => Unit,
- handler: PartialFunction[Any, Any],
- msg: Any)
- extends ReactorTask(replyReactor, fun, handler, msg) {
-
- var saved: InternalReplyReactor = _
-
- protected override def beginExecution() {
- saved = Actor.tl.get
- // !!! If this is supposed to be setting the current contents of the
- // inherited mutable var rather than always the value given in the constructor,
- // then it should be changed to "set reactor".
- Actor.tl set replyReactor
- }
-
- protected override def suspendExecution() {
- Actor.tl set saved
- }
-
-}
diff --git a/src/actors/scala/actors/Scheduler.scala b/src/actors/scala/actors/Scheduler.scala
deleted file mode 100644
index 67c8e5cd10..0000000000
--- a/src/actors/scala/actors/Scheduler.scala
+++ /dev/null
@@ -1,40 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-import scheduler.{DelegatingScheduler, ForkJoinScheduler, ResizableThreadPoolScheduler, ThreadPoolConfig}
-
-/**
- * Used by [[scala.actors.Actor]] instances to
- * execute tasks of an actor execution.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-object Scheduler extends DelegatingScheduler {
-
- Debug.info("initializing "+this+"...")
-
- def makeNewScheduler: IScheduler = {
- val sched = if (!ThreadPoolConfig.useForkJoin) {
- // default is non-daemon
- val s = new ResizableThreadPoolScheduler(false)
- s.start()
- s
- } else {
- // default is non-daemon, fair
- val s = new ForkJoinScheduler
- s.start()
- s
- }
- Debug.info(this+": starting new "+sched+" ["+sched.getClass+"]")
- sched
- }
-}
diff --git a/src/actors/scala/actors/SchedulerAdapter.scala b/src/actors/scala/actors/SchedulerAdapter.scala
deleted file mode 100644
index b8e66dd6cc..0000000000
--- a/src/actors/scala/actors/SchedulerAdapter.scala
+++ /dev/null
@@ -1,68 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-
-/** Adapts
- * the behavior of the standard [[scala.actors.Scheduler]] object.
- *
- * Providing an implementation for the
- * <code>execute(f: => Unit)</code> method is sufficient to
- * obtain a concrete <code>IScheduler</code> implementation.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait SchedulerAdapter extends IScheduler {
-
- /** Submits a <code>Runnable</code> for execution.
- *
- * @param task the task to be executed
- */
- def execute(task: Runnable): Unit =
- execute { task.run() }
-
- /** Shuts down the scheduler.
- */
- def shutdown(): Unit =
- Scheduler.shutdown()
-
- /** When the scheduler is active, it can execute tasks.
- */
- def isActive: Boolean =
- Scheduler.isActive
-
- /** Registers a newly created actor with this scheduler.
- *
- * @param a the actor to be registered
- */
- def newActor(a: TrackedReactor) =
- Scheduler.newActor(a)
-
- /** Unregisters an actor from this scheduler, because it
- * has terminated.
- *
- * @param a the actor to be unregistered
- */
- def terminated(a: TrackedReactor) =
- Scheduler.terminated(a)
-
- /** Registers a closure to be executed when the specified
- * actor terminates.
- *
- * @param a the actor
- * @param f the closure to be registered
- */
- def onTerminate(a: TrackedReactor)(f: => Unit) =
- Scheduler.onTerminate(a)(f)
-
- def managedBlock(blocker: scala.concurrent.ManagedBlocker) {
- blocker.block()
- }
-}
diff --git a/src/actors/scala/actors/UncaughtException.scala b/src/actors/scala/actors/UncaughtException.scala
deleted file mode 100644
index 02b916a3b5..0000000000
--- a/src/actors/scala/actors/UncaughtException.scala
+++ /dev/null
@@ -1,34 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-
-/**
- * The exit reason when an actor fails to catch an exception.
- *
- * @param actor the actor that threw the exception
- * @param message the message the actor was processing, or None if no message (e.g. on initial startup)
- * @param sender the sender of the most recent message
- * @param thread the thread on which the actor was running
- * @param cause the uncaught exception
- *
- * @author Philipp Haller
- * @author Erik Engbrecht
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-case class UncaughtException(actor: InternalActor,
- message: Option[Any],
- sender: Option[OutputChannel[Any]],
- thread: Thread,
- cause: Throwable)
-extends Exception(cause) {
-
- override def toString() =
- "UncaughtException("+actor+","+message+","+sender+","+cause+")"
-
-}
diff --git a/src/actors/scala/actors/package.scala b/src/actors/scala/actors/package.scala
deleted file mode 100644
index ae960860cf..0000000000
--- a/src/actors/scala/actors/package.scala
+++ /dev/null
@@ -1,23 +0,0 @@
-package scala
-
-/**
- * A library that provides both asynchronous and synchronous messaging to allow
- * for concurrent programming without explicit synchronization.
- *
- * == Guide ==
- *
- * A detailed guide for the actors library is available
- * [[http://docs.scala-lang.org/overviews/core/actors.html]].
- *
- * == Getting Started ==
- *
- * A starting point for using the actors library would be [[scala.actors.Reactor]],
- * [[scala.actors.ReplyReactor]], or [[scala.actors.Actor]] or their companion objects.
- *
- * @note As of release 2.10.1, replaced by <code>akka.actor</code> package. For migration of existing actors refer to the Actors Migration Guide.
- */
-package object actors {
-
- // type of Reactors tracked by termination detector
- private[actors] type TrackedReactor = Reactor[A] forSome { type A >: Null }
-}
diff --git a/src/actors/scala/actors/remote/FreshNameCreator.scala b/src/actors/scala/actors/remote/FreshNameCreator.scala
deleted file mode 100644
index f7cf29387e..0000000000
--- a/src/actors/scala/actors/remote/FreshNameCreator.scala
+++ /dev/null
@@ -1,36 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-package remote
-
-object FreshNameCreator {
-
- protected var counter = 0
- protected val counters = new scala.collection.mutable.HashMap[String, Int]
-
- /**
- * Create a fresh name with the given prefix. It is guaranteed
- * that the returned name has never been returned by a previous
- * call to this function (provided the prefix does not end in a digit).
- */
- def newName(prefix: String): Symbol = {
- val count = counters.get(prefix) match {
- case Some(last) => last + 1
- case None => 0
- }
- counters.update(prefix, count)
- Symbol(prefix + count)
- }
-
- def newName(): Symbol = {
- counter += 1
- Symbol("$" + counter + "$")
- }
-}
diff --git a/src/actors/scala/actors/remote/JavaSerializer.scala b/src/actors/scala/actors/remote/JavaSerializer.scala
deleted file mode 100644
index 7549bbf429..0000000000
--- a/src/actors/scala/actors/remote/JavaSerializer.scala
+++ /dev/null
@@ -1,63 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-package remote
-
-import java.io.{ByteArrayInputStream, ByteArrayOutputStream,
- ObjectInputStream, ObjectOutputStream, InputStream,
- ObjectStreamClass}
-
-/**
- * @author Guy Oliver
- */
-private[remote] class CustomObjectInputStream(in: InputStream, cl: ClassLoader)
-extends ObjectInputStream(in) {
- override def resolveClass(cd: ObjectStreamClass): Class[_] =
- try {
- cl.loadClass(cd.getName())
- } catch {
- case cnf: ClassNotFoundException =>
- super.resolveClass(cd)
- }
- override def resolveProxyClass(interfaces: Array[String]): Class[_] =
- try {
- val ifaces = interfaces map { iface => cl.loadClass(iface) }
- java.lang.reflect.Proxy.getProxyClass(cl, ifaces: _*)
- } catch {
- case e: ClassNotFoundException =>
- super.resolveProxyClass(interfaces)
- }
-}
-
-/**
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-class JavaSerializer(serv: Service, cl: ClassLoader) extends Serializer(serv) {
- def serialize(o: AnyRef): Array[Byte] = {
- val bos = new ByteArrayOutputStream()
- val out = new ObjectOutputStream(bos)
- out.writeObject(o)
- out.flush()
- bos.toByteArray()
- }
-
- def deserialize(bytes: Array[Byte]): AnyRef = {
- val bis = new ByteArrayInputStream(bytes)
-
- // use custom stream only if cl != null
- val in = if (cl != null)
- new CustomObjectInputStream(bis, cl)
- else
- new ObjectInputStream(bis)
-
- in.readObject()
- }
-}
diff --git a/src/actors/scala/actors/remote/NetKernel.scala b/src/actors/scala/actors/remote/NetKernel.scala
deleted file mode 100644
index 57d7af6d26..0000000000
--- a/src/actors/scala/actors/remote/NetKernel.scala
+++ /dev/null
@@ -1,147 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-package remote
-
-import scala.collection.mutable
-
-case class NamedSend(senderLoc: Locator, receiverLoc: Locator, data: Array[Byte], session: Symbol)
-
-case class RemoteApply0(senderLoc: Locator, receiverLoc: Locator, rfun: Function2[AbstractActor, Proxy, Unit])
-case class LocalApply0(rfun: Function2[AbstractActor, Proxy, Unit], a: AbstractActor)
-
-case class SendTo(a: OutputChannel[Any], msg: Any, session: Symbol)
-case object Terminate
-
-case class Locator(node: Node, name: Symbol)
-
-/**
- * @version 0.9.17
- * @author Philipp Haller
- */
-private[remote] class NetKernel(service: Service) {
-
- def sendToNode(node: Node, msg: AnyRef) = {
- val bytes = service.serializer.serialize(msg)
- service.send(node, bytes)
- }
-
- def namedSend(senderLoc: Locator, receiverLoc: Locator,
- msg: AnyRef, session: Symbol) {
- val bytes = service.serializer.serialize(msg)
- sendToNode(receiverLoc.node, NamedSend(senderLoc, receiverLoc, bytes, session))
- }
-
- private val actors = new mutable.HashMap[Symbol, OutputChannel[Any]]
- private val names = new mutable.HashMap[OutputChannel[Any], Symbol]
-
- def register(name: Symbol, a: OutputChannel[Any]): Unit = synchronized {
- actors(name) = a
- names(a) = name
- }
-
- def getOrCreateName(from: OutputChannel[Any]) = names.get(from) match {
- case None =>
- val freshName = FreshNameCreator.newName("remotesender")
- register(freshName, from)
- freshName
- case Some(name) =>
- name
- }
-
- def send(node: Node, name: Symbol, msg: AnyRef): Unit =
- send(node, name, msg, 'nosession)
-
- def send(node: Node, name: Symbol, msg: AnyRef, session: Symbol) {
- val senderLoc = Locator(service.node, getOrCreateName(Actor.self(Scheduler)))
- val receiverLoc = Locator(node, name)
- namedSend(senderLoc, receiverLoc, msg, session)
- }
-
- def forward(from: OutputChannel[Any], node: Node, name: Symbol, msg: AnyRef, session: Symbol) {
- val senderLoc = Locator(service.node, getOrCreateName(from))
- val receiverLoc = Locator(node, name)
- namedSend(senderLoc, receiverLoc, msg, session)
- }
-
- def remoteApply(node: Node, name: Symbol, from: OutputChannel[Any], rfun: Function2[AbstractActor, Proxy, Unit]) {
- val senderLoc = Locator(service.node, getOrCreateName(from))
- val receiverLoc = Locator(node, name)
- sendToNode(receiverLoc.node, RemoteApply0(senderLoc, receiverLoc, rfun))
- }
-
- def createProxy(node: Node, sym: Symbol): Proxy = {
- val p = new Proxy(node, sym, this)
- proxies((node, sym)) = p
- p
- }
-
- val proxies = new mutable.HashMap[(Node, Symbol), Proxy]
-
- def getOrCreateProxy(senderNode: Node, senderName: Symbol): Proxy =
- proxies.synchronized {
- proxies.get((senderNode, senderName)) match {
- case Some(senderProxy) => senderProxy
- case None => createProxy(senderNode, senderName)
- }
- }
-
- /* Register proxy if no other proxy has been registered.
- */
- def registerProxy(senderNode: Node, senderName: Symbol, p: Proxy): Unit =
- proxies.synchronized {
- proxies.get((senderNode, senderName)) match {
- case Some(senderProxy) => // do nothing
- case None => proxies((senderNode, senderName)) = p
- }
- }
-
- def processMsg(senderNode: Node, msg: AnyRef): Unit = synchronized {
- msg match {
- case cmd@RemoteApply0(senderLoc, receiverLoc, rfun) =>
- Debug.info(this+": processing "+cmd)
- actors.get(receiverLoc.name) match {
- case Some(a) =>
- val senderProxy = getOrCreateProxy(senderLoc.node, senderLoc.name)
- senderProxy.send(LocalApply0(rfun, a.asInstanceOf[AbstractActor]), null)
-
- case None =>
- // message is lost
- Debug.info(this+": lost message")
- }
-
- case cmd@NamedSend(senderLoc, receiverLoc, data, session) =>
- Debug.info(this+": processing "+cmd)
- actors.get(receiverLoc.name) match {
- case Some(a) =>
- try {
- val msg = service.serializer.deserialize(data)
- val senderProxy = getOrCreateProxy(senderLoc.node, senderLoc.name)
- senderProxy.send(SendTo(a, msg, session), null)
- } catch {
- case e: Exception =>
- Debug.error(this+": caught "+e)
- }
-
- case None =>
- // message is lost
- Debug.info(this+": lost message")
- }
- }
- }
-
- def terminate() {
- // tell all proxies to terminate
- proxies.values foreach { _.send(Terminate, null) }
-
- // tell service to terminate
- service.terminate()
- }
-}
diff --git a/src/actors/scala/actors/remote/Proxy.scala b/src/actors/scala/actors/remote/Proxy.scala
deleted file mode 100644
index 2cb03544f2..0000000000
--- a/src/actors/scala/actors/remote/Proxy.scala
+++ /dev/null
@@ -1,190 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-package remote
-
-import scala.collection.mutable
-
-/**
- * @author Philipp Haller
- */
-private[remote] class Proxy(node: Node, name: Symbol, @transient var kernel: NetKernel) extends AbstractActor with Serializable {
- import java.io.{IOException, ObjectOutputStream, ObjectInputStream}
-
- type Future[+P] = scala.actors.Future[P]
-
- @transient
- private[remote] var del: Actor = null
- startDelegate()
-
- @throws(classOf[IOException])
- private def writeObject(out: ObjectOutputStream) {
- out.defaultWriteObject()
- }
-
- @throws(classOf[ClassNotFoundException]) @throws(classOf[IOException])
- private def readObject(in: ObjectInputStream) {
- in.defaultReadObject()
- setupKernel()
- startDelegate()
- }
-
- private def startDelegate() {
- del = new DelegateActor(this, node, name, kernel)
- del.start()
- }
-
- private def setupKernel() {
- kernel = RemoteActor.someNetKernel
- kernel.registerProxy(node, name, this)
- }
-
- def !(msg: Any): Unit =
- del ! msg
-
- def send(msg: Any, replyCh: OutputChannel[Any]): Unit =
- del.send(msg, replyCh)
-
- def forward(msg: Any): Unit =
- del.forward(msg)
-
- def receiver: Actor =
- del
-
- def !?(msg: Any): Any =
- del !? msg
-
- def !?(msec: Long, msg: Any): Option[Any] =
- del !? (msec, msg)
-
- def !!(msg: Any): Future[Any] =
- del !! msg
-
- def !![A](msg: Any, f: PartialFunction[Any, A]): Future[A] =
- del !! (msg, f)
-
- def linkTo(to: AbstractActor): Unit =
- del ! Apply0(new LinkToFun)
-
- def unlinkFrom(from: AbstractActor): Unit =
- del ! Apply0(new UnlinkFromFun)
-
- def exit(from: AbstractActor, reason: AnyRef): Unit =
- del ! Apply0(new ExitFun(reason))
-
- override def toString() =
- name+"@"+node
-}
-
-// Proxy is private[remote], but these classes are public and use it in a public
-// method signature. That makes the only method they have non-overridable.
-// So I made them final, which seems appropriate anyway.
-
-final class LinkToFun extends Function2[AbstractActor, Proxy, Unit] with Serializable {
- def apply(target: AbstractActor, creator: Proxy) {
- target.linkTo(creator)
- }
- override def toString =
- "<LinkToFun>"
-}
-
-final class UnlinkFromFun extends Function2[AbstractActor, Proxy, Unit] with Serializable {
- def apply(target: AbstractActor, creator: Proxy) {
- target.unlinkFrom(creator)
- }
- override def toString =
- "<UnlinkFromFun>"
-}
-
-final class ExitFun(reason: AnyRef) extends Function2[AbstractActor, Proxy, Unit] with Serializable {
- def apply(target: AbstractActor, creator: Proxy) {
- target.exit(creator, reason)
- }
- override def toString =
- "<ExitFun>("+reason.toString+")"
-}
-
-private[remote] case class Apply0(rfun: Function2[AbstractActor, Proxy, Unit])
-
-/**
- * @author Philipp Haller
- */
-private[remote] class DelegateActor(creator: Proxy, node: Node, name: Symbol, kernel: NetKernel) extends Actor {
- var channelMap = new mutable.HashMap[Symbol, OutputChannel[Any]]
- var sessionMap = new mutable.HashMap[OutputChannel[_], Symbol]
-
- def act() {
- Actor.loop {
- react {
- case cmd@Apply0(rfun) =>
- kernel.remoteApply(node, name, sender, rfun)
-
- case cmd@LocalApply0(rfun, target) =>
- rfun(target, creator)
-
- // Request from remote proxy.
- // `this` is local proxy.
- case cmd@SendTo(out, msg, session) =>
- if (session.name == "nosession") {
- // local send
- out.send(msg, this)
- } else {
- // is this an active session?
- channelMap.get(session) match {
- case None =>
- // create a new reply channel...
- val replyCh = new Channel[Any](this)
- // ...that maps to session
- sessionMap(replyCh) = session
- // local send
- out.send(msg, replyCh)
-
- // finishes request-reply cycle
- case Some(replyCh) =>
- channelMap -= session
- replyCh ! msg
- }
- }
-
- case cmd@Terminate =>
- exit()
-
- // local proxy receives response to
- // reply channel
- case ch ! resp =>
- // lookup session ID
- sessionMap.get(ch) match {
- case Some(sid) =>
- sessionMap -= ch
- val msg = resp.asInstanceOf[AnyRef]
- // send back response
- kernel.forward(sender, node, name, msg, sid)
-
- case None =>
- Debug.info(this+": cannot find session for "+ch)
- }
-
- // remote proxy receives request
- case msg: AnyRef =>
- // find out whether it's a synchronous send
- if (sender.getClass.toString.contains("Channel")) {
- // create fresh session ID...
- val fresh = FreshNameCreator.newName(node+"@"+name)
- // ...that maps to reply channel
- channelMap(fresh) = sender
- kernel.forward(sender, node, name, msg, fresh)
- } else {
- kernel.forward(sender, node, name, msg, 'nosession)
- }
- }
- }
- }
-
-}
diff --git a/src/actors/scala/actors/remote/RemoteActor.scala b/src/actors/scala/actors/remote/RemoteActor.scala
deleted file mode 100644
index 2daf9ceb43..0000000000
--- a/src/actors/scala/actors/remote/RemoteActor.scala
+++ /dev/null
@@ -1,132 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-
-package scala.actors
-package remote
-
-
-/**
- * This object provides methods for creating, registering, and
- * selecting remotely accessible actors.
- *
- * A remote actor is typically created like this:
- * {{{
- * actor {
- * alive(9010)
- * register('myName, self)
- *
- * // behavior
- * }
- * }}}
- * It can be accessed by an actor running on a (possibly)
- * different node by selecting it in the following way:
- * {{{
- * actor {
- * // ...
- * val c = select(Node("127.0.0.1", 9010), 'myName)
- * c ! msg
- * // ...
- * }
- * }}}
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-object RemoteActor {
-
- private val kernels = new scala.collection.mutable.HashMap[InternalActor, NetKernel]
-
- /* If set to <code>null</code> (default), the default class loader
- * of <code>java.io.ObjectInputStream</code> is used for deserializing
- * objects sent as messages.
- */
- private var cl: ClassLoader = null
-
- def classLoader: ClassLoader = cl
- def classLoader_=(x: ClassLoader) { cl = x }
-
- /**
- * Makes <code>self</code> remotely accessible on TCP port
- * <code>port</code>.
- */
- def alive(port: Int): Unit = synchronized {
- createNetKernelOnPort(port)
- }
-
- private def createNetKernelOnPort(port: Int): NetKernel = {
- val serv = TcpService(port, cl)
- val kern = serv.kernel
- val s = Actor.self(Scheduler)
- kernels(s) = kern
-
- s.onTerminate {
- Debug.info("alive actor "+s+" terminated")
- // remove mapping for `s`
- kernels -= s
- // terminate `kern` when it does
- // not appear as value any more
- if (!kernels.valuesIterator.contains(kern)) {
- Debug.info("terminating "+kern)
- // terminate NetKernel
- kern.terminate()
- }
- }
-
- kern
- }
-
- /**
- * Registers <code>a</code> under <code>name</code> on this
- * node.
- */
- def register(name: Symbol, a: Actor): Unit = synchronized {
- val kernel = kernels.get(Actor.self(Scheduler)) match {
- case None =>
- val serv = TcpService(TcpService.generatePort, cl)
- kernels(Actor.self(Scheduler)) = serv.kernel
- serv.kernel
- case Some(k) =>
- k
- }
- kernel.register(name, a)
- }
-
- private def selfKernel = kernels.get(Actor.self(Scheduler)) match {
- case None =>
- // establish remotely accessible
- // return path (sender)
- createNetKernelOnPort(TcpService.generatePort)
- case Some(k) =>
- k
- }
-
- /**
- * Returns (a proxy for) the actor registered under
- * <code>name</code> on <code>node</code>.
- */
- def select(node: Node, sym: Symbol): AbstractActor = synchronized {
- selfKernel.getOrCreateProxy(node, sym)
- }
-
- private[remote] def someNetKernel: NetKernel =
- kernels.valuesIterator.next
-}
-
-
-/**
- * This class represents a machine node on a TCP network.
- *
- * @param address the host name, or <code>null</code> for the loopback address.
- * @param port the port number.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-case class Node(address: String, port: Int)
diff --git a/src/actors/scala/actors/remote/Serializer.scala b/src/actors/scala/actors/remote/Serializer.scala
deleted file mode 100644
index 7be4aa6583..0000000000
--- a/src/actors/scala/actors/remote/Serializer.scala
+++ /dev/null
@@ -1,58 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-
-package scala.actors
-package remote
-
-
-import java.lang.ClassNotFoundException
-
-import java.io.{DataInputStream, DataOutputStream, EOFException, IOException}
-
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-abstract class Serializer(val service: Service) {
- def serialize(o: AnyRef): Array[Byte]
- def deserialize(a: Array[Byte]): AnyRef
-
- @throws(classOf[IOException])
- private def readBytes(inputStream: DataInputStream): Array[Byte] = {
- try {
- val length = inputStream.readInt()
- val bytes = new Array[Byte](length)
- inputStream.readFully(bytes, 0, length)
- bytes
- }
- catch {
- case npe: NullPointerException =>
- throw new EOFException("Connection closed.")
- }
- }
-
- @throws(classOf[IOException]) @throws(classOf[ClassNotFoundException])
- def readObject(inputStream: DataInputStream): AnyRef = {
- val bytes = readBytes(inputStream)
- deserialize(bytes)
- }
-
- @throws(classOf[IOException])
- private def writeBytes(outputStream: DataOutputStream, bytes: Array[Byte]) {
- val length = bytes.length;
- // original length
- outputStream.writeInt(length)
- outputStream.write(bytes, 0, length)
- outputStream.flush()
- }
-
- @throws(classOf[IOException])
- def writeObject(outputStream: DataOutputStream, obj: AnyRef) {
- val bytes = serialize(obj)
- writeBytes(outputStream, bytes)
- }
-}
diff --git a/src/actors/scala/actors/remote/Service.scala b/src/actors/scala/actors/remote/Service.scala
deleted file mode 100644
index d102df1970..0000000000
--- a/src/actors/scala/actors/remote/Service.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-package remote
-
-/**
- * @version 0.9.10
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait Service {
- val kernel = new NetKernel(this)
- val serializer: Serializer
- def node: Node
- def send(node: Node, data: Array[Byte]): Unit
- def terminate(): Unit
-}
diff --git a/src/actors/scala/actors/remote/TcpService.scala b/src/actors/scala/actors/remote/TcpService.scala
deleted file mode 100644
index 69e5c46c52..0000000000
--- a/src/actors/scala/actors/remote/TcpService.scala
+++ /dev/null
@@ -1,292 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-
-package scala.actors
-package remote
-
-
-import java.io.{DataInputStream, DataOutputStream, IOException}
-import java.lang.{Thread, SecurityException}
-import java.net.{InetAddress, InetSocketAddress, ServerSocket, Socket, SocketTimeoutException, UnknownHostException}
-
-import scala.collection.mutable
-import scala.util.Random
-
-/* Object TcpService.
- *
- * @version 0.9.9
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-object TcpService {
- private val random = new Random
- private val ports = new mutable.HashMap[Int, TcpService]
-
- def apply(port: Int, cl: ClassLoader): TcpService =
- ports.get(port) match {
- case Some(service) =>
- service
- case None =>
- val service = new TcpService(port, cl)
- ports(port) = service
- service.start()
- Debug.info("created service at "+service.node)
- service
- }
-
- def generatePort: Int = {
- var portnum = 0
- try {
- portnum = 8000 + random.nextInt(500)
- val socket = new ServerSocket(portnum)
- socket.close()
- }
- catch {
- case ioe: IOException =>
- // this happens when trying to open a socket twice
- // at the same port
- // try again
- generatePort
- case se: SecurityException =>
- // do nothing
- }
- portnum
- }
-
- private val connectTimeoutMillis = {
- val propName = "scala.actors.tcpSocket.connectTimeoutMillis"
- val defaultTimeoutMillis = 0
- sys.props get propName flatMap {
- timeout =>
- try {
- val to = timeout.toInt
- Debug.info(s"Using socket timeout $to")
- Some(to)
- } catch {
- case e: NumberFormatException =>
- Debug.warning(s"""Could not parse $propName = "$timeout" as an Int""")
- None
- }
- } getOrElse defaultTimeoutMillis
- }
-
- var BufSize: Int = 65536
-}
-
-/* Class TcpService.
- *
- * @version 0.9.10
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-class TcpService(port: Int, cl: ClassLoader) extends Thread with Service {
- val serializer: JavaSerializer = new JavaSerializer(this, cl)
-
- private val internalNode = new Node(InetAddress.getLocalHost().getHostAddress(), port)
- def node: Node = internalNode
-
- private val pendingSends = new mutable.HashMap[Node, List[Array[Byte]]]
-
- /**
- * Sends a byte array to another node on the network.
- * If the node is not yet up, up to `TcpService.BufSize`
- * messages are buffered.
- */
- def send(node: Node, data: Array[Byte]): Unit = synchronized {
-
- def bufferMsg(t: Throwable) {
- // buffer message, so that it can be re-sent
- // when remote net kernel comes up
- (pendingSends.get(node): @unchecked) match {
- case None =>
- pendingSends(node) = List(data)
- case Some(msgs) if msgs.length < TcpService.BufSize =>
- pendingSends(node) = data :: msgs
- }
- }
-
- // retrieve worker thread (if any) that already has connection
- getConnection(node) match {
- case None =>
- // we are not connected, yet
- try {
- val newWorker = connect(node)
-
- // any pending sends?
- pendingSends.get(node) match {
- case None =>
- // do nothing
- case Some(msgs) =>
- msgs.reverse foreach {newWorker transmit _}
- pendingSends -= node
- }
-
- newWorker transmit data
- } catch {
- case uhe: UnknownHostException =>
- bufferMsg(uhe)
- case ioe: IOException =>
- bufferMsg(ioe)
- case se: SecurityException =>
- // do nothing
- }
- case Some(worker) =>
- worker transmit data
- }
- }
-
- def terminate() {
- shouldTerminate = true
- try {
- new Socket(internalNode.address, internalNode.port)
- } catch {
- case ce: java.net.ConnectException =>
- Debug.info(this+": caught "+ce)
- }
- }
-
- private var shouldTerminate = false
-
- override def run() {
- try {
- val socket = new ServerSocket(port)
- while (!shouldTerminate) {
- Debug.info(this+": waiting for new connection on port "+port+"...")
- val nextClient = socket.accept()
- if (!shouldTerminate) {
- val worker = new TcpServiceWorker(this, nextClient)
- Debug.info("Started new "+worker)
- worker.readNode
- worker.start()
- } else
- nextClient.close()
- }
- } catch {
- case e: Exception =>
- Debug.info(this+": caught "+e)
- } finally {
- Debug.info(this+": shutting down...")
- connections foreach { case (_, worker) => worker.halt }
- }
- }
-
- // connection management
-
- private val connections =
- new mutable.HashMap[Node, TcpServiceWorker]
-
- private[actors] def addConnection(node: Node, worker: TcpServiceWorker) = synchronized {
- connections(node) = worker
- }
-
- def getConnection(n: Node) = synchronized {
- connections.get(n)
- }
-
- def isConnected(n: Node): Boolean = synchronized {
- !connections.get(n).isEmpty
- }
-
- def connect(n: Node): TcpServiceWorker = synchronized {
- val socket = new Socket()
- val start = System.nanoTime
- try {
- socket.connect(new InetSocketAddress(n.address, n.port), TcpService.connectTimeoutMillis)
- } catch {
- case e: SocketTimeoutException =>
- Debug.warning(f"Timed out connecting to $n after ${(System.nanoTime - start) / math.pow(10, 9)}%.3f seconds")
- throw e
- }
- val worker = new TcpServiceWorker(this, socket)
- worker.sendNode(n)
- worker.start()
- addConnection(n, worker)
- worker
- }
-
- def disconnectNode(n: Node) = synchronized {
- connections.get(n) match {
- case None =>
- // do nothing
- case Some(worker) =>
- connections -= n
- worker.halt
- }
- }
-
- def isReachable(node: Node): Boolean =
- if (isConnected(node)) true
- else try {
- connect(node)
- return true
- } catch {
- case uhe: UnknownHostException => false
- case ioe: IOException => false
- case se: SecurityException => false
- }
-
- def nodeDown(mnode: Node): Unit = synchronized {
- connections -= mnode
- }
-}
-
-
-private[actors] class TcpServiceWorker(parent: TcpService, so: Socket) extends Thread {
- val datain = new DataInputStream(so.getInputStream)
- val dataout = new DataOutputStream(so.getOutputStream)
-
- var connectedNode: Node = _
-
- def sendNode(n: Node) {
- connectedNode = n
- parent.serializer.writeObject(dataout, parent.node)
- }
-
- def readNode() {
- val node = parent.serializer.readObject(datain)
- node match {
- case n: Node =>
- connectedNode = n
- parent.addConnection(n, this)
- }
- }
-
- def transmit(data: Array[Byte]): Unit = synchronized {
- Debug.info(this+": transmitting data...")
- dataout.writeInt(data.length)
- dataout.write(data)
- dataout.flush()
- }
-
- var running = true
-
- def halt() = synchronized {
- so.close()
- running = false
- }
-
- override def run() {
- try {
- while (running) {
- val msg = parent.serializer.readObject(datain);
- parent.kernel.processMsg(connectedNode, msg)
- }
- }
- catch {
- case ioe: IOException =>
- Debug.info(this+": caught "+ioe)
- parent nodeDown connectedNode
- case e: Exception =>
- Debug.info(this+": caught "+e)
- parent nodeDown connectedNode
- }
- Debug.info(this+": service terminated at "+parent.node)
- }
-}
diff --git a/src/actors/scala/actors/scheduler/ActorGC.scala b/src/actors/scala/actors/scheduler/ActorGC.scala
deleted file mode 100644
index a27799d132..0000000000
--- a/src/actors/scala/actors/scheduler/ActorGC.scala
+++ /dev/null
@@ -1,101 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-package scheduler
-
-import java.lang.ref.{Reference, WeakReference, ReferenceQueue}
-import scala.collection.mutable
-
-/**
- * ActorGC keeps track of the number of live actors being managed by a
- * a scheduler so that it can shutdown when all of the actors it manages have
- * either been explicitly terminated or garbage collected.
- *
- * When an actor is started, it is registered with the ActorGC via the
- * `newActor` method, and when an actor is knowingly terminated
- * (e.g. act method finishes, exit explicitly called, an exception is thrown),
- * the ActorGC is informed via the `terminated` method.
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait ActorGC extends TerminationMonitor {
- self: IScheduler =>
-
- /** Actors are added to refQ in newActor. */
- private val refQ = new ReferenceQueue[TrackedReactor]
-
- /**
- * This is a set of references to all the actors registered with
- * this ActorGC. It is maintained so that the WeakReferences will
- * not be GC'd before the actors to which they point.
- */
- private val refSet = new mutable.HashSet[Reference[t] forSome { type t <: TrackedReactor }]
-
- /** newActor is invoked whenever a new actor is started. */
- override def newActor(a: TrackedReactor) = synchronized {
- // registers a reference to the actor with the ReferenceQueue
- val wr = new WeakReference[TrackedReactor](a, refQ)
- refSet += wr
- activeActors += 1
- }
-
- /** Checks for actors that have become garbage. */
- protected override def gc() = synchronized {
- // check for unreachable actors
- def drainRefQ() {
- val wr = refQ.poll
- if (wr != null) {
- activeActors -= 1
- refSet -= wr
- // continue draining
- drainRefQ()
- }
- }
- drainRefQ()
- }
-
- /** Prints some status information on currently managed actors. */
- protected def status() {
- println(this+": size of refSet: "+refSet.size)
- }
-
- /** Checks whether all actors have terminated. */
- override private[actors] def allActorsTerminated: Boolean = synchronized {
- activeActors <= 0
- }
-
- override def onTerminate(a: TrackedReactor)(f: => Unit): Unit = synchronized {
- terminationHandlers += (a -> (() => f))
- }
-
- override def terminated(a: TrackedReactor) = {
- super.terminated(a)
-
- synchronized {
- // find the weak reference that points to the terminated actor, if any
- refSet.find((ref: Reference[t] forSome { type t <: TrackedReactor }) => ref.get() == a) match {
- case Some(r) =>
- // invoking clear will not cause r to be enqueued
- r.clear()
- refSet -= r.asInstanceOf[Reference[t] forSome { type t <: TrackedReactor }]
- case None =>
- // do nothing
- }
- }
- }
-
- private[actors] def getPendingCount = synchronized {
- activeActors
- }
-
- private[actors] def setPendingCount(cnt: Int) = synchronized {
- activeActors = cnt
- }
-
-}
diff --git a/src/actors/scala/actors/scheduler/DaemonScheduler.scala b/src/actors/scala/actors/scheduler/DaemonScheduler.scala
deleted file mode 100644
index b21a1aa3e6..0000000000
--- a/src/actors/scala/actors/scheduler/DaemonScheduler.scala
+++ /dev/null
@@ -1,34 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-package scheduler
-
-/**
- * Default scheduler for actors with daemon semantics, such as those backing futures.
- *
- * @author Erik Engbrecht
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-object DaemonScheduler extends DelegatingScheduler {
-
- protected def makeNewScheduler(): IScheduler = {
- val sched = if (!ThreadPoolConfig.useForkJoin) {
- val s = new ResizableThreadPoolScheduler(true)
- s.start()
- s
- } else {
- val s = new ForkJoinScheduler(true)
- s.start()
- s
- }
- Debug.info(this+": starting new "+sched+" ["+sched.getClass+"]")
- sched
- }
-
-}
diff --git a/src/actors/scala/actors/scheduler/DelegatingScheduler.scala b/src/actors/scala/actors/scheduler/DelegatingScheduler.scala
deleted file mode 100644
index b8a81d11a9..0000000000
--- a/src/actors/scala/actors/scheduler/DelegatingScheduler.scala
+++ /dev/null
@@ -1,74 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-package scheduler
-
-import scala.concurrent.ManagedBlocker
-
-/**
- * @author Erik Engbrecht
- */
-private[actors] trait DelegatingScheduler extends IScheduler {
- protected def makeNewScheduler(): IScheduler
-
- protected var sched: IScheduler = null
-
- final def impl = synchronized {
- if ((sched eq null) || (!sched.isActive))
- sched = makeNewScheduler()
- sched
- }
-
- final def impl_= (scheduler: IScheduler): Unit = synchronized {
- //TODO: if there is already a scheduler, should it be shutdown?
- sched = scheduler
- }
-
- /**
- * Always active because it will just make a new scheduler if required
- */
- def isActive: Boolean = true
-
- def execute(fun: => Unit) = impl.execute(fun)
-
- def execute(task: Runnable) = impl.execute(task)
-
- override def executeFromActor(task: Runnable) = impl.executeFromActor(task)
-
- def shutdown(): Unit = synchronized {
- if (sched ne null) {
- sched.shutdown()
- sched = null
- }
- }
-
- def newActor(actor: TrackedReactor) = synchronized {
- val createNew = if (sched eq null)
- true
- else sched.synchronized {
- if (!sched.isActive)
- true
- else {
- sched.newActor(actor)
- false
- }
- }
- if (createNew) {
- sched = makeNewScheduler()
- sched.newActor(actor)
- }
- }
-
- def terminated(actor: TrackedReactor) = impl.terminated(actor)
-
- def onTerminate(actor: TrackedReactor)(f: => Unit) = impl.onTerminate(actor)(f)
-
- override def managedBlock(blocker: ManagedBlocker): Unit =
- impl.managedBlock(blocker)
-}
diff --git a/src/actors/scala/actors/scheduler/DrainableForkJoinPool.scala b/src/actors/scala/actors/scheduler/DrainableForkJoinPool.scala
deleted file mode 100644
index 37710ec037..0000000000
--- a/src/actors/scala/actors/scheduler/DrainableForkJoinPool.scala
+++ /dev/null
@@ -1,11 +0,0 @@
-package scala.actors
-package scheduler
-
-import java.util.Collection
-import scala.concurrent.forkjoin.{ForkJoinPool, ForkJoinTask}
-
-private class DrainableForkJoinPool(parallelism: Int, maxPoolSize: Int) extends ForkJoinPool(parallelism, ForkJoinPool.defaultForkJoinWorkerThreadFactory, null, true) {
-
- override def drainTasksTo(c: Collection[ _ >: ForkJoinTask[_]]): Int =
- super.drainTasksTo(c)
-}
diff --git a/src/actors/scala/actors/scheduler/ExecutorScheduler.scala b/src/actors/scala/actors/scheduler/ExecutorScheduler.scala
deleted file mode 100644
index 4d3ebc3c04..0000000000
--- a/src/actors/scala/actors/scheduler/ExecutorScheduler.scala
+++ /dev/null
@@ -1,95 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-package scheduler
-
-import java.util.concurrent.{Callable, ExecutorService}
-import scala.concurrent.ThreadPoolRunner
-
-/**
- * The <code>ExecutorScheduler</code> object is used to create
- * <code>ExecutorScheduler</code> instances.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-object ExecutorScheduler {
-
- private def start(sched: ExecutorScheduler): ExecutorScheduler = {
- sched.start()
- sched
- }
-
- /** Creates an <code>ExecutorScheduler</code> using the provided
- * <code>ExecutorService</code>.
- *
- * @param exec the executor to use
- * @return the scheduler
- */
- def apply(exec: ExecutorService): ExecutorScheduler =
- start(new ExecutorScheduler {
- val executor: ExecutorService = exec
- })
-
- /** Creates an <code>ExecutorScheduler</code> using the provided
- * <code>ExecutorService</code>.
- *
- * @param exec the executor to use
- * @param term whether the scheduler should automatically terminate
- * @return the scheduler
- */
- def apply(exec: ExecutorService, term: Boolean): ExecutorScheduler =
- start(new ExecutorScheduler {
- val executor: ExecutorService = exec
- override val terminate = term
- })
-
-}
-
-/**
- * The <code>ExecutorScheduler</code> class uses an
- * <code>ExecutorService</code> to execute <code>Actor</code>s.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-trait ExecutorScheduler extends Thread
- with IScheduler with TerminationService
- with ThreadPoolRunner {
-
- def execute(task: Runnable) {
- super[ThreadPoolRunner].execute(task.asInstanceOf[Task[Unit]])
- }
-
- private class RunCallable(fun: => Unit) extends Callable[Unit] with Runnable {
- def call() { fun }
- def run() { fun }
- }
-
- /** Submits a closure for execution.
- *
- * @param fun the closure to be executed
- */
- override def execute(fun: => Unit) {
- super[ThreadPoolRunner].execute((new RunCallable(fun)).asInstanceOf[Task[Unit]])
- }
-
- /** This method is called when the scheduler shuts down.
- */
- def onShutdown(): Unit =
- executor.shutdown()
-
- /** The scheduler is active if the underlying <code>ExecutorService</code>
- * has not been shut down.
- */
- def isActive =
- (executor ne null) && !executor.isShutdown
-
-}
diff --git a/src/actors/scala/actors/scheduler/ForkJoinScheduler.scala b/src/actors/scala/actors/scheduler/ForkJoinScheduler.scala
deleted file mode 100644
index 75a98db6c8..0000000000
--- a/src/actors/scala/actors/scheduler/ForkJoinScheduler.scala
+++ /dev/null
@@ -1,174 +0,0 @@
-package scala.actors
-package scheduler
-
-import java.util.{Collection, ArrayList}
-import scala.concurrent.forkjoin._
-
-/** The <code>ForkJoinScheduler</code> is backed by a lightweight
- * fork-join task execution framework.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-class ForkJoinScheduler(val initCoreSize: Int, val maxSize: Int, daemon: Boolean, fair: Boolean)
- extends Runnable with IScheduler with TerminationMonitor {
-
- private var pool = makeNewPool() // guarded by this
- private var terminating = false // guarded by this
- private var snapshoting = false // guarded by this
-
- // this has to be a java.util.Collection, since this is what
- // the ForkJoinPool returns.
- private var drainedTasks: Collection[ForkJoinTask[_]] = null
-
- protected val CHECK_FREQ = 10
-
- // this random number generator is only used in fair mode
- private lazy val random = new java.util.Random // guarded by random
-
- def this(d: Boolean, f: Boolean) {
- this(ThreadPoolConfig.corePoolSize, ThreadPoolConfig.maxPoolSize, d, f)
- }
-
- def this(d: Boolean) {
- this(d, true) // default is fair
- }
-
- def this() {
- this(false) // default is non-daemon
- }
-
- private def makeNewPool(): DrainableForkJoinPool = {
- val p = new DrainableForkJoinPool(initCoreSize, maxSize)
- Debug.info(this+": parallelism "+p.getParallelism())
- p
- }
-
- /** Starts this scheduler.
- */
- def start() {
- try {
- val t = new Thread(this)
- t.setDaemon(daemon)
- t.setName("ForkJoinScheduler")
- t.start()
- } catch {
- case e: Exception =>
- Debug.info(this+": could not create scheduler thread: "+e)
- }
- }
-
- override def run() {
- try {
- while (true) {
- this.synchronized {
- try {
- wait(CHECK_FREQ.toLong)
- } catch {
- case _: InterruptedException =>
- }
-
- if (terminating)
- throw new QuitControl
-
- if (allActorsTerminated) {
- Debug.info(this+": all actors terminated")
- terminating = true
- throw new QuitControl
- }
-
- if (!snapshoting) {
- gc()
- } else if (pool.isQuiescent()) {
- val list = new ArrayList[ForkJoinTask[_]]
- val num = pool.drainTasksTo(list)
- Debug.info(this+": drained "+num+" tasks")
- drainedTasks = list
- terminating = true
- throw new QuitControl
- }
- }
- }
- } catch {
- case _: QuitControl =>
- Debug.info(this+": initiating shutdown...")
- while (!pool.isQuiescent()) {
- try {
- Thread.sleep(10)
- } catch {
- case ignore: InterruptedException =>
- }
- }
- pool.shutdown()
- // allow thread to exit
- }
- }
-
- // TODO: when do we pass a task that is not a RecursiveAction?
- def execute(task: Runnable) {
- pool.execute(task)
- }
-
- override def executeFromActor(task: Runnable) {
- // in fair mode: 2% chance of submitting to global task queue
- if (fair && random.synchronized { random.nextInt(50) == 1 })
- pool.execute(task)
- else
- task.asInstanceOf[RecursiveAction].fork()
- }
-
- /** Submits a closure for execution.
- *
- * @param fun the closure to be executed
- */
- def execute(fun: => Unit): Unit =
- execute(new Runnable {
- def run() { fun }
- })
-
- /** Shuts down the scheduler.
- */
- def shutdown(): Unit = synchronized {
- terminating = true
- }
-
- def isActive = synchronized {
- !terminating && (pool ne null) && !pool.isShutdown()
- }
-
- override def managedBlock(blocker: scala.concurrent.ManagedBlocker) {
- ForkJoinPool.managedBlock(new ForkJoinPool.ManagedBlocker {
- def block = blocker.block()
- def isReleasable() = blocker.isReleasable
- })
- }
-
- /** Suspends the scheduler. All threads that were in use by the
- * scheduler and its internal thread pool are terminated.
- */
- def snapshot() = synchronized {
- snapshoting = true
- }
-
- /** Resumes the execution of the scheduler if it was previously
- * suspended using <code>ForkJoinScheduler.snapshot</code>.
- */
- def restart() {
- synchronized {
- if (!snapshoting)
- sys.error("snapshot has not been invoked")
- else if (isActive)
- sys.error("scheduler is still active")
- else
- snapshoting = false
-
- pool = makeNewPool()
- }
- val iter = drainedTasks.iterator()
- while (iter.hasNext()) {
- pool.execute(iter.next())
- }
- start()
- }
-
-}
diff --git a/src/actors/scala/actors/scheduler/QuitControl.scala b/src/actors/scala/actors/scheduler/QuitControl.scala
deleted file mode 100644
index b3e288aaff..0000000000
--- a/src/actors/scala/actors/scheduler/QuitControl.scala
+++ /dev/null
@@ -1,19 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors.scheduler
-
-import scala.util.control.ControlThrowable
-
-/**
- * The `QuitControl` class is used to manage control flow of certain
- * schedulers.
- *
- * @author Philipp Haller
- */
-private[scheduler] class QuitControl extends ControlThrowable
diff --git a/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala b/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala
deleted file mode 100644
index 342579db6c..0000000000
--- a/src/actors/scala/actors/scheduler/ResizableThreadPoolScheduler.scala
+++ /dev/null
@@ -1,197 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors.scheduler
-
-import scala.actors.threadpool.{ThreadPoolExecutor, TimeUnit, LinkedBlockingQueue,
- ThreadFactory}
-import scala.actors.{Debug, IScheduler}
-import scala.concurrent.ManagedBlocker
-
-/**
- * This scheduler class uses a `ThreadPoolExecutor` to execute `Actor`s.
- *
- * The scheduler attempts to shut down itself and the underlying
- * `ThreadPoolExecutor` only if `terminate` is set to true. Otherwise,
- * the scheduler must be shut down explicitly.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-class ResizableThreadPoolScheduler(protected val terminate: Boolean,
- protected val daemon: Boolean)
- extends Thread with IScheduler with TerminationMonitor {
-
- setDaemon(daemon)
-
- // guarded by this
- private var terminating = false
- // guarded by this
- private var suspending = false
-
- // this has to be a java.util.Collection, since this is what
- // the ForkJoinPool returns.
- @volatile
- private var drainedTasks: java.util.List[_] = null
-
- // guarded by this
- private var coreSize = ThreadPoolConfig.corePoolSize
- private val maxSize = ThreadPoolConfig.maxPoolSize
- private val numCores = Runtime.getRuntime().availableProcessors()
-
- protected val CHECK_FREQ = 10
-
- private class DaemonThreadFactory extends ThreadFactory {
- def newThread(r: Runnable): Thread = {
- val t = new Thread(r)
- t.setDaemon(daemon)
- t
- }
- }
- private val threadFac = new DaemonThreadFactory
-
- private def makeNewPool(): ThreadPoolExecutor = {
- val workQueue = new LinkedBlockingQueue
- new ThreadPoolExecutor(coreSize,
- maxSize,
- 60000L,
- TimeUnit.MILLISECONDS,
- workQueue,
- threadFac,
- new ThreadPoolExecutor.CallerRunsPolicy)
- }
-
- // guarded by this
- private var executor = makeNewPool()
-
- Debug.info(this+": corePoolSize = "+coreSize+", maxPoolSize = "+maxSize)
-
- def this(d: Boolean) {
- this(true, d)
- }
-
- def this() {
- this(false)
- }
-
- private def numWorkersBlocked = {
- executor.mainLock.lock()
- val iter = executor.workers.iterator()
- var numBlocked = 0
- while (iter.hasNext()) {
- val w = iter.next().asInstanceOf[ThreadPoolExecutor#Worker]
- if (w.tryLock()) {
- // worker is idle
- w.unlock()
- } else {
- val s = w.thread.getState()
- if (s == Thread.State.WAITING || s == Thread.State.TIMED_WAITING)
- numBlocked += 1
- }
- }
- executor.mainLock.unlock()
- numBlocked
- }
-
- override def run() {
- try {
- while (true) {
- this.synchronized {
- try {
- wait(CHECK_FREQ.toLong)
- } catch {
- case _: InterruptedException =>
- }
-
- if (terminating)
- throw new QuitControl
-
- if (!suspending) {
- gc()
-
- // check if we need more worker threads
- val activeBlocked = numWorkersBlocked
- if (coreSize - activeBlocked < numCores && coreSize < maxSize) {
- coreSize = numCores + activeBlocked
- executor.setCorePoolSize(coreSize)
- } else if (terminate && allActorsTerminated) {
- // if all worker threads idle terminate
- if (executor.getActiveCount() == 0) {
- Debug.info(this+": initiating shutdown...")
- Debug.info(this+": corePoolSize = "+coreSize+", maxPoolSize = "+maxSize)
-
- terminating = true
- throw new QuitControl
- }
- }
- } else {
- drainedTasks = executor.shutdownNow()
- Debug.info(this+": drained "+drainedTasks.size()+" tasks")
- terminating = true
- throw new QuitControl
- }
- } // sync
- }
- } catch {
- case _: QuitControl =>
- executor.shutdown()
- // allow thread to exit
- }
- }
-
- def execute(task: Runnable): Unit =
- executor execute task
-
- def execute(fun: => Unit): Unit =
- executor.execute(new Runnable {
- def run() { fun }
- })
-
- /** Shuts down the scheduler.
- */
- def shutdown(): Unit = synchronized {
- terminating = true
- }
-
- def isActive = synchronized {
- !terminating && (executor ne null) && !executor.isShutdown()
- }
-
- def managedBlock(blocker: ManagedBlocker) {
- blocker.block()
- }
-
- /** Suspends the scheduler. All threads that were in use by the
- * scheduler and its internal thread pool are terminated.
- */
- def snapshot() = synchronized {
- suspending = true
- }
-
- /** Resumes the execution of the scheduler if it was previously
- * suspended using `snapshot`.
- */
- def restart() {
- synchronized {
- if (!suspending)
- sys.error("snapshot has not been invoked")
- else if (isActive)
- sys.error("scheduler is still active")
- else
- suspending = false
-
- executor = makeNewPool()
- }
- val iter = drainedTasks.iterator()
- while (iter.hasNext()) {
- executor.execute(iter.next().asInstanceOf[Runnable])
- }
- start()
- }
-
-}
diff --git a/src/actors/scala/actors/scheduler/SingleThreadedScheduler.scala b/src/actors/scala/actors/scheduler/SingleThreadedScheduler.scala
deleted file mode 100644
index 03b235fe74..0000000000
--- a/src/actors/scala/actors/scheduler/SingleThreadedScheduler.scala
+++ /dev/null
@@ -1,69 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-package scheduler
-
-import scala.collection.mutable
-
-/**
- * This scheduler executes actor tasks on the current thread.
- *
- * @author Philipp Haller
- */
-@deprecated("Use the akka.actor package instead. For migration from the scala.actors package refer to the Actors Migration Guide.", "2.11.0")
-class SingleThreadedScheduler extends IScheduler {
-
- private val tasks = new mutable.Queue[Runnable]
-
- /** The maximum number of nested tasks that are run
- * without unwinding the call stack.
- */
- protected val maxNesting = 10
-
- private var curNest = 0
- private var isShutdown = false
-
- def execute(task: Runnable) {
- if (curNest < maxNesting) {
- curNest += 1
- task.run()
- } else {
- curNest = 0
- tasks += task
- }
- }
-
- def execute(fun: => Unit): Unit =
- execute(new Runnable {
- def run() { fun }
- })
-
- def shutdown() {
- isShutdown = false
- while (!tasks.isEmpty) {
- val task = tasks.dequeue()
- task.run()
- }
- isShutdown = true
- }
-
- def newActor(actor: TrackedReactor) {}
- def terminated(actor: TrackedReactor) {}
-
- // TODO: run termination handlers at end of shutdown.
- def onTerminate(actor: TrackedReactor)(f: => Unit) {}
-
- def isActive =
- !isShutdown
-
- def managedBlock(blocker: scala.concurrent.ManagedBlocker) {
- blocker.block()
- }
-}
diff --git a/src/actors/scala/actors/scheduler/TerminationMonitor.scala b/src/actors/scala/actors/scheduler/TerminationMonitor.scala
deleted file mode 100644
index 9f26ca8d69..0000000000
--- a/src/actors/scala/actors/scheduler/TerminationMonitor.scala
+++ /dev/null
@@ -1,69 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.actors
-package scheduler
-
-import scala.collection.mutable
-
-private[scheduler] trait TerminationMonitor {
- _: IScheduler =>
-
- protected var activeActors = 0
- protected val terminationHandlers = new mutable.HashMap[TrackedReactor, () => Unit]
- private var started = false
-
- /** newActor is invoked whenever a new actor is started. */
- def newActor(a: TrackedReactor) = synchronized {
- activeActors += 1
- if (!started)
- started = true
- }
-
- /** Registers a closure to be executed when the specified
- * actor terminates.
- *
- * @param a the actor
- * @param f the closure to be registered
- */
- def onTerminate(a: TrackedReactor)(f: => Unit): Unit = synchronized {
- terminationHandlers += (a -> (() => f))
- }
-
- /** Registers that the specified actor has terminated.
- *
- * @param a the actor that has terminated
- */
- def terminated(a: TrackedReactor) = {
- // obtain termination handler (if any)
- val todo = synchronized {
- terminationHandlers.get(a) match {
- case Some(handler) =>
- terminationHandlers -= a
- handler
- case None =>
- () => { /* do nothing */ }
- }
- }
-
- // invoke termination handler (if any)
- todo()
-
- synchronized {
- activeActors -= 1
- }
- }
-
- /** Checks whether all actors have terminated. */
- private[actors] def allActorsTerminated: Boolean = synchronized {
- started && activeActors <= 0
- }
-
- /** Checks for actors that have become garbage. */
- protected def gc() {}
-}
diff --git a/src/actors/scala/actors/scheduler/TerminationService.scala b/src/actors/scala/actors/scheduler/TerminationService.scala
deleted file mode 100644
index ed1805ee1e..0000000000
--- a/src/actors/scala/actors/scheduler/TerminationService.scala
+++ /dev/null
@@ -1,68 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-package scheduler
-
-import java.lang.{Thread, InterruptedException}
-
-/**
- * The <code>TerminationService</code> class starts a new thread
- * that is used to check regularly if the scheduler can be
- * shut down, because all started actors are known to
- * have terminated.
- *
- * @author Philipp Haller
- */
-private[scheduler] trait TerminationService extends TerminationMonitor {
- _: Thread with IScheduler =>
-
- private var terminating = false
-
- /** Indicates whether the scheduler should terminate when all
- * actors have terminated.
- */
- protected val terminate = true
-
- protected val CHECK_FREQ = 50
-
- def onShutdown(): Unit
-
- override def run() {
- try {
- while (true) {
- this.synchronized {
- try {
- wait(CHECK_FREQ.toLong)
- } catch {
- case _: InterruptedException =>
- }
-
- if (terminating || (terminate && allActorsTerminated))
- throw new QuitControl
-
- gc()
- }
- }
- } catch {
- case _: QuitControl =>
- Debug.info(this+": initiating shutdown...")
- // invoke shutdown hook
- onShutdown()
- // allow thread to exit
- }
- }
-
- /** Shuts down the scheduler.
- */
- def shutdown(): Unit = synchronized {
- terminating = true
- }
-
-}
diff --git a/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala b/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala
deleted file mode 100644
index bfd4e7ac40..0000000000
--- a/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala
+++ /dev/null
@@ -1,50 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2005-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-package scala.actors
-package scheduler
-
-import scala.util.Properties.{ javaVersion, javaVmVendor, isJavaAtLeast, propIsSetTo, propOrNone }
-
-/**
- * @author Erik Engbrecht
- * @author Philipp Haller
- */
-private[actors] object ThreadPoolConfig {
- private val rt = Runtime.getRuntime()
- private val minNumThreads = 4
-
- private def getIntegerProp(propName: String): Option[Int] =
- try propOrNone(propName) map (_.toInt)
- catch { case _: SecurityException | _: NumberFormatException => None }
-
- val corePoolSize = getIntegerProp("actors.corePoolSize") match {
- case Some(i) if i > 0 => i
- case _ => {
- val byCores = rt.availableProcessors() * 2
- if (byCores > minNumThreads) byCores else minNumThreads
- }
- }
-
- val maxPoolSize = {
- val preMaxSize = getIntegerProp("actors.maxPoolSize") getOrElse 256
- if (preMaxSize >= corePoolSize) preMaxSize else corePoolSize
- }
-
- private[actors] def useForkJoin: Boolean =
- try !propIsSetTo("actors.enableForkJoin", "false") &&
- (propIsSetTo("actors.enableForkJoin", "true") || {
- Debug.info(this+": java.version = "+javaVersion)
- Debug.info(this+": java.vm.vendor = "+javaVmVendor)
- isJavaAtLeast("1.6")
- })
- catch {
- case _: SecurityException => false
- }
-}
diff --git a/src/actors/scala/actors/threadpool/AbstractCollection.java b/src/actors/scala/actors/threadpool/AbstractCollection.java
deleted file mode 100644
index 195a0064ab..0000000000
--- a/src/actors/scala/actors/threadpool/AbstractCollection.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Written by Dawid Kurzyniec, based on public domain code written by Doug Lea
- * and publicly available documentation, and released to the public domain, as
- * explained at http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-import scala.actors.threadpool.helpers.Utils;
-
-/**
- * Overrides toArray() and toArray(Object[]) in AbstractCollection to provide
- * implementations valid for concurrent collections.
- *
- * @author Doug Lea
- * @author Dawid Kurzyniec
- */
-public abstract class AbstractCollection extends java.util.AbstractCollection {
-
- /**
- * Sole constructor. (For invocation by subclass constructors, typically
- * implicit.)
- */
- protected AbstractCollection() { super(); }
-
- public Object[] toArray() {
- return Utils.collectionToArray(this);
- }
-
- public Object[] toArray(Object[] a) {
- return Utils.collectionToArray(this, a);
- }
-}
diff --git a/src/actors/scala/actors/threadpool/AbstractExecutorService.java b/src/actors/scala/actors/threadpool/AbstractExecutorService.java
deleted file mode 100644
index 4a12aa3c28..0000000000
--- a/src/actors/scala/actors/threadpool/AbstractExecutorService.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-import scala.actors.threadpool.helpers.*;
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Iterator;
-
-/**
- * Provides default implementations of {@link ExecutorService}
- * execution methods. This class implements the <tt>submit</tt>,
- * <tt>invokeAny</tt> and <tt>invokeAll</tt> methods using a
- * {@link RunnableFuture} returned by <tt>newTaskFor</tt>, which defaults
- * to the {@link FutureTask} class provided in this package. For example,
- * the implementation of <tt>submit(Runnable)</tt> creates an
- * associated <tt>RunnableFuture</tt> that is executed and
- * returned. Subclasses may override the <tt>newTaskFor</tt> methods
- * to return <tt>RunnableFuture</tt> implementations other than
- * <tt>FutureTask</tt>.
- *
- * <p> <b>Extension example</b>. Here is a sketch of a class
- * that customizes {@link ThreadPoolExecutor} to use
- * a <tt>CustomTask</tt> class instead of the default <tt>FutureTask</tt>:
- * <pre>
- * public class CustomThreadPoolExecutor extends ThreadPoolExecutor {
- *
- * static class CustomTask&lt;V&gt; implements RunnableFuture&lt;V&gt; {...}
- *
- * protected &lt;V&gt; RunnableFuture&lt;V&gt; newTaskFor(Callable&lt;V&gt; c) {
- * return new CustomTask&lt;V&gt;(c);
- * }
- * protected &lt;V&gt; RunnableFuture&lt;V&gt; newTaskFor(Runnable r, V v) {
- * return new CustomTask&lt;V&gt;(r, v);
- * }
- * // ... add constructors, etc.
- * }
- * </pre>
- * @since 1.5
- * @author Doug Lea
- */
-public abstract class AbstractExecutorService implements ExecutorService {
-
- /**
- * Returns a <tt>RunnableFuture</tt> for the given runnable and default
- * value.
- *
- * @param runnable the runnable task being wrapped
- * @param value the default value for the returned future
- * @return a <tt>RunnableFuture</tt> which when run will run the
- * underlying runnable and which, as a <tt>Future</tt>, will yield
- * the given value as its result and provide for cancellation of
- * the underlying task.
- * @since 1.6
- */
- protected RunnableFuture newTaskFor(Runnable runnable, Object value) {
- return new FutureTask(runnable, value);
- }
-
- /**
- * Returns a <tt>RunnableFuture</tt> for the given callable task.
- *
- * @param callable the callable task being wrapped
- * @return a <tt>RunnableFuture</tt> which when run will call the
- * underlying callable and which, as a <tt>Future</tt>, will yield
- * the callable's result as its result and provide for
- * cancellation of the underlying task.
- * @since 1.6
- */
- protected RunnableFuture newTaskFor(Callable callable) {
- return new FutureTask(callable);
- }
-
- /**
- * @throws RejectedExecutionException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- */
- public Future submit(Runnable task) {
- if (task == null) throw new NullPointerException();
- RunnableFuture ftask = newTaskFor(task, null);
- execute(ftask);
- return ftask;
- }
-
- /**
- * @throws RejectedExecutionException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- */
- public Future submit(Runnable task, Object result) {
- if (task == null) throw new NullPointerException();
- RunnableFuture ftask = newTaskFor(task, result);
- execute(ftask);
- return ftask;
- }
-
- /**
- * @throws RejectedExecutionException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- */
- public Future submit(Callable task) {
- if (task == null) throw new NullPointerException();
- RunnableFuture ftask = newTaskFor(task);
- execute(ftask);
- return ftask;
- }
-
- /**
- * the main mechanics of invokeAny.
- */
- private Object doInvokeAny(Collection tasks,
- boolean timed, long nanos)
- throws InterruptedException, ExecutionException, TimeoutException {
- if (tasks == null)
- throw new NullPointerException();
- int ntasks = tasks.size();
- if (ntasks == 0)
- throw new IllegalArgumentException();
- List<Future> futures = new ArrayList<Future>(ntasks);
- ExecutorCompletionService ecs =
- new ExecutorCompletionService(this);
-
- // For efficiency, especially in executors with limited
- // parallelism, check to see if previously submitted tasks are
- // done before submitting more of them. This interleaving
- // plus the exception mechanics account for messiness of main
- // loop.
-
- try {
- // Record exceptions so that if we fail to obtain any
- // result, we can throw the last exception we got.
- ExecutionException ee = null;
- long lastTime = (timed)? Utils.nanoTime() : 0;
- Iterator it = tasks.iterator();
-
- // Start one task for sure; the rest incrementally
- futures.add(ecs.submit((Callable)it.next()));
- --ntasks;
- int active = 1;
-
- for (;;) {
- Future f = ecs.poll();
- if (f == null) {
- if (ntasks > 0) {
- --ntasks;
- futures.add(ecs.submit((Callable)it.next()));
- ++active;
- }
- else if (active == 0)
- break;
- else if (timed) {
- f = ecs.poll(nanos, TimeUnit.NANOSECONDS);
- if (f == null)
- throw new TimeoutException();
- long now = Utils.nanoTime();
- nanos -= now - lastTime;
- lastTime = now;
- }
- else
- f = ecs.take();
- }
- if (f != null) {
- --active;
- try {
- return f.get();
- } catch (InterruptedException ie) {
- throw ie;
- } catch (ExecutionException eex) {
- ee = eex;
- } catch (RuntimeException rex) {
- ee = new ExecutionException(rex);
- }
- }
- }
-
- if (ee == null)
- ee = new ExecutionException();
- throw ee;
-
- } finally {
- for (Iterator f = futures.iterator(); f.hasNext();)
- ((Future)f.next()).cancel(true);
- }
- }
-
- public Object invokeAny(Collection tasks)
- throws InterruptedException, ExecutionException {
- try {
- return doInvokeAny(tasks, false, 0);
- } catch (TimeoutException cannotHappen) {
- assert false;
- return null;
- }
- }
-
- public Object invokeAny(Collection tasks,
- long timeout, TimeUnit unit)
- throws InterruptedException, ExecutionException, TimeoutException {
- return doInvokeAny(tasks, true, unit.toNanos(timeout));
- }
-
- public List<Future> invokeAll(Collection tasks) throws InterruptedException {
- if (tasks == null)
- throw new NullPointerException();
- List<Future> futures = new ArrayList<Future>(tasks.size());
- boolean done = false;
- try {
- for (Iterator t = tasks.iterator(); t.hasNext();) {
- RunnableFuture f = newTaskFor((Callable)t.next());
- futures.add(f);
- execute(f);
- }
- for (Iterator i = futures.iterator(); i.hasNext();) {
- Future f = (Future) i.next();
- if (!f.isDone()) {
- try {
- f.get();
- } catch (CancellationException ignore) {
- } catch (ExecutionException ignore) {
- }
- }
- }
- done = true;
- return futures;
- } finally {
- if (!done)
- for (Iterator i = futures.iterator(); i.hasNext();) {
- Future f = (Future) i.next();
- f.cancel(true);
- }
- }
- }
-
- public List<Future> invokeAll(Collection tasks,
- long timeout, TimeUnit unit)
- throws InterruptedException {
- if (tasks == null || unit == null)
- throw new NullPointerException();
- long nanos = unit.toNanos(timeout);
- List<Future> futures = new ArrayList<Future>(tasks.size());
- boolean done = false;
- try {
- for (Iterator t = tasks.iterator(); t.hasNext();)
- futures.add(newTaskFor((Callable)t.next()));
-
- long lastTime = Utils.nanoTime();
-
- // Interleave time checks and calls to execute in case
- // executor doesn't have any/much parallelism.
- Iterator it = futures.iterator();
- while (it.hasNext()) {
- execute((Runnable)(it.next()));
- long now = Utils.nanoTime();
- nanos -= (now - lastTime);
- lastTime = now;
- if (nanos <= 0)
- return futures;
- }
-
- for (Iterator i = futures.iterator(); i.hasNext();) {
- Future f = (Future)i.next();
- if (!f.isDone()) {
- if (nanos <= 0)
- return futures;
- try {
- f.get(nanos, TimeUnit.NANOSECONDS);
- } catch (CancellationException ignore) {
- } catch (ExecutionException ignore) {
- } catch (TimeoutException toe) {
- return futures;
- }
- long now = Utils.nanoTime();
- nanos -= now - lastTime;
- lastTime = now;
- }
- }
- done = true;
- return futures;
- } finally {
- if (!done)
- for (Iterator i = futures.iterator(); i.hasNext();) {
- Future f = (Future) i.next();
- f.cancel(true);
- }
- }
- }
-
-}
diff --git a/src/actors/scala/actors/threadpool/AbstractQueue.java b/src/actors/scala/actors/threadpool/AbstractQueue.java
deleted file mode 100644
index 84ddc136bc..0000000000
--- a/src/actors/scala/actors/threadpool/AbstractQueue.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-import java.util.Iterator;
-import java.util.Collection;
-import java.util.NoSuchElementException;
-
-/**
- * This class provides skeletal implementations of some {@link Queue}
- * operations. The implementations in this class are appropriate when
- * the base implementation does <em>not</em> allow <tt>null</tt>
- * elements. Methods {@link #add add}, {@link #remove remove}, and
- * {@link #element element} are based on {@link #offer offer}, {@link
- * #poll poll}, and {@link #peek peek}, respectively but throw
- * exceptions instead of indicating failure via <tt>false</tt> or
- * <tt>null</tt> returns.
- *
- * <p> A <tt>Queue</tt> implementation that extends this class must
- * minimally define a method {@link Queue#offer} which does not permit
- * insertion of <tt>null</tt> elements, along with methods {@link
- * Queue#peek}, {@link Queue#poll}, {@link Collection#size}, and a
- * {@link Collection#iterator} supporting {@link
- * Iterator#remove}. Typically, additional methods will be overridden
- * as well. If these requirements cannot be met, consider instead
- * subclassing {@link AbstractCollection}.
- *
- * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
- * Java Collections Framework</a>.
- *
- * @since 1.5
- * @author Doug Lea
- */
-public abstract class AbstractQueue
- extends AbstractCollection
- implements Queue {
-
- /**
- * Constructor for use by subclasses.
- */
- protected AbstractQueue() {
- }
-
- /**
- * Inserts the specified element into this queue if it is possible to do so
- * immediately without violating capacity restrictions, returning
- * <tt>true</tt> upon success and throwing an <tt>IllegalStateException</tt>
- * if no space is currently available.
- *
- * <p>This implementation returns <tt>true</tt> if <tt>offer</tt> succeeds,
- * else throws an <tt>IllegalStateException</tt>.
- *
- * @param e the element to add
- * @return <tt>true</tt> (as specified by {@link Collection#add})
- * @throws IllegalStateException if the element cannot be added at this
- * time due to capacity restrictions
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null and
- * this queue does not permit null elements
- * @throws IllegalArgumentException if some property of this element
- * prevents it from being added to this queue
- */
- public boolean add(Object e) {
- if (offer(e))
- return true;
- else
- throw new IllegalStateException("Queue full");
- }
-
- /**
- * Retrieves and removes the head of this queue. This method differs
- * from {@link #poll poll} only in that it throws an exception if this
- * queue is empty.
- *
- * <p>This implementation returns the result of <tt>poll</tt>
- * unless the queue is empty.
- *
- * @return the head of this queue
- * @throws NoSuchElementException if this queue is empty
- */
- public Object remove() {
- Object x = poll();
- if (x != null)
- return x;
- else
- throw new NoSuchElementException();
- }
-
-
- /**
- * Retrieves, but does not remove, the head of this queue. This method
- * differs from {@link #peek peek} only in that it throws an exception if
- * this queue is empty.
- *
- * <p>This implementation returns the result of <tt>peek</tt>
- * unless the queue is empty.
- *
- * @return the head of this queue
- * @throws NoSuchElementException if this queue is empty
- */
- public Object element() {
- Object x = peek();
- if (x != null)
- return x;
- else
- throw new NoSuchElementException();
- }
-
- /**
- * Removes all of the elements from this queue.
- * The queue will be empty after this call returns.
- *
- * <p>This implementation repeatedly invokes {@link #poll poll} until it
- * returns <tt>null</tt>.
- */
- public void clear() {
- while (poll() != null)
- ;
- }
-
- /**
- * Adds all of the elements in the specified collection to this
- * queue. Attempts to addAll of a queue to itself result in
- * <tt>IllegalArgumentException</tt>. Further, the behavior of
- * this operation is undefined if the specified collection is
- * modified while the operation is in progress.
- *
- * <p>This implementation iterates over the specified collection,
- * and adds each element returned by the iterator to this
- * queue, in turn. A runtime exception encountered while
- * trying to add an element (including, in particular, a
- * <tt>null</tt> element) may result in only some of the elements
- * having been successfully added when the associated exception is
- * thrown.
- *
- * @param c collection containing elements to be added to this queue
- * @return <tt>true</tt> if this queue changed as a result of the call
- * @throws ClassCastException if the class of an element of the specified
- * collection prevents it from being added to this queue
- * @throws NullPointerException if the specified collection contains a
- * null element and this queue does not permit null elements,
- * or if the specified collection is null
- * @throws IllegalArgumentException if some property of an element of the
- * specified collection prevents it from being added to this
- * queue, or if the specified collection is this queue
- * @throws IllegalStateException if not all the elements can be added at
- * this time due to insertion restrictions
- * @see #add(Object)
- */
- public boolean addAll(Collection c) {
- if (c == null)
- throw new NullPointerException();
- if (c == this)
- throw new IllegalArgumentException();
- boolean modified = false;
- Iterator e = c.iterator();
- while (e.hasNext()) {
- if (add(e.next()))
- modified = true;
- }
- return modified;
- }
-
-}
diff --git a/src/actors/scala/actors/threadpool/Arrays.java b/src/actors/scala/actors/threadpool/Arrays.java
deleted file mode 100644
index 85e7c8fa00..0000000000
--- a/src/actors/scala/actors/threadpool/Arrays.java
+++ /dev/null
@@ -1,811 +0,0 @@
-/*
- * Written by Dawid Kurzyniec, based on code written by Doug Lea with assistance
- * from members of JCP JSR-166 Expert Group. Released to the public domain,
- * as explained at http://creativecommons.org/licenses/publicdomain.
- */
-
-package scala.actors.threadpool;
-
-import java.lang.reflect.Array;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Comparator;
-
-public class Arrays {
-
- private Arrays() {}
-
- public static void sort(long[] a) {
- java.util.Arrays.sort(a);
- }
-
- public static void sort(long[] a, int fromIndex, int toIndex) {
- java.util.Arrays.sort(a, fromIndex, toIndex);
- }
-
- public static void sort(int[] a) {
- java.util.Arrays.sort(a);
- }
-
- public static void sort(int[] a, int fromIndex, int toIndex) {
- java.util.Arrays.sort(a, fromIndex, toIndex);
- }
-
- public static void sort(short[] a) {
- java.util.Arrays.sort(a);
- }
-
- public static void sort(short[] a, int fromIndex, int toIndex) {
- java.util.Arrays.sort(a, fromIndex, toIndex);
- }
-
- public static void sort(char[] a) {
- java.util.Arrays.sort(a);
- }
-
- public static void sort(char[] a, int fromIndex, int toIndex) {
- java.util.Arrays.sort(a, fromIndex, toIndex);
- }
-
- public static void sort(byte[] a) {
- java.util.Arrays.sort(a);
- }
-
- public static void sort(byte[] a, int fromIndex, int toIndex) {
- java.util.Arrays.sort(a, fromIndex, toIndex);
- }
-
- public static void sort(double[] a) {
- java.util.Arrays.sort(a);
- }
-
- public static void sort(double[] a, int fromIndex, int toIndex) {
- java.util.Arrays.sort(a, fromIndex, toIndex);
- }
-
- public static void sort(float[] a) {
- java.util.Arrays.sort(a);
- }
-
- public static void sort(float[] a, int fromIndex, int toIndex) {
- java.util.Arrays.sort(a, fromIndex, toIndex);
- }
-
-
- public static void sort(Object[] a) {
- java.util.Arrays.sort(a);
- }
-
- public static void sort(Object[] a, int fromIndex, int toIndex) {
- java.util.Arrays.sort(a, fromIndex, toIndex);
- }
-
- public static void sort(Object[] a, Comparator c) {
- java.util.Arrays.sort(a, c);
- }
-
- public static void sort(Object[] a, int fromIndex, int toIndex, Comparator c) {
- java.util.Arrays.sort(a, fromIndex, toIndex, c);
- }
-
-
- // Searching
-
- public static int binarySearch(long[] a, long key) {
- return java.util.Arrays.binarySearch(a, key);
- }
-
- public static int binarySearch(int[] a, int key) {
- return java.util.Arrays.binarySearch(a, key);
- }
-
- public static int binarySearch(short[] a, short key) {
- return java.util.Arrays.binarySearch(a, key);
- }
-
- public static int binarySearch(char[] a, char key) {
- return java.util.Arrays.binarySearch(a, key);
- }
-
- public static int binarySearch(byte[] a, byte key) {
- return java.util.Arrays.binarySearch(a, key);
- }
-
- public static int binarySearch(double[] a, double key) {
- return java.util.Arrays.binarySearch(a, key);
- }
-
- public static int binarySearch(float[] a, float key) {
- return java.util.Arrays.binarySearch(a, key);
- }
-
- public static int binarySearch(Object[] a, Object key) {
- return java.util.Arrays.binarySearch(a, key);
- }
-
- public static int binarySearch(Object[] a, Object key, Comparator c) {
- return java.util.Arrays.binarySearch(a, key, c);
- }
-
-
- // Equality Testing
-
- public static boolean equals(long[] a, long[] a2) {
- return java.util.Arrays.equals(a, a2);
- }
-
- public static boolean equals(int[] a, int[] a2) {
- return java.util.Arrays.equals(a, a2);
- }
-
- public static boolean equals(short[] a, short a2[]) {
- return java.util.Arrays.equals(a, a2);
- }
-
- public static boolean equals(char[] a, char[] a2) {
- return java.util.Arrays.equals(a, a2);
- }
-
- public static boolean equals(byte[] a, byte[] a2) {
- return java.util.Arrays.equals(a, a2);
- }
-
- public static boolean equals(boolean[] a, boolean[] a2) {
- return java.util.Arrays.equals(a, a2);
- }
-
- public static boolean equals(double[] a, double[] a2) {
- return java.util.Arrays.equals(a, a2);
- }
-
- public static boolean equals(float[] a, float[] a2) {
- return java.util.Arrays.equals(a, a2);
- }
-
- public static boolean equals(Object[] a, Object[] a2) {
- return java.util.Arrays.equals(a, a2);
- }
-
-
- // Filling
-
- public static void fill(long[] a, long val) {
- java.util.Arrays.fill(a, val);
- }
-
- public static void fill(long[] a, int fromIndex, int toIndex, long val) {
- java.util.Arrays.fill(a, fromIndex, toIndex, val);
- }
-
- public static void fill(int[] a, int val) {
- java.util.Arrays.fill(a, val);
- }
-
- public static void fill(int[] a, int fromIndex, int toIndex, int val) {
- java.util.Arrays.fill(a, fromIndex, toIndex, val);
- }
-
- public static void fill(short[] a, short val) {
- java.util.Arrays.fill(a, val);
- }
-
- public static void fill(short[] a, int fromIndex, int toIndex, short val) {
- java.util.Arrays.fill(a, fromIndex, toIndex, val);
- }
-
- public static void fill(char[] a, char val) {
- java.util.Arrays.fill(a, val);
- }
-
- public static void fill(char[] a, int fromIndex, int toIndex, char val) {
- java.util.Arrays.fill(a, fromIndex, toIndex, val);
- }
-
- public static void fill(byte[] a, byte val) {
- java.util.Arrays.fill(a, val);
- }
-
- public static void fill(byte[] a, int fromIndex, int toIndex, byte val) {
- java.util.Arrays.fill(a, fromIndex, toIndex, val);
- }
-
- public static void fill(boolean[] a, boolean val) {
- java.util.Arrays.fill(a, val);
- }
-
- public static void fill(boolean[] a, int fromIndex, int toIndex,
- boolean val) {
- java.util.Arrays.fill(a, fromIndex, toIndex, val);
- }
-
- public static void fill(double[] a, double val) {
- java.util.Arrays.fill(a, val);
- }
-
- public static void fill(double[] a, int fromIndex, int toIndex,double val) {
- java.util.Arrays.fill(a, fromIndex, toIndex, val);
- }
-
- public static void fill(float[] a, float val) {
- java.util.Arrays.fill(a, val);
- }
-
- public static void fill(float[] a, int fromIndex, int toIndex, float val) {
- java.util.Arrays.fill(a, fromIndex, toIndex, val);
- }
-
- public static void fill(Object[] a, Object val) {
- java.util.Arrays.fill(a, val);
- }
-
- public static void fill(Object[] a, int fromIndex, int toIndex, Object val) {
- java.util.Arrays.fill(a, fromIndex, toIndex, val);
- }
-
-
- // Cloning
-
- /**
- * @since 1.6
- */
- public static Object[] copyOf(Object[] original, int newLength) {
- return copyOf(original, newLength, original.getClass());
- }
-
- /**
- * @since 1.6
- */
- public static Object[] copyOf(Object[] original, int newLength, Class newType) {
- Object[] arr = (newType == Object[].class) ? new Object[newLength] :
- (Object[])Array.newInstance(newType.getComponentType(), newLength);
- int len = (original.length < newLength ? original.length : newLength);
- System.arraycopy(original, 0, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static byte[] copyOf(byte[] original, int newLength) {
- byte[] arr = new byte[newLength];
- int len = (original.length < newLength ? original.length : newLength);
- System.arraycopy(original, 0, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static short[] copyOf(short[] original, int newLength) {
- short[] arr = new short[newLength];
- int len = (original.length < newLength ? original.length : newLength);
- System.arraycopy(original, 0, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static int[] copyOf(int[] original, int newLength) {
- int[] arr = new int[newLength];
- int len = (original.length < newLength ? original.length : newLength);
- System.arraycopy(original, 0, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static long[] copyOf(long[] original, int newLength) {
- long[] arr = new long[newLength];
- int len = (original.length < newLength ? original.length : newLength);
- System.arraycopy(original, 0, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static char[] copyOf(char[] original, int newLength) {
- char[] arr = new char[newLength];
- int len = (original.length < newLength ? original.length : newLength);
- System.arraycopy(original, 0, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static float[] copyOf(float[] original, int newLength) {
- float[] arr = new float[newLength];
- int len = (original.length < newLength ? original.length : newLength);
- System.arraycopy(original, 0, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static double[] copyOf(double[] original, int newLength) {
- double[] arr = new double[newLength];
- int len = (original.length < newLength ? original.length : newLength);
- System.arraycopy(original, 0, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static boolean[] copyOf(boolean[] original, int newLength) {
- boolean[] arr = new boolean[newLength];
- int len = (original.length < newLength ? original.length : newLength);
- System.arraycopy(original, 0, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static Object[] copyOfRange(Object[] original, int from, int to) {
- return copyOfRange(original, from, to, original.getClass());
- }
-
- /**
- * @since 1.6
- */
- public static Object[] copyOfRange(Object[] original, int from, int to, Class newType) {
- int newLength = to - from;
- if (newLength < 0) throw new IllegalArgumentException(from + " > " + to);
- Object[] arr = (newType == Object[].class) ? new Object[newLength] :
- (Object[])Array.newInstance(newType.getComponentType(), newLength);
- int ceil = original.length-from;
- int len = (ceil < newLength) ? ceil : newLength;
- System.arraycopy(original, from, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static byte[] copyOfRange(byte[] original, int from, int to) {
- int newLength = to - from;
- if (newLength < 0) throw new IllegalArgumentException(from + " > " + to);
- byte[] arr = new byte[newLength];
- int ceil = original.length-from;
- int len = (ceil < newLength) ? ceil : newLength;
- System.arraycopy(original, from, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static short[] copyOfRange(short[] original, int from, int to) {
- int newLength = to - from;
- if (newLength < 0) throw new IllegalArgumentException(from + " > " + to);
- short[] arr = new short[newLength];
- int ceil = original.length-from;
- int len = (ceil < newLength) ? ceil : newLength;
- System.arraycopy(original, from, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static int[] copyOfRange(int[] original, int from, int to) {
- int newLength = to - from;
- if (newLength < 0) throw new IllegalArgumentException(from + " > " + to);
- int[] arr = new int[newLength];
- int ceil = original.length-from;
- int len = (ceil < newLength) ? ceil : newLength;
- System.arraycopy(original, from, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static long[] copyOfRange(long[] original, int from, int to) {
- int newLength = to - from;
- if (newLength < 0) throw new IllegalArgumentException(from + " > " + to);
- long[] arr = new long[newLength];
- int ceil = original.length-from;
- int len = (ceil < newLength) ? ceil : newLength;
- System.arraycopy(original, from, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static char[] copyOfRange(char[] original, int from, int to) {
- int newLength = to - from;
- if (newLength < 0) throw new IllegalArgumentException(from + " > " + to);
- char[] arr = new char[newLength];
- int ceil = original.length-from;
- int len = (ceil < newLength) ? ceil : newLength;
- System.arraycopy(original, from, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static float[] copyOfRange(float[] original, int from, int to) {
- int newLength = to - from;
- if (newLength < 0) throw new IllegalArgumentException(from + " > " + to);
- float[] arr = new float[newLength];
- int ceil = original.length-from;
- int len = (ceil < newLength) ? ceil : newLength;
- System.arraycopy(original, from, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static double[] copyOfRange(double[] original, int from, int to) {
- int newLength = to - from;
- if (newLength < 0) throw new IllegalArgumentException(from + " > " + to);
- double[] arr = new double[newLength];
- int ceil = original.length-from;
- int len = (ceil < newLength) ? ceil : newLength;
- System.arraycopy(original, from, arr, 0, len);
- return arr;
- }
-
- /**
- * @since 1.6
- */
- public static boolean[] copyOfRange(boolean[] original, int from, int to) {
- int newLength = to - from;
- if (newLength < 0) throw new IllegalArgumentException(from + " > " + to);
- boolean[] arr = new boolean[newLength];
- int ceil = original.length-from;
- int len = (ceil < newLength) ? ceil : newLength;
- System.arraycopy(original, from, arr, 0, len);
- return arr;
- }
-
-
- public static List asList(Object[] a) {
- return java.util.Arrays.asList(a);
- }
-
- /**
- * @since 1.5
- */
- public static int hashCode(long a[]) {
- if (a == null) return 0;
- int hash = 1;
- for (int i=0; i<a.length; i++) {
- long e = a[i];
- hash = 31*hash + (int)(e ^ (e >>> 32));
- }
- return hash;
- }
-
- /**
- * @since 1.5
- */
- public static int hashCode(int a[]) {
- if (a == null) return 0;
- int hash = 1;
- for (int i=0; i<a.length; i++) {
- hash = 31*hash + a[i];
- }
- return hash;
- }
-
- /**
- * @since 1.5
- */
- public static int hashCode(short a[]) {
- if (a == null) return 0;
- int hash = 1;
- for (int i=0; i<a.length; i++) {
- hash = 31*hash + a[i];
- }
- return hash;
- }
-
- /**
- * @since 1.5
- */
- public static int hashCode(char a[]) {
- if (a == null) return 0;
- int hash = 1;
- for (int i=0; i<a.length; i++) {
- hash = 31*hash + a[i];
- }
- return hash;
- }
-
- /**
- * @since 1.5
- */
- public static int hashCode(byte a[]) {
- if (a == null) return 0;
- int hash = 1;
- for (int i=0; i<a.length; i++) {
- hash = 31*hash + a[i];
- }
- return hash;
- }
-
- /**
- * @since 1.5
- */
- public static int hashCode(boolean a[]) {
- if (a == null) return 0;
- int hash = 1;
- for (int i=0; i<a.length; i++) {
- hash = 31*hash + (a[i] ? 1231 : 1237);
- }
- return hash;
- }
-
- /**
- * @since 1.5
- */
- public static int hashCode(float a[]) {
- if (a == null) return 0;
- int hash = 1;
- for (int i=0; i<a.length; i++) {
- hash = 31*hash + Float.floatToIntBits(a[i]);
- }
- return hash;
- }
-
- /**
- * @since 1.5
- */
- public static int hashCode(double a[]) {
- if (a == null) return 0;
- int hash = 1;
- for (int i=0; i<a.length; i++) {
- long e = Double.doubleToLongBits(a[i]);
- hash = 31*hash + (int)(e ^ (e >>> 32));
- }
- return hash;
- }
-
- /**
- * @since 1.5
- */
- public static int hashCode(Object a[]) {
- if (a == null) return 0;
- int hash = 1;
- for (int i=0; i<a.length; i++) {
- Object e = a[i];
- hash = 31*hash + (e == null ? 0 : e.hashCode());
- }
- return hash;
- }
-
- /**
- * @since 1.5
- */
- public static int deepHashCode(Object a[]) {
- if (a == null) return 0;
- int hash = 1;
- for (int i=0; i<a.length; i++) {
- Object e = a[i];
- hash = 31*hash +
- (e instanceof Object[] ? deepHashCode((Object[])e) :
- (e instanceof byte[] ? hashCode((byte[])e) :
- (e instanceof short[] ? hashCode((short[])e) :
- (e instanceof int[] ? hashCode((int[])e) :
- (e instanceof long[] ? hashCode((long[])e) :
- (e instanceof char[] ? hashCode((char[])e) :
- (e instanceof boolean[] ? hashCode((boolean[])e) :
- (e instanceof float[] ? hashCode((float[])e) :
- (e instanceof double[] ? hashCode((double[])e) :
- (e != null ? e.hashCode() : 0))))))))));
- }
- return hash;
-
- }
-
- /**
- * @since 1.5
- */
- public static boolean deepEquals(Object[] a1, Object[] a2) {
- if (a1 == a2) return true;
- if (a1 == null || a2==null) return false;
- int len = a1.length;
- if (len != a2.length) return false;
- for (int i = 0; i < len; i++) {
- Object e1 = a1[i];
- Object e2 = a2[i];
- if (e1 == e2) continue;
- if (e1 == null) return false;
- boolean eq =
- (e1.getClass() != e2.getClass() || e1.getClass().isArray()) ?
- e1.equals(e2) :
- (e1 instanceof Object[] && e2 instanceof Object[]) ?
- deepEquals((Object[])e1, (Object[])e2) :
- (e1 instanceof byte[] && e2 instanceof byte[]) ?
- equals((byte[])e1, (byte[])e2) :
- (e1 instanceof short[] && e2 instanceof short[]) ?
- equals((short[])e1, (short[])e2) :
- (e1 instanceof int[] && e2 instanceof int[]) ?
- equals((int[])e1, (int[])e2) :
- (e1 instanceof long[] && e2 instanceof long[]) ?
- equals((long[])e1, (long[])e2) :
- (e1 instanceof char[] && e2 instanceof char[]) ?
- equals((char[])e1, (char[])e2) :
- (e1 instanceof boolean[] && e2 instanceof boolean[]) ?
- equals((boolean[])e1, (boolean[])e2) :
- (e1 instanceof float[] && e2 instanceof float[]) ?
- equals((float[])e1, (float[])e2) :
- (e1 instanceof double[] && e2 instanceof double[]) ?
- equals((double[])e1, (double[])e2) :
- e1.equals(e2);
-
- if (!eq) return false;
- }
- return true;
- }
-
- /**
- * @since 1.5
- */
- public static String toString(long[] a) {
- if (a == null) return "null";
- if (a.length == 0) return "[]";
- StringBuffer buf = new StringBuffer();
- buf.append('[').append(a[0]);
- for (int i=1; i<a.length; i++) buf.append(", ").append(a[i]);
- buf.append(']');
- return buf.toString();
- }
-
- /**
- * @since 1.5
- */
- public static String toString(int[] a) {
- if (a == null) return "null";
- if (a.length == 0) return "[]";
- StringBuffer buf = new StringBuffer();
- buf.append('[').append(a[0]);
- for (int i=1; i<a.length; i++) buf.append(", ").append(a[i]);
- buf.append(']');
- return buf.toString();
- }
-
- /**
- * @since 1.5
- */
- public static String toString(short[] a) {
- if (a == null) return "null";
- if (a.length == 0) return "[]";
- StringBuffer buf = new StringBuffer();
- buf.append('[').append(a[0]);
- for (int i=1; i<a.length; i++) buf.append(", ").append(a[i]);
- buf.append(']');
- return buf.toString();
- }
-
- /**
- * @since 1.5
- */
- public static String toString(char[] a) {
- if (a == null) return "null";
- if (a.length == 0) return "[]";
- StringBuffer buf = new StringBuffer();
- buf.append('[').append(a[0]);
- for (int i=1; i<a.length; i++) buf.append(", ").append(a[i]);
- buf.append(']');
- return buf.toString();
- }
-
- /**
- * @since 1.5
- */
- public static String toString(byte[] a) {
- if (a == null) return "null";
- if (a.length == 0) return "[]";
- StringBuffer buf = new StringBuffer();
- buf.append('[').append(a[0]);
- for (int i=1; i<a.length; i++) buf.append(", ").append(a[i]);
- buf.append(']');
- return buf.toString();
- }
-
- /**
- * @since 1.5
- */
- public static String toString(boolean[] a) {
- if (a == null) return "null";
- if (a.length == 0) return "[]";
- StringBuffer buf = new StringBuffer();
- buf.append('[').append(a[0]);
- for (int i=1; i<a.length; i++) buf.append(", ").append(a[i]);
- buf.append(']');
- return buf.toString();
- }
-
- /**
- * @since 1.5
- */
- public static String toString(float[] a) {
- if (a == null) return "null";
- if (a.length == 0) return "[]";
- StringBuffer buf = new StringBuffer();
- buf.append('[').append(a[0]);
- for (int i=1; i<a.length; i++) buf.append(", ").append(a[i]);
- buf.append(']');
- return buf.toString();
- }
-
- /**
- * @since 1.5
- */
- public static String toString(double[] a) {
- if (a == null) return "null";
- if (a.length == 0) return "[]";
- StringBuffer buf = new StringBuffer();
- buf.append('[').append(a[0]);
- for (int i=1; i<a.length; i++) buf.append(", ").append(a[i]);
- buf.append(']');
- return buf.toString();
- }
-
- /**
- * @since 1.5
- */
- public static String toString(Object[] a) {
- if (a == null) return "null";
- if (a.length == 0) return "[]";
- StringBuffer buf = new StringBuffer();
- buf.append('[').append(a[0]);
- for (int i=1; i<a.length; i++) buf.append(", ").append(a[i]);
- buf.append(']');
- return buf.toString();
- }
-
- /**
- * @since 1.5
- */
- public static String deepToString(Object[] a) {
- if (a == null) return "null";
- StringBuffer buf = new StringBuffer();
- deepToString(a, buf, new ArrayList());
- return buf.toString();
- }
-
- private static void deepToString(Object[] a, StringBuffer buf, List seen) {
- seen.add(a);
- buf.append('[');
- for (int i = 0; i < a.length; i++) {
- if (i>0) buf.append(", ");
- Object e = a[i];
- if (e == null) {
- buf.append("null");
- }
- else if (!e.getClass().isArray()) {
- buf.append(e.toString());
- }
- else if (e instanceof Object[]) {
- if (seen.contains(e)) buf.append("[...]");
- else deepToString((Object[])e, buf, seen);
- }
- else {
- // primitive arr
- buf.append(
- (e instanceof byte[]) ? toString( (byte[]) e) :
- (e instanceof short[]) ? toString( (short[]) e) :
- (e instanceof int[]) ? toString( (int[]) e) :
- (e instanceof long[]) ? toString( (long[]) e) :
- (e instanceof char[]) ? toString( (char[]) e) :
- (e instanceof boolean[]) ? toString( (boolean[]) e) :
- (e instanceof float[]) ? toString( (float[]) e) :
- (e instanceof double[]) ? toString( (double[]) e) : "");
- }
- }
- buf.append(']');
- seen.remove(seen.size()-1);
- }
-}
diff --git a/src/actors/scala/actors/threadpool/AtomicInteger.java b/src/actors/scala/actors/threadpool/AtomicInteger.java
deleted file mode 100644
index eedb84512a..0000000000
--- a/src/actors/scala/actors/threadpool/AtomicInteger.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-/**
- * An {@code int} value that may be updated atomically. See the
- * {@link edu.emory.mathcs.backport.java.util.concurrent.atomic} package specification for
- * description of the properties of atomic variables. An
- * {@code AtomicInteger} is used in applications such as atomically
- * incremented counters, and cannot be used as a replacement for an
- * {@link java.lang.Integer}. However, this class does extend
- * {@code Number} to allow uniform access by tools and utilities that
- * deal with numerically-based classes.
- *
- * @since 1.5
- * @author Doug Lea
-*/
-public class AtomicInteger extends Number implements java.io.Serializable {
- private static final long serialVersionUID = 6214790243416807050L;
-
- private volatile int value;
-
- /**
- * Creates a new AtomicInteger with the given initial value.
- *
- * @param initialValue the initial value
- */
- public AtomicInteger(int initialValue) {
- value = initialValue;
- }
-
- /**
- * Creates a new AtomicInteger with initial value {@code 0}.
- */
- public AtomicInteger() {
- }
-
- /**
- * Gets the current value.
- *
- * @return the current value
- */
- public final int get() {
- return value;
- }
-
- /**
- * Sets to the given value.
- *
- * @param newValue the new value
- */
- public final synchronized void set(int newValue) {
- value = newValue;
- }
-
- /**
- * Eventually sets to the given value.
- *
- * @param newValue the new value
- * @since 1.6
- */
- public final synchronized void lazySet(int newValue) {
- value = newValue;
- }
-
- /**
- * Atomically sets to the given value and returns the old value.
- *
- * @param newValue the new value
- * @return the previous value
- */
- public final synchronized int getAndSet(int newValue) {
- int old = value;
- value = newValue;
- return old;
- }
-
- /**
- * Atomically sets the value to the given updated value
- * if the current value {@code ==} the expected value.
- *
- * @param expect the expected value
- * @param update the new value
- * @return true if successful. False return indicates that
- * the actual value was not equal to the expected value.
- */
- public final synchronized boolean compareAndSet(int expect, int update) {
- if (value == expect) {
- value = update;
- return true;
- }
- else {
- return false;
- }
- }
-
- /**
- * Atomically sets the value to the given updated value
- * if the current value {@code ==} the expected value.
- *
- * <p>May <a href="package-summary.html#Spurious">fail spuriously</a>
- * and does not provide ordering guarantees, so is only rarely an
- * appropriate alternative to {@code compareAndSet}.
- *
- * @param expect the expected value
- * @param update the new value
- * @return true if successful.
- */
- public final synchronized boolean weakCompareAndSet(int expect, int update) {
- if (value == expect) {
- value = update;
- return true;
- }
- else {
- return false;
- }
- }
-
-
- /**
- * Atomically increments by one the current value.
- *
- * @return the previous value
- */
- public final synchronized int getAndIncrement() {
- return value++;
- }
-
-
- /**
- * Atomically decrements by one the current value.
- *
- * @return the previous value
- */
- public final synchronized int getAndDecrement() {
- return value--;
- }
-
-
- /**
- * Atomically adds the given value to the current value.
- *
- * @param delta the value to add
- * @return the previous value
- */
- public final synchronized int getAndAdd(int delta) {
- int old = value;
- value += delta;
- return old;
- }
-
- /**
- * Atomically increments by one the current value.
- *
- * @return the updated value
- */
- public final synchronized int incrementAndGet() {
- return ++value;
- }
-
- /**
- * Atomically decrements by one the current value.
- *
- * @return the updated value
- */
- public final synchronized int decrementAndGet() {
- return --value;
- }
-
-
- /**
- * Atomically adds the given value to the current value.
- *
- * @param delta the value to add
- * @return the updated value
- */
- public final synchronized int addAndGet(int delta) {
- return value += delta;
- }
-
- /**
- * Returns the String representation of the current value.
- * @return the String representation of the current value.
- */
- public String toString() {
- return Integer.toString(get());
- }
-
-
- public int intValue() {
- return get();
- }
-
- public long longValue() {
- return (long)get();
- }
-
- public float floatValue() {
- return (float)get();
- }
-
- public double doubleValue() {
- return (double)get();
- }
-
-}
diff --git a/src/actors/scala/actors/threadpool/BlockingQueue.java b/src/actors/scala/actors/threadpool/BlockingQueue.java
deleted file mode 100644
index 4b8c201b85..0000000000
--- a/src/actors/scala/actors/threadpool/BlockingQueue.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-import java.util.Collection;
-import java.util.Queue;
-
-/**
- * A {@link java.util.Queue} that additionally supports operations
- * that wait for the queue to become non-empty when retrieving an
- * element, and wait for space to become available in the queue when
- * storing an element.
- *
- * <p><tt>BlockingQueue</tt> methods come in four forms, with different ways
- * of handling operations that cannot be satisfied immediately, but may be
- * satisfied at some point in the future:
- * one throws an exception, the second returns a special value (either
- * <tt>null</tt> or <tt>false</tt>, depending on the operation), the third
- * blocks the current thread indefinitely until the operation can succeed,
- * and the fourth blocks for only a given maximum time limit before giving
- * up. These methods are summarized in the following table:
- *
- * <p>
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
- * <tr>
- * <td></td>
- * <td ALIGN=CENTER><em>Throws exception</em></td>
- * <td ALIGN=CENTER><em>Special value</em></td>
- * <td ALIGN=CENTER><em>Blocks</em></td>
- * <td ALIGN=CENTER><em>Times out</em></td>
- * </tr>
- * <tr>
- * <td><b>Insert</b></td>
- * <td>{@link #add add(e)}</td>
- * <td>{@link #offer offer(e)}</td>
- * <td>{@link #put put(e)}</td>
- * <td>{@link #offer(Object, long, TimeUnit) offer(e, time, unit)}</td>
- * </tr>
- * <tr>
- * <td><b>Remove</b></td>
- * <td>{@link #remove remove()}</td>
- * <td>{@link #poll poll()}</td>
- * <td>{@link #take take()}</td>
- * <td>{@link #poll(long, TimeUnit) poll(time, unit)}</td>
- * </tr>
- * <tr>
- * <td><b>Examine</b></td>
- * <td>{@link #element element()}</td>
- * <td>{@link #peek peek()}</td>
- * <td><em>not applicable</em></td>
- * <td><em>not applicable</em></td>
- * </tr>
- * </table>
- *
- * <p>A <tt>BlockingQueue</tt> does not accept <tt>null</tt> elements.
- * Implementations throw <tt>NullPointerException</tt> on attempts
- * to <tt>add</tt>, <tt>put</tt> or <tt>offer</tt> a <tt>null</tt>. A
- * <tt>null</tt> is used as a sentinel value to indicate failure of
- * <tt>poll</tt> operations.
- *
- * <p>A <tt>BlockingQueue</tt> may be capacity bounded. At any given
- * time it may have a <tt>remainingCapacity</tt> beyond which no
- * additional elements can be <tt>put</tt> without blocking.
- * A <tt>BlockingQueue</tt> without any intrinsic capacity constraints always
- * reports a remaining capacity of <tt>Integer.MAX_VALUE</tt>.
- *
- * <p> <tt>BlockingQueue</tt> implementations are designed to be used
- * primarily for producer-consumer queues, but additionally support
- * the {@link java.util.Collection} interface. So, for example, it is
- * possible to remove an arbitrary element from a queue using
- * <tt>remove(x)</tt>. However, such operations are in general
- * <em>not</em> performed very efficiently, and are intended for only
- * occasional use, such as when a queued message is cancelled.
- *
- * <p> <tt>BlockingQueue</tt> implementations are thread-safe. All
- * queuing methods achieve their effects atomically using internal
- * locks or other forms of concurrency control. However, the
- * <em>bulk</em> Collection operations <tt>addAll</tt>,
- * <tt>containsAll</tt>, <tt>retainAll</tt> and <tt>removeAll</tt> are
- * <em>not</em> necessarily performed atomically unless specified
- * otherwise in an implementation. So it is possible, for example, for
- * <tt>addAll(c)</tt> to fail (throwing an exception) after adding
- * only some of the elements in <tt>c</tt>.
- *
- * <p>A <tt>BlockingQueue</tt> does <em>not</em> intrinsically support
- * any kind of &quot;close&quot; or &quot;shutdown&quot; operation to
- * indicate that no more items will be added. The needs and usage of
- * such features tend to be implementation-dependent. For example, a
- * common tactic is for producers to insert special
- * <em>end-of-stream</em> or <em>poison</em> objects, that are
- * interpreted accordingly when taken by consumers.
- *
- * <p>
- * Usage example, based on a typical producer-consumer scenario.
- * Note that a <tt>BlockingQueue</tt> can safely be used with multiple
- * producers and multiple consumers.
- * <pre>
- * class Producer implements Runnable {
- * private final BlockingQueue queue;
- * Producer(BlockingQueue q) { queue = q; }
- * public void run() {
- * try {
- * while (true) { queue.put(produce()); }
- * } catch (InterruptedException ex) { ... handle ...}
- * }
- * Object produce() { ... }
- * }
- *
- * class Consumer implements Runnable {
- * private final BlockingQueue queue;
- * Consumer(BlockingQueue q) { queue = q; }
- * public void run() {
- * try {
- * while (true) { consume(queue.take()); }
- * } catch (InterruptedException ex) { ... handle ...}
- * }
- * void consume(Object x) { ... }
- * }
- *
- * class Setup {
- * void main() {
- * BlockingQueue q = new SomeQueueImplementation();
- * Producer p = new Producer(q);
- * Consumer c1 = new Consumer(q);
- * Consumer c2 = new Consumer(q);
- * new Thread(p).start();
- * new Thread(c1).start();
- * new Thread(c2).start();
- * }
- * }
- * </pre>
- *
- * <p>Memory consistency effects: As with other concurrent
- * collections, actions in a thread prior to placing an object into a
- * {@code BlockingQueue}
- * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
- * actions subsequent to the access or removal of that element from
- * the {@code BlockingQueue} in another thread.
- *
- * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
- * Java Collections Framework</a>.
- *
- * @since 1.5
- * @author Doug Lea
- * @param <E> the type of elements held in this collection
- */
-public interface BlockingQueue<E> extends java.util.Queue<E> {
- /**
- * Inserts the specified element into this queue if it is possible to do
- * so immediately without violating capacity restrictions, returning
- * <tt>true</tt> upon success and throwing an
- * <tt>IllegalStateException</tt> if no space is currently available.
- * When using a capacity-restricted queue, it is generally preferable to
- * use {@link #offer(Object) offer}.
- *
- * @param e the element to add
- * @return <tt>true</tt> (as specified by {@link Collection#add})
- * @throws IllegalStateException if the element cannot be added at this
- * time due to capacity restrictions
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this queue
- */
- boolean add(E e);
-
- /**
- * Inserts the specified element into this queue if it is possible to do
- * so immediately without violating capacity restrictions, returning
- * <tt>true</tt> upon success and <tt>false</tt> if no space is currently
- * available. When using a capacity-restricted queue, this method is
- * generally preferable to {@link #add}, which can fail to insert an
- * element only by throwing an exception.
- *
- * @param e the element to add
- * @return <tt>true</tt> if the element was added to this queue, else
- * <tt>false</tt>
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this queue
- */
- boolean offer(E e);
-
- /**
- * Inserts the specified element into this queue, waiting if necessary
- * for space to become available.
- *
- * @param e the element to add
- * @throws InterruptedException if interrupted while waiting
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this queue
- */
- void put(E e) throws InterruptedException;
-
- /**
- * Inserts the specified element into this queue, waiting up to the
- * specified wait time if necessary for space to become available.
- *
- * @param e the element to add
- * @param timeout how long to wait before giving up, in units of
- * <tt>unit</tt>
- * @param unit a <tt>TimeUnit</tt> determining how to interpret the
- * <tt>timeout</tt> parameter
- * @return <tt>true</tt> if successful, or <tt>false</tt> if
- * the specified waiting time elapses before space is available
- * @throws InterruptedException if interrupted while waiting
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this queue
- */
- boolean offer(E e, long timeout, TimeUnit unit)
- throws InterruptedException;
-
- /**
- * Retrieves and removes the head of this queue, waiting if necessary
- * until an element becomes available.
- *
- * @return the head of this queue
- * @throws InterruptedException if interrupted while waiting
- */
- E take() throws InterruptedException;
-
- /**
- * Retrieves and removes the head of this queue, waiting up to the
- * specified wait time if necessary for an element to become available.
- *
- * @param timeout how long to wait before giving up, in units of
- * <tt>unit</tt>
- * @param unit a <tt>TimeUnit</tt> determining how to interpret the
- * <tt>timeout</tt> parameter
- * @return the head of this queue, or <tt>null</tt> if the
- * specified waiting time elapses before an element is available
- * @throws InterruptedException if interrupted while waiting
- */
- E poll(long timeout, TimeUnit unit)
- throws InterruptedException;
-
- /**
- * Returns the number of additional elements that this queue can ideally
- * (in the absence of memory or resource constraints) accept without
- * blocking, or <tt>Integer.MAX_VALUE</tt> if there is no intrinsic
- * limit.
- *
- * <p>Note that you <em>cannot</em> always tell if an attempt to insert
- * an element will succeed by inspecting <tt>remainingCapacity</tt>
- * because it may be the case that another thread is about to
- * insert or remove an element.
- *
- * @return the remaining capacity
- */
- int remainingCapacity();
-
- /**
- * Removes a single instance of the specified element from this queue,
- * if it is present. More formally, removes an element <tt>e</tt> such
- * that <tt>o.equals(e)</tt>, if this queue contains one or more such
- * elements.
- * Returns <tt>true</tt> if this queue contained the specified element
- * (or equivalently, if this queue changed as a result of the call).
- *
- * @param o element to be removed from this queue, if present
- * @return <tt>true</tt> if this queue changed as a result of the call
- * @throws ClassCastException if the class of the specified element
- * is incompatible with this queue (optional)
- * @throws NullPointerException if the specified element is null (optional)
- */
- boolean remove(Object o);
-
- /**
- * Returns <tt>true</tt> if this queue contains the specified element.
- * More formally, returns <tt>true</tt> if and only if this queue contains
- * at least one element <tt>e</tt> such that <tt>o.equals(e)</tt>.
- *
- * @param o object to be checked for containment in this queue
- * @return <tt>true</tt> if this queue contains the specified element
- * @throws ClassCastException if the class of the specified element
- * is incompatible with this queue (optional)
- * @throws NullPointerException if the specified element is null (optional)
- */
- public boolean contains(Object o);
-
- /**
- * Removes all available elements from this queue and adds them
- * to the given collection. This operation may be more
- * efficient than repeatedly polling this queue. A failure
- * encountered while attempting to add elements to
- * collection <tt>c</tt> may result in elements being in neither,
- * either or both collections when the associated exception is
- * thrown. Attempts to drain a queue to itself result in
- * <tt>IllegalArgumentException</tt>. Further, the behavior of
- * this operation is undefined if the specified collection is
- * modified while the operation is in progress.
- *
- * @param c the collection to transfer elements into
- * @return the number of elements transferred
- * @throws UnsupportedOperationException if addition of elements
- * is not supported by the specified collection
- * @throws ClassCastException if the class of an element of this queue
- * prevents it from being added to the specified collection
- * @throws NullPointerException if the specified collection is null
- * @throws IllegalArgumentException if the specified collection is this
- * queue, or some property of an element of this queue prevents
- * it from being added to the specified collection
- */
- int drainTo(Collection<? super E> c);
-
- /**
- * Removes at most the given number of available elements from
- * this queue and adds them to the given collection. A failure
- * encountered while attempting to add elements to
- * collection <tt>c</tt> may result in elements being in neither,
- * either or both collections when the associated exception is
- * thrown. Attempts to drain a queue to itself result in
- * <tt>IllegalArgumentException</tt>. Further, the behavior of
- * this operation is undefined if the specified collection is
- * modified while the operation is in progress.
- *
- * @param c the collection to transfer elements into
- * @param maxElements the maximum number of elements to transfer
- * @return the number of elements transferred
- * @throws UnsupportedOperationException if addition of elements
- * is not supported by the specified collection
- * @throws ClassCastException if the class of an element of this queue
- * prevents it from being added to the specified collection
- * @throws NullPointerException if the specified collection is null
- * @throws IllegalArgumentException if the specified collection is this
- * queue, or some property of an element of this queue prevents
- * it from being added to the specified collection
- */
- int drainTo(Collection<? super E> c, int maxElements);
-}
diff --git a/src/actors/scala/actors/threadpool/Callable.java b/src/actors/scala/actors/threadpool/Callable.java
deleted file mode 100644
index f1b200c022..0000000000
--- a/src/actors/scala/actors/threadpool/Callable.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-/**
- * A task that returns a result and may throw an exception.
- * Implementors define a single method with no arguments called
- * <tt>call</tt>.
- *
- * <p>The <tt>Callable</tt> interface is similar to {@link
- * java.lang.Runnable}, in that both are designed for classes whose
- * instances are potentially executed by another thread. A
- * <tt>Runnable</tt>, however, does not return a result and cannot
- * throw a checked exception.
- *
- * <p> The {@link Executors} class contains utility methods to
- * convert from other common forms to <tt>Callable</tt> classes.
- *
- * @see Executor
- * @since 1.5
- * @author Doug Lea
- */
-public interface Callable {
- /**
- * Computes a result, or throws an exception if unable to do so.
- *
- * @return computed result
- * @throws Exception if unable to compute a result
- */
- Object call() throws Exception;
-}
diff --git a/src/actors/scala/actors/threadpool/CancellationException.java b/src/actors/scala/actors/threadpool/CancellationException.java
deleted file mode 100644
index c2163b83c7..0000000000
--- a/src/actors/scala/actors/threadpool/CancellationException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-/**
- * Exception indicating that the result of a value-producing task,
- * such as a {@link FutureTask}, cannot be retrieved because the task
- * was cancelled.
- *
- * @since 1.5
- * @author Doug Lea
- */
-public class CancellationException extends IllegalStateException {
- private static final long serialVersionUID = -9202173006928992231L;
-
- /**
- * Constructs a <tt>CancellationException</tt> with no detail message.
- */
- public CancellationException() {}
-
- /**
- * Constructs a <tt>CancellationException</tt> with the specified detail
- * message.
- *
- * @param message the detail message
- */
- public CancellationException(String message) {
- super(message);
- }
-}
diff --git a/src/actors/scala/actors/threadpool/CompletionService.java b/src/actors/scala/actors/threadpool/CompletionService.java
deleted file mode 100644
index 219ab7affa..0000000000
--- a/src/actors/scala/actors/threadpool/CompletionService.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-/**
- * A service that decouples the production of new asynchronous tasks
- * from the consumption of the results of completed tasks. Producers
- * <tt>submit</tt> tasks for execution. Consumers <tt>take</tt>
- * completed tasks and process their results in the order they
- * complete. A <tt>CompletionService</tt> can for example be used to
- * manage asynchronous IO, in which tasks that perform reads are
- * submitted in one part of a program or system, and then acted upon
- * in a different part of the program when the reads complete,
- * possibly in a different order than they were requested.
- *
- * <p>Typically, a <tt>CompletionService</tt> relies on a separate
- * {@link Executor} to actually execute the tasks, in which case the
- * <tt>CompletionService</tt> only manages an internal completion
- * queue. The {@link ExecutorCompletionService} class provides an
- * implementation of this approach.
- *
- * <p>Memory consistency effects: Actions in a thread prior to
- * submitting a task to a {@code CompletionService}
- * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
- * actions taken by that task, which in turn <i>happen-before</i>
- * actions following a successful return from the corresponding {@code take()}.
- *
- */
-public interface CompletionService {
- /**
- * Submits a value-returning task for execution and returns a Future
- * representing the pending results of the task. Upon completion,
- * this task may be taken or polled.
- *
- * @param task the task to submit
- * @return a Future representing pending completion of the task
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- * @throws NullPointerException if the task is null
- */
- Future submit(Callable task);
-
- /**
- * Submits a Runnable task for execution and returns a Future
- * representing that task. Upon completion, this task may be
- * taken or polled.
- *
- * @param task the task to submit
- * @param result the result to return upon successful completion
- * @return a Future representing pending completion of the task,
- * and whose <tt>get()</tt> method will return the given
- * result value upon completion
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- * @throws NullPointerException if the task is null
- */
- Future submit(Runnable task, Object result);
-
- /**
- * Retrieves and removes the Future representing the next
- * completed task, waiting if none are yet present.
- *
- * @return the Future representing the next completed task
- * @throws InterruptedException if interrupted while waiting
- */
- Future take() throws InterruptedException;
-
-
- /**
- * Retrieves and removes the Future representing the next
- * completed task or <tt>null</tt> if none are present.
- *
- * @return the Future representing the next completed task, or
- * <tt>null</tt> if none are present
- */
- Future poll();
-
- /**
- * Retrieves and removes the Future representing the next
- * completed task, waiting if necessary up to the specified wait
- * time if none are yet present.
- *
- * @param timeout how long to wait before giving up, in units of
- * <tt>unit</tt>
- * @param unit a <tt>TimeUnit</tt> determining how to interpret the
- * <tt>timeout</tt> parameter
- * @return the Future representing the next completed task or
- * <tt>null</tt> if the specified waiting time elapses
- * before one is present
- * @throws InterruptedException if interrupted while waiting
- */
- Future poll(long timeout, TimeUnit unit) throws InterruptedException;
-}
diff --git a/src/actors/scala/actors/threadpool/ExecutionException.java b/src/actors/scala/actors/threadpool/ExecutionException.java
deleted file mode 100644
index 912f965acf..0000000000
--- a/src/actors/scala/actors/threadpool/ExecutionException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-/**
- * Exception thrown when attempting to retrieve the result of a task
- * that aborted by throwing an exception. This exception can be
- * inspected using the {@link #getCause()} method.
- *
- * @see Future
- * @since 1.5
- * @author Doug Lea
- */
-public class ExecutionException extends Exception {
- private static final long serialVersionUID = 7830266012832686185L;
-
- /**
- * Constructs an <tt>ExecutionException</tt> with no detail message.
- * The cause is not initialized, and may subsequently be
- * initialized by a call to {@link #initCause(Throwable) initCause}.
- */
- protected ExecutionException() { }
-
- /**
- * Constructs an <tt>ExecutionException</tt> with the specified detail
- * message. The cause is not initialized, and may subsequently be
- * initialized by a call to {@link #initCause(Throwable) initCause}.
- *
- * @param message the detail message
- */
- protected ExecutionException(String message) {
- super(message);
- }
-
- /**
- * Constructs an <tt>ExecutionException</tt> with the specified detail
- * message and cause.
- *
- * @param message the detail message
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method)
- */
- public ExecutionException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Constructs an <tt>ExecutionException</tt> with the specified cause.
- * The detail message is set to:
- * <pre>
- * (cause == null ? null : cause.toString())</pre>
- * (which typically contains the class and detail message of
- * <tt>cause</tt>).
- *
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method)
- */
- public ExecutionException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/src/actors/scala/actors/threadpool/Executor.java b/src/actors/scala/actors/threadpool/Executor.java
deleted file mode 100644
index e444e64dff..0000000000
--- a/src/actors/scala/actors/threadpool/Executor.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-/**
- * An object that executes submitted {@link Runnable} tasks. This
- * interface provides a way of decoupling task submission from the
- * mechanics of how each task will be run, including details of thread
- * use, scheduling, etc. An <tt>Executor</tt> is normally used
- * instead of explicitly creating threads. For example, rather than
- * invoking <tt>new Thread(new(RunnableTask())).start()</tt> for each
- * of a set of tasks, you might use:
- *
- * <pre>
- * Executor executor = <em>anExecutor</em>;
- * executor.execute(new RunnableTask1());
- * executor.execute(new RunnableTask2());
- * ...
- * </pre>
- *
- * However, the <tt>Executor</tt> interface does not strictly
- * require that execution be asynchronous. In the simplest case, an
- * executor can run the submitted task immediately in the caller's
- * thread:
- *
- * <pre>
- * class DirectExecutor implements Executor {
- * public void execute(Runnable r) {
- * r.run();
- * }
- * }</pre>
- *
- * More typically, tasks are executed in some thread other
- * than the caller's thread. The executor below spawns a new thread
- * for each task.
- *
- * <pre>
- * class ThreadPerTaskExecutor implements Executor {
- * public void execute(Runnable r) {
- * new Thread(r).start();
- * }
- * }</pre>
- *
- * Many <tt>Executor</tt> implementations impose some sort of
- * limitation on how and when tasks are scheduled. The executor below
- * serializes the submission of tasks to a second executor,
- * illustrating a composite executor.
- *
- * <pre>
- * class SerialExecutor implements Executor {
- * final Queue&lt;Runnable&gt; tasks = new ArrayDeque&lt;Runnable&gt;();
- * final Executor executor;
- * Runnable active;
- *
- * SerialExecutor(Executor executor) {
- * this.executor = executor;
- * }
- *
- * public synchronized void execute(final Runnable r) {
- * tasks.offer(new Runnable() {
- * public void run() {
- * try {
- * r.run();
- * } finally {
- * scheduleNext();
- * }
- * }
- * });
- * if (active == null) {
- * scheduleNext();
- * }
- * }
- *
- * protected synchronized void scheduleNext() {
- * if ((active = tasks.poll()) != null) {
- * executor.execute(active);
- * }
- * }
- * }</pre>
- *
- * The <tt>Executor</tt> implementations provided in this package
- * implement {@link ExecutorService}, which is a more extensive
- * interface. The {@link ThreadPoolExecutor} class provides an
- * extensible thread pool implementation. The {@link Executors} class
- * provides convenient factory methods for these Executors.
- *
- * <p>Memory consistency effects: Actions in a thread prior to
- * submitting a {@code Runnable} object to an {@code Executor}
- * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
- * its execution begins, perhaps in another thread.
- *
- * @since 1.5
- * @author Doug Lea
- */
-public interface Executor {
-
- /**
- * Executes the given command at some time in the future. The command
- * may execute in a new thread, in a pooled thread, or in the calling
- * thread, at the discretion of the <tt>Executor</tt> implementation.
- *
- * @param command the runnable task
- * @throws RejectedExecutionException if this task cannot be
- * accepted for execution.
- * @throws NullPointerException if command is null
- */
- void execute(Runnable command);
-}
diff --git a/src/actors/scala/actors/threadpool/ExecutorCompletionService.java b/src/actors/scala/actors/threadpool/ExecutorCompletionService.java
deleted file mode 100644
index 02e9bbe297..0000000000
--- a/src/actors/scala/actors/threadpool/ExecutorCompletionService.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-import scala.actors.threadpool.*; // for javadoc (till 6280605 is fixed)
-
-/**
- * A {@link CompletionService} that uses a supplied {@link Executor}
- * to execute tasks. This class arranges that submitted tasks are,
- * upon completion, placed on a queue accessible using <tt>take</tt>.
- * The class is lightweight enough to be suitable for transient use
- * when processing groups of tasks.
- *
- * <p>
- *
- * <b>Usage Examples.</b>
- *
- * Suppose you have a set of solvers for a certain problem, each
- * returning a value of some type <tt>Result</tt>, and would like to
- * run them concurrently, processing the results of each of them that
- * return a non-null value, in some method <tt>use(Result r)</tt>. You
- * could write this as:
- *
- * <pre>
- * void solve(Executor e,
- * Collection&lt;Callable&lt;Result&gt;&gt; solvers)
- * throws InterruptedException, ExecutionException {
- * CompletionService&lt;Result&gt; ecs
- * = new ExecutorCompletionService&lt;Result&gt;(e);
- * for (Callable&lt;Result&gt; s : solvers)
- * ecs.submit(s);
- * int n = solvers.size();
- * for (int i = 0; i &lt; n; ++i) {
- * Result r = ecs.take().get();
- * if (r != null)
- * use(r);
- * }
- * }
- * </pre>
- *
- * Suppose instead that you would like to use the first non-null result
- * of the set of tasks, ignoring any that encounter exceptions,
- * and cancelling all other tasks when the first one is ready:
- *
- * <pre>
- * void solve(Executor e,
- * Collection&lt;Callable&lt;Result&gt;&gt; solvers)
- * throws InterruptedException {
- * CompletionService&lt;Result&gt; ecs
- * = new ExecutorCompletionService&lt;Result&gt;(e);
- * int n = solvers.size();
- * List&lt;Future&lt;Result&gt;&gt; futures
- * = new ArrayList&lt;Future&lt;Result&gt;&gt;(n);
- * Result result = null;
- * try {
- * for (Callable&lt;Result&gt; s : solvers)
- * futures.add(ecs.submit(s));
- * for (int i = 0; i &lt; n; ++i) {
- * try {
- * Result r = ecs.take().get();
- * if (r != null) {
- * result = r;
- * break;
- * }
- * } catch (ExecutionException ignore) {}
- * }
- * }
- * finally {
- * for (Future&lt;Result&gt; f : futures)
- * f.cancel(true);
- * }
- *
- * if (result != null)
- * use(result);
- * }
- * </pre>
- */
-public class ExecutorCompletionService implements CompletionService {
- private final Executor executor;
- private final AbstractExecutorService aes;
- private final BlockingQueue completionQueue;
-
- /**
- * FutureTask extension to enqueue upon completion
- */
- private class QueueingFuture extends FutureTask {
- QueueingFuture(RunnableFuture task) {
- super(task, null);
- this.task = task;
- }
- protected void done() { completionQueue.add(task); }
- private final Future task;
- }
-
- private RunnableFuture newTaskFor(Callable task) {
- if (aes == null)
- return new FutureTask(task);
- else
- return aes.newTaskFor(task);
- }
-
- private RunnableFuture newTaskFor(Runnable task, Object result) {
- if (aes == null)
- return new FutureTask(task, result);
- else
- return aes.newTaskFor(task, result);
- }
-
- /**
- * Creates an ExecutorCompletionService using the supplied
- * executor for base task execution and a
- * {@link LinkedBlockingQueue} as a completion queue.
- *
- * @param executor the executor to use
- * @throws NullPointerException if executor is <tt>null</tt>
- */
- public ExecutorCompletionService(Executor executor) {
- if (executor == null)
- throw new NullPointerException();
- this.executor = executor;
- this.aes = (executor instanceof AbstractExecutorService) ?
- (AbstractExecutorService) executor : null;
- this.completionQueue = new LinkedBlockingQueue();
- }
-
- /**
- * Creates an ExecutorCompletionService using the supplied
- * executor for base task execution and the supplied queue as its
- * completion queue.
- *
- * @param executor the executor to use
- * @param completionQueue the queue to use as the completion queue
- * normally one dedicated for use by this service. This queue is
- * treated as unbounded -- failed attempted <tt>Queue.add</tt>
- * operations for completed tasks cause them not to be
- * retrievable.
- * @throws NullPointerException if executor or completionQueue are <tt>null</tt>
- */
- public ExecutorCompletionService(Executor executor,
- BlockingQueue completionQueue) {
- if (executor == null || completionQueue == null)
- throw new NullPointerException();
- this.executor = executor;
- this.aes = (executor instanceof AbstractExecutorService) ?
- (AbstractExecutorService) executor : null;
- this.completionQueue = completionQueue;
- }
-
- public Future submit(Callable task) {
- if (task == null) throw new NullPointerException();
- RunnableFuture f = newTaskFor(task);
- executor.execute(new QueueingFuture(f));
- return f;
- }
-
- public Future submit(Runnable task, Object result) {
- if (task == null) throw new NullPointerException();
- RunnableFuture f = newTaskFor(task, result);
- executor.execute(new QueueingFuture(f));
- return f;
- }
-
- public Future take() throws InterruptedException {
- return (Future)completionQueue.take();
- }
-
- public Future poll() {
- return (Future)completionQueue.poll();
- }
-
- public Future poll(long timeout, TimeUnit unit) throws InterruptedException {
- return (Future)completionQueue.poll(timeout, unit);
- }
-
-}
diff --git a/src/actors/scala/actors/threadpool/ExecutorService.java b/src/actors/scala/actors/threadpool/ExecutorService.java
deleted file mode 100644
index d3a9a3b8a8..0000000000
--- a/src/actors/scala/actors/threadpool/ExecutorService.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-import scala.actors.threadpool.*; // for javadoc (till 6280605 is fixed)
-import java.util.List;
-import java.util.Collection;
-
-/**
- * An {@link Executor} that provides methods to manage termination and
- * methods that can produce a {@link Future} for tracking progress of
- * one or more asynchronous tasks.
- *
- * <p> An <tt>ExecutorService</tt> can be shut down, which will cause
- * it to reject new tasks. Two different methods are provided for
- * shutting down an <tt>ExecutorService</tt>. The {@link #shutdown}
- * method will allow previously submitted tasks to execute before
- * terminating, while the {@link #shutdownNow} method prevents waiting
- * tasks from starting and attempts to stop currently executing tasks.
- * Upon termination, an executor has no tasks actively executing, no
- * tasks awaiting execution, and no new tasks can be submitted. An
- * unused <tt>ExecutorService</tt> should be shut down to allow
- * reclamation of its resources.
- *
- * <p> Method <tt>submit</tt> extends base method {@link
- * Executor#execute} by creating and returning a {@link Future} that
- * can be used to cancel execution and/or wait for completion.
- * Methods <tt>invokeAny</tt> and <tt>invokeAll</tt> perform the most
- * commonly useful forms of bulk execution, executing a collection of
- * tasks and then waiting for at least one, or all, to
- * complete. (Class {@link ExecutorCompletionService} can be used to
- * write customized variants of these methods.)
- *
- * <p>The {@link Executors} class provides factory methods for the
- * executor services provided in this package.
- *
- * <h3>Usage Example</h3>
- *
- * Here is a sketch of a network service in which threads in a thread
- * pool service incoming requests. It uses the preconfigured {@link
- * Executors#newFixedThreadPool} factory method:
- *
- * <pre>
- * class NetworkService implements Runnable {
- * private final ServerSocket serverSocket;
- * private final ExecutorService pool;
- *
- * public NetworkService(int port, int poolSize)
- * throws IOException {
- * serverSocket = new ServerSocket(port);
- * pool = Executors.newFixedThreadPool(poolSize);
- * }
- *
- * public void run() { // run the service
- * try {
- * for (;;) {
- * pool.execute(new Handler(serverSocket.accept()));
- * }
- * } catch (IOException ex) {
- * pool.shutdown();
- * }
- * }
- * }
- *
- * class Handler implements Runnable {
- * private final Socket socket;
- * Handler(Socket socket) { this.socket = socket; }
- * public void run() {
- * // read and service request on socket
- * }
- * }
- * </pre>
- *
- * The following method shuts down an <tt>ExecutorService</tt> in two phases,
- * first by calling <tt>shutdown</tt> to reject incoming tasks, and then
- * calling <tt>shutdownNow</tt>, if necessary, to cancel any lingering tasks:
- *
- * <pre>
- * void shutdownAndAwaitTermination(ExecutorService pool) {
- * pool.shutdown(); // Disable new tasks from being submitted
- * try {
- * // Wait a while for existing tasks to terminate
- * if (!pool.awaitTermination(60, TimeUnit.SECONDS)) {
- * pool.shutdownNow(); // Cancel currently executing tasks
- * // Wait a while for tasks to respond to being cancelled
- * if (!pool.awaitTermination(60, TimeUnit.SECONDS))
- * System.err.println("Pool did not terminate");
- * }
- * } catch (InterruptedException ie) {
- * // (Re-)Cancel if current thread also interrupted
- * pool.shutdownNow();
- * // Preserve interrupt status
- * Thread.currentThread().interrupt();
- * }
- * }
- * </pre>
- *
- * <p>Memory consistency effects: Actions in a thread prior to the
- * submission of a {@code Runnable} or {@code Callable} task to an
- * {@code ExecutorService}
- * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
- * any actions taken by that task, which in turn <i>happen-before</i> the
- * result is retrieved via {@code Future.get()}.
- *
- * @since 1.5
- * @author Doug Lea
- */
-public interface ExecutorService extends Executor {
-
- /**
- * Initiates an orderly shutdown in which previously submitted
- * tasks are executed, but no new tasks will be accepted.
- * Invocation has no additional effect if already shut down.
- *
- * @throws SecurityException if a security manager exists and
- * shutting down this ExecutorService may manipulate
- * threads that the caller is not permitted to modify
- * because it does not hold {@link
- * java.lang.RuntimePermission}<tt>("modifyThread")</tt>,
- * or the security manager's <tt>checkAccess</tt> method
- * denies access.
- */
- void shutdown();
-
- /**
- * Attempts to stop all actively executing tasks, halts the
- * processing of waiting tasks, and returns a list of the tasks that were
- * awaiting execution.
- *
- * <p>There are no guarantees beyond best-effort attempts to stop
- * processing actively executing tasks. For example, typical
- * implementations will cancel via {@link Thread#interrupt}, so any
- * task that fails to respond to interrupts may never terminate.
- *
- * @return list of tasks that never commenced execution
- * @throws SecurityException if a security manager exists and
- * shutting down this ExecutorService may manipulate
- * threads that the caller is not permitted to modify
- * because it does not hold {@link
- * java.lang.RuntimePermission}<tt>("modifyThread")</tt>,
- * or the security manager's <tt>checkAccess</tt> method
- * denies access.
- */
- List shutdownNow();
-
- /**
- * Returns <tt>true</tt> if this executor has been shut down.
- *
- * @return <tt>true</tt> if this executor has been shut down
- */
- boolean isShutdown();
-
- /**
- * Returns <tt>true</tt> if all tasks have completed following shut down.
- * Note that <tt>isTerminated</tt> is never <tt>true</tt> unless
- * either <tt>shutdown</tt> or <tt>shutdownNow</tt> was called first.
- *
- * @return <tt>true</tt> if all tasks have completed following shut down
- */
- boolean isTerminated();
-
- /**
- * Blocks until all tasks have completed execution after a shutdown
- * request, or the timeout occurs, or the current thread is
- * interrupted, whichever happens first.
- *
- * @param timeout the maximum time to wait
- * @param unit the time unit of the timeout argument
- * @return <tt>true</tt> if this executor terminated and
- * <tt>false</tt> if the timeout elapsed before termination
- * @throws InterruptedException if interrupted while waiting
- */
- boolean awaitTermination(long timeout, TimeUnit unit)
- throws InterruptedException;
-
-
- /**
- * Submits a value-returning task for execution and returns a
- * Future representing the pending results of the task. The
- * Future's <tt>get</tt> method will return the task's result upon
- * successful completion.
- *
- * <p>
- * If you would like to immediately block waiting
- * for a task, you can use constructions of the form
- * <tt>result = exec.submit(aCallable).get();</tt>
- *
- * <p> Note: The {@link Executors} class includes a set of methods
- * that can convert some other common closure-like objects,
- * for example, {@link java.security.PrivilegedAction} to
- * {@link Callable} form so they can be submitted.
- *
- * @param task the task to submit
- * @return a Future representing pending completion of the task
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- * @throws NullPointerException if the task is null
- */
- Future submit(Callable task);
-
- /**
- * Submits a Runnable task for execution and returns a Future
- * representing that task. The Future's <tt>get</tt> method will
- * return the given result upon successful completion.
- *
- * @param task the task to submit
- * @param result the result to return
- * @return a Future representing pending completion of the task
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- * @throws NullPointerException if the task is null
- */
- Future submit(Runnable task, Object result);
-
- /**
- * Submits a Runnable task for execution and returns a Future
- * representing that task. The Future's <tt>get</tt> method will
- * return <tt>null</tt> upon <em>successful</em> completion.
- *
- * @param task the task to submit
- * @return a Future representing pending completion of the task
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- * @throws NullPointerException if the task is null
- */
- Future submit(Runnable task);
-
- /**
- * Executes the given tasks, returning a list of Futures holding
- * their status and results when all complete.
- * {@link Future#isDone} is <tt>true</tt> for each
- * element of the returned list.
- * Note that a <em>completed</em> task could have
- * terminated either normally or by throwing an exception.
- * The results of this method are undefined if the given
- * collection is modified while this operation is in progress.
- *
- * @param tasks the collection of tasks
- * @return A list of Futures representing the tasks, in the same
- * sequential order as produced by the iterator for the
- * given task list, each of which has completed.
- * @throws InterruptedException if interrupted while waiting, in
- * which case unfinished tasks are cancelled.
- * @throws NullPointerException if tasks or any of its elements are <tt>null</tt>
- * @throws RejectedExecutionException if any task cannot be
- * scheduled for execution
- */
-
- List invokeAll(Collection tasks)
- throws InterruptedException;
-
- /**
- * Executes the given tasks, returning a list of Futures holding
- * their status and results
- * when all complete or the timeout expires, whichever happens first.
- * {@link Future#isDone} is <tt>true</tt> for each
- * element of the returned list.
- * Upon return, tasks that have not completed are cancelled.
- * Note that a <em>completed</em> task could have
- * terminated either normally or by throwing an exception.
- * The results of this method are undefined if the given
- * collection is modified while this operation is in progress.
- *
- * @param tasks the collection of tasks
- * @param timeout the maximum time to wait
- * @param unit the time unit of the timeout argument
- * @return a list of Futures representing the tasks, in the same
- * sequential order as produced by the iterator for the
- * given task list. If the operation did not time out,
- * each task will have completed. If it did time out, some
- * of these tasks will not have completed.
- * @throws InterruptedException if interrupted while waiting, in
- * which case unfinished tasks are cancelled
- * @throws NullPointerException if tasks, any of its elements, or
- * unit are <tt>null</tt>
- * @throws RejectedExecutionException if any task cannot be scheduled
- * for execution
- */
- List invokeAll(Collection tasks, long timeout, TimeUnit unit)
- throws InterruptedException;
-
- /**
- * Executes the given tasks, returning the result
- * of one that has completed successfully (i.e., without throwing
- * an exception), if any do. Upon normal or exceptional return,
- * tasks that have not completed are cancelled.
- * The results of this method are undefined if the given
- * collection is modified while this operation is in progress.
- *
- * @param tasks the collection of tasks
- * @return the result returned by one of the tasks
- * @throws InterruptedException if interrupted while waiting
- * @throws NullPointerException if tasks or any of its elements
- * are <tt>null</tt>
- * @throws IllegalArgumentException if tasks is empty
- * @throws ExecutionException if no task successfully completes
- * @throws RejectedExecutionException if tasks cannot be scheduled
- * for execution
- */
- Object invokeAny(Collection tasks)
- throws InterruptedException, ExecutionException;
-
- /**
- * Executes the given tasks, returning the result
- * of one that has completed successfully (i.e., without throwing
- * an exception), if any do before the given timeout elapses.
- * Upon normal or exceptional return, tasks that have not
- * completed are cancelled.
- * The results of this method are undefined if the given
- * collection is modified while this operation is in progress.
- *
- * @param tasks the collection of tasks
- * @param timeout the maximum time to wait
- * @param unit the time unit of the timeout argument
- * @return the result returned by one of the tasks.
- * @throws InterruptedException if interrupted while waiting
- * @throws NullPointerException if tasks, any of its elements, or
- * unit are <tt>null</tt>
- * @throws TimeoutException if the given timeout elapses before
- * any task successfully completes
- * @throws ExecutionException if no task successfully completes
- * @throws RejectedExecutionException if tasks cannot be scheduled
- * for execution
- */
- Object invokeAny(Collection tasks, long timeout, TimeUnit unit)
- throws InterruptedException, ExecutionException, TimeoutException;
-}
diff --git a/src/actors/scala/actors/threadpool/Executors.java b/src/actors/scala/actors/threadpool/Executors.java
deleted file mode 100644
index 49a127a8db..0000000000
--- a/src/actors/scala/actors/threadpool/Executors.java
+++ /dev/null
@@ -1,667 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-//import edu.emory.mathcs.backport.java.util.*;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
-import java.security.AccessControlException;
-import java.util.List;
-import java.util.Collection;
-
-/**
- * Factory and utility methods for {@link Executor}, {@link
- * ExecutorService}, {@link ScheduledExecutorService}, {@link
- * ThreadFactory}, and {@link Callable} classes defined in this
- * package. This class supports the following kinds of methods:
- *
- * <ul>
- * <li> Methods that create and return an {@link ExecutorService}
- * set up with commonly useful configuration settings.
- * <li> Methods that create and return a {@link ScheduledExecutorService}
- * set up with commonly useful configuration settings.
- * <li> Methods that create and return a "wrapped" ExecutorService, that
- * disables reconfiguration by making implementation-specific methods
- * inaccessible.
- * <li> Methods that create and return a {@link ThreadFactory}
- * that sets newly created threads to a known state.
- * <li> Methods that create and return a {@link Callable}
- * out of other closure-like forms, so they can be used
- * in execution methods requiring <tt>Callable</tt>.
- * </ul>
- *
- * @since 1.5
- * @author Doug Lea
- */
-public class Executors {
-
- /**
- * Creates a thread pool that reuses a fixed number of threads
- * operating off a shared unbounded queue. At any point, at most
- * <tt>nThreads</tt> threads will be active processing tasks.
- * If additional tasks are submitted when all threads are active,
- * they will wait in the queue until a thread is available.
- * If any thread terminates due to a failure during execution
- * prior to shutdown, a new one will take its place if needed to
- * execute subsequent tasks. The threads in the pool will exist
- * until it is explicitly {@link ExecutorService#shutdown shutdown}.
- *
- * @param nThreads the number of threads in the pool
- * @return the newly created thread pool
- * @throws IllegalArgumentException if <tt>nThreads &lt;= 0</tt>
- */
- public static ExecutorService newFixedThreadPool(int nThreads) {
- return new ThreadPoolExecutor(nThreads, nThreads,
- 0L, TimeUnit.MILLISECONDS,
- new LinkedBlockingQueue());
- }
-
- /**
- * Creates a thread pool that reuses a fixed number of threads
- * operating off a shared unbounded queue, using the provided
- * ThreadFactory to create new threads when needed. At any point,
- * at most <tt>nThreads</tt> threads will be active processing
- * tasks. If additional tasks are submitted when all threads are
- * active, they will wait in the queue until a thread is
- * available. If any thread terminates due to a failure during
- * execution prior to shutdown, a new one will take its place if
- * needed to execute subsequent tasks. The threads in the pool will
- * exist until it is explicitly {@link ExecutorService#shutdown
- * shutdown}.
- *
- * @param nThreads the number of threads in the pool
- * @param threadFactory the factory to use when creating new threads
- * @return the newly created thread pool
- * @throws NullPointerException if threadFactory is null
- * @throws IllegalArgumentException if <tt>nThreads &lt;= 0</tt>
- */
- public static ExecutorService newFixedThreadPool(int nThreads, ThreadFactory threadFactory) {
- return new ThreadPoolExecutor(nThreads, nThreads,
- 0L, TimeUnit.MILLISECONDS,
- new LinkedBlockingQueue(),
- threadFactory);
- }
-
- /**
- * Creates an Executor that uses a single worker thread operating
- * off an unbounded queue. (Note however that if this single
- * thread terminates due to a failure during execution prior to
- * shutdown, a new one will take its place if needed to execute
- * subsequent tasks.) Tasks are guaranteed to execute
- * sequentially, and no more than one task will be active at any
- * given time. Unlike the otherwise equivalent
- * <tt>newFixedThreadPool(1)</tt> the returned executor is
- * guaranteed not to be reconfigurable to use additional threads.
- *
- * @return the newly created single-threaded Executor
- */
- public static ExecutorService newSingleThreadExecutor() {
- return new FinalizableDelegatedExecutorService
- (new ThreadPoolExecutor(1, 1,
- 0L, TimeUnit.MILLISECONDS,
- new LinkedBlockingQueue()));
- }
-
- /**
- * Creates an Executor that uses a single worker thread operating
- * off an unbounded queue, and uses the provided ThreadFactory to
- * create a new thread when needed. Unlike the otherwise
- * equivalent <tt>newFixedThreadPool(1, threadFactory)</tt> the
- * returned executor is guaranteed not to be reconfigurable to use
- * additional threads.
- *
- * @param threadFactory the factory to use when creating new
- * threads
- *
- * @return the newly created single-threaded Executor
- * @throws NullPointerException if threadFactory is null
- */
- public static ExecutorService newSingleThreadExecutor(ThreadFactory threadFactory) {
- return new FinalizableDelegatedExecutorService
- (new ThreadPoolExecutor(1, 1,
- 0L, TimeUnit.MILLISECONDS,
- new LinkedBlockingQueue(),
- threadFactory));
- }
-
- /**
- * Creates a thread pool that creates new threads as needed, but
- * will reuse previously constructed threads when they are
- * available. These pools will typically improve the performance
- * of programs that execute many short-lived asynchronous tasks.
- * Calls to <tt>execute</tt> will reuse previously constructed
- * threads if available. If no existing thread is available, a new
- * thread will be created and added to the pool. Threads that have
- * not been used for sixty seconds are terminated and removed from
- * the cache. Thus, a pool that remains idle for long enough will
- * not consume any resources. Note that pools with similar
- * properties but different details (for example, timeout parameters)
- * may be created using {@link ThreadPoolExecutor} constructors.
- *
- * @return the newly created thread pool
- */
- public static ExecutorService newCachedThreadPool() {
- return new ThreadPoolExecutor(0, Integer.MAX_VALUE,
- 60L, TimeUnit.SECONDS,
- new SynchronousQueue());
- }
-
- /**
- * Creates a thread pool that creates new threads as needed, but
- * will reuse previously constructed threads when they are
- * available, and uses the provided
- * ThreadFactory to create new threads when needed.
- * @param threadFactory the factory to use when creating new threads
- * @return the newly created thread pool
- * @throws NullPointerException if threadFactory is null
- */
- public static ExecutorService newCachedThreadPool(ThreadFactory threadFactory) {
- return new ThreadPoolExecutor(0, Integer.MAX_VALUE,
- 60L, TimeUnit.SECONDS,
- new SynchronousQueue(),
- threadFactory);
- }
-
- /**
- * Creates a single-threaded executor that can schedule commands
- * to run after a given delay, or to execute periodically.
- * (Note however that if this single
- * thread terminates due to a failure during execution prior to
- * shutdown, a new one will take its place if needed to execute
- * subsequent tasks.) Tasks are guaranteed to execute
- * sequentially, and no more than one task will be active at any
- * given time. Unlike the otherwise equivalent
- * <tt>newScheduledThreadPool(1)</tt> the returned executor is
- * guaranteed not to be reconfigurable to use additional threads.
- * @return the newly created scheduled executor
- */
- /* public static ScheduledExecutorService newSingleThreadScheduledExecutor() {
- return new DelegatedScheduledExecutorService
- (new ScheduledThreadPoolExecutor(1));
- }
- */
- /**
- * Creates a single-threaded executor that can schedule commands
- * to run after a given delay, or to execute periodically. (Note
- * however that if this single thread terminates due to a failure
- * during execution prior to shutdown, a new one will take its
- * place if needed to execute subsequent tasks.) Tasks are
- * guaranteed to execute sequentially, and no more than one task
- * will be active at any given time. Unlike the otherwise
- * equivalent <tt>newScheduledThreadPool(1, threadFactory)</tt>
- * the returned executor is guaranteed not to be reconfigurable to
- * use additional threads.
- * @param threadFactory the factory to use when creating new
- * threads
- * @return a newly created scheduled executor
- * @throws NullPointerException if threadFactory is null
- */
- /* public static ScheduledExecutorService newSingleThreadScheduledExecutor(ThreadFactory threadFactory) {
- return new DelegatedScheduledExecutorService
- (new ScheduledThreadPoolExecutor(1, threadFactory));
- }
- */
- /**
- * Creates a thread pool that can schedule commands to run after a
- * given delay, or to execute periodically.
- * @param corePoolSize the number of threads to keep in the pool,
- * even if they are idle.
- * @return a newly created scheduled thread pool
- * @throws IllegalArgumentException if <tt>corePoolSize &lt; 0</tt>
- */
- /* public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize) {
- return new ScheduledThreadPoolExecutor(corePoolSize);
- }
- */
- /**
- * Creates a thread pool that can schedule commands to run after a
- * given delay, or to execute periodically.
- * @param corePoolSize the number of threads to keep in the pool,
- * even if they are idle.
- * @param threadFactory the factory to use when the executor
- * creates a new thread.
- * @return a newly created scheduled thread pool
- * @throws IllegalArgumentException if <tt>corePoolSize &lt; 0</tt>
- * @throws NullPointerException if threadFactory is null
- */
- /* public static ScheduledExecutorService newScheduledThreadPool(
- int corePoolSize, ThreadFactory threadFactory) {
- return new ScheduledThreadPoolExecutor(corePoolSize, threadFactory);
- }
- */
-
- /**
- * Returns an object that delegates all defined {@link
- * ExecutorService} methods to the given executor, but not any
- * other methods that might otherwise be accessible using
- * casts. This provides a way to safely "freeze" configuration and
- * disallow tuning of a given concrete implementation.
- * @param executor the underlying implementation
- * @return an <tt>ExecutorService</tt> instance
- * @throws NullPointerException if executor null
- */
- public static ExecutorService unconfigurableExecutorService(ExecutorService executor) {
- if (executor == null)
- throw new NullPointerException();
- return new DelegatedExecutorService(executor);
- }
-
- /**
- * Returns an object that delegates all defined {@link
- * ScheduledExecutorService} methods to the given executor, but
- * not any other methods that might otherwise be accessible using
- * casts. This provides a way to safely "freeze" configuration and
- * disallow tuning of a given concrete implementation.
- * @param executor the underlying implementation
- * @return a <tt>ScheduledExecutorService</tt> instance
- * @throws NullPointerException if executor null
- */
- /* public static ScheduledExecutorService unconfigurableScheduledExecutorService(ScheduledExecutorService executor) {
- if (executor == null)
- throw new NullPointerException();
- return new DelegatedScheduledExecutorService(executor);
- }
- */
- /**
- * Returns a default thread factory used to create new threads.
- * This factory creates all new threads used by an Executor in the
- * same {@link ThreadGroup}. If there is a {@link
- * java.lang.SecurityManager}, it uses the group of {@link
- * System#getSecurityManager}, else the group of the thread
- * invoking this <tt>defaultThreadFactory</tt> method. Each new
- * thread is created as a non-daemon thread with priority set to
- * the smaller of <tt>Thread.NORM_PRIORITY</tt> and the maximum
- * priority permitted in the thread group. New threads have names
- * accessible via {@link Thread#getName} of
- * <em>pool-N-thread-M</em>, where <em>N</em> is the sequence
- * number of this factory, and <em>M</em> is the sequence number
- * of the thread created by this factory.
- * @return a thread factory
- */
- public static ThreadFactory defaultThreadFactory() {
- return new DefaultThreadFactory();
- }
-
- /**
- * Returns a thread factory used to create new threads that
- * have the same permissions as the current thread.
- * This factory creates threads with the same settings as {@link
- * Executors#defaultThreadFactory}, additionally setting the
- * AccessControlContext and contextClassLoader of new threads to
- * be the same as the thread invoking this
- * <tt>privilegedThreadFactory</tt> method. A new
- * <tt>privilegedThreadFactory</tt> can be created within an
- * {@link AccessController#doPrivileged} action setting the
- * current thread's access control context to create threads with
- * the selected permission settings holding within that action.
- *
- * <p> Note that while tasks running within such threads will have
- * the same access control and class loader settings as the
- * current thread, they need not have the same {@link
- * java.lang.ThreadLocal} or {@link
- * java.lang.InheritableThreadLocal} values. If necessary,
- * particular values of thread locals can be set or reset before
- * any task runs in {@link ThreadPoolExecutor} subclasses using
- * {@link ThreadPoolExecutor#beforeExecute}. Also, if it is
- * necessary to initialize worker threads to have the same
- * InheritableThreadLocal settings as some other designated
- * thread, you can create a custom ThreadFactory in which that
- * thread waits for and services requests to create others that
- * will inherit its values.
- *
- * @return a thread factory
- * @throws AccessControlException if the current access control
- * context does not have permission to both get and set context
- * class loader.
- */
- public static ThreadFactory privilegedThreadFactory() {
- return new PrivilegedThreadFactory();
- }
-
- /**
- * Returns a {@link Callable} object that, when
- * called, runs the given task and returns the given result. This
- * can be useful when applying methods requiring a
- * <tt>Callable</tt> to an otherwise resultless action.
- * @param task the task to run
- * @param result the result to return
- * @return a callable object
- * @throws NullPointerException if task null
- */
- public static Callable callable(Runnable task, Object result) {
- if (task == null)
- throw new NullPointerException();
- return new RunnableAdapter(task, result);
- }
-
- /**
- * Returns a {@link Callable} object that, when
- * called, runs the given task and returns <tt>null</tt>.
- * @param task the task to run
- * @return a callable object
- * @throws NullPointerException if task null
- */
- public static Callable callable(Runnable task) {
- if (task == null)
- throw new NullPointerException();
- return new RunnableAdapter(task, null);
- }
-
- /**
- * Returns a {@link Callable} object that, when
- * called, runs the given privileged action and returns its result.
- * @param action the privileged action to run
- * @return a callable object
- * @throws NullPointerException if action null
- */
- public static Callable callable(final PrivilegedAction action) {
- if (action == null)
- throw new NullPointerException();
- return new Callable() {
- public Object call() { return action.run(); }};
- }
-
- /**
- * Returns a {@link Callable} object that, when
- * called, runs the given privileged exception action and returns
- * its result.
- * @param action the privileged exception action to run
- * @return a callable object
- * @throws NullPointerException if action null
- */
- public static Callable callable(final PrivilegedExceptionAction action) {
- if (action == null)
- throw new NullPointerException();
- return new Callable() {
- public Object call() throws Exception { return action.run(); }};
- }
-
- /**
- * Returns a {@link Callable} object that will, when
- * called, execute the given <tt>callable</tt> under the current
- * access control context. This method should normally be
- * invoked within an {@link AccessController#doPrivileged} action
- * to create callables that will, if possible, execute under the
- * selected permission settings holding within that action; or if
- * not possible, throw an associated {@link
- * AccessControlException}.
- * @param callable the underlying task
- * @return a callable object
- * @throws NullPointerException if callable null
- *
- */
- public static Callable privilegedCallable(Callable callable) {
- if (callable == null)
- throw new NullPointerException();
- return new PrivilegedCallable(callable);
- }
-
- /**
- * Returns a {@link Callable} object that will, when
- * called, execute the given <tt>callable</tt> under the current
- * access control context, with the current context class loader
- * as the context class loader. This method should normally be
- * invoked within an {@link AccessController#doPrivileged} action
- * to create callables that will, if possible, execute under the
- * selected permission settings holding within that action; or if
- * not possible, throw an associated {@link
- * AccessControlException}.
- * @param callable the underlying task
- *
- * @return a callable object
- * @throws NullPointerException if callable null
- * @throws AccessControlException if the current access control
- * context does not have permission to both set and get context
- * class loader.
- */
- public static Callable privilegedCallableUsingCurrentClassLoader(Callable callable) {
- if (callable == null)
- throw new NullPointerException();
- return new PrivilegedCallableUsingCurrentClassLoader(callable);
- }
-
- // Non-public classes supporting the public methods
-
- /**
- * A callable that runs given task and returns given result
- */
- static final class RunnableAdapter implements Callable {
- final Runnable task;
- final Object result;
- RunnableAdapter(Runnable task, Object result) {
- this.task = task;
- this.result = result;
- }
- public Object call() {
- task.run();
- return result;
- }
- }
-
- /**
- * A callable that runs under established access control settings
- */
- static final class PrivilegedCallable implements Callable {
- private final AccessControlContext acc;
- private final Callable task;
- private Object result;
- private Exception exception;
- PrivilegedCallable(Callable task) {
- this.task = task;
- this.acc = AccessController.getContext();
- }
-
- public Object call() throws Exception {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- try {
- result = task.call();
- } catch (Exception ex) {
- exception = ex;
- }
- return null;
- }
- }, acc);
- if (exception != null)
- throw exception;
- else
- return result;
- }
- }
-
- /**
- * A callable that runs under established access control settings and
- * current ClassLoader
- */
- static final class PrivilegedCallableUsingCurrentClassLoader implements Callable {
- private final ClassLoader ccl;
- private final AccessControlContext acc;
- private final Callable task;
- private Object result;
- private Exception exception;
- PrivilegedCallableUsingCurrentClassLoader(Callable task) {
- this.task = task;
- this.ccl = Thread.currentThread().getContextClassLoader();
- this.acc = AccessController.getContext();
- acc.checkPermission(new RuntimePermission("getContextClassLoader"));
- acc.checkPermission(new RuntimePermission("setContextClassLoader"));
- }
-
- public Object call() throws Exception {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader savedcl = null;
- Thread t = Thread.currentThread();
- try {
- ClassLoader cl = t.getContextClassLoader();
- if (ccl != cl) {
- t.setContextClassLoader(ccl);
- savedcl = cl;
- }
- result = task.call();
- } catch (Exception ex) {
- exception = ex;
- } finally {
- if (savedcl != null)
- t.setContextClassLoader(savedcl);
- }
- return null;
- }
- }, acc);
- if (exception != null)
- throw exception;
- else
- return result;
- }
- }
-
- /**
- * The default thread factory
- */
- static class DefaultThreadFactory implements ThreadFactory {
- static final AtomicInteger poolNumber = new AtomicInteger(1);
- final ThreadGroup group;
- final AtomicInteger threadNumber = new AtomicInteger(1);
- final String namePrefix;
-
- DefaultThreadFactory() {
- SecurityManager s = System.getSecurityManager();
- group = (s != null)? s.getThreadGroup() :
- Thread.currentThread().getThreadGroup();
- namePrefix = "pool-" +
- poolNumber.getAndIncrement() +
- "-thread-";
- }
-
- public Thread newThread(Runnable r) {
- Thread t = new Thread(group, r,
- namePrefix + threadNumber.getAndIncrement(),
- 0);
- if (t.isDaemon())
- t.setDaemon(false);
- if (t.getPriority() != Thread.NORM_PRIORITY)
- t.setPriority(Thread.NORM_PRIORITY);
- return t;
- }
- }
-
- /**
- * Thread factory capturing access control and class loader
- */
- static class PrivilegedThreadFactory extends DefaultThreadFactory {
- private final ClassLoader ccl;
- private final AccessControlContext acc;
-
- PrivilegedThreadFactory() {
- super();
- this.ccl = Thread.currentThread().getContextClassLoader();
- this.acc = AccessController.getContext();
- acc.checkPermission(new RuntimePermission("setContextClassLoader"));
- }
-
- public Thread newThread(final Runnable r) {
- return super.newThread(new Runnable() {
- public void run() {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(ccl);
- r.run();
- return null;
- }
- }, acc);
- }
- });
- }
-
- }
-
- /**
- * A wrapper class that exposes only the ExecutorService methods
- * of an ExecutorService implementation.
- */
- static class DelegatedExecutorService extends AbstractExecutorService {
- private final ExecutorService e;
- DelegatedExecutorService(ExecutorService executor) { e = executor; }
- public void execute(Runnable command) { e.execute(command); }
- public void shutdown() { e.shutdown(); }
- public List shutdownNow() { return e.shutdownNow(); }
- public boolean isShutdown() { return e.isShutdown(); }
- public boolean isTerminated() { return e.isTerminated(); }
- public boolean awaitTermination(long timeout, TimeUnit unit)
- throws InterruptedException {
- return e.awaitTermination(timeout, unit);
- }
- public Future submit(Runnable task) {
- return e.submit(task);
- }
- public Future submit(Callable task) {
- return e.submit(task);
- }
- public Future submit(Runnable task, Object result) {
- return e.submit(task, result);
- }
- public List<Future> invokeAll(Collection tasks)
- throws InterruptedException {
- return e.invokeAll(tasks);
- }
- public List<Future> invokeAll(Collection tasks,
- long timeout, TimeUnit unit)
- throws InterruptedException {
- return e.invokeAll(tasks, timeout, unit);
- }
- public Object invokeAny(Collection tasks)
- throws InterruptedException, ExecutionException {
- return e.invokeAny(tasks);
- }
- public Object invokeAny(Collection tasks,
- long timeout, TimeUnit unit)
- throws InterruptedException, ExecutionException, TimeoutException {
- return e.invokeAny(tasks, timeout, unit);
- }
- }
-
- static class FinalizableDelegatedExecutorService
- extends DelegatedExecutorService {
- FinalizableDelegatedExecutorService(ExecutorService executor) {
- super(executor);
- }
- protected void finalize() {
- super.shutdown();
- }
- }
-
- /**
- * A wrapper class that exposes only the ScheduledExecutorService
- * methods of a ScheduledExecutorService implementation.
- */
- /* static class DelegatedScheduledExecutorService
- extends DelegatedExecutorService
- implements ScheduledExecutorService {
- private final ScheduledExecutorService e;
- DelegatedScheduledExecutorService(ScheduledExecutorService executor) {
- super(executor);
- e = executor;
- }
- public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) {
- return e.schedule(command, delay, unit);
- }
- public ScheduledFuture schedule(Callable callable, long delay, TimeUnit unit) {
- return e.schedule(callable, delay, unit);
- }
- public ScheduledFuture scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) {
- return e.scheduleAtFixedRate(command, initialDelay, period, unit);
- }
- public ScheduledFuture scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) {
- return e.scheduleWithFixedDelay(command, initialDelay, delay, unit);
- }
- }
-*/
-
- /** Cannot instantiate. */
- private Executors() {}
-}
diff --git a/src/actors/scala/actors/threadpool/Future.java b/src/actors/scala/actors/threadpool/Future.java
deleted file mode 100644
index 5e1b3d414a..0000000000
--- a/src/actors/scala/actors/threadpool/Future.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-import scala.actors.threadpool.*; // for javadoc (till 6280605 is fixed)
-
-/**
- * A <tt>Future</tt> represents the result of an asynchronous
- * computation. Methods are provided to check if the computation is
- * complete, to wait for its completion, and to retrieve the result of
- * the computation. The result can only be retrieved using method
- * <tt>get</tt> when the computation has completed, blocking if
- * necessary until it is ready. Cancellation is performed by the
- * <tt>cancel</tt> method. Additional methods are provided to
- * determine if the task completed normally or was cancelled. Once a
- * computation has completed, the computation cannot be cancelled.
- * If you would like to use a <tt>Future</tt> for the sake
- * of cancellability but not provide a usable result, you can
- * declare types of the form <tt>Future&lt;?&gt;</tt> and
- * return <tt>null</tt> as a result of the underlying task.
- *
- * <p>
- * <b>Sample Usage</b> (Note that the following classes are all
- * made-up.) <p>
- * <pre>
- * interface ArchiveSearcher { String search(String target); }
- * class App {
- * ExecutorService executor = ...
- * ArchiveSearcher searcher = ...
- * void showSearch(final String target)
- * throws InterruptedException {
- * Future&lt;String&gt; future
- * = executor.submit(new Callable&lt;String&gt;() {
- * public String call() {
- * return searcher.search(target);
- * }});
- * displayOtherThings(); // do other things while searching
- * try {
- * displayText(future.get()); // use future
- * } catch (ExecutionException ex) { cleanup(); return; }
- * }
- * }
- * </pre>
- *
- * The {@link FutureTask} class is an implementation of <tt>Future</tt> that
- * implements <tt>Runnable</tt>, and so may be executed by an <tt>Executor</tt>.
- * For example, the above construction with <tt>submit</tt> could be replaced by:
- * <pre>
- * FutureTask&lt;String&gt; future =
- * new FutureTask&lt;String&gt;(new Callable&lt;String&gt;() {
- * public String call() {
- * return searcher.search(target);
- * }});
- * executor.execute(future);
- * </pre>
- *
- * <p>Memory consistency effects: Actions taken by the asynchronous computation
- * <a href="package-summary.html#MemoryVisibility"> <i>happen-before</i></a>
- * actions following the corresponding {@code Future.get()} in another thread.
- *
- * @see FutureTask
- * @see Executor
- * @since 1.5
- * @author Doug Lea
- */
-public interface Future {
-
- /**
- * Attempts to cancel execution of this task. This attempt will
- * fail if the task has already completed, has already been cancelled,
- * or could not be cancelled for some other reason. If successful,
- * and this task has not started when <tt>cancel</tt> is called,
- * this task should never run. If the task has already started,
- * then the <tt>mayInterruptIfRunning</tt> parameter determines
- * whether the thread executing this task should be interrupted in
- * an attempt to stop the task.
- *
- * <p>After this method returns, subsequent calls to {@link #isDone} will
- * always return <tt>true</tt>. Subsequent calls to {@link #isCancelled}
- * will always return <tt>true</tt> if this method returned <tt>true</tt>.
- *
- * @param mayInterruptIfRunning <tt>true</tt> if the thread executing this
- * task should be interrupted; otherwise, in-progress tasks are allowed
- * to complete
- * @return <tt>false</tt> if the task could not be cancelled,
- * typically because it has already completed normally;
- * <tt>true</tt> otherwise
- */
- boolean cancel(boolean mayInterruptIfRunning);
-
- /**
- * Returns <tt>true</tt> if this task was cancelled before it completed
- * normally.
- *
- * @return <tt>true</tt> if this task was cancelled before it completed
- */
- boolean isCancelled();
-
- /**
- * Returns <tt>true</tt> if this task completed.
- *
- * Completion may be due to normal termination, an exception, or
- * cancellation -- in all of these cases, this method will return
- * <tt>true</tt>.
- *
- * @return <tt>true</tt> if this task completed
- */
- boolean isDone();
-
- /**
- * Waits if necessary for the computation to complete, and then
- * retrieves its result.
- *
- * @return the computed result
- * @throws CancellationException if the computation was cancelled
- * @throws ExecutionException if the computation threw an
- * exception
- * @throws InterruptedException if the current thread was interrupted
- * while waiting
- */
- Object get() throws InterruptedException, ExecutionException;
-
- /**
- * Waits if necessary for at most the given time for the computation
- * to complete, and then retrieves its result, if available.
- *
- * @param timeout the maximum time to wait
- * @param unit the time unit of the timeout argument
- * @return the computed result
- * @throws CancellationException if the computation was cancelled
- * @throws ExecutionException if the computation threw an
- * exception
- * @throws InterruptedException if the current thread was interrupted
- * while waiting
- * @throws TimeoutException if the wait timed out
- */
- Object get(long timeout, TimeUnit unit)
- throws InterruptedException, ExecutionException, TimeoutException;
-}
diff --git a/src/actors/scala/actors/threadpool/FutureTask.java b/src/actors/scala/actors/threadpool/FutureTask.java
deleted file mode 100644
index d4dcfe38b3..0000000000
--- a/src/actors/scala/actors/threadpool/FutureTask.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain. Use, modify, and
- * redistribute this code in any way without acknowledgement.
- */
-
-package scala.actors.threadpool;
-
-import scala.actors.threadpool.*; // for javadoc
-import scala.actors.threadpool.helpers.*;
-
-/**
- * A cancellable asynchronous computation. This class provides a base
- * implementation of {@link Future}, with methods to start and cancel
- * a computation, query to see if the computation is complete, and
- * retrieve the result of the computation. The result can only be
- * retrieved when the computation has completed; the <tt>get</tt>
- * method will block if the computation has not yet completed. Once
- * the computation has completed, the computation cannot be restarted
- * or cancelled.
- *
- * <p>A <tt>FutureTask</tt> can be used to wrap a {@link Callable} or
- * {@link java.lang.Runnable} object. Because <tt>FutureTask</tt>
- * implements <tt>Runnable</tt>, a <tt>FutureTask</tt> can be
- * submitted to an {@link Executor} for execution.
- *
- * <p>In addition to serving as a standalone class, this class provides
- * <tt>protected</tt> functionality that may be useful when creating
- * customized task classes.
- *
- * @since 1.5
- * @author Doug Lea
- */
-public class FutureTask implements RunnableFuture {
-
- /** State value representing that task is ready to run */
- private static final int READY = 0;
- /** State value representing that task is running */
- private static final int RUNNING = 1;
- /** State value representing that task ran */
- private static final int RAN = 2;
- /** State value representing that task was cancelled */
- private static final int CANCELLED = 4;
-
- /** The underlying callable */
- private final Callable callable;
- /** The result to return from get() */
- private Object result;
- /** The exception to throw from get() */
- private Throwable exception;
-
- private int state;
-
- /**
- * The thread running task. When nulled after set/cancel, this
- * indicates that the results are accessible. Must be
- * volatile, to ensure visibility upon completion.
- */
- private volatile Thread runner;
-
- /**
- * Creates a <tt>FutureTask</tt> that will, upon running, execute the
- * given <tt>Callable</tt>.
- *
- * @param callable the callable task
- * @throws NullPointerException if callable is null
- */
- public FutureTask(Callable callable) {
- if (callable == null)
- throw new NullPointerException();
- this.callable = callable;
- }
-
- /**
- * Creates a <tt>FutureTask</tt> that will, upon running, execute the
- * given <tt>Runnable</tt>, and arrange that <tt>get</tt> will return the
- * given result on successful completion.
- *
- * @param runnable the runnable task
- * @param result the result to return on successful completion. If
- * you don't need a particular result, consider using
- * constructions of the form:
- * <tt>Future&lt;?&gt; f = new FutureTask&lt;Object&gt;(runnable, null)</tt>
- * @throws NullPointerException if runnable is null
- */
- public FutureTask(Runnable runnable, Object result) {
- this(Executors.callable(runnable, result));
- }
-
- public synchronized boolean isCancelled() {
- return state == CANCELLED;
- }
-
- public synchronized boolean isDone() {
- return ranOrCancelled() && runner == null;
- }
-
- public boolean cancel(boolean mayInterruptIfRunning) {
- synchronized (this) {
- if (ranOrCancelled()) return false;
- state = CANCELLED;
- if (mayInterruptIfRunning) {
- Thread r = runner;
- if (r != null) r.interrupt();
- }
- runner = null;
- notifyAll();
- }
- done();
- return true;
- }
-
- /**
- * @throws CancellationException {@inheritDoc}
- */
- public synchronized Object get()
- throws InterruptedException, ExecutionException
- {
- waitFor();
- return getResult();
- }
-
- /**
- * @throws CancellationException {@inheritDoc}
- */
- public synchronized Object get(long timeout, TimeUnit unit)
- throws InterruptedException, ExecutionException, TimeoutException
- {
- waitFor(unit.toNanos(timeout));
- return getResult();
- }
-
- /**
- * Protected method invoked when this task transitions to state
- * <tt>isDone</tt> (whether normally or via cancellation). The
- * default implementation does nothing. Subclasses may override
- * this method to invoke completion callbacks or perform
- * bookkeeping. Note that you can query status inside the
- * implementation of this method to determine whether this task
- * has been cancelled.
- */
- protected void done() { }
-
- /**
- * Sets the result of this Future to the given value unless
- * this future has already been set or has been cancelled.
- * This method is invoked internally by the <tt>run</tt> method
- * upon successful completion of the computation.
- * @param v the value
- */
- protected void set(Object v) {
- setCompleted(v);
- }
-
- /**
- * Causes this future to report an <tt>ExecutionException</tt>
- * with the given throwable as its cause, unless this Future has
- * already been set or has been cancelled.
- * This method is invoked internally by the <tt>run</tt> method
- * upon failure of the computation.
- * @param t the cause of failure
- */
- protected void setException(Throwable t) {
- setFailed(t);
- }
-
- /**
- * Sets this Future to the result of its computation
- * unless it has been cancelled.
- */
- public void run() {
- synchronized (this) {
- if (state != READY) return;
- state = RUNNING;
- runner = Thread.currentThread();
- }
- try {
- set(callable.call());
- }
- catch (Throwable ex) {
- setException(ex);
- }
- }
-
- /**
- * Executes the computation without setting its result, and then
- * resets this Future to initial state, failing to do so if the
- * computation encounters an exception or is cancelled. This is
- * designed for use with tasks that intrinsically execute more
- * than once.
- * @return true if successfully run and reset
- */
- protected boolean runAndReset() {
- synchronized (this) {
- if (state != READY) return false;
- state = RUNNING;
- runner = Thread.currentThread();
- }
- try {
- callable.call(); // don't set result
- synchronized (this) {
- runner = null;
- if (state == RUNNING) {
- state = READY;
- return true;
- }
- else {
- return false;
- }
- }
- }
- catch (Throwable ex) {
- setException(ex);
- return false;
- }
- }
-
- // PRE: lock owned
- private boolean ranOrCancelled() {
- return (state & (RAN | CANCELLED)) != 0;
- }
-
- /**
- * Marks the task as completed.
- * @param result the result of a task.
- */
- private void setCompleted(Object result) {
- synchronized (this) {
- if (ranOrCancelled()) return;
- this.state = RAN;
- this.result = result;
- this.runner = null;
- notifyAll();
- }
-
- // invoking callbacks *after* setting future as completed and
- // outside the synchronization block makes it safe to call
- // interrupt() from within callback code (in which case it will be
- // ignored rather than cause deadlock / illegal state exception)
- done();
- }
-
- /**
- * Marks the task as failed.
- * @param exception the cause of abrupt completion.
- */
- private void setFailed(Throwable exception) {
- synchronized (this) {
- if (ranOrCancelled()) return;
- this.state = RAN;
- this.exception = exception;
- this.runner = null;
- notifyAll();
- }
-
- // invoking callbacks *after* setting future as completed and
- // outside the synchronization block makes it safe to call
- // interrupt() from within callback code (in which case it will be
- // ignored rather than cause deadlock / illegal state exception)
- done();
- }
-
- /**
- * Waits for the task to complete.
- * PRE: lock owned
- */
- private void waitFor() throws InterruptedException {
- while (!isDone()) {
- wait();
- }
- }
-
- /**
- * Waits for the task to complete for timeout nanoseconds or throw
- * TimeoutException if still not completed after that
- * PRE: lock owned
- */
- private void waitFor(long nanos) throws InterruptedException, TimeoutException {
- if (nanos < 0) throw new IllegalArgumentException();
- if (isDone()) return;
- long deadline = Utils.nanoTime() + nanos;
- while (nanos > 0) {
- TimeUnit.NANOSECONDS.timedWait(this, nanos);
- if (isDone()) return;
- nanos = deadline - Utils.nanoTime();
- }
- throw new TimeoutException();
- }
-
- /**
- * Gets the result of the task.
- *
- * PRE: task completed
- * PRE: lock owned
- */
- private Object getResult() throws ExecutionException {
- if (state == CANCELLED) {
- throw new CancellationException();
- }
- if (exception != null) {
- throw new ExecutionException(exception);
- }
- return result;
- }
-
- // todo: consider
- //public String toString() {
- // return callable.toString();
- //}
-}
diff --git a/src/actors/scala/actors/threadpool/LinkedBlockingQueue.java b/src/actors/scala/actors/threadpool/LinkedBlockingQueue.java
deleted file mode 100644
index 15f1085ec6..0000000000
--- a/src/actors/scala/actors/threadpool/LinkedBlockingQueue.java
+++ /dev/null
@@ -1,843 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.ReentrantLock;
-import java.util.AbstractQueue;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * An optionally-bounded {@linkplain BlockingQueue blocking queue} based on
- * linked nodes.
- * This queue orders elements FIFO (first-in-first-out).
- * The <em>head</em> of the queue is that element that has been on the
- * queue the longest time.
- * The <em>tail</em> of the queue is that element that has been on the
- * queue the shortest time. New elements
- * are inserted at the tail of the queue, and the queue retrieval
- * operations obtain elements at the head of the queue.
- * Linked queues typically have higher throughput than array-based queues but
- * less predictable performance in most concurrent applications.
- *
- * <p> The optional capacity bound constructor argument serves as a
- * way to prevent excessive queue expansion. The capacity, if unspecified,
- * is equal to {@link Integer#MAX_VALUE}. Linked nodes are
- * dynamically created upon each insertion unless this would bring the
- * queue above capacity.
- *
- * <p>This class and its iterator implement all of the
- * <em>optional</em> methods of the {@link Collection} and {@link
- * Iterator} interfaces.
- *
- * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
- * Java Collections Framework</a>.
- *
- * @since 1.5
- * @author Doug Lea
- * @param <E> the type of elements held in this collection
- *
- */
-public class LinkedBlockingQueue<E> extends java.util.AbstractQueue<E>
- implements BlockingQueue<E>, java.io.Serializable {
- private static final long serialVersionUID = -6903933977591709194L;
-
- /*
- * A variant of the "two lock queue" algorithm. The putLock gates
- * entry to put (and offer), and has an associated condition for
- * waiting puts. Similarly for the takeLock. The "count" field
- * that they both rely on is maintained as an atomic to avoid
- * needing to get both locks in most cases. Also, to minimize need
- * for puts to get takeLock and vice-versa, cascading notifies are
- * used. When a put notices that it has enabled at least one take,
- * it signals taker. That taker in turn signals others if more
- * items have been entered since the signal. And symmetrically for
- * takes signalling puts. Operations such as remove(Object) and
- * iterators acquire both locks.
- *
- * Visibility between writers and readers is provided as follows:
- *
- * Whenever an element is enqueued, the putLock is acquired and
- * count updated. A subsequent reader guarantees visibility to the
- * enqueued Node by either acquiring the putLock (via fullyLock)
- * or by acquiring the takeLock, and then reading n = count.get();
- * this gives visibility to the first n items.
- *
- * To implement weakly consistent iterators, it appears we need to
- * keep all Nodes GC-reachable from a predecessor dequeued Node.
- * That would cause two problems:
- * - allow a rogue Iterator to cause unbounded memory retention
- * - cause cross-generational linking of old Nodes to new Nodes if
- * a Node was tenured while live, which generational GCs have a
- * hard time dealing with, causing repeated major collections.
- * However, only non-deleted Nodes need to be reachable from
- * dequeued Nodes, and reachability does not necessarily have to
- * be of the kind understood by the GC. We use the trick of
- * linking a Node that has just been dequeued to itself. Such a
- * self-link implicitly means to advance to head.next.
- */
-
- /**
- * Linked list node class
- */
- static class Node<E> {
- E item;
-
- /**
- * One of:
- * - the real successor Node
- * - this Node, meaning the successor is head.next
- * - null, meaning there is no successor (this is the last node)
- */
- Node<E> next;
-
- Node(E x) { item = x; }
- }
-
- /** The capacity bound, or Integer.MAX_VALUE if none */
- private final int capacity;
-
- /** Current number of elements */
- private final AtomicInteger count = new AtomicInteger(0);
-
- /**
- * Head of linked list.
- * Invariant: head.item == null
- */
- private transient Node<E> head;
-
- /**
- * Tail of linked list.
- * Invariant: last.next == null
- */
- private transient Node<E> last;
-
- /** Lock held by take, poll, etc */
- private final ReentrantLock takeLock = new ReentrantLock();
-
- /** Wait queue for waiting takes */
- private final Condition notEmpty = takeLock.newCondition();
-
- /** Lock held by put, offer, etc */
- private final ReentrantLock putLock = new ReentrantLock();
-
- /** Wait queue for waiting puts */
- private final Condition notFull = putLock.newCondition();
-
- /**
- * Signals a waiting take. Called only from put/offer (which do not
- * otherwise ordinarily lock takeLock.)
- */
- private void signalNotEmpty() {
- final ReentrantLock takeLock = this.takeLock;
- takeLock.lock();
- try {
- notEmpty.signal();
- } finally {
- takeLock.unlock();
- }
- }
-
- /**
- * Signals a waiting put. Called only from take/poll.
- */
- private void signalNotFull() {
- final ReentrantLock putLock = this.putLock;
- putLock.lock();
- try {
- notFull.signal();
- } finally {
- putLock.unlock();
- }
- }
-
- /**
- * Creates a node and links it at end of queue.
- *
- * @param x the item
- */
- private void enqueue(E x) {
- // assert putLock.isHeldByCurrentThread();
- // assert last.next == null;
- last = last.next = new Node<E>(x);
- }
-
- /**
- * Removes a node from head of queue.
- *
- * @return the node
- */
- private E dequeue() {
- // assert takeLock.isHeldByCurrentThread();
- // assert head.item == null;
- Node<E> h = head;
- Node<E> first = h.next;
- h.next = h; // help GC
- head = first;
- E x = first.item;
- first.item = null;
- return x;
- }
-
- /**
- * Lock to prevent both puts and takes.
- */
- void fullyLock() {
- putLock.lock();
- takeLock.lock();
- }
-
- /**
- * Unlock to allow both puts and takes.
- */
- void fullyUnlock() {
- takeLock.unlock();
- putLock.unlock();
- }
-
-// /**
-// * Tells whether both locks are held by current thread.
-// */
-// boolean isFullyLocked() {
-// return (putLock.isHeldByCurrentThread() &&
-// takeLock.isHeldByCurrentThread());
-// }
-
- /**
- * Creates a {@code LinkedBlockingQueue} with a capacity of
- * {@link Integer#MAX_VALUE}.
- */
- public LinkedBlockingQueue() {
- this(Integer.MAX_VALUE);
- }
-
- /**
- * Creates a {@code LinkedBlockingQueue} with the given (fixed) capacity.
- *
- * @param capacity the capacity of this queue
- * @throws IllegalArgumentException if {@code capacity} is not greater
- * than zero
- */
- public LinkedBlockingQueue(int capacity) {
- if (capacity <= 0) throw new IllegalArgumentException();
- this.capacity = capacity;
- last = head = new Node<E>(null);
- }
-
- /**
- * Creates a {@code LinkedBlockingQueue} with a capacity of
- * {@link Integer#MAX_VALUE}, initially containing the elements of the
- * given collection,
- * added in traversal order of the collection's iterator.
- *
- * @param c the collection of elements to initially contain
- * @throws NullPointerException if the specified collection or any
- * of its elements are null
- */
- public LinkedBlockingQueue(Collection<? extends E> c) {
- this(Integer.MAX_VALUE);
- final ReentrantLock putLock = this.putLock;
- putLock.lock(); // Never contended, but necessary for visibility
- try {
- int n = 0;
- for (E e : c) {
- if (e == null)
- throw new NullPointerException();
- if (n == capacity)
- throw new IllegalStateException("Queue full");
- enqueue(e);
- ++n;
- }
- count.set(n);
- } finally {
- putLock.unlock();
- }
- }
-
-
- // this doc comment is overridden to remove the reference to collections
- // greater in size than Integer.MAX_VALUE
- /**
- * Returns the number of elements in this queue.
- *
- * @return the number of elements in this queue
- */
- public int size() {
- return count.get();
- }
-
- // this doc comment is a modified copy of the inherited doc comment,
- // without the reference to unlimited queues.
- /**
- * Returns the number of additional elements that this queue can ideally
- * (in the absence of memory or resource constraints) accept without
- * blocking. This is always equal to the initial capacity of this queue
- * less the current {@code size} of this queue.
- *
- * <p>Note that you <em>cannot</em> always tell if an attempt to insert
- * an element will succeed by inspecting {@code remainingCapacity}
- * because it may be the case that another thread is about to
- * insert or remove an element.
- */
- public int remainingCapacity() {
- return capacity - count.get();
- }
-
- /**
- * Inserts the specified element at the tail of this queue, waiting if
- * necessary for space to become available.
- *
- * @throws InterruptedException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- */
- public void put(E e) throws InterruptedException {
- if (e == null) throw new NullPointerException();
- // Note: convention in all put/take/etc is to preset local var
- // holding count negative to indicate failure unless set.
- int c = -1;
- final ReentrantLock putLock = this.putLock;
- final AtomicInteger count = this.count;
- putLock.lockInterruptibly();
- try {
- /*
- * Note that count is used in wait guard even though it is
- * not protected by lock. This works because count can
- * only decrease at this point (all other puts are shut
- * out by lock), and we (or some other waiting put) are
- * signalled if it ever changes from capacity. Similarly
- * for all other uses of count in other wait guards.
- */
- while (count.get() == capacity) {
- notFull.await();
- }
- enqueue(e);
- c = count.getAndIncrement();
- if (c + 1 < capacity)
- notFull.signal();
- } finally {
- putLock.unlock();
- }
- if (c == 0)
- signalNotEmpty();
- }
-
- /**
- * Inserts the specified element at the tail of this queue, waiting if
- * necessary up to the specified wait time for space to become available.
- *
- * @return {@code true} if successful, or {@code false} if
- * the specified waiting time elapses before space is available.
- * @throws InterruptedException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- */
- public boolean offer(E e, long timeout, TimeUnit unit)
- throws InterruptedException {
-
- if (e == null) throw new NullPointerException();
- long nanos = unit.toNanos(timeout);
- int c = -1;
- final ReentrantLock putLock = this.putLock;
- final AtomicInteger count = this.count;
- putLock.lockInterruptibly();
- try {
- while (count.get() == capacity) {
- if (nanos <= 0)
- return false;
- nanos = notFull.awaitNanos(nanos);
- }
- enqueue(e);
- c = count.getAndIncrement();
- if (c + 1 < capacity)
- notFull.signal();
- } finally {
- putLock.unlock();
- }
- if (c == 0)
- signalNotEmpty();
- return true;
- }
-
- /**
- * Inserts the specified element at the tail of this queue if it is
- * possible to do so immediately without exceeding the queue's capacity,
- * returning {@code true} upon success and {@code false} if this queue
- * is full.
- * When using a capacity-restricted queue, this method is generally
- * preferable to method {@link BlockingQueue#add add}, which can fail to
- * insert an element only by throwing an exception.
- *
- * @throws NullPointerException if the specified element is null
- */
- public boolean offer(E e) {
- if (e == null) throw new NullPointerException();
- final AtomicInteger count = this.count;
- if (count.get() == capacity)
- return false;
- int c = -1;
- final ReentrantLock putLock = this.putLock;
- putLock.lock();
- try {
- if (count.get() < capacity) {
- enqueue(e);
- c = count.getAndIncrement();
- if (c + 1 < capacity)
- notFull.signal();
- }
- } finally {
- putLock.unlock();
- }
- if (c == 0)
- signalNotEmpty();
- return c >= 0;
- }
-
-
- public E take() throws InterruptedException {
- E x;
- int c = -1;
- final AtomicInteger count = this.count;
- final ReentrantLock takeLock = this.takeLock;
- takeLock.lockInterruptibly();
- try {
- while (count.get() == 0) {
- notEmpty.await();
- }
- x = dequeue();
- c = count.getAndDecrement();
- if (c > 1)
- notEmpty.signal();
- } finally {
- takeLock.unlock();
- }
- if (c == capacity)
- signalNotFull();
- return x;
- }
-
- public E poll(long timeout, TimeUnit unit) throws InterruptedException {
- E x = null;
- int c = -1;
- long nanos = unit.toNanos(timeout);
- final AtomicInteger count = this.count;
- final ReentrantLock takeLock = this.takeLock;
- takeLock.lockInterruptibly();
- try {
- while (count.get() == 0) {
- if (nanos <= 0)
- return null;
- nanos = notEmpty.awaitNanos(nanos);
- }
- x = dequeue();
- c = count.getAndDecrement();
- if (c > 1)
- notEmpty.signal();
- } finally {
- takeLock.unlock();
- }
- if (c == capacity)
- signalNotFull();
- return x;
- }
-
- public E poll() {
- final AtomicInteger count = this.count;
- if (count.get() == 0)
- return null;
- E x = null;
- int c = -1;
- final ReentrantLock takeLock = this.takeLock;
- takeLock.lock();
- try {
- if (count.get() > 0) {
- x = dequeue();
- c = count.getAndDecrement();
- if (c > 1)
- notEmpty.signal();
- }
- } finally {
- takeLock.unlock();
- }
- if (c == capacity)
- signalNotFull();
- return x;
- }
-
- public E peek() {
- if (count.get() == 0)
- return null;
- final ReentrantLock takeLock = this.takeLock;
- takeLock.lock();
- try {
- Node<E> first = head.next;
- if (first == null)
- return null;
- else
- return first.item;
- } finally {
- takeLock.unlock();
- }
- }
-
- /**
- * Unlinks interior Node p with predecessor trail.
- */
- void unlink(Node<E> p, Node<E> trail) {
- // assert isFullyLocked();
- // p.next is not changed, to allow iterators that are
- // traversing p to maintain their weak-consistency guarantee.
- p.item = null;
- trail.next = p.next;
- if (last == p)
- last = trail;
- if (count.getAndDecrement() == capacity)
- notFull.signal();
- }
-
- /**
- * Removes a single instance of the specified element from this queue,
- * if it is present. More formally, removes an element {@code e} such
- * that {@code o.equals(e)}, if this queue contains one or more such
- * elements.
- * Returns {@code true} if this queue contained the specified element
- * (or equivalently, if this queue changed as a result of the call).
- *
- * @param o element to be removed from this queue, if present
- * @return {@code true} if this queue changed as a result of the call
- */
- public boolean remove(Object o) {
- if (o == null) return false;
- fullyLock();
- try {
- for (Node<E> trail = head, p = trail.next;
- p != null;
- trail = p, p = p.next) {
- if (o.equals(p.item)) {
- unlink(p, trail);
- return true;
- }
- }
- return false;
- } finally {
- fullyUnlock();
- }
- }
-
- /**
- * Returns an array containing all of the elements in this queue, in
- * proper sequence.
- *
- * <p>The returned array will be "safe" in that no references to it are
- * maintained by this queue. (In other words, this method must allocate
- * a new array). The caller is thus free to modify the returned array.
- *
- * <p>This method acts as bridge between array-based and collection-based
- * APIs.
- *
- * @return an array containing all of the elements in this queue
- */
- public Object[] toArray() {
- fullyLock();
- try {
- int size = count.get();
- Object[] a = new Object[size];
- int k = 0;
- for (Node<E> p = head.next; p != null; p = p.next)
- a[k++] = p.item;
- return a;
- } finally {
- fullyUnlock();
- }
- }
-
- /**
- * Returns an array containing all of the elements in this queue, in
- * proper sequence; the runtime type of the returned array is that of
- * the specified array. If the queue fits in the specified array, it
- * is returned therein. Otherwise, a new array is allocated with the
- * runtime type of the specified array and the size of this queue.
- *
- * <p>If this queue fits in the specified array with room to spare
- * (i.e., the array has more elements than this queue), the element in
- * the array immediately following the end of the queue is set to
- * {@code null}.
- *
- * <p>Like the {@link #toArray()} method, this method acts as bridge between
- * array-based and collection-based APIs. Further, this method allows
- * precise control over the runtime type of the output array, and may,
- * under certain circumstances, be used to save allocation costs.
- *
- * <p>Suppose {@code x} is a queue known to contain only strings.
- * The following code can be used to dump the queue into a newly
- * allocated array of {@code String}:
- *
- * <pre>
- * String[] y = x.toArray(new String[0]);</pre>
- *
- * Note that {@code toArray(new Object[0])} is identical in function to
- * {@code toArray()}.
- *
- * @param a the array into which the elements of the queue are to
- * be stored, if it is big enough; otherwise, a new array of the
- * same runtime type is allocated for this purpose
- * @return an array containing all of the elements in this queue
- * @throws ArrayStoreException if the runtime type of the specified array
- * is not a supertype of the runtime type of every element in
- * this queue
- * @throws NullPointerException if the specified array is null
- */
- @SuppressWarnings("unchecked")
- public <T> T[] toArray(T[] a) {
- fullyLock();
- try {
- int size = count.get();
- if (a.length < size)
- a = (T[])java.lang.reflect.Array.newInstance
- (a.getClass().getComponentType(), size);
-
- int k = 0;
- for (Node<E> p = head.next; p != null; p = p.next)
- a[k++] = (T)p.item;
- if (a.length > k)
- a[k] = null;
- return a;
- } finally {
- fullyUnlock();
- }
- }
-
- public String toString() {
- fullyLock();
- try {
- return super.toString();
- } finally {
- fullyUnlock();
- }
- }
-
- /**
- * Atomically removes all of the elements from this queue.
- * The queue will be empty after this call returns.
- */
- public void clear() {
- fullyLock();
- try {
- for (Node<E> p, h = head; (p = h.next) != null; h = p) {
- h.next = h;
- p.item = null;
- }
- head = last;
- // assert head.item == null && head.next == null;
- if (count.getAndSet(0) == capacity)
- notFull.signal();
- } finally {
- fullyUnlock();
- }
- }
-
- /**
- * @throws UnsupportedOperationException {@inheritDoc}
- * @throws ClassCastException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- * @throws IllegalArgumentException {@inheritDoc}
- */
- public int drainTo(Collection<? super E> c) {
- return drainTo(c, Integer.MAX_VALUE);
- }
-
- /**
- * @throws UnsupportedOperationException {@inheritDoc}
- * @throws ClassCastException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- * @throws IllegalArgumentException {@inheritDoc}
- */
- public int drainTo(Collection<? super E> c, int maxElements) {
- if (c == null)
- throw new NullPointerException();
- if (c == this)
- throw new IllegalArgumentException();
- boolean signalNotFull = false;
- final ReentrantLock takeLock = this.takeLock;
- takeLock.lock();
- try {
- int n = Math.min(maxElements, count.get());
- // count.get provides visibility to first n Nodes
- Node<E> h = head;
- int i = 0;
- try {
- while (i < n) {
- Node<E> p = h.next;
- c.add(p.item);
- p.item = null;
- h.next = h;
- h = p;
- ++i;
- }
- return n;
- } finally {
- // Restore invariants even if c.add() threw
- if (i > 0) {
- // assert h.item == null;
- head = h;
- signalNotFull = (count.getAndAdd(-i) == capacity);
- }
- }
- } finally {
- takeLock.unlock();
- if (signalNotFull)
- signalNotFull();
- }
- }
-
- /**
- * Returns an iterator over the elements in this queue in proper sequence.
- * The returned {@code Iterator} is a "weakly consistent" iterator that
- * will never throw {@link java.util.ConcurrentModificationException
- * ConcurrentModificationException},
- * and guarantees to traverse elements as they existed upon
- * construction of the iterator, and may (but is not guaranteed to)
- * reflect any modifications subsequent to construction.
- *
- * @return an iterator over the elements in this queue in proper sequence
- */
- public Iterator<E> iterator() {
- return new Itr();
- }
-
- private class Itr implements Iterator<E> {
- /*
- * Basic weakly-consistent iterator. At all times hold the next
- * item to hand out so that if hasNext() reports true, we will
- * still have it to return even if lost race with a take etc.
- */
- private Node<E> current;
- private Node<E> lastRet;
- private E currentElement;
-
- Itr() {
- fullyLock();
- try {
- current = head.next;
- if (current != null)
- currentElement = current.item;
- } finally {
- fullyUnlock();
- }
- }
-
- public boolean hasNext() {
- return current != null;
- }
-
- /**
- * Returns the next live successor of p, or null if no such.
- *
- * Unlike other traversal methods, iterators need to handle both:
- * - dequeued nodes (p.next == p)
- * - (possibly multiple) interior removed nodes (p.item == null)
- */
- private Node<E> nextNode(Node<E> p) {
- for (;;) {
- Node<E> s = p.next;
- if (s == p)
- return head.next;
- if (s == null || s.item != null)
- return s;
- p = s;
- }
- }
-
- public E next() {
- fullyLock();
- try {
- if (current == null)
- throw new NoSuchElementException();
- E x = currentElement;
- lastRet = current;
- current = nextNode(current);
- currentElement = (current == null) ? null : current.item;
- return x;
- } finally {
- fullyUnlock();
- }
- }
-
- public void remove() {
- if (lastRet == null)
- throw new IllegalStateException();
- fullyLock();
- try {
- Node<E> node = lastRet;
- lastRet = null;
- for (Node<E> trail = head, p = trail.next;
- p != null;
- trail = p, p = p.next) {
- if (p == node) {
- unlink(p, trail);
- break;
- }
- }
- } finally {
- fullyUnlock();
- }
- }
- }
-
- /**
- * Save the state to a stream (that is, serialize it).
- *
- * @serialData The capacity is emitted (int), followed by all of
- * its elements (each an {@code Object}) in the proper order,
- * followed by a null
- * @param s the stream
- */
- private void writeObject(java.io.ObjectOutputStream s)
- throws java.io.IOException {
-
- fullyLock();
- try {
- // Write out any hidden stuff, plus capacity
- s.defaultWriteObject();
-
- // Write out all elements in the proper order.
- for (Node<E> p = head.next; p != null; p = p.next)
- s.writeObject(p.item);
-
- // Use trailing null as sentinel
- s.writeObject(null);
- } finally {
- fullyUnlock();
- }
- }
-
- /**
- * Reconstitute this queue instance from a stream (that is,
- * deserialize it).
- *
- * @param s the stream
- */
- private void readObject(java.io.ObjectInputStream s)
- throws java.io.IOException, ClassNotFoundException {
- // Read in capacity, and any hidden stuff
- s.defaultReadObject();
-
- count.set(0);
- last = head = new Node<E>(null);
-
- // Read in all elements and place in queue
- for (;;) {
- @SuppressWarnings("unchecked")
- E item = (E)s.readObject();
- if (item == null)
- break;
- add(item);
- }
- }
-}
diff --git a/src/actors/scala/actors/threadpool/Perf.java b/src/actors/scala/actors/threadpool/Perf.java
deleted file mode 100644
index 0f262b444f..0000000000
--- a/src/actors/scala/actors/threadpool/Perf.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package scala.actors.threadpool;
-
-/**
- * Compilation stub for pre-1.4.2 JREs. Thanks to it, the whole backport
- * package compiles and works with 1.4.2 as well as wih earlier JREs, and takes
- * advantage of native Perf class when running on 1.4.2 while seamlessly
- * falling back to System.currentTimeMillis() on previous JREs. This class
- * should NOT be included in the binary distribution of backport.
- *
- * @author Dawid Kurzyniec
- * @version 1.0
- */
-public final class Perf {
-
- private static final Perf perf = new Perf();
-
- public static Perf getPerf() { return perf; }
-
- private Perf() {}
-
- public long highResCounter() {
- return System.currentTimeMillis();
- }
-
- public long highResFrequency() {
- return 1000L;
- }
-}
diff --git a/src/actors/scala/actors/threadpool/Queue.java b/src/actors/scala/actors/threadpool/Queue.java
deleted file mode 100644
index f952e9d94c..0000000000
--- a/src/actors/scala/actors/threadpool/Queue.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-import java.util.Collection;
-
-/**
- * A collection designed for holding elements prior to processing.
- * Besides basic {@link java.util.Collection Collection} operations,
- * queues provide additional insertion, extraction, and inspection
- * operations. Each of these methods exists in two forms: one throws
- * an exception if the operation fails, the other returns a special
- * value (either <tt>null</tt> or <tt>false</tt>, depending on the
- * operation). The latter form of the insert operation is designed
- * specifically for use with capacity-restricted <tt>Queue</tt>
- * implementations; in most implementations, insert operations cannot
- * fail.
- *
- * <p>
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
- * <tr>
- * <td></td>
- * <td ALIGN=CENTER><em>Throws exception</em></td>
- * <td ALIGN=CENTER><em>Returns special value</em></td>
- * </tr>
- * <tr>
- * <td><b>Insert</b></td>
- * <td>{@link #add add(e)}</td>
- * <td>{@link #offer offer(e)}</td>
- * </tr>
- * <tr>
- * <td><b>Remove</b></td>
- * <td>{@link #remove remove()}</td>
- * <td>{@link #poll poll()}</td>
- * </tr>
- * <tr>
- * <td><b>Examine</b></td>
- * <td>{@link #element element()}</td>
- * <td>{@link #peek peek()}</td>
- * </tr>
- * </table>
- *
- * <p>Queues typically, but do not necessarily, order elements in a
- * FIFO (first-in-first-out) manner. Among the exceptions are
- * priority queues, which order elements according to a supplied
- * comparator, or the elements' natural ordering, and LIFO queues (or
- * stacks) which order the elements LIFO (last-in-first-out).
- * Whatever the ordering used, the <em>head</em> of the queue is that
- * element which would be removed by a call to {@link #remove() } or
- * {@link #poll()}. In a FIFO queue, all new elements are inserted at
- * the <em> tail</em> of the queue. Other kinds of queues may use
- * different placement rules. Every <tt>Queue</tt> implementation
- * must specify its ordering properties.
- *
- * <p>The {@link #offer offer} method inserts an element if possible,
- * otherwise returning <tt>false</tt>. This differs from the {@link
- * java.util.Collection#add Collection.add} method, which can fail to
- * add an element only by throwing an unchecked exception. The
- * <tt>offer</tt> method is designed for use when failure is a normal,
- * rather than exceptional occurrence, for example, in fixed-capacity
- * (or &quot;bounded&quot;) queues.
- *
- * <p>The {@link #remove()} and {@link #poll()} methods remove and
- * return the head of the queue.
- * Exactly which element is removed from the queue is a
- * function of the queue's ordering policy, which differs from
- * implementation to implementation. The <tt>remove()</tt> and
- * <tt>poll()</tt> methods differ only in their behavior when the
- * queue is empty: the <tt>remove()</tt> method throws an exception,
- * while the <tt>poll()</tt> method returns <tt>null</tt>.
- *
- * <p>The {@link #element()} and {@link #peek()} methods return, but do
- * not remove, the head of the queue.
- *
- * <p>The <tt>Queue</tt> interface does not define the <i>blocking queue
- * methods</i>, which are common in concurrent programming. These methods,
- * which wait for elements to appear or for space to become available, are
- * defined in the {@link edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue} interface, which
- * extends this interface.
- *
- * <p><tt>Queue</tt> implementations generally do not allow insertion
- * of <tt>null</tt> elements, although some implementations, such as
- * {@link LinkedList}, do not prohibit insertion of <tt>null</tt>.
- * Even in the implementations that permit it, <tt>null</tt> should
- * not be inserted into a <tt>Queue</tt>, as <tt>null</tt> is also
- * used as a special return value by the <tt>poll</tt> method to
- * indicate that the queue contains no elements.
- *
- * <p><tt>Queue</tt> implementations generally do not define
- * element-based versions of methods <tt>equals</tt> and
- * <tt>hashCode</tt> but instead inherit the identity based versions
- * from class <tt>Object</tt>, because element-based equality is not
- * always well-defined for queues with the same elements but different
- * ordering properties.
- *
- *
- * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
- * Java Collections Framework</a>.
- *
- * @see java.util.Collection
- * @see LinkedList
- * @see PriorityQueue
- * @see edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue
- * @see edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue
- * @see edu.emory.mathcs.backport.java.util.concurrent.ArrayBlockingQueue
- * @see edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue
- * @see edu.emory.mathcs.backport.java.util.concurrent.PriorityBlockingQueue
- * @since 1.5
- * @author Doug Lea
- */
-public interface Queue extends Collection {
- /**
- * Inserts the specified element into this queue if it is possible to do so
- * immediately without violating capacity restrictions, returning
- * <tt>true</tt> upon success and throwing an <tt>IllegalStateException</tt>
- * if no space is currently available.
- *
- * @param e the element to add
- * @return <tt>true</tt> (as specified by {@link Collection#add})
- * @throws IllegalStateException if the element cannot be added at this
- * time due to capacity restrictions
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null and
- * this queue not permit null elements
- * @throws IllegalArgumentException if some property of this element
- * prevents it from being added to this queue
- */
- boolean add(Object e);
-
- /**
- * Inserts the specified element into this queue if it is possible to do
- * so immediately without violating capacity restrictions.
- * When using a capacity-restricted queue, this method is generally
- * preferable to {@link #add}, which can fail to insert an element only
- * by throwing an exception.
- *
- * @param e the element to add
- * @return <tt>true</tt> if the element was added to this queue, else
- * <tt>false</tt>
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null and
- * this queue does not permit null elements
- * @throws IllegalArgumentException if some property of this element
- * prevents it from being added to this queue
- */
- boolean offer(Object e);
-
- /**
- * Retrieves and removes the head of this queue. This method differs
- * from {@link #poll poll} only in that it throws an exception if this
- * queue is empty.
- * is empty.
- *
- * @return the head of this queue
- * @throws NoSuchElementException if this queue is empty
- */
- Object remove();
-
- /**
- * Retrieves and removes the head of this queue,
- * or returns <tt>null</tt> if this queue is empty.
- *
- * @return the head of this queue, or <tt>null</tt> if this queue is empty
- */
- Object poll();
-
- /**
- * Retrieves, but does not remove, the head of this queue. This method
- * differs from {@link #peek peek} only in that it throws an exception
- * if this queue is empty.
- *
- * @return the head of this queue
- * @throws NoSuchElementException if this queue is empty
- */
- Object element();
-
- /**
- * Retrieves, but does not remove, the head of this queue,
- * or returns <tt>null</tt> if this queue is empty.
- *
- * @return the head of this queue, or <tt>null</tt> if this queue is empty
- */
- Object peek();
-}
diff --git a/src/actors/scala/actors/threadpool/RejectedExecutionException.java b/src/actors/scala/actors/threadpool/RejectedExecutionException.java
deleted file mode 100644
index 1b61d35974..0000000000
--- a/src/actors/scala/actors/threadpool/RejectedExecutionException.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-/**
- * Exception thrown by an {@link Executor} when a task cannot be
- * accepted for execution.
- *
- * @since 1.5
- * @author Doug Lea
- */
-public class RejectedExecutionException extends RuntimeException {
- private static final long serialVersionUID = -375805702767069545L;
-
- /**
- * Constructs a <tt>RejectedExecutionException</tt> with no detail message.
- * The cause is not initialized, and may subsequently be
- * initialized by a call to {@link #initCause(Throwable) initCause}.
- */
- public RejectedExecutionException() { }
-
- /**
- * Constructs a <tt>RejectedExecutionException</tt> with the
- * specified detail message. The cause is not initialized, and may
- * subsequently be initialized by a call to {@link
- * #initCause(Throwable) initCause}.
- *
- * @param message the detail message
- */
- public RejectedExecutionException(String message) {
- super(message);
- }
-
- /**
- * Constructs a <tt>RejectedExecutionException</tt> with the
- * specified detail message and cause.
- *
- * @param message the detail message
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method)
- */
- public RejectedExecutionException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Constructs a <tt>RejectedExecutionException</tt> with the
- * specified cause. The detail message is set to: <pre> (cause ==
- * null ? null : cause.toString())</pre> (which typically contains
- * the class and detail message of <tt>cause</tt>).
- *
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method)
- */
- public RejectedExecutionException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/src/actors/scala/actors/threadpool/RejectedExecutionHandler.java b/src/actors/scala/actors/threadpool/RejectedExecutionHandler.java
deleted file mode 100644
index 86e6d18a40..0000000000
--- a/src/actors/scala/actors/threadpool/RejectedExecutionHandler.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-/**
- * A handler for tasks that cannot be executed by a {@link ThreadPoolExecutor}.
- *
- * @since 1.5
- * @author Doug Lea
- */
-public interface RejectedExecutionHandler {
-
- /**
- * Method that may be invoked by a {@link ThreadPoolExecutor} when
- * {@link ThreadPoolExecutor#execute execute} cannot accept a
- * task. This may occur when no more threads or queue slots are
- * available because their bounds would be exceeded, or upon
- * shutdown of the Executor.
- *
- * <p>In the absence of other alternatives, the method may throw
- * an unchecked {@link RejectedExecutionException}, which will be
- * propagated to the caller of {@code execute}.
- *
- * @param r the runnable task requested to be executed
- * @param executor the executor attempting to execute this task
- * @throws RejectedExecutionException if there is no remedy
- */
-
- void rejectedExecution(Runnable r, ThreadPoolExecutor executor);
-}
diff --git a/src/actors/scala/actors/threadpool/RunnableFuture.java b/src/actors/scala/actors/threadpool/RunnableFuture.java
deleted file mode 100644
index bbd63a2d92..0000000000
--- a/src/actors/scala/actors/threadpool/RunnableFuture.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-/**
- * A {@link Future} that is {@link Runnable}. Successful execution of
- * the <tt>run</tt> method causes completion of the <tt>Future</tt>
- * and allows access to its results.
- * @see FutureTask
- * @see Executor
- * @since 1.6
- * @author Doug Lea
- */
-public interface RunnableFuture extends Runnable, Future {
- /**
- * Sets this Future to the result of its computation
- * unless it has been cancelled.
- */
- void run();
-}
diff --git a/src/actors/scala/actors/threadpool/SynchronousQueue.java b/src/actors/scala/actors/threadpool/SynchronousQueue.java
deleted file mode 100644
index 739b0043dd..0000000000
--- a/src/actors/scala/actors/threadpool/SynchronousQueue.java
+++ /dev/null
@@ -1,833 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-import scala.actors.threadpool.locks.*;
-//import edu.emory.mathcs.backport.java.util.*;
-import java.util.Collection;
-import java.util.Iterator;
-import scala.actors.threadpool.helpers.Utils;
-import java.util.NoSuchElementException;
-
-/**
- * A {@linkplain BlockingQueue blocking queue} in which each insert
- * operation must wait for a corresponding remove operation by another
- * thread, and vice versa. A synchronous queue does not have any
- * internal capacity, not even a capacity of one. You cannot
- * <tt>peek</tt> at a synchronous queue because an element is only
- * present when you try to remove it; you cannot insert an element
- * (using any method) unless another thread is trying to remove it;
- * you cannot iterate as there is nothing to iterate. The
- * <em>head</em> of the queue is the element that the first queued
- * inserting thread is trying to add to the queue; if there is no such
- * queued thread then no element is available for removal and
- * <tt>poll()</tt> will return <tt>null</tt>. For purposes of other
- * <tt>Collection</tt> methods (for example <tt>contains</tt>), a
- * <tt>SynchronousQueue</tt> acts as an empty collection. This queue
- * does not permit <tt>null</tt> elements.
- *
- * <p>Synchronous queues are similar to rendezvous channels used in
- * CSP and Ada. They are well suited for handoff designs, in which an
- * object running in one thread must sync up with an object running
- * in another thread in order to hand it some information, event, or
- * task.
- *
- * <p> This class supports an optional fairness policy for ordering
- * waiting producer and consumer threads. By default, this ordering
- * is not guaranteed. However, a queue constructed with fairness set
- * to <tt>true</tt> grants threads access in FIFO order. Fairness
- * generally decreases throughput but reduces variability and avoids
- * starvation.
- *
- * <p>This class and its iterator implement all of the
- * <em>optional</em> methods of the {@link Collection} and {@link
- * Iterator} interfaces.
- *
- * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
- * Java Collections Framework</a>.
- *
- * @since 1.5
- * @author Doug Lea
- */
-public class SynchronousQueue extends AbstractQueue
- implements BlockingQueue, java.io.Serializable {
- private static final long serialVersionUID = -3223113410248163686L;
-
- /*
- This implementation divides actions into two cases for puts:
-
- * An arriving producer that does not already have a waiting consumer
- creates a node holding item, and then waits for a consumer to take it.
- * An arriving producer that does already have a waiting consumer fills
- the slot node created by the consumer, and notifies it to continue.
-
- And symmetrically, two for takes:
-
- * An arriving consumer that does not already have a waiting producer
- creates an empty slot node, and then waits for a producer to fill it.
- * An arriving consumer that does already have a waiting producer takes
- item from the node created by the producer, and notifies it to continue.
-
- When a put or take waiting for the actions of its counterpart
- aborts due to interruption or timeout, it marks the node
- it created as "CANCELLED", which causes its counterpart to retry
- the entire put or take sequence.
-
- This requires keeping two simple queues, waitingProducers and
- waitingConsumers. Each of these can be FIFO (preserves fairness)
- or LIFO (improves throughput).
- */
-
- /** Lock protecting both wait queues */
- private final ReentrantLock qlock;
- /** Queue holding waiting puts */
- private final WaitQueue waitingProducers;
- /** Queue holding waiting takes */
- private final WaitQueue waitingConsumers;
-
- /**
- * Creates a <tt>SynchronousQueue</tt> with nonfair access policy.
- */
- public SynchronousQueue() {
- this(false);
- }
-
- /**
- * Creates a <tt>SynchronousQueue</tt> with specified fairness policy.
- * @param fair if true, threads contend in FIFO order for access;
- * otherwise the order is unspecified.
- */
- public SynchronousQueue(boolean fair) {
- if (fair) {
- qlock = new ReentrantLock(true);
- waitingProducers = new FifoWaitQueue();
- waitingConsumers = new FifoWaitQueue();
- }
- else {
- qlock = new ReentrantLock();
- waitingProducers = new LifoWaitQueue();
- waitingConsumers = new LifoWaitQueue();
- }
- }
-
- /**
- * Queue to hold waiting puts/takes; specialized to Fifo/Lifo below.
- * These queues have all transient fields, but are serializable
- * in order to recover fairness settings when deserialized.
- */
- static abstract class WaitQueue implements java.io.Serializable {
- /** Creates, adds, and returns node for x. */
- abstract Node enq(Object x);
- /** Removes and returns node, or null if empty. */
- abstract Node deq();
- /** Removes a cancelled node to avoid garbage retention. */
- abstract void unlink(Node node);
- /** Returns true if a cancelled node might be on queue. */
- abstract boolean shouldUnlink(Node node);
- }
-
- /**
- * FIFO queue to hold waiting puts/takes.
- */
- static final class FifoWaitQueue extends WaitQueue implements java.io.Serializable {
- private static final long serialVersionUID = -3623113410248163686L;
- private transient Node head;
- private transient Node last;
-
- Node enq(Object x) {
- Node p = new Node(x);
- if (last == null)
- last = head = p;
- else
- last = last.next = p;
- return p;
- }
-
- Node deq() {
- Node p = head;
- if (p != null) {
- if ((head = p.next) == null)
- last = null;
- p.next = null;
- }
- return p;
- }
-
- boolean shouldUnlink(Node node) {
- return (node == last || node.next != null);
- }
-
- void unlink(Node node) {
- Node p = head;
- Node trail = null;
- while (p != null) {
- if (p == node) {
- Node next = p.next;
- if (trail == null)
- head = next;
- else
- trail.next = next;
- if (last == node)
- last = trail;
- break;
- }
- trail = p;
- p = p.next;
- }
- }
- }
-
- /**
- * LIFO queue to hold waiting puts/takes.
- */
- static final class LifoWaitQueue extends WaitQueue implements java.io.Serializable {
- private static final long serialVersionUID = -3633113410248163686L;
- private transient Node head;
-
- Node enq(Object x) {
- return head = new Node(x, head);
- }
-
- Node deq() {
- Node p = head;
- if (p != null) {
- head = p.next;
- p.next = null;
- }
- return p;
- }
-
- boolean shouldUnlink(Node node) {
- // Return false if already dequeued or is bottom node (in which
- // case we might retain at most one garbage node)
- return (node == head || node.next != null);
- }
-
- void unlink(Node node) {
- Node p = head;
- Node trail = null;
- while (p != null) {
- if (p == node) {
- Node next = p.next;
- if (trail == null)
- head = next;
- else
- trail.next = next;
- break;
- }
- trail = p;
- p = p.next;
- }
- }
- }
-
- /**
- * Unlinks the given node from consumer queue. Called by cancelled
- * (timeout, interrupt) waiters to avoid garbage retention in the
- * absence of producers.
- */
- private void unlinkCancelledConsumer(Node node) {
- // Use a form of double-check to avoid unnecessary locking and
- // traversal. The first check outside lock might
- // conservatively report true.
- if (waitingConsumers.shouldUnlink(node)) {
- qlock.lock();
- try {
- if (waitingConsumers.shouldUnlink(node))
- waitingConsumers.unlink(node);
- } finally {
- qlock.unlock();
- }
- }
- }
-
- /**
- * Unlinks the given node from producer queue. Symmetric
- * to unlinkCancelledConsumer.
- */
- private void unlinkCancelledProducer(Node node) {
- if (waitingProducers.shouldUnlink(node)) {
- qlock.lock();
- try {
- if (waitingProducers.shouldUnlink(node))
- waitingProducers.unlink(node);
- } finally {
- qlock.unlock();
- }
- }
- }
-
- /**
- * Nodes each maintain an item and handle waits and signals for
- * getting and setting it. The class extends
- * AbstractQueuedSynchronizer to manage blocking, using AQS state
- * 0 for waiting, 1 for ack, -1 for cancelled.
- */
- static final class Node implements java.io.Serializable {
- private static final long serialVersionUID = -3223113410248163686L;
-
- /** Synchronization state value representing that node acked */
- private static final int ACK = 1;
- /** Synchronization state value representing that node cancelled */
- private static final int CANCEL = -1;
-
- int state = 0;
-
- /** The item being transferred */
- Object item;
- /** Next node in wait queue */
- Node next;
-
- /** Creates a node with initial item */
- Node(Object x) { item = x; }
-
- /** Creates a node with initial item and next */
- Node(Object x, Node n) { item = x; next = n; }
-
- /**
- * Takes item and nulls out field (for sake of GC)
- *
- * PRE: lock owned
- */
- private Object extract() {
- Object x = item;
- item = null;
- return x;
- }
-
- /**
- * Tries to cancel on interrupt; if so rethrowing,
- * else setting interrupt state
- *
- * PRE: lock owned
- */
- private void checkCancellationOnInterrupt(InterruptedException ie)
- throws InterruptedException
- {
- if (state == 0) {
- state = CANCEL;
- notify();
- throw ie;
- }
- Thread.currentThread().interrupt();
- }
-
- /**
- * Fills in the slot created by the consumer and signal consumer to
- * continue.
- */
- synchronized boolean setItem(Object x) {
- if (state != 0) return false;
- item = x;
- state = ACK;
- notify();
- return true;
- }
-
- /**
- * Removes item from slot created by producer and signal producer
- * to continue.
- */
- synchronized Object getItem() {
- if (state != 0) return null;
- state = ACK;
- notify();
- return extract();
- }
-
- /**
- * Waits for a consumer to take item placed by producer.
- */
- synchronized void waitForTake() throws InterruptedException {
- try {
- while (state == 0) wait();
- } catch (InterruptedException ie) {
- checkCancellationOnInterrupt(ie);
- }
- }
-
- /**
- * Waits for a producer to put item placed by consumer.
- */
- synchronized Object waitForPut() throws InterruptedException {
- try {
- while (state == 0) wait();
- } catch (InterruptedException ie) {
- checkCancellationOnInterrupt(ie);
- }
- return extract();
- }
-
- private boolean attempt(long nanos) throws InterruptedException {
- if (state != 0) return true;
- if (nanos <= 0) {
- state = CANCEL;
- notify();
- return false;
- }
- long deadline = Utils.nanoTime() + nanos;
- while (true) {
- TimeUnit.NANOSECONDS.timedWait(this, nanos);
- if (state != 0) return true;
- nanos = deadline - Utils.nanoTime();
- if (nanos <= 0) {
- state = CANCEL;
- notify();
- return false;
- }
- }
- }
-
- /**
- * Waits for a consumer to take item placed by producer or time out.
- */
- synchronized boolean waitForTake(long nanos) throws InterruptedException {
- try {
- if (!attempt(nanos)) return false;
- } catch (InterruptedException ie) {
- checkCancellationOnInterrupt(ie);
- }
- return true;
- }
-
- /**
- * Waits for a producer to put item placed by consumer, or time out.
- */
- synchronized Object waitForPut(long nanos) throws InterruptedException {
- try {
- if (!attempt(nanos)) return null;
- } catch (InterruptedException ie) {
- checkCancellationOnInterrupt(ie);
- }
- return extract();
- }
- }
-
- /**
- * Adds the specified element to this queue, waiting if necessary for
- * another thread to receive it.
- *
- * @throws InterruptedException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- */
- public void put(Object e) throws InterruptedException {
- if (e == null) throw new NullPointerException();
- final ReentrantLock qlock = this.qlock;
-
- for (;;) {
- Node node;
- boolean mustWait;
- if (Thread.interrupted()) throw new InterruptedException();
- qlock.lock();
- try {
- node = waitingConsumers.deq();
- if ( (mustWait = (node == null)) )
- node = waitingProducers.enq(e);
- } finally {
- qlock.unlock();
- }
-
- if (mustWait) {
- try {
- node.waitForTake();
- return;
- } catch (InterruptedException ex) {
- unlinkCancelledProducer(node);
- throw ex;
- }
- }
-
- else if (node.setItem(e))
- return;
-
- // else consumer cancelled, so retry
- }
- }
-
- /**
- * Inserts the specified element into this queue, waiting if necessary
- * up to the specified wait time for another thread to receive it.
- *
- * @return <tt>true</tt> if successful, or <tt>false</tt> if the
- * specified waiting time elapses before a consumer appears.
- * @throws InterruptedException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- */
- public boolean offer(Object e, long timeout, TimeUnit unit) throws InterruptedException {
- if (e == null) throw new NullPointerException();
- long nanos = unit.toNanos(timeout);
- final ReentrantLock qlock = this.qlock;
- for (;;) {
- Node node;
- boolean mustWait;
- if (Thread.interrupted()) throw new InterruptedException();
- qlock.lock();
- try {
- node = waitingConsumers.deq();
- if ( (mustWait = (node == null)) )
- node = waitingProducers.enq(e);
- } finally {
- qlock.unlock();
- }
-
- if (mustWait) {
- try {
- boolean x = node.waitForTake(nanos);
- if (!x)
- unlinkCancelledProducer(node);
- return x;
- } catch (InterruptedException ex) {
- unlinkCancelledProducer(node);
- throw ex;
- }
- }
-
- else if (node.setItem(e))
- return true;
-
- // else consumer cancelled, so retry
- }
- }
-
- /**
- * Retrieves and removes the head of this queue, waiting if necessary
- * for another thread to insert it.
- *
- * @return the head of this queue
- * @throws InterruptedException {@inheritDoc}
- */
- public Object take() throws InterruptedException {
- final ReentrantLock qlock = this.qlock;
- for (;;) {
- Node node;
- boolean mustWait;
-
- if (Thread.interrupted()) throw new InterruptedException();
- qlock.lock();
- try {
- node = waitingProducers.deq();
- if ( (mustWait = (node == null)) )
- node = waitingConsumers.enq(null);
- } finally {
- qlock.unlock();
- }
-
- if (mustWait) {
- try {
- Object x = node.waitForPut();
- return (Object)x;
- } catch (InterruptedException ex) {
- unlinkCancelledConsumer(node);
- throw ex;
- }
- }
- else {
- Object x = node.getItem();
- if (x != null)
- return (Object)x;
- // else cancelled, so retry
- }
- }
- }
-
- /**
- * Retrieves and removes the head of this queue, waiting
- * if necessary up to the specified wait time, for another thread
- * to insert it.
- *
- * @return the head of this queue, or <tt>null</tt> if the
- * specified waiting time elapses before an element is present.
- * @throws InterruptedException {@inheritDoc}
- */
- public Object poll(long timeout, TimeUnit unit) throws InterruptedException {
- long nanos = unit.toNanos(timeout);
- final ReentrantLock qlock = this.qlock;
-
- for (;;) {
- Node node;
- boolean mustWait;
-
- if (Thread.interrupted()) throw new InterruptedException();
- qlock.lock();
- try {
- node = waitingProducers.deq();
- if ( (mustWait = (node == null)) )
- node = waitingConsumers.enq(null);
- } finally {
- qlock.unlock();
- }
-
- if (mustWait) {
- try {
- Object x = node.waitForPut(nanos);
- if (x == null)
- unlinkCancelledConsumer(node);
- return (Object)x;
- } catch (InterruptedException ex) {
- unlinkCancelledConsumer(node);
- throw ex;
- }
- }
- else {
- Object x = node.getItem();
- if (x != null)
- return (Object)x;
- // else cancelled, so retry
- }
- }
- }
-
- // Untimed nonblocking versions
-
- /**
- * Inserts the specified element into this queue, if another thread is
- * waiting to receive it.
- *
- * @param e the element to add
- * @return <tt>true</tt> if the element was added to this queue, else
- * <tt>false</tt>
- * @throws NullPointerException if the specified element is null
- */
- public boolean offer(Object e) {
- if (e == null) throw new NullPointerException();
- final ReentrantLock qlock = this.qlock;
-
- for (;;) {
- Node node;
- qlock.lock();
- try {
- node = waitingConsumers.deq();
- } finally {
- qlock.unlock();
- }
- if (node == null)
- return false;
-
- else if (node.setItem(e))
- return true;
- // else retry
- }
- }
-
- /**
- * Retrieves and removes the head of this queue, if another thread
- * is currently making an element available.
- *
- * @return the head of this queue, or <tt>null</tt> if no
- * element is available.
- */
- public Object poll() {
- final ReentrantLock qlock = this.qlock;
- for (;;) {
- Node node;
- qlock.lock();
- try {
- node = waitingProducers.deq();
- } finally {
- qlock.unlock();
- }
- if (node == null)
- return null;
-
- else {
- Object x = node.getItem();
- if (x != null)
- return (Object)x;
- // else retry
- }
- }
- }
-
- /**
- * Always returns <tt>true</tt>.
- * A <tt>SynchronousQueue</tt> has no internal capacity.
- *
- * @return <tt>true</tt>
- */
- public boolean isEmpty() {
- return true;
- }
-
- /**
- * Always returns zero.
- * A <tt>SynchronousQueue</tt> has no internal capacity.
- *
- * @return zero
- */
- public int size() {
- return 0;
- }
-
- /**
- * Always returns zero.
- * A <tt>SynchronousQueue</tt> has no internal capacity.
- *
- * @return zero
- */
- public int remainingCapacity() {
- return 0;
- }
-
- /**
- * Does nothing.
- * A <tt>SynchronousQueue</tt> has no internal capacity.
- */
- public void clear() {}
-
- /**
- * Always returns <tt>false</tt>.
- * A <tt>SynchronousQueue</tt> has no internal capacity.
- *
- * @param o object to be checked for containment in this queue
- * @return <tt>false</tt>
- */
- public boolean contains(Object o) {
- return false;
- }
-
- /**
- * Always returns <tt>false</tt>.
- * A <tt>SynchronousQueue</tt> has no internal capacity.
- *
- * @param o the element to remove
- * @return <tt>false</tt>
- */
- public boolean remove(Object o) {
- return false;
- }
-
- /**
- * Returns <tt>false</tt> unless the given collection is empty.
- * A <tt>SynchronousQueue</tt> has no internal capacity.
- *
- * @param c the collection
- * @return <tt>false</tt> unless the given collection is empty
- * @throws NullPointerException if the specified collection is null
- */
- public boolean containsAll(Collection c) {
- return c.isEmpty();
- }
-
- /**
- * Always returns <tt>false</tt>.
- * A <tt>SynchronousQueue</tt> has no internal capacity.
- *
- * @param c the collection
- * @return <tt>false</tt>
- */
- public boolean removeAll(Collection c) {
- return false;
- }
-
- /**
- * Always returns <tt>false</tt>.
- * A <tt>SynchronousQueue</tt> has no internal capacity.
- *
- * @param c the collection
- * @return <tt>false</tt>
- */
- public boolean retainAll(Collection c) {
- return false;
- }
-
- /**
- * Always returns <tt>null</tt>.
- * A <tt>SynchronousQueue</tt> does not return elements
- * unless actively waited on.
- *
- * @return <tt>null</tt>
- */
- public Object peek() {
- return null;
- }
-
-
- static class EmptyIterator implements Iterator {
- public boolean hasNext() {
- return false;
- }
- public Object next() {
- throw new NoSuchElementException();
- }
- public void remove() {
- throw new IllegalStateException();
- }
- }
-
- /**
- * Returns an empty iterator in which <tt>hasNext</tt> always returns
- * <tt>false</tt>.
- *
- * @return an empty iterator
- */
- public Iterator iterator() {
- return new EmptyIterator();
- }
-
-
- /**
- * Returns a zero-length array.
- * @return a zero-length array
- */
- public Object[] toArray() {
- return new Object[0];
- }
-
- /**
- * Sets the zeroeth element of the specified array to <tt>null</tt>
- * (if the array has non-zero length) and returns it.
- *
- * @param a the array
- * @return the specified array
- * @throws NullPointerException if the specified array is null
- */
- public Object[] toArray(Object[] a) {
- if (a.length > 0)
- a[0] = null;
- return a;
- }
-
- /**
- * @throws UnsupportedOperationException {@inheritDoc}
- * @throws ClassCastException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- * @throws IllegalArgumentException {@inheritDoc}
- */
- public int drainTo(Collection c) {
- if (c == null)
- throw new NullPointerException();
- if (c == this)
- throw new IllegalArgumentException();
- int n = 0;
- Object e;
- while ( (e = poll()) != null) {
- c.add(e);
- ++n;
- }
- return n;
- }
-
- /**
- * @throws UnsupportedOperationException {@inheritDoc}
- * @throws ClassCastException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- * @throws IllegalArgumentException {@inheritDoc}
- */
- public int drainTo(Collection c, int maxElements) {
- if (c == null)
- throw new NullPointerException();
- if (c == this)
- throw new IllegalArgumentException();
- int n = 0;
- Object e;
- while (n < maxElements && (e = poll()) != null) {
- c.add(e);
- ++n;
- }
- return n;
- }
-}
diff --git a/src/actors/scala/actors/threadpool/ThreadFactory.java b/src/actors/scala/actors/threadpool/ThreadFactory.java
deleted file mode 100644
index ed6e90ccaa..0000000000
--- a/src/actors/scala/actors/threadpool/ThreadFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-/**
- * An object that creates new threads on demand. Using thread factories
- * removes hardwiring of calls to {@link Thread#Thread(Runnable) new Thread},
- * enabling applications to use special thread subclasses, priorities, etc.
- *
- * <p>
- * The simplest implementation of this interface is just:
- * <pre>
- * class SimpleThreadFactory implements ThreadFactory {
- * public Thread newThread(Runnable r) {
- * return new Thread(r);
- * }
- * }
- * </pre>
- *
- * The {@link Executors#defaultThreadFactory} method provides a more
- * useful simple implementation, that sets the created thread context
- * to known values before returning it.
- * @since 1.5
- * @author Doug Lea
- */
-public interface ThreadFactory {
-
- /**
- * Constructs a new {@code Thread}. Implementations may also initialize
- * priority, name, daemon status, {@code ThreadGroup}, etc.
- *
- * @param r a runnable to be executed by new thread instance
- * @return constructed thread, or {@code null} if the request to
- * create a thread is rejected
- */
- Thread newThread(Runnable r);
-}
diff --git a/src/actors/scala/actors/threadpool/ThreadPoolExecutor.java b/src/actors/scala/actors/threadpool/ThreadPoolExecutor.java
deleted file mode 100644
index 11e35b034c..0000000000
--- a/src/actors/scala/actors/threadpool/ThreadPoolExecutor.java
+++ /dev/null
@@ -1,1968 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-import scala.actors.threadpool.locks.*;
-import scala.actors.threadpool.helpers.Utils;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Iterator;
-import java.util.ArrayList;
-import java.util.ConcurrentModificationException;
-
-/**
- * An {@link ExecutorService} that executes each submitted task using
- * one of possibly several pooled threads, normally configured
- * using {@link Executors} factory methods.
- *
- * <p>Thread pools address two different problems: they usually
- * provide improved performance when executing large numbers of
- * asynchronous tasks, due to reduced per-task invocation overhead,
- * and they provide a means of bounding and managing the resources,
- * including threads, consumed when executing a collection of tasks.
- * Each {@code ThreadPoolExecutor} also maintains some basic
- * statistics, such as the number of completed tasks.
- *
- * <p>To be useful across a wide range of contexts, this class
- * provides many adjustable parameters and extensibility
- * hooks. However, programmers are urged to use the more convenient
- * {@link Executors} factory methods {@link
- * Executors#newCachedThreadPool} (unbounded thread pool, with
- * automatic thread reclamation), {@link Executors#newFixedThreadPool}
- * (fixed size thread pool) and {@link
- * Executors#newSingleThreadExecutor} (single background thread), that
- * preconfigure settings for the most common usage
- * scenarios. Otherwise, use the following guide when manually
- * configuring and tuning this class:
- *
- * <dl>
- *
- * <dt>Core and maximum pool sizes</dt>
- *
- * <dd>A {@code ThreadPoolExecutor} will automatically adjust the
- * pool size (see {@link #getPoolSize})
- * according to the bounds set by
- * corePoolSize (see {@link #getCorePoolSize}) and
- * maximumPoolSize (see {@link #getMaximumPoolSize}).
- *
- * When a new task is submitted in method {@link #execute}, and fewer
- * than corePoolSize threads are running, a new thread is created to
- * handle the request, even if other worker threads are idle. If
- * there are more than corePoolSize but less than maximumPoolSize
- * threads running, a new thread will be created only if the queue is
- * full. By setting corePoolSize and maximumPoolSize the same, you
- * create a fixed-size thread pool. By setting maximumPoolSize to an
- * essentially unbounded value such as {@code Integer.MAX_VALUE}, you
- * allow the pool to accommodate an arbitrary number of concurrent
- * tasks. Most typically, core and maximum pool sizes are set only
- * upon construction, but they may also be changed dynamically using
- * {@link #setCorePoolSize} and {@link #setMaximumPoolSize}. </dd>
- *
- * <dt>On-demand construction</dt>
- *
- * <dd> By default, even core threads are initially created and
- * started only when new tasks arrive, but this can be overridden
- * dynamically using method {@link #prestartCoreThread} or {@link
- * #prestartAllCoreThreads}. You probably want to prestart threads if
- * you construct the pool with a non-empty queue. </dd>
- *
- * <dt>Creating new threads</dt>
- *
- * <dd>New threads are created using a {@link ThreadFactory}. If not
- * otherwise specified, a {@link Executors#defaultThreadFactory} is
- * used, that creates threads to all be in the same {@link
- * ThreadGroup} and with the same {@code NORM_PRIORITY} priority and
- * non-daemon status. By supplying a different ThreadFactory, you can
- * alter the thread's name, thread group, priority, daemon status,
- * etc. If a {@code ThreadFactory} fails to create a thread when asked
- * by returning null from {@code newThread}, the executor will
- * continue, but might not be able to execute any tasks. Threads
- * should possess the "modifyThread" {@code RuntimePermission}. If
- * worker threads or other threads using the pool do not possess this
- * permission, service may be degraded: configuration changes may not
- * take effect in a timely manner, and a shutdown pool may remain in a
- * state in which termination is possible but not completed.</dd>
- *
- * <dt>Keep-alive times</dt>
- *
- * <dd>If the pool currently has more than corePoolSize threads,
- * excess threads will be terminated if they have been idle for more
- * than the keepAliveTime (see {@link #getKeepAliveTime}). This
- * provides a means of reducing resource consumption when the pool is
- * not being actively used. If the pool becomes more active later, new
- * threads will be constructed. This parameter can also be changed
- * dynamically using method {@link #setKeepAliveTime}. Using a value
- * of {@code Long.MAX_VALUE} {@link TimeUnit#NANOSECONDS} effectively
- * disables idle threads from ever terminating prior to shut down. By
- * default, the keep-alive policy applies only when there are more
- * than corePoolSizeThreads. But method {@link
- * #allowCoreThreadTimeOut(boolean)} can be used to apply this
- * time-out policy to core threads as well, so long as the
- * keepAliveTime value is non-zero. </dd>
- *
- * <dt>Queuing</dt>
- *
- * <dd>Any {@link BlockingQueue} may be used to transfer and hold
- * submitted tasks. The use of this queue interacts with pool sizing:
- *
- * <ul>
- *
- * <li> If fewer than corePoolSize threads are running, the Executor
- * always prefers adding a new thread
- * rather than queuing.</li>
- *
- * <li> If corePoolSize or more threads are running, the Executor
- * always prefers queuing a request rather than adding a new
- * thread.</li>
- *
- * <li> If a request cannot be queued, a new thread is created unless
- * this would exceed maximumPoolSize, in which case, the task will be
- * rejected.</li>
- *
- * </ul>
- *
- * There are three general strategies for queuing:
- * <ol>
- *
- * <li> <em> Direct handoffs.</em> A good default choice for a work
- * queue is a {@link SynchronousQueue} that hands off tasks to threads
- * without otherwise holding them. Here, an attempt to queue a task
- * will fail if no threads are immediately available to run it, so a
- * new thread will be constructed. This policy avoids lockups when
- * handling sets of requests that might have internal dependencies.
- * Direct handoffs generally require unbounded maximumPoolSizes to
- * avoid rejection of new submitted tasks. This in turn admits the
- * possibility of unbounded thread growth when commands continue to
- * arrive on average faster than they can be processed. </li>
- *
- * <li><em> Unbounded queues.</em> Using an unbounded queue (for
- * example a {@link LinkedBlockingQueue} without a predefined
- * capacity) will cause new tasks to wait in the queue when all
- * corePoolSize threads are busy. Thus, no more than corePoolSize
- * threads will ever be created. (And the value of the maximumPoolSize
- * therefore doesn't have any effect.) This may be appropriate when
- * each task is completely independent of others, so tasks cannot
- * affect each others execution; for example, in a web page server.
- * While this style of queuing can be useful in smoothing out
- * transient bursts of requests, it admits the possibility of
- * unbounded work queue growth when commands continue to arrive on
- * average faster than they can be processed. </li>
- *
- * <li><em>Bounded queues.</em> A bounded queue (for example, an
- * {@link ArrayBlockingQueue}) helps prevent resource exhaustion when
- * used with finite maximumPoolSizes, but can be more difficult to
- * tune and control. Queue sizes and maximum pool sizes may be traded
- * off for each other: Using large queues and small pools minimizes
- * CPU usage, OS resources, and context-switching overhead, but can
- * lead to artificially low throughput. If tasks frequently block (for
- * example if they are I/O bound), a system may be able to schedule
- * time for more threads than you otherwise allow. Use of small queues
- * generally requires larger pool sizes, which keeps CPUs busier but
- * may encounter unacceptable scheduling overhead, which also
- * decreases throughput. </li>
- *
- * </ol>
- *
- * </dd>
- *
- * <dt>Rejected tasks</dt>
- *
- * <dd> New tasks submitted in method {@link #execute} will be
- * <em>rejected</em> when the Executor has been shut down, and also
- * when the Executor uses finite bounds for both maximum threads and
- * work queue capacity, and is saturated. In either case, the {@code
- * execute} method invokes the {@link
- * RejectedExecutionHandler#rejectedExecution} method of its {@link
- * RejectedExecutionHandler}. Four predefined handler policies are
- * provided:
- *
- * <ol>
- *
- * <li> In the default {@link ThreadPoolExecutor.AbortPolicy}, the
- * handler throws a runtime {@link RejectedExecutionException} upon
- * rejection. </li>
- *
- * <li> In {@link ThreadPoolExecutor.CallerRunsPolicy}, the thread
- * that invokes {@code execute} itself runs the task. This provides a
- * simple feedback control mechanism that will slow down the rate that
- * new tasks are submitted. </li>
- *
- * <li> In {@link ThreadPoolExecutor.DiscardPolicy}, a task that
- * cannot be executed is simply dropped. </li>
- *
- * <li>In {@link ThreadPoolExecutor.DiscardOldestPolicy}, if the
- * executor is not shut down, the task at the head of the work queue
- * is dropped, and then execution is retried (which can fail again,
- * causing this to be repeated.) </li>
- *
- * </ol>
- *
- * It is possible to define and use other kinds of {@link
- * RejectedExecutionHandler} classes. Doing so requires some care
- * especially when policies are designed to work only under particular
- * capacity or queuing policies. </dd>
- *
- * <dt>Hook methods</dt>
- *
- * <dd>This class provides {@code protected} overridable {@link
- * #beforeExecute} and {@link #afterExecute} methods that are called
- * before and after execution of each task. These can be used to
- * manipulate the execution environment; for example, reinitializing
- * ThreadLocals, gathering statistics, or adding log
- * entries. Additionally, method {@link #terminated} can be overridden
- * to perform any special processing that needs to be done once the
- * Executor has fully terminated.
- *
- * <p>If hook or callback methods throw exceptions, internal worker
- * threads may in turn fail and abruptly terminate.</dd>
- *
- * <dt>Queue maintenance</dt>
- *
- * <dd> Method {@link #getQueue} allows access to the work queue for
- * purposes of monitoring and debugging. Use of this method for any
- * other purpose is strongly discouraged. Two supplied methods,
- * {@link #remove} and {@link #purge} are available to assist in
- * storage reclamation when large numbers of queued tasks become
- * cancelled.</dd>
- *
- * <dt>Finalization</dt>
- *
- * <dd> A pool that is no longer referenced in a program <em>AND</em>
- * has no remaining threads will be {@code shutdown} automatically. If
- * you would like to ensure that unreferenced pools are reclaimed even
- * if users forget to call {@link #shutdown}, then you must arrange
- * that unused threads eventually die, by setting appropriate
- * keep-alive times, using a lower bound of zero core threads and/or
- * setting {@link #allowCoreThreadTimeOut(boolean)}. </dd>
- *
- * </dl>
- *
- * <p> <b>Extension example</b>. Most extensions of this class
- * override one or more of the protected hook methods. For example,
- * here is a subclass that adds a simple pause/resume feature:
- *
- * <pre> {@code
- * class PausableThreadPoolExecutor extends ThreadPoolExecutor {
- * private boolean isPaused;
- * private ReentrantLock pauseLock = new ReentrantLock();
- * private Condition unpaused = pauseLock.newCondition();
- *
- * public PausableThreadPoolExecutor(...) { super(...); }
- *
- * protected void beforeExecute(Thread t, Runnable r) {
- * super.beforeExecute(t, r);
- * pauseLock.lock();
- * try {
- * while (isPaused) unpaused.await();
- * } catch (InterruptedException ie) {
- * t.interrupt();
- * } finally {
- * pauseLock.unlock();
- * }
- * }
- *
- * public void pause() {
- * pauseLock.lock();
- * try {
- * isPaused = true;
- * } finally {
- * pauseLock.unlock();
- * }
- * }
- *
- * public void resume() {
- * pauseLock.lock();
- * try {
- * isPaused = false;
- * unpaused.signalAll();
- * } finally {
- * pauseLock.unlock();
- * }
- * }
- * }}</pre>
- *
- * @since 1.5
- * @author Doug Lea
- */
-public class ThreadPoolExecutor extends AbstractExecutorService {
- /**
- * The main pool control state, ctl, is an atomic integer packing
- * two conceptual fields
- * workerCount, indicating the effective number of threads
- * runState, indicating whether running, shutting down etc
- *
- * In order to pack them into one int, we limit workerCount to
- * (2^29)-1 (about 500 million) threads rather than (2^31)-1 (2
- * billion) otherwise representable. If this is ever an issue in
- * the future, the variable can be changed to be an AtomicLong,
- * and the shift/mask constants below adjusted. But until the need
- * arises, this code is a bit faster and simpler using an int.
- *
- * The workerCount is the number of workers that have been
- * permitted to start and not permitted to stop. The value may be
- * transiently different from the actual number of live threads,
- * for example when a ThreadFactory fails to create a thread when
- * asked, and when exiting threads are still performing
- * bookkeeping before terminating. The user-visible pool size is
- * reported as the current size of the workers set.
- *
- * The runState provides the main lifecyle control, taking on values:
- *
- * RUNNING: Accept new tasks and process queued tasks
- * SHUTDOWN: Don't accept new tasks, but process queued tasks
- * STOP: Don't accept new tasks, don't process queued tasks,
- * and interrupt in-progress tasks
- * TIDYING: All tasks have terminated, workerCount is zero,
- * the thread transitioning to state TIDYING
- * will run the terminated() hook method
- * TERMINATED: terminated() has completed
- *
- * The numerical order among these values matters, to allow
- * ordered comparisons. The runState monotonically increases over
- * time, but need not hit each state. The transitions are:
- *
- * RUNNING -> SHUTDOWN
- * On invocation of shutdown(), perhaps implicitly in finalize()
- * (RUNNING or SHUTDOWN) -> STOP
- * On invocation of shutdownNow()
- * SHUTDOWN -> TIDYING
- * When both queue and pool are empty
- * STOP -> TIDYING
- * When pool is empty
- * TIDYING -> TERMINATED
- * When the terminated() hook method has completed
- *
- * Threads waiting in awaitTermination() will return when the
- * state reaches TERMINATED.
- *
- * Detecting the transition from SHUTDOWN to TIDYING is less
- * straightforward than you'd like because the queue may become
- * empty after non-empty and vice versa during SHUTDOWN state, but
- * we can only terminate if, after seeing that it is empty, we see
- * that workerCount is 0 (which sometimes entails a recheck -- see
- * below).
- */
- private final AtomicInteger ctl = new AtomicInteger(ctlOf(RUNNING, 0));
- private static final int COUNT_BITS = 29; // Integer.SIZE - 3;
- private static final int CAPACITY = (1 << COUNT_BITS) - 1;
-
- // runState is stored in the high-order bits
- private static final int RUNNING = -1 << COUNT_BITS;
- private static final int SHUTDOWN = 0 << COUNT_BITS;
- private static final int STOP = 1 << COUNT_BITS;
- private static final int TIDYING = 2 << COUNT_BITS;
- private static final int TERMINATED = 3 << COUNT_BITS;
-
- // Packing and unpacking ctl
- private static int runStateOf(int c) { return c & ~CAPACITY; }
- private static int workerCountOf(int c) { return c & CAPACITY; }
- private static int ctlOf(int rs, int wc) { return rs | wc; }
-
- /*
- * Bit field accessors that don't require unpacking ctl.
- * These depend on the bit layout and on workerCount being never negative.
- */
-
- private static boolean runStateLessThan(int c, int s) {
- return c < s;
- }
-
- private static boolean runStateAtLeast(int c, int s) {
- return c >= s;
- }
-
- private static boolean isRunning(int c) {
- return c < SHUTDOWN;
- }
-
- /**
- * Attempt to CAS-increment the workerCount field of ctl.
- */
- private boolean compareAndIncrementWorkerCount(int expect) {
- return ctl.compareAndSet(expect, expect + 1);
- }
-
- /**
- * Attempt to CAS-decrement the workerCount field of ctl.
- */
- private boolean compareAndDecrementWorkerCount(int expect) {
- return ctl.compareAndSet(expect, expect - 1);
- }
-
- /**
- * Decrements the workerCount field of ctl. This is called only on
- * abrupt termination of a thread (see processWorkerExit). Other
- * decrements are performed within getTask.
- */
- private void decrementWorkerCount() {
- do {} while (! compareAndDecrementWorkerCount(ctl.get()));
- }
-
- /**
- * The queue used for holding tasks and handing off to worker
- * threads. We do not require that workQueue.poll() returning
- * null necessarily means that workQueue.isEmpty(), so rely
- * solely on isEmpty to see if the queue is empty (which we must
- * do for example when deciding whether to transition from
- * SHUTDOWN to TIDYING). This accommodates special-purpose
- * queues such as DelayQueues for which poll() is allowed to
- * return null even if it may later return non-null when delays
- * expire.
- */
- private final BlockingQueue workQueue;
-
- // TODO: DK: mainLock is used in lock(); try { ... } finally { unlock(); }
- // Consider replacing with synchronized {} if performance reasons exist
- /**
- * Lock held on access to workers set and related bookkeeping.
- * While we could use a concurrent set of some sort, it turns out
- * to be generally preferable to use a lock. Among the reasons is
- * that this serializes interruptIdleWorkers, which avoids
- * unnecessary interrupt storms, especially during shutdown.
- * Otherwise exiting threads would concurrently interrupt those
- * that have not yet interrupted. It also simplifies some of the
- * associated statistics bookkeeping of largestPoolSize etc. We
- * also hold mainLock on shutdown and shutdownNow, for the sake of
- * ensuring workers set is stable while separately checking
- * permission to interrupt and actually interrupting.
- */
- public final ReentrantLock mainLock = new ReentrantLock();
-
- /**
- * Set containing all worker threads in pool. Accessed only when
- * holding mainLock.
- */
- public final HashSet workers = new HashSet();
-
- /**
- * Wait condition to support awaitTermination
- */
- private final Condition termination = mainLock.newCondition();
-
- /**
- * Tracks largest attained pool size. Accessed only under
- * mainLock.
- */
- private int largestPoolSize;
-
- /**
- * Counter for completed tasks. Updated only on termination of
- * worker threads. Accessed only under mainLock.
- */
- private long completedTaskCount;
-
- /*
- * All user control parameters are declared as volatiles so that
- * ongoing actions are based on freshest values, but without need
- * for locking, since no internal invariants depend on them
- * changing synchronously with respect to other actions.
- */
-
- /**
- * Factory for new threads. All threads are created using this
- * factory (via method addWorker). All callers must be prepared
- * for addWorker to fail, which may reflect a system or user's
- * policy limiting the number of threads. Even though it is not
- * treated as an error, failure to create threads may result in
- * new tasks being rejected or existing ones remaining stuck in
- * the queue. On the other hand, no special precautions exist to
- * handle OutOfMemoryErrors that might be thrown while trying to
- * create threads, since there is generally no recourse from
- * within this class.
- */
- private volatile ThreadFactory threadFactory;
-
- /**
- * Handler called when saturated or shutdown in execute.
- */
- private volatile RejectedExecutionHandler handler;
-
- /**
- * Timeout in nanoseconds for idle threads waiting for work.
- * Threads use this timeout when there are more than corePoolSize
- * present or if allowCoreThreadTimeOut. Otherwise they wait
- * forever for new work.
- */
- private volatile long keepAliveTime;
-
- /**
- * If false (default), core threads stay alive even when idle.
- * If true, core threads use keepAliveTime to time out waiting
- * for work.
- */
- private volatile boolean allowCoreThreadTimeOut;
-
- /**
- * Core pool size is the minimum number of workers to keep alive
- * (and not allow to time out etc) unless allowCoreThreadTimeOut
- * is set, in which case the minimum is zero.
- */
- private volatile int corePoolSize;
-
- /**
- * Maximum pool size. Note that the actual maximum is internally
- * bounded by CAPACITY.
- */
- private volatile int maximumPoolSize;
-
- /**
- * The default rejected execution handler
- */
- private static final RejectedExecutionHandler defaultHandler =
- new AbortPolicy();
-
- /**
- * Permission required for callers of shutdown and shutdownNow.
- * We additionally require (see checkShutdownAccess) that callers
- * have permission to actually interrupt threads in the worker set
- * (as governed by Thread.interrupt, which relies on
- * ThreadGroup.checkAccess, which in turn relies on
- * SecurityManager.checkAccess). Shutdowns are attempted only if
- * these checks pass.
- *
- * All actual invocations of Thread.interrupt (see
- * interruptIdleWorkers and interruptWorkers) ignore
- * SecurityExceptions, meaning that the attempted interrupts
- * silently fail. In the case of shutdown, they should not fail
- * unless the SecurityManager has inconsistent policies, sometimes
- * allowing access to a thread and sometimes not. In such cases,
- * failure to actually interrupt threads may disable or delay full
- * termination. Other uses of interruptIdleWorkers are advisory,
- * and failure to actually interrupt will merely delay response to
- * configuration changes so is not handled exceptionally.
- */
- private static final RuntimePermission shutdownPerm =
- new RuntimePermission("modifyThread");
-
- /**
- * Class Worker mainly maintains interrupt control state for
- * threads running tasks, along with other minor bookkeeping. This
- * class opportunistically extends ReentrantLock to simplify
- * acquiring and releasing a lock surrounding each task execution.
- * This protects against interrupts that are intended to wake up a
- * worker thread waiting for a task from instead interrupting a
- * task being run.
- */
- public final class Worker extends ReentrantLock implements Runnable {
- /**
- * This class will never be serialized, but we provide a
- * serialVersionUID to suppress a javac warning.
- */
- private static final long serialVersionUID = 6138294804551838833L;
-
- /** Thread this worker is running in. Null if factory fails. */
- public final Thread thread;
- /** Initial task to run. Possibly null. */
- Runnable firstTask;
- /** Per-thread task counter */
- volatile long completedTasks;
-
- /**
- * Creates with given first task and thread from ThreadFactory.
- * @param firstTask the first task (null if none)
- */
- Worker(Runnable firstTask) {
- this.firstTask = firstTask;
- this.thread = getThreadFactory().newThread(this);
- }
-
- /** Delegates main run loop to outer runWorker */
- public void run() {
- runWorker(this);
- }
- }
-
- /*
- * Methods for setting control state
- */
-
- /**
- * Transitions runState to given target, or leaves it alone if
- * already at least the given target.
- *
- * @param targetState the desired state, either SHUTDOWN or STOP
- * (but not TIDYING or TERMINATED -- use tryTerminate for that)
- */
- private void advanceRunState(int targetState) {
- for (;;) {
- int c = ctl.get();
- if (runStateAtLeast(c, targetState) ||
- ctl.compareAndSet(c, ctlOf(targetState, workerCountOf(c))))
- break;
- }
- }
-
- /**
- * Transitions to TERMINATED state if either (SHUTDOWN and pool
- * and queue empty) or (STOP and pool empty). If otherwise
- * eligible to terminate but workerCount is nonzero, interrupts an
- * idle worker to ensure that shutdown signals propagate. This
- * method must be called following any action that might make
- * termination possible -- reducing worker count or removing tasks
- * from the queue during shutdown. The method is non-private to
- * allow access from ScheduledThreadPoolExecutor.
- */
- final void tryTerminate() {
- for (;;) {
- int c = ctl.get();
- if (isRunning(c) ||
- runStateAtLeast(c, TIDYING) ||
- (runStateOf(c) == SHUTDOWN && ! workQueue.isEmpty()))
- return;
- if (workerCountOf(c) != 0) { // Eligible to terminate
- interruptIdleWorkers(ONLY_ONE);
- return;
- }
-
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- if (ctl.compareAndSet(c, ctlOf(TIDYING, 0))) {
- try {
- terminated();
- } finally {
- ctl.set(ctlOf(TERMINATED, 0));
- termination.signalAll();
- }
- return;
- }
- } finally {
- mainLock.unlock();
- }
- // else retry on failed CAS
- }
- }
-
- /*
- * Methods for controlling interrupts to worker threads.
- */
-
- /**
- * If there is a security manager, makes sure caller has
- * permission to shut down threads in general (see shutdownPerm).
- * If this passes, additionally makes sure the caller is allowed
- * to interrupt each worker thread. This might not be true even if
- * first check passed, if the SecurityManager treats some threads
- * specially.
- */
- private void checkShutdownAccess() {
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- security.checkPermission(shutdownPerm);
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- for (Iterator itr = workers.iterator(); itr.hasNext();) {
- Worker w = (Worker)itr.next();
- security.checkAccess(w.thread);
- }
- } finally {
- mainLock.unlock();
- }
- }
- }
-
- /**
- * Interrupts all threads, even if active. Ignores SecurityExceptions
- * (in which case some threads may remain uninterrupted).
- */
- private void interruptWorkers() {
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- for (Iterator itr = workers.iterator(); itr.hasNext();) {
- Worker w = (Worker)itr.next();
- try {
- w.thread.interrupt();
- } catch (SecurityException ignore) {
- }
- }
- } finally {
- mainLock.unlock();
- }
- }
-
- /**
- * Interrupts threads that might be waiting for tasks (as
- * indicated by not being locked) so they can check for
- * termination or configuration changes. Ignores
- * SecurityExceptions (in which case some threads may remain
- * uninterrupted).
- *
- * @param onlyOne If true, interrupt at most one worker. This is
- * called only from tryTerminate when termination is otherwise
- * enabled but there are still other workers. In this case, at
- * most one waiting worker is interrupted to propagate shutdown
- * signals in case all threads are currently waiting.
- * Interrupting any arbitrary thread ensures that newly arriving
- * workers since shutdown began will also eventually exit.
- * To guarantee eventual termination, it suffices to always
- * interrupt only one idle worker, but shutdown() interrupts all
- * idle workers so that redundant workers exit promptly, not
- * waiting for a straggler task to finish.
- */
- private void interruptIdleWorkers(boolean onlyOne) {
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- Iterator it = workers.iterator();
- while (it.hasNext()) {
- Worker w = (Worker)it.next();
- Thread t = w.thread;
- if (!t.isInterrupted() && w.tryLock()) {
- try {
- t.interrupt();
- } catch (SecurityException ignore) {
- } finally {
- w.unlock();
- }
- }
- if (onlyOne)
- break;
- }
- } finally {
- mainLock.unlock();
- }
- }
-
- /**
- * Common form of interruptIdleWorkers, to avoid having to
- * remember what the boolean argument means.
- */
- private void interruptIdleWorkers() {
- interruptIdleWorkers(false);
- }
-
- private static final boolean ONLY_ONE = true;
-
- /**
- * Ensures that unless the pool is stopping, the current thread
- * does not have its interrupt set. This requires a double-check
- * of state in case the interrupt was cleared concurrently with a
- * shutdownNow -- if so, the interrupt is re-enabled.
- */
- private void clearInterruptsForTaskRun() {
- if (runStateLessThan(ctl.get(), STOP) &&
- Thread.interrupted() &&
- runStateAtLeast(ctl.get(), STOP))
- Thread.currentThread().interrupt();
- }
-
- /*
- * Misc utilities, most of which are also exported to
- * ScheduledThreadPoolExecutor
- */
-
- /**
- * Invokes the rejected execution handler for the given command.
- * Package-protected for use by ScheduledThreadPoolExecutor.
- */
- final void reject(Runnable command) {
- handler.rejectedExecution(command, this);
- }
-
- /**
- * Performs any further cleanup following run state transition on
- * invocation of shutdown. A no-op here, but used by
- * ScheduledThreadPoolExecutor to cancel delayed tasks.
- */
- void onShutdown() {
- }
-
- /**
- * State check needed by ScheduledThreadPoolExecutor to
- * enable running tasks during shutdown.
- *
- * @param shutdownOK true if should return true if SHUTDOWN
- */
- final boolean isRunningOrShutdown(boolean shutdownOK) {
- int rs = runStateOf(ctl.get());
- return rs == RUNNING || (rs == SHUTDOWN && shutdownOK);
- }
-
- /**
- * Drains the task queue into a new list, normally using
- * drainTo. But if the queue is a DelayQueue or any other kind of
- * queue for which poll or drainTo may fail to remove some
- * elements, it deletes them one by one.
- */
- private List drainQueue() {
- BlockingQueue q = workQueue;
- List<Runnable> taskList = new ArrayList<Runnable>();
- q.drainTo(taskList);
- if (!q.isEmpty()) {
- Runnable[] arr = (Runnable[])q.toArray(new Runnable[0]);
- for (int i=0; i<arr.length; i++) {
- Runnable r = arr[i];
- if (q.remove(r))
- taskList.add(r);
- }
- }
- return taskList;
- }
-
- /*
- * Methods for creating, running and cleaning up after workers
- */
-
- /**
- * Checks if a new worker can be added with respect to current
- * pool state and the given bound (either core or maximum). If so,
- * the worker count is adjusted accordingly, and, if possible, a
- * new worker is created and started running firstTask as its
- * first task. This method returns false if the pool is stopped or
- * eligible to shut down. It also returns false if the thread
- * factory fails to create a thread when asked, which requires a
- * backout of workerCount, and a recheck for termination, in case
- * the existence of this worker was holding up termination.
- *
- * @param firstTask the task the new thread should run first (or
- * null if none). Workers are created with an initial first task
- * (in method execute()) to bypass queuing when there are fewer
- * than corePoolSize threads (in which case we always start one),
- * or when the queue is full (in which case we must bypass queue).
- * Initially idle threads are usually created via
- * prestartCoreThread or to replace other dying workers.
- *
- * @param core if true use corePoolSize as bound, else
- * maximumPoolSize. (A boolean indicator is used here rather than a
- * value to ensure reads of fresh values after checking other pool
- * state).
- * @return true if successful
- */
- private boolean addWorker(Runnable firstTask, boolean core) {
- retry:
- for (;;) {
- int c = ctl.get();
- int rs = runStateOf(c);
-
- // Check if queue empty only if necessary.
- if (rs >= SHUTDOWN &&
- ! (rs == SHUTDOWN &&
- firstTask == null &&
- ! workQueue.isEmpty()))
- return false;
-
- for (;;) {
- int wc = workerCountOf(c);
- if (wc >= CAPACITY ||
- wc >= (core ? corePoolSize : maximumPoolSize))
- return false;
- if (compareAndIncrementWorkerCount(c))
- break retry;
- c = ctl.get(); // Re-read ctl
- if (runStateOf(c) != rs)
- continue retry;
- // else CAS failed due to workerCount change; retry inner loop
- }
- }
-
- Worker w = new Worker(firstTask);
- Thread t = w.thread;
-
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- // Recheck while holding lock.
- // Back out on ThreadFactory failure or if
- // shut down before lock acquired.
- int c = ctl.get();
- int rs = runStateOf(c);
-
- if (t == null ||
- (rs >= SHUTDOWN &&
- ! (rs == SHUTDOWN &&
- firstTask == null))) {
- decrementWorkerCount();
- tryTerminate();
- return false;
- }
-
- workers.add(w);
-
- int s = workers.size();
- if (s > largestPoolSize)
- largestPoolSize = s;
- } finally {
- mainLock.unlock();
- }
-
- t.start();
- // It is possible (but unlikely) for a thread to have been
- // added to workers, but not yet started, during transition to
- // STOP, which could result in a rare missed interrupt,
- // because Thread.interrupt is not guaranteed to have any effect
- // on a non-yet-started Thread (see Thread#interrupt).
- if (runStateOf(ctl.get()) == STOP && ! t.isInterrupted())
- t.interrupt();
-
- return true;
- }
-
- /**
- * Performs cleanup and bookkeeping for a dying worker. Called
- * only from worker threads. Unless completedAbruptly is set,
- * assumes that workerCount has already been adjusted to account
- * for exit. This method removes thread from worker set, and
- * possibly terminates the pool or replaces the worker if either
- * it exited due to user task exception or if fewer than
- * corePoolSize workers are running or queue is non-empty but
- * there are no workers.
- *
- * @param w the worker
- * @param completedAbruptly if the worker died due to user exception
- */
- private void processWorkerExit(Worker w, boolean completedAbruptly) {
- if (completedAbruptly) // If abrupt, then workerCount wasn't adjusted
- decrementWorkerCount();
-
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- completedTaskCount += w.completedTasks;
- workers.remove(w);
- } finally {
- mainLock.unlock();
- }
-
- tryTerminate();
-
- int c = ctl.get();
- if (runStateLessThan(c, STOP)) {
- if (!completedAbruptly) {
- int min = allowCoreThreadTimeOut ? 0 : corePoolSize;
- if (min == 0 && ! workQueue.isEmpty())
- min = 1;
- if (workerCountOf(c) >= min)
- return; // replacement not needed
- }
- addWorker(null, false);
- }
- }
-
- /**
- * Performs blocking or timed wait for a task, depending on
- * current configuration settings, or returns null if this worker
- * must exit because of any of:
- * 1. There are more than maximumPoolSize workers (due to
- * a call to setMaximumPoolSize).
- * 2. The pool is stopped.
- * 3. The pool is shutdown and the queue is empty.
- * 4. This worker timed out waiting for a task, and timed-out
- * workers are subject to termination (that is,
- * {@code allowCoreThreadTimeOut || workerCount > corePoolSize})
- * both before and after the timed wait.
- *
- * @return task, or null if the worker must exit, in which case
- * workerCount is decremented
- */
- private Runnable getTask() {
- boolean timedOut = false; // Did the last poll() time out?
-
- retry:
- for (;;) {
- int c = ctl.get();
- int rs = runStateOf(c);
-
- // Check if queue empty only if necessary.
- if (rs >= SHUTDOWN && (rs >= STOP || workQueue.isEmpty())) {
- decrementWorkerCount();
- return null;
- }
-
- boolean timed; // Are workers subject to culling?
-
- for (;;) {
- int wc = workerCountOf(c);
- timed = allowCoreThreadTimeOut || wc > corePoolSize;
-
- if (wc <= maximumPoolSize && ! (timedOut && timed))
- break;
- if (compareAndDecrementWorkerCount(c))
- return null;
- c = ctl.get(); // Re-read ctl
- if (runStateOf(c) != rs)
- continue retry;
- // else CAS failed due to workerCount change; retry inner loop
- }
-
- try {
- Runnable r = timed ?
- (Runnable)workQueue.poll(keepAliveTime, TimeUnit.NANOSECONDS) :
- (Runnable)workQueue.take();
- if (r != null)
- return r;
- timedOut = true;
- } catch (InterruptedException retry) {
- timedOut = false;
- }
- }
- }
-
- /**
- * Main worker run loop. Repeatedly gets tasks from queue and
- * executes them, while coping with a number of issues:
- *
- * 1. We may start out with an initial task, in which case we
- * don't need to get the first one. Otherwise, as long as pool is
- * running, we get tasks from getTask. If it returns null then the
- * worker exits due to changed pool state or configuration
- * parameters. Other exits result from exception throws in
- * external code, in which case completedAbruptly holds, which
- * usually leads processWorkerExit to replace this thread.
- *
- * 2. Before running any task, the lock is acquired to prevent
- * other pool interrupts while the task is executing, and
- * clearInterruptsForTaskRun called to ensure that unless pool is
- * stopping, this thread does not have its interrupt set.
- *
- * 3. Each task run is preceded by a call to beforeExecute, which
- * might throw an exception, in which case we cause thread to die
- * (breaking loop with completedAbruptly true) without processing
- * the task.
- *
- * 4. Assuming beforeExecute completes normally, we run the task,
- * gathering any of its thrown exceptions to send to
- * afterExecute. We separately handle RuntimeException, Error
- * (both of which the specs guarantee that we trap) and arbitrary
- * Throwables. Because we cannot rethrow Throwables within
- * Runnable.run, we wrap them within Errors on the way out (to the
- * thread's UncaughtExceptionHandler). Any thrown exception also
- * conservatively causes thread to die.
- *
- * 5. After task.run completes, we call afterExecute, which may
- * also throw an exception, which will also cause thread to
- * die. According to JLS Sec 14.20, this exception is the one that
- * will be in effect even if task.run throws.
- *
- * The net effect of the exception mechanics is that afterExecute
- * and the thread's UncaughtExceptionHandler have as accurate
- * information as we can provide about any problems encountered by
- * user code.
- *
- * @param w the worker
- */
- final void runWorker(Worker w) {
- Runnable task = w.firstTask;
- w.firstTask = null;
- boolean completedAbruptly = true;
- try {
- while (task != null || (task = getTask()) != null) {
- w.lock();
- clearInterruptsForTaskRun();
- try {
- beforeExecute(w.thread, task);
- Throwable thrown = null;
- try {
- task.run();
- } catch (RuntimeException x) {
- thrown = x; throw x;
- } catch (Error x) {
- thrown = x; throw x;
- } catch (Throwable x) {
- thrown = x; throw new Error(x);
- } finally {
- afterExecute(task, thrown);
- }
- } finally {
- task = null;
- w.completedTasks++;
- w.unlock();
- }
- }
- completedAbruptly = false;
- } finally {
- processWorkerExit(w, completedAbruptly);
- }
- }
-
- // Public constructors and methods
-
- /**
- * Creates a new {@code ThreadPoolExecutor} with the given initial
- * parameters and default thread factory and rejected execution handler.
- * It may be more convenient to use one of the {@link Executors} factory
- * methods instead of this general purpose constructor.
- *
- * @param corePoolSize the number of threads to keep in the pool, even
- * if they are idle, unless {@code allowCoreThreadTimeOut} is set
- * @param maximumPoolSize the maximum number of threads to allow in the
- * pool
- * @param keepAliveTime when the number of threads is greater than
- * the core, this is the maximum time that excess idle threads
- * will wait for new tasks before terminating.
- * @param unit the time unit for the {@code keepAliveTime} argument
- * @param workQueue the queue to use for holding tasks before they are
- * executed. This queue will hold only the {@code Runnable}
- * tasks submitted by the {@code execute} method.
- * @throws IllegalArgumentException if one of the following holds:<br>
- * {@code corePoolSize < 0}<br>
- * {@code keepAliveTime < 0}<br>
- * {@code maximumPoolSize <= 0}<br>
- * {@code maximumPoolSize < corePoolSize}
- * @throws NullPointerException if {@code workQueue} is null
- */
- public ThreadPoolExecutor(int corePoolSize,
- int maximumPoolSize,
- long keepAliveTime,
- TimeUnit unit,
- BlockingQueue workQueue) {
- this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue,
- Executors.defaultThreadFactory(), defaultHandler);
- }
-
- /**
- * Creates a new {@code ThreadPoolExecutor} with the given initial
- * parameters and default rejected execution handler.
- *
- * @param corePoolSize the number of threads to keep in the pool, even
- * if they are idle, unless {@code allowCoreThreadTimeOut} is set
- * @param maximumPoolSize the maximum number of threads to allow in the
- * pool
- * @param keepAliveTime when the number of threads is greater than
- * the core, this is the maximum time that excess idle threads
- * will wait for new tasks before terminating.
- * @param unit the time unit for the {@code keepAliveTime} argument
- * @param workQueue the queue to use for holding tasks before they are
- * executed. This queue will hold only the {@code Runnable}
- * tasks submitted by the {@code execute} method.
- * @param threadFactory the factory to use when the executor
- * creates a new thread
- * @throws IllegalArgumentException if one of the following holds:<br>
- * {@code corePoolSize < 0}<br>
- * {@code keepAliveTime < 0}<br>
- * {@code maximumPoolSize <= 0}<br>
- * {@code maximumPoolSize < corePoolSize}
- * @throws NullPointerException if {@code workQueue}
- * or {@code threadFactory} is null
- */
- public ThreadPoolExecutor(int corePoolSize,
- int maximumPoolSize,
- long keepAliveTime,
- TimeUnit unit,
- BlockingQueue workQueue,
- ThreadFactory threadFactory) {
- this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue,
- threadFactory, defaultHandler);
- }
-
- /**
- * Creates a new {@code ThreadPoolExecutor} with the given initial
- * parameters and default thread factory.
- *
- * @param corePoolSize the number of threads to keep in the pool, even
- * if they are idle, unless {@code allowCoreThreadTimeOut} is set
- * @param maximumPoolSize the maximum number of threads to allow in the
- * pool
- * @param keepAliveTime when the number of threads is greater than
- * the core, this is the maximum time that excess idle threads
- * will wait for new tasks before terminating.
- * @param unit the time unit for the {@code keepAliveTime} argument
- * @param workQueue the queue to use for holding tasks before they are
- * executed. This queue will hold only the {@code Runnable}
- * tasks submitted by the {@code execute} method.
- * @param handler the handler to use when execution is blocked
- * because the thread bounds and queue capacities are reached
- * @throws IllegalArgumentException if one of the following holds:<br>
- * {@code corePoolSize < 0}<br>
- * {@code keepAliveTime < 0}<br>
- * {@code maximumPoolSize <= 0}<br>
- * {@code maximumPoolSize < corePoolSize}
- * @throws NullPointerException if {@code workQueue}
- * or {@code handler} is null
- */
- public ThreadPoolExecutor(int corePoolSize,
- int maximumPoolSize,
- long keepAliveTime,
- TimeUnit unit,
- BlockingQueue workQueue,
- RejectedExecutionHandler handler) {
- this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue,
- Executors.defaultThreadFactory(), handler);
- }
-
- /**
- * Creates a new {@code ThreadPoolExecutor} with the given initial
- * parameters.
- *
- * @param corePoolSize the number of threads to keep in the pool, even
- * if they are idle, unless {@code allowCoreThreadTimeOut} is set
- * @param maximumPoolSize the maximum number of threads to allow in the
- * pool
- * @param keepAliveTime when the number of threads is greater than
- * the core, this is the maximum time that excess idle threads
- * will wait for new tasks before terminating.
- * @param unit the time unit for the {@code keepAliveTime} argument
- * @param workQueue the queue to use for holding tasks before they are
- * executed. This queue will hold only the {@code Runnable}
- * tasks submitted by the {@code execute} method.
- * @param threadFactory the factory to use when the executor
- * creates a new thread
- * @param handler the handler to use when execution is blocked
- * because the thread bounds and queue capacities are reached
- * @throws IllegalArgumentException if one of the following holds:<br>
- * {@code corePoolSize < 0}<br>
- * {@code keepAliveTime < 0}<br>
- * {@code maximumPoolSize <= 0}<br>
- * {@code maximumPoolSize < corePoolSize}
- * @throws NullPointerException if {@code workQueue}
- * or {@code threadFactory} or {@code handler} is null
- */
- public ThreadPoolExecutor(int corePoolSize,
- int maximumPoolSize,
- long keepAliveTime,
- TimeUnit unit,
- BlockingQueue workQueue,
- ThreadFactory threadFactory,
- RejectedExecutionHandler handler) {
- if (corePoolSize < 0 ||
- maximumPoolSize <= 0 ||
- maximumPoolSize < corePoolSize ||
- keepAliveTime < 0)
- throw new IllegalArgumentException();
- if (workQueue == null || threadFactory == null || handler == null)
- throw new NullPointerException();
- this.corePoolSize = corePoolSize;
- this.maximumPoolSize = maximumPoolSize;
- this.workQueue = workQueue;
- this.keepAliveTime = unit.toNanos(keepAliveTime);
- this.threadFactory = threadFactory;
- this.handler = handler;
- }
-
- /**
- * Executes the given task sometime in the future. The task
- * may execute in a new thread or in an existing pooled thread.
- *
- * If the task cannot be submitted for execution, either because this
- * executor has been shutdown or because its capacity has been reached,
- * the task is handled by the current {@code RejectedExecutionHandler}.
- *
- * @param command the task to execute
- * @throws RejectedExecutionException at discretion of
- * {@code RejectedExecutionHandler}, if the task
- * cannot be accepted for execution
- * @throws NullPointerException if {@code command} is null
- */
- public void execute(Runnable command) {
- if (command == null)
- throw new NullPointerException();
- /*
- * Proceed in 3 steps:
- *
- * 1. If fewer than corePoolSize threads are running, try to
- * start a new thread with the given command as its first
- * task. The call to addWorker atomically checks runState and
- * workerCount, and so prevents false alarms that would add
- * threads when it shouldn't, by returning false.
- *
- * 2. If a task can be successfully queued, then we still need
- * to double-check whether we should have added a thread
- * (because existing ones died since last checking) or that
- * the pool shut down since entry into this method. So we
- * recheck state and if necessary roll back the enqueuing if
- * stopped, or start a new thread if there are none.
- *
- * 3. If we cannot queue task, then we try to add a new
- * thread. If it fails, we know we are shut down or saturated
- * and so reject the task.
- */
- int c = ctl.get();
- if (workerCountOf(c) < corePoolSize) {
- if (addWorker(command, true))
- return;
- c = ctl.get();
- }
- if (isRunning(c) && workQueue.offer(command)) {
- int recheck = ctl.get();
- if (! isRunning(recheck) && remove(command))
- reject(command);
- else if (workerCountOf(recheck) == 0)
- addWorker(null, false);
- }
- else if (!addWorker(command, false))
- reject(command);
- }
-
- /**
- * Initiates an orderly shutdown in which previously submitted
- * tasks are executed, but no new tasks will be accepted.
- * Invocation has no additional effect if already shut down.
- *
- * @throws SecurityException {@inheritDoc}
- */
- public void shutdown() {
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- checkShutdownAccess();
- advanceRunState(SHUTDOWN);
- interruptIdleWorkers();
- onShutdown(); // hook for ScheduledThreadPoolExecutor
- } finally {
- mainLock.unlock();
- }
- tryTerminate();
- }
-
- /**
- * Attempts to stop all actively executing tasks, halts the
- * processing of waiting tasks, and returns a list of the tasks
- * that were awaiting execution. These tasks are drained (removed)
- * from the task queue upon return from this method.
- *
- * <p>There are no guarantees beyond best-effort attempts to stop
- * processing actively executing tasks. This implementation
- * cancels tasks via {@link Thread#interrupt}, so any task that
- * fails to respond to interrupts may never terminate.
- *
- * @throws SecurityException {@inheritDoc}
- */
- public List shutdownNow() {
- List tasks;
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- checkShutdownAccess();
- advanceRunState(STOP);
- interruptWorkers();
- tasks = drainQueue();
- } finally {
- mainLock.unlock();
- }
- tryTerminate();
- return tasks;
- }
-
- public boolean isShutdown() {
- return ! isRunning(ctl.get());
- }
-
- /**
- * Returns true if this executor is in the process of terminating
- * after {@link #shutdown} or {@link #shutdownNow} but has not
- * completely terminated. This method may be useful for
- * debugging. A return of {@code true} reported a sufficient
- * period after shutdown may indicate that submitted tasks have
- * ignored or suppressed interruption, causing this executor not
- * to properly terminate.
- *
- * @return true if terminating but not yet terminated
- */
- public boolean isTerminating() {
- int c = ctl.get();
- return ! isRunning(c) && runStateLessThan(c, TERMINATED);
- }
-
- public boolean isTerminated() {
- return runStateAtLeast(ctl.get(), TERMINATED);
- }
-
- public boolean awaitTermination(long timeout, TimeUnit unit)
- throws InterruptedException {
- long nanos = unit.toNanos(timeout);
- long deadline = Utils.nanoTime() + nanos;
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- if (runStateAtLeast(ctl.get(), TERMINATED))
- return true;
- while (nanos > 0) {
- termination.await(nanos, TimeUnit.NANOSECONDS);
- if (runStateAtLeast(ctl.get(), TERMINATED))
- return true;
- nanos = deadline - Utils.nanoTime();
- }
- return false;
- } finally {
- mainLock.unlock();
- }
- }
-
- /**
- * Invokes {@code shutdown} when this executor is no longer
- * referenced and it has no threads.
- */
- protected void finalize() {
- shutdown();
- }
-
- /**
- * Sets the thread factory used to create new threads.
- *
- * @param threadFactory the new thread factory
- * @throws NullPointerException if threadFactory is null
- * @see #getThreadFactory
- */
- public void setThreadFactory(ThreadFactory threadFactory) {
- if (threadFactory == null)
- throw new NullPointerException();
- this.threadFactory = threadFactory;
- }
-
- /**
- * Returns the thread factory used to create new threads.
- *
- * @return the current thread factory
- * @see #setThreadFactory
- */
- public ThreadFactory getThreadFactory() {
- return threadFactory;
- }
-
- /**
- * Sets a new handler for unexecutable tasks.
- *
- * @param handler the new handler
- * @throws NullPointerException if handler is null
- * @see #getRejectedExecutionHandler
- */
- public void setRejectedExecutionHandler(RejectedExecutionHandler handler) {
- if (handler == null)
- throw new NullPointerException();
- this.handler = handler;
- }
-
- /**
- * Returns the current handler for unexecutable tasks.
- *
- * @return the current handler
- * @see #setRejectedExecutionHandler
- */
- public RejectedExecutionHandler getRejectedExecutionHandler() {
- return handler;
- }
-
- /**
- * Sets the core number of threads. This overrides any value set
- * in the constructor. If the new value is smaller than the
- * current value, excess existing threads will be terminated when
- * they next become idle. If larger, new threads will, if needed,
- * be started to execute any queued tasks.
- *
- * @param corePoolSize the new core size
- * @throws IllegalArgumentException if {@code corePoolSize < 0}
- * @see #getCorePoolSize
- */
- public void setCorePoolSize(int corePoolSize) {
- if (corePoolSize < 0)
- throw new IllegalArgumentException();
- int delta = corePoolSize - this.corePoolSize;
- this.corePoolSize = corePoolSize;
- if (workerCountOf(ctl.get()) > corePoolSize)
- interruptIdleWorkers();
- else if (delta > 0) {
- // We don't really know how many new threads are "needed".
- // As a heuristic, prestart enough new workers (up to new
- // core size) to handle the current number of tasks in
- // queue, but stop if queue becomes empty while doing so.
- int k = Math.min(delta, workQueue.size());
- while (k-- > 0 && addWorker(null, true)) {
- if (workQueue.isEmpty())
- break;
- }
- }
- }
-
- /**
- * Returns the core number of threads.
- *
- * @return the core number of threads
- * @see #setCorePoolSize
- */
- public int getCorePoolSize() {
- return corePoolSize;
- }
-
- /**
- * Starts a core thread, causing it to idly wait for work. This
- * overrides the default policy of starting core threads only when
- * new tasks are executed. This method will return {@code false}
- * if all core threads have already been started.
- *
- * @return {@code true} if a thread was started
- */
- public boolean prestartCoreThread() {
- return workerCountOf(ctl.get()) < corePoolSize &&
- addWorker(null, true);
- }
-
- /**
- * Starts all core threads, causing them to idly wait for work. This
- * overrides the default policy of starting core threads only when
- * new tasks are executed.
- *
- * @return the number of threads started
- */
- public int prestartAllCoreThreads() {
- int n = 0;
- while (addWorker(null, true))
- ++n;
- return n;
- }
-
- /**
- * Returns true if this pool allows core threads to time out and
- * terminate if no tasks arrive within the keepAlive time, being
- * replaced if needed when new tasks arrive. When true, the same
- * keep-alive policy applying to non-core threads applies also to
- * core threads. When false (the default), core threads are never
- * terminated due to lack of incoming tasks.
- *
- * @return {@code true} if core threads are allowed to time out,
- * else {@code false}
- *
- * @since 1.6
- */
- public boolean allowsCoreThreadTimeOut() {
- return allowCoreThreadTimeOut;
- }
-
- /**
- * Sets the policy governing whether core threads may time out and
- * terminate if no tasks arrive within the keep-alive time, being
- * replaced if needed when new tasks arrive. When false, core
- * threads are never terminated due to lack of incoming
- * tasks. When true, the same keep-alive policy applying to
- * non-core threads applies also to core threads. To avoid
- * continual thread replacement, the keep-alive time must be
- * greater than zero when setting {@code true}. This method
- * should in general be called before the pool is actively used.
- *
- * @param value {@code true} if should time out, else {@code false}
- * @throws IllegalArgumentException if value is {@code true}
- * and the current keep-alive time is not greater than zero
- *
- * @since 1.6
- */
- public void allowCoreThreadTimeOut(boolean value) {
- if (value && keepAliveTime <= 0)
- throw new IllegalArgumentException("Core threads must have nonzero keep alive times");
- if (value != allowCoreThreadTimeOut) {
- allowCoreThreadTimeOut = value;
- if (value)
- interruptIdleWorkers();
- }
- }
-
- /**
- * Sets the maximum allowed number of threads. This overrides any
- * value set in the constructor. If the new value is smaller than
- * the current value, excess existing threads will be
- * terminated when they next become idle.
- *
- * @param maximumPoolSize the new maximum
- * @throws IllegalArgumentException if the new maximum is
- * less than or equal to zero, or
- * less than the {@linkplain #getCorePoolSize core pool size}
- * @see #getMaximumPoolSize
- */
- public void setMaximumPoolSize(int maximumPoolSize) {
- if (maximumPoolSize <= 0 || maximumPoolSize < corePoolSize)
- throw new IllegalArgumentException();
- this.maximumPoolSize = maximumPoolSize;
- if (workerCountOf(ctl.get()) > maximumPoolSize)
- interruptIdleWorkers();
- }
-
- /**
- * Returns the maximum allowed number of threads.
- *
- * @return the maximum allowed number of threads
- * @see #setMaximumPoolSize
- */
- public int getMaximumPoolSize() {
- return maximumPoolSize;
- }
-
- /**
- * Sets the time limit for which threads may remain idle before
- * being terminated. If there are more than the core number of
- * threads currently in the pool, after waiting this amount of
- * time without processing a task, excess threads will be
- * terminated. This overrides any value set in the constructor.
- *
- * @param time the time to wait. A time value of zero will cause
- * excess threads to terminate immediately after executing tasks.
- * @param unit the time unit of the {@code time} argument
- * @throws IllegalArgumentException if {@code time} less than zero or
- * if {@code time} is zero and {@code allowsCoreThreadTimeOut}
- * @see #getKeepAliveTime
- */
- public void setKeepAliveTime(long time, TimeUnit unit) {
- if (time < 0)
- throw new IllegalArgumentException();
- if (time == 0 && allowsCoreThreadTimeOut())
- throw new IllegalArgumentException("Core threads must have nonzero keep alive times");
- long keepAliveTime = unit.toNanos(time);
- long delta = keepAliveTime - this.keepAliveTime;
- this.keepAliveTime = keepAliveTime;
- if (delta < 0)
- interruptIdleWorkers();
- }
-
- /**
- * Returns the thread keep-alive time, which is the amount of time
- * that threads in excess of the core pool size may remain
- * idle before being terminated.
- *
- * @param unit the desired time unit of the result
- * @return the time limit
- * @see #setKeepAliveTime
- */
- public long getKeepAliveTime(TimeUnit unit) {
- return unit.convert(keepAliveTime, TimeUnit.NANOSECONDS);
- }
-
- /* User-level queue utilities */
-
- /**
- * Returns the task queue used by this executor. Access to the
- * task queue is intended primarily for debugging and monitoring.
- * This queue may be in active use. Retrieving the task queue
- * does not prevent queued tasks from executing.
- *
- * @return the task queue
- */
- public BlockingQueue getQueue() {
- return workQueue;
- }
-
- /**
- * Removes this task from the executor's internal queue if it is
- * present, thus causing it not to be run if it has not already
- * started.
- *
- * <p> This method may be useful as one part of a cancellation
- * scheme. It may fail to remove tasks that have been converted
- * into other forms before being placed on the internal queue. For
- * example, a task entered using {@code submit} might be
- * converted into a form that maintains {@code Future} status.
- * However, in such cases, method {@link #purge} may be used to
- * remove those Futures that have been cancelled.
- *
- * @param task the task to remove
- * @return true if the task was removed
- */
- public boolean remove(Runnable task) {
- boolean removed = workQueue.remove(task);
- tryTerminate(); // In case SHUTDOWN and now empty
- return removed;
- }
-
- /**
- * Tries to remove from the work queue all {@link Future}
- * tasks that have been cancelled. This method can be useful as a
- * storage reclamation operation, that has no other impact on
- * functionality. Cancelled tasks are never executed, but may
- * accumulate in work queues until worker threads can actively
- * remove them. Invoking this method instead tries to remove them now.
- * However, this method may fail to remove tasks in
- * the presence of interference by other threads.
- */
- public void purge() {
- final BlockingQueue q = workQueue;
- try {
- Iterator it = q.iterator();
- while (it.hasNext()) {
- Runnable r = (Runnable)it.next();
- if (r instanceof Future && ((Future)r).isCancelled())
- it.remove();
- }
- } catch (ConcurrentModificationException fallThrough) {
- // Take slow path if we encounter interference during traversal.
- // Make copy for traversal and call remove for cancelled entries.
- // The slow path is more likely to be O(N*N).
- Object[] arr = q.toArray();
- for (int i=0; i<arr.length; i++) {
- Object r = arr[i];
- if (r instanceof Future && ((Future)r).isCancelled())
- q.remove(r);
- }
- }
-
- tryTerminate(); // In case SHUTDOWN and now empty
- }
-
- /* Statistics */
-
- /**
- * Returns the current number of threads in the pool.
- *
- * @return the number of threads
- */
- public int getPoolSize() {
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- // Remove rare and surprising possibility of
- // isTerminated() && getPoolSize() > 0
- return runStateAtLeast(ctl.get(), TIDYING) ? 0
- : workers.size();
- } finally {
- mainLock.unlock();
- }
- }
-
- /**
- * Returns the approximate number of threads that are actively
- * executing tasks.
- *
- * @return the number of threads
- */
- public int getActiveCount() {
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- int n = 0;
- for (Iterator itr = workers.iterator(); itr.hasNext();) {
- Worker w = (Worker)itr.next();
- if (w.isLocked())
- ++n;
- }
- return n;
- } finally {
- mainLock.unlock();
- }
- }
-
- /**
- * Returns the largest number of threads that have ever
- * simultaneously been in the pool.
- *
- * @return the number of threads
- */
- public int getLargestPoolSize() {
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- return largestPoolSize;
- } finally {
- mainLock.unlock();
- }
- }
-
- /**
- * Returns the approximate total number of tasks that have ever been
- * scheduled for execution. Because the states of tasks and
- * threads may change dynamically during computation, the returned
- * value is only an approximation.
- *
- * @return the number of tasks
- */
- public long getTaskCount() {
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- long n = completedTaskCount;
- for (Iterator itr = workers.iterator(); itr.hasNext();) {
- Worker w = (Worker)itr.next();
- n += w.completedTasks;
- if (w.isLocked())
- ++n;
- }
- return n + workQueue.size();
- } finally {
- mainLock.unlock();
- }
- }
-
- /**
- * Returns the approximate total number of tasks that have
- * completed execution. Because the states of tasks and threads
- * may change dynamically during computation, the returned value
- * is only an approximation, but one that does not ever decrease
- * across successive calls.
- *
- * @return the number of tasks
- */
- public long getCompletedTaskCount() {
- final ReentrantLock mainLock = this.mainLock;
- mainLock.lock();
- try {
- long n = completedTaskCount;
- for (Iterator itr = workers.iterator(); itr.hasNext();) {
- Worker w = (Worker)itr.next();
- n += w.completedTasks;
- }
- return n;
- } finally {
- mainLock.unlock();
- }
- }
-
- /* Extension hooks */
-
- /**
- * Method invoked prior to executing the given Runnable in the
- * given thread. This method is invoked by thread {@code t} that
- * will execute task {@code r}, and may be used to re-initialize
- * ThreadLocals, or to perform logging.
- *
- * <p>This implementation does nothing, but may be customized in
- * subclasses. Note: To properly nest multiple overridings, subclasses
- * should generally invoke {@code super.beforeExecute} at the end of
- * this method.
- *
- * @param t the thread that will run task {@code r}
- * @param r the task that will be executed
- */
- protected void beforeExecute(Thread t, Runnable r) { }
-
- /**
- * Method invoked upon completion of execution of the given Runnable.
- * This method is invoked by the thread that executed the task. If
- * non-null, the Throwable is the uncaught {@code RuntimeException}
- * or {@code Error} that caused execution to terminate abruptly.
- *
- * <p>This implementation does nothing, but may be customized in
- * subclasses. Note: To properly nest multiple overridings, subclasses
- * should generally invoke {@code super.afterExecute} at the
- * beginning of this method.
- *
- * <p><b>Note:</b> When actions are enclosed in tasks (such as
- * {@link FutureTask}) either explicitly or via methods such as
- * {@code submit}, these task objects catch and maintain
- * computational exceptions, and so they do not cause abrupt
- * termination, and the internal exceptions are <em>not</em>
- * passed to this method. If you would like to trap both kinds of
- * failures in this method, you can further probe for such cases,
- * as in this sample subclass that prints either the direct cause
- * or the underlying exception if a task has been aborted:
- *
- * <pre> {@code
- * class ExtendedExecutor extends ThreadPoolExecutor {
- * // ...
- * protected void afterExecute(Runnable r, Throwable t) {
- * super.afterExecute(r, t);
- * if (t == null && r instanceof Future<?>) {
- * try {
- * Object result = ((Future<?>) r).get();
- * } catch (CancellationException ce) {
- * t = ce;
- * } catch (ExecutionException ee) {
- * t = ee.getCause();
- * } catch (InterruptedException ie) {
- * Thread.currentThread().interrupt(); // ignore/reset
- * }
- * }
- * if (t != null)
- * System.out.println(t);
- * }
- * }}</pre>
- *
- * @param r the runnable that has completed
- * @param t the exception that caused termination, or null if
- * execution completed normally
- */
- protected void afterExecute(Runnable r, Throwable t) { }
-
- /**
- * Method invoked when the Executor has terminated. Default
- * implementation does nothing. Note: To properly nest multiple
- * overridings, subclasses should generally invoke
- * {@code super.terminated} within this method.
- */
- protected void terminated() { }
-
- /* Predefined RejectedExecutionHandlers */
-
- /**
- * A handler for rejected tasks that runs the rejected task
- * directly in the calling thread of the {@code execute} method,
- * unless the executor has been shut down, in which case the task
- * is discarded.
- */
- public static class CallerRunsPolicy implements RejectedExecutionHandler {
- /**
- * Creates a {@code CallerRunsPolicy}.
- */
- public CallerRunsPolicy() { }
-
- /**
- * Executes task r in the caller's thread, unless the executor
- * has been shut down, in which case the task is discarded.
- *
- * @param r the runnable task requested to be executed
- * @param e the executor attempting to execute this task
- */
- public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
- if (!e.isShutdown()) {
- r.run();
- }
- }
- }
-
- /**
- * A handler for rejected tasks that throws a
- * {@code RejectedExecutionException}.
- */
- public static class AbortPolicy implements RejectedExecutionHandler {
- /**
- * Creates an {@code AbortPolicy}.
- */
- public AbortPolicy() { }
-
- /**
- * Always throws RejectedExecutionException.
- *
- * @param r the runnable task requested to be executed
- * @param e the executor attempting to execute this task
- * @throws RejectedExecutionException always.
- */
- public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
- throw new RejectedExecutionException();
- }
- }
-
- /**
- * A handler for rejected tasks that silently discards the
- * rejected task.
- */
- public static class DiscardPolicy implements RejectedExecutionHandler {
- /**
- * Creates a {@code DiscardPolicy}.
- */
- public DiscardPolicy() { }
-
- /**
- * Does nothing, which has the effect of discarding task r.
- *
- * @param r the runnable task requested to be executed
- * @param e the executor attempting to execute this task
- */
- public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
- }
- }
-
- /**
- * A handler for rejected tasks that discards the oldest unhandled
- * request and then retries {@code execute}, unless the executor
- * is shut down, in which case the task is discarded.
- */
- public static class DiscardOldestPolicy implements RejectedExecutionHandler {
- /**
- * Creates a {@code DiscardOldestPolicy} for the given executor.
- */
- public DiscardOldestPolicy() { }
-
- /**
- * Obtains and ignores the next task that the executor
- * would otherwise execute, if one is immediately available,
- * and then retries execution of task r, unless the executor
- * is shut down, in which case task r is instead discarded.
- *
- * @param r the runnable task requested to be executed
- * @param e the executor attempting to execute this task
- */
- public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
- if (!e.isShutdown()) {
- e.getQueue().poll();
- e.execute(r);
- }
- }
- }
-}
diff --git a/src/actors/scala/actors/threadpool/TimeUnit.java b/src/actors/scala/actors/threadpool/TimeUnit.java
deleted file mode 100644
index c443750e33..0000000000
--- a/src/actors/scala/actors/threadpool/TimeUnit.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-import java.io.InvalidObjectException;
-import java.io.ObjectStreamException;
-
-/**
- * A <tt>TimeUnit</tt> represents time durations at a given unit of
- * granularity and provides utility methods to convert across units,
- * and to perform timing and delay operations in these units. A
- * <tt>TimeUnit</tt> does not maintain time information, but only
- * helps organize and use time representations that may be maintained
- * separately across various contexts. A nanosecond is defined as one
- * thousandth of a microsecond, a microsecond as one thousandth of a
- * millisecond, a millisecond as one thousandth of a second, a minute
- * as sixty seconds, an hour as sixty minutes, and a day as twenty four
- * hours.
- *
- * <p>A <tt>TimeUnit</tt> is mainly used to inform time-based methods
- * how a given timing parameter should be interpreted. For example,
- * the following code will timeout in 50 milliseconds if the {@link
- * edu.emory.mathcs.backport.java.util.concurrent.locks.Lock lock} is not available:
- *
- * <pre> Lock lock = ...;
- * if ( lock.tryLock(50L, TimeUnit.MILLISECONDS) ) ...
- * </pre>
- * while this code will timeout in 50 seconds:
- * <pre>
- * Lock lock = ...;
- * if ( lock.tryLock(50L, TimeUnit.SECONDS) ) ...
- * </pre>
- *
- * Note however, that there is no guarantee that a particular timeout
- * implementation will be able to notice the passage of time at the
- * same granularity as the given <tt>TimeUnit</tt>.
- *
- * @since 1.5
- * @author Doug Lea
- */
-public abstract class TimeUnit implements java.io.Serializable {
-
- public static final TimeUnit NANOSECONDS = new TimeUnit(0, "NANOSECONDS") {
- private final static long serialVersionUID = 535148490883208361L;
- public long toNanos(long d) { return d; }
- public long toMicros(long d) { return d/(C1/C0); }
- public long toMillis(long d) { return d/(C2/C0); }
- public long toSeconds(long d) { return d/(C3/C0); }
- public long toMinutes(long d) { return d/(C4/C0); }
- public long toHours(long d) { return d/(C5/C0); }
- public long toDays(long d) { return d/(C6/C0); }
- public long convert(long d, TimeUnit u) { return u.toNanos(d); }
- int excessNanos(long d, long m) { return (int)(d - (m*C2)); }
- };
- public static final TimeUnit MICROSECONDS = new TimeUnit(1, "MICROSECONDS") {
- private final static long serialVersionUID = 2185906575929579108L;
- public long toNanos(long d) { return x(d, C1/C0, MAX/(C1/C0)); }
- public long toMicros(long d) { return d; }
- public long toMillis(long d) { return d/(C2/C1); }
- public long toSeconds(long d) { return d/(C3/C1); }
- public long toMinutes(long d) { return d/(C4/C1); }
- public long toHours(long d) { return d/(C5/C1); }
- public long toDays(long d) { return d/(C6/C1); }
- public long convert(long d, TimeUnit u) { return u.toMicros(d); }
- int excessNanos(long d, long m) { return (int)((d*C1) - (m*C2)); }
- };
- public static final TimeUnit MILLISECONDS = new TimeUnit(2, "MILLISECONDS") {
- private final static long serialVersionUID = 9032047794123325184L;
- public long toNanos(long d) { return x(d, C2/C0, MAX/(C2/C0)); }
- public long toMicros(long d) { return x(d, C2/C1, MAX/(C2/C1)); }
- public long toMillis(long d) { return d; }
- public long toSeconds(long d) { return d/(C3/C2); }
- public long toMinutes(long d) { return d/(C4/C2); }
- public long toHours(long d) { return d/(C5/C2); }
- public long toDays(long d) { return d/(C6/C2); }
- public long convert(long d, TimeUnit u) { return u.toMillis(d); }
- int excessNanos(long d, long m) { return 0; }
- };
- public static final TimeUnit SECONDS = new TimeUnit(3, "SECONDS") {
- private final static long serialVersionUID = 227755028449378390L;
- public long toNanos(long d) { return x(d, C3/C0, MAX/(C3/C0)); }
- public long toMicros(long d) { return x(d, C3/C1, MAX/(C3/C1)); }
- public long toMillis(long d) { return x(d, C3/C2, MAX/(C3/C2)); }
- public long toSeconds(long d) { return d; }
- public long toMinutes(long d) { return d/(C4/C3); }
- public long toHours(long d) { return d/(C5/C3); }
- public long toDays(long d) { return d/(C6/C3); }
- public long convert(long d, TimeUnit u) { return u.toSeconds(d); }
- int excessNanos(long d, long m) { return 0; }
- };
- public static final TimeUnit MINUTES = new TimeUnit(4, "MINUTES") {
- private final static long serialVersionUID = 1827351566402609187L;
- public long toNanos(long d) { return x(d, C4/C0, MAX/(C4/C0)); }
- public long toMicros(long d) { return x(d, C4/C1, MAX/(C4/C1)); }
- public long toMillis(long d) { return x(d, C4/C2, MAX/(C4/C2)); }
- public long toSeconds(long d) { return x(d, C4/C3, MAX/(C4/C3)); }
- public long toMinutes(long d) { return d; }
- public long toHours(long d) { return d/(C5/C4); }
- public long toDays(long d) { return d/(C6/C4); }
- public long convert(long d, TimeUnit u) { return u.toMinutes(d); }
- int excessNanos(long d, long m) { return 0; }
- };
- public static final TimeUnit HOURS = new TimeUnit(5, "HOURS") {
- private final static long serialVersionUID = -6438436134732089810L;
- public long toNanos(long d) { return x(d, C5/C0, MAX/(C5/C0)); }
- public long toMicros(long d) { return x(d, C5/C1, MAX/(C5/C1)); }
- public long toMillis(long d) { return x(d, C5/C2, MAX/(C5/C2)); }
- public long toSeconds(long d) { return x(d, C5/C3, MAX/(C5/C3)); }
- public long toMinutes(long d) { return x(d, C5/C4, MAX/(C5/C4)); }
- public long toHours(long d) { return d; }
- public long toDays(long d) { return d/(C6/C5); }
- public long convert(long d, TimeUnit u) { return u.toHours(d); }
- int excessNanos(long d, long m) { return 0; }
- };
- public static final TimeUnit DAYS = new TimeUnit(6, "DAYS") {
- private final static long serialVersionUID = 567463171959674600L;
- public long toNanos(long d) { return x(d, C6/C0, MAX/(C6/C0)); }
- public long toMicros(long d) { return x(d, C6/C1, MAX/(C6/C1)); }
- public long toMillis(long d) { return x(d, C6/C2, MAX/(C6/C2)); }
- public long toSeconds(long d) { return x(d, C6/C3, MAX/(C6/C3)); }
- public long toMinutes(long d) { return x(d, C6/C4, MAX/(C6/C4)); }
- public long toHours(long d) { return x(d, C6/C5, MAX/(C6/C5)); }
- public long toDays(long d) { return d; }
- public long convert(long d, TimeUnit u) { return u.toDays(d); }
- int excessNanos(long d, long m) { return 0; }
- };
-
- private static final TimeUnit[] values = new TimeUnit[]
- { NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS };
-
- public static TimeUnit[] values() {
- return (TimeUnit[])values.clone();
- }
-
- /**
- * Returns the enum constant of this type with the specified name. The
- * string must match <em>exactly</em> an identifier used to declare an
- * enum constant in this type. (Extraneous whitespace characters are not
- * permitted.)
- *
- * @param name the name of the enum constant to be returned
- * @return the enum constant with the specified name
- * @throws IllegalArgumentException
- * if this enum type has no constant with the specified name
- */
- public static TimeUnit valueOf(String name) {
- for (int i = 0; i < values.length; i++) {
- if (values[i].name.equals(name)) {
- return values[i];
- }
- }
- throw new IllegalArgumentException("No enum const TimeUnit." + name);
- }
-
- /**
- * The ordinal of this unit. This is useful both for {@link #ordinal()}
- * and to maintain serialization consistence with earlier versions.
- */
- private final int index;
-
- /** name of this unit */
- private final String name;
-
- /** Internal constructor */
- TimeUnit(int index, String name) {
- this.index = index;
- this.name = name;
- }
-
- // Handy constants for conversion methods
- static final long C0 = 1;
- static final long C1 = C0 * 1000;
- static final long C2 = C1 * 1000;
- static final long C3 = C2 * 1000;
- static final long C4 = C3 * 60;
- static final long C5 = C4 * 60;
- static final long C6 = C5 * 24;
-
- static final long MAX = Long.MAX_VALUE;
-
- /**
- * Scale d by m, checking for overflow.
- * This has a short name to make above code more readable.
- */
- static long x(long d, long m, long over) {
- if (d > over) return Long.MAX_VALUE;
- if (d < -over) return Long.MIN_VALUE;
- return d * m;
- }
-
- /**
- * Convert the given time duration in the given unit to this
- * unit. Conversions from finer to coarser granularities
- * truncate, so lose precision. For example converting
- * <tt>999</tt> milliseconds to seconds results in
- * <tt>0</tt>. Conversions from coarser to finer granularities
- * with arguments that would numerically overflow saturate to
- * <tt>Long.MIN_VALUE</tt> if negative or <tt>Long.MAX_VALUE</tt>
- * if positive.
- *
- * <p>For example, to convert 10 minutes to milliseconds, use:
- * <tt>TimeUnit.MILLISECONDS.convert(10L, TimeUnit.MINUTES)</tt>
- *
- * @param sourceDuration the time duration in the given <tt>sourceUnit</tt>
- * @param sourceUnit the unit of the <tt>sourceDuration</tt> argument
- * @return the converted duration in this unit,
- * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
- * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
- */
- public abstract long convert(long sourceDuration, TimeUnit sourceUnit);
-
- /**
- * Equivalent to <tt>NANOSECONDS.convert(duration, this)</tt>.
- * @param duration the duration
- * @return the converted duration,
- * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
- * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
- * @see #convert
- */
- public abstract long toNanos(long duration);
-
- /**
- * Equivalent to <tt>MICROSECONDS.convert(duration, this)</tt>.
- * @param duration the duration
- * @return the converted duration,
- * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
- * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
- * @see #convert
- */
- public abstract long toMicros(long duration);
-
- /**
- * Equivalent to <tt>MILLISECONDS.convert(duration, this)</tt>.
- * @param duration the duration
- * @return the converted duration,
- * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
- * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
- * @see #convert
- */
- public abstract long toMillis(long duration);
-
- /**
- * Equivalent to <tt>SECONDS.convert(duration, this)</tt>.
- * @param duration the duration
- * @return the converted duration,
- * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
- * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
- * @see #convert
- */
- public abstract long toSeconds(long duration);
-
- /**
- * Equivalent to <tt>MINUTES.convert(duration, this)</tt>.
- * @param duration the duration
- * @return the converted duration,
- * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
- * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
- * @see #convert
- * @since 1.6
- */
- public abstract long toMinutes(long duration);
-
- /**
- * Equivalent to <tt>HOURS.convert(duration, this)</tt>.
- * @param duration the duration
- * @return the converted duration,
- * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
- * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
- * @see #convert
- * @since 1.6
- */
- public abstract long toHours(long duration);
-
- /**
- * Equivalent to <tt>DAYS.convert(duration, this)</tt>.
- * @param duration the duration
- * @return the converted duration
- * @see #convert
- * @since 1.6
- */
- public abstract long toDays(long duration);
-
- /**
- * Utility to compute the excess-nanosecond argument to wait,
- * sleep, join.
- * @param d the duration
- * @param m the number of milliseconds
- * @return the number of nanoseconds
- */
- abstract int excessNanos(long d, long m);
-
- /**
- * Returns the name of this enum constant, exactly as declared in its enum
- * declaration. <strong>Most programmers should use the
- * {@link #toString()} method in preference to this one, as the toString
- * method may return a more user-friendly name.</strong> This method is
- * designed primarily for use in specialized situations where correctness
- * depends on getting the exact name, which will not vary from release to
- * release.
- *
- * @return the name of this enum constant
- */
- public String name() {
- return name;
- }
-
- /**
- * Returns the ordinal of this enumeration constant (its position in its
- * enum declaration, where the initial constant is assigned an ordinal of
- * zero). Most programmers will have no use for this method. It is
- * designed for use by sophisticated enum-based data structures, such as
- * <code>EnumSet</code> and <code>EnumMap</code>.
- *
- * @return the ordinal of this enumeration constant
- */
- public int ordinal() {
- return index;
- }
-
- /*
- * Guarantees that deserialized objects will be referentially equal to the
- * standard enumeration objects.
- */
- protected Object readResolve() throws ObjectStreamException {
- try {
- return valueOf(name);
- } catch (IllegalArgumentException e) {
- throw new InvalidObjectException(name
- + " is not a valid enum for TimeUnit");
- }
- }
-
- /**
- * Performs a timed <tt>Object.wait</tt> using this time unit.
- * This is a convenience method that converts timeout arguments
- * into the form required by the <tt>Object.wait</tt> method.
- *
- * <p>For example, you could implement a blocking <tt>poll</tt>
- * method (see {@link BlockingQueue#poll BlockingQueue.poll})
- * using:
- *
- * <pre> public synchronized Object poll(long timeout, TimeUnit unit) throws InterruptedException {
- * while (empty) {
- * unit.timedWait(this, timeout);
- * ...
- * }
- * }</pre>
- *
- * @param obj the object to wait on
- * @param timeout the maximum time to wait. If less than
- * or equal to zero, do not wait at all.
- * @throws InterruptedException if interrupted while waiting.
- * @see java.lang.Object#wait(long, int)
- */
- public void timedWait(Object obj, long timeout)
- throws InterruptedException {
- if (timeout > 0) {
- long ms = toMillis(timeout);
- int ns = excessNanos(timeout, ms);
- obj.wait(ms, ns);
- }
- }
-
- /**
- * Performs a timed <tt>Thread.join</tt> using this time unit.
- * This is a convenience method that converts time arguments into the
- * form required by the <tt>Thread.join</tt> method.
- * @param thread the thread to wait for
- * @param timeout the maximum time to wait. If less than
- * or equal to zero, do not wait at all.
- * @throws InterruptedException if interrupted while waiting.
- * @see java.lang.Thread#join(long, int)
- */
- public void timedJoin(Thread thread, long timeout)
- throws InterruptedException {
- if (timeout > 0) {
- long ms = toMillis(timeout);
- int ns = excessNanos(timeout, ms);
- thread.join(ms, ns);
- }
- }
-
- /**
- * Performs a <tt>Thread.sleep</tt> using this unit.
- * This is a convenience method that converts time arguments into the
- * form required by the <tt>Thread.sleep</tt> method.
- * @param timeout the maximum time to sleep. If less than
- * or equal to zero, do not sleep at all.
- * @throws InterruptedException if interrupted while sleeping.
- * @see java.lang.Thread#sleep
- */
- public void sleep(long timeout) throws InterruptedException {
- if (timeout > 0) {
- long ms = toMillis(timeout);
- int ns = excessNanos(timeout, ms);
- Thread.sleep(ms, ns);
- }
- }
-
- public String toString() {
- return name;
- }
-}
diff --git a/src/actors/scala/actors/threadpool/TimeoutException.java b/src/actors/scala/actors/threadpool/TimeoutException.java
deleted file mode 100644
index c6fdbe5dc4..0000000000
--- a/src/actors/scala/actors/threadpool/TimeoutException.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool;
-
-/**
- * Exception thrown when a blocking operation times out. Blocking
- * operations for which a timeout is specified need a means to
- * indicate that the timeout has occurred. For many such operations it
- * is possible to return a value that indicates timeout; when that is
- * not possible or desirable then <tt>TimeoutException</tt> should be
- * declared and thrown.
- *
- * @since 1.5
- * @author Doug Lea
- */
-public class TimeoutException extends Exception {
- private static final long serialVersionUID = 1900926677490660714L;
-
- /**
- * Constructs a <tt>TimeoutException</tt> with no specified detail
- * message.
- */
- public TimeoutException() {}
-
- /**
- * Constructs a <tt>TimeoutException</tt> with the specified detail
- * message.
- *
- * @param message the detail message
- */
- public TimeoutException(String message) {
- super(message);
- }
-}
diff --git a/src/actors/scala/actors/threadpool/helpers/FIFOWaitQueue.java b/src/actors/scala/actors/threadpool/helpers/FIFOWaitQueue.java
deleted file mode 100644
index 432b851f3e..0000000000
--- a/src/actors/scala/actors/threadpool/helpers/FIFOWaitQueue.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package scala.actors.threadpool.helpers;
-
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Simple linked list queue used in FIFOSemaphore.
- * Methods are not synchronized; they depend on synch of callers.
- * Must be public, since it is used by Semaphore (outside this package).
- * NOTE: this class is NOT present in java.util.concurrent.
- **/
-
-public class FIFOWaitQueue extends WaitQueue implements java.io.Serializable {
-
- private final static long serialVersionUID = 2416444691925378811L;
-
- protected transient WaitNode head_ = null;
- protected transient WaitNode tail_ = null;
-
- public FIFOWaitQueue() {}
-
- public void insert(WaitNode w) {
- if (tail_ == null)
- head_ = tail_ = w;
- else {
- tail_.next = w;
- tail_ = w;
- }
- }
-
- public WaitNode extract() {
- if (head_ == null)
- return null;
- else {
- WaitNode w = head_;
- head_ = w.next;
- if (head_ == null)
- tail_ = null;
- w.next = null;
- return w;
- }
- }
-
- public void putBack(WaitNode w) {
- w.next = head_;
- head_ = w;
- if (tail_ == null)
- tail_ = w;
- }
-
- public boolean hasNodes() {
- return head_ != null;
- }
-
- public int getLength() {
- int count = 0;
- WaitNode node = head_;
- while (node != null) {
- if (node.waiting) count++;
- node = node.next;
- }
- return count;
- }
-
- public Collection getWaitingThreads() {
- List<Thread> list = new ArrayList<Thread>();
- int count = 0;
- WaitNode node = head_;
- while (node != null) {
- if (node.waiting) list.add(node.owner);
- node = node.next;
- }
- return list;
- }
-
- public boolean isWaiting(Thread thread) {
- if (thread == null) throw new NullPointerException();
- for (WaitNode node = head_; node != null; node = node.next) {
- if (node.waiting && node.owner == thread) return true;
- }
- return false;
- }
-
-}
diff --git a/src/actors/scala/actors/threadpool/helpers/NanoTimer.java b/src/actors/scala/actors/threadpool/helpers/NanoTimer.java
deleted file mode 100644
index f3edf13565..0000000000
--- a/src/actors/scala/actors/threadpool/helpers/NanoTimer.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Written by Dawid Kurzyniec and released to the public domain, as explained
- * at http://creativecommons.org/licenses/publicdomain
- */
-package scala.actors.threadpool.helpers;
-
-/**
- * Interface to specify custom implementation of precise timer.
- *
- * @author Dawid Kurzyniec
- * @version 1.0
- */
-public interface NanoTimer {
- /**
- * Returns the current value of the most precise available system timer,
- * in nanoseconds. This method can only be used to measure elapsed time and
- * is not related to any other notion of system or wall-clock time. The
- * value returned represents nanoseconds since some fixed but arbitrary
- * time (perhaps in the future, so values may be negative). This method
- * provides nanosecond precision, but not necessarily nanosecond accuracy.
- * No guarantees are made about how frequently values change. Differences
- * in successive calls that span greater than approximately 292 years
- * (263 nanoseconds) will not accurately compute elapsed time due to
- * numerical overflow.
- *
- * @return The current value of the system timer, in nanoseconds.
- */
- long nanoTime();
-}
diff --git a/src/actors/scala/actors/threadpool/helpers/ThreadHelpers.java b/src/actors/scala/actors/threadpool/helpers/ThreadHelpers.java
deleted file mode 100644
index 13da20c4d6..0000000000
--- a/src/actors/scala/actors/threadpool/helpers/ThreadHelpers.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Written by Dawid Kurzyniec and released to the public domain, as explained
- * at http://creativecommons.org/licenses/publicdomain
- */
-package scala.actors.threadpool.helpers;
-
-/**
- * Emulation of some new functionality present in java.lang.Thread in J2SE 5.0.
- *
- * @author Dawid Kurzyniec
- * @version 1.0
- */
-public class ThreadHelpers {
-
- private ThreadHelpers() {}
-
- /**
- * Returns wrapped runnable that ensures that if an exception occurs
- * during the execution, the specified exception handler is invoked.
- * @param runnable runnable for which exceptions are to be intercepted
- * @param handler the exception handler to call when exception occurs
- * during execution of the given runnable
- * @return wrapped runnable
- */
- public static Runnable assignExceptionHandler(final Runnable runnable,
- final UncaughtExceptionHandler handler)
- {
- if (runnable == null || handler == null) {
- throw new NullPointerException();
- }
- return new Runnable() {
- public void run() {
- try {
- runnable.run();
- }
- catch (Throwable error) {
- try {
- handler.uncaughtException(Thread.currentThread(), error);
- }
- catch (Throwable ignore) {}
- }
- }
- };
- }
-
- /**
- * Abstraction of the exception handler which receives notifications of
- * exceptions occurred possibly in various parts of the system. Exception
- * handlers present attractive approach to exception handling in multi-threaded
- * systems, as they can handle exceptions that occurred in different threads.
- * <p>
- * This class is analogous to Thread.UncaughtExceptionHandler in J2SE 5.0.
- * Obviously you cannot use it the same way, e.g. you cannot assign the
- * handler to the thread so that it is invoked when thread terminates.
- * However, it can be {@link ThreadHelpers#assignExceptionHandler emulated}.
- */
- public static interface UncaughtExceptionHandler {
- /**
- * Notification of the uncaught exception that occurred within specified
- * thread.
- * @param thread the thread where the exception occurred
- * @param error the exception
- */
- void uncaughtException(Thread thread, Throwable error);
- }
-}
diff --git a/src/actors/scala/actors/threadpool/helpers/Utils.java b/src/actors/scala/actors/threadpool/helpers/Utils.java
deleted file mode 100644
index d12389215d..0000000000
--- a/src/actors/scala/actors/threadpool/helpers/Utils.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * Written by Dawid Kurzyniec, based on code written by Doug Lea with assistance
- * from members of JCP JSR-166 Expert Group. Released to the public domain,
- * as explained at http://creativecommons.org/licenses/publicdomain.
- *
- * Thanks to Craig Mattocks for suggesting to use <code>sun.misc.Perf</code>.
- */
-
-package scala.actors.threadpool.helpers;
-
-//import edu.emory.mathcs.backport.java.util.*;
-import scala.actors.threadpool.*;
-import scala.actors.threadpool.locks.*;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.lang.reflect.Array;
-import java.util.Iterator;
-import java.util.Collection;
-
-/**
- * <p>
- * This class groups together the functionality of java.util.concurrent that
- * cannot be fully and reliably implemented in backport, but for which some
- * form of emulation is possible.
- * <p>
- * Currently, this class contains methods related to nanosecond-precision
- * timing, particularly via the {@link #nanoTime} method. To measure time
- * accurately, this method by default uses <code>java.sun.Perf</code> on
- * JDK1.4.2 and it falls back to <code>System.currentTimeMillis</code>
- * on earlier JDKs.
- *
- * @author Dawid Kurzyniec
- * @version 1.0
- */
-public final class Utils {
-
- private final static NanoTimer nanoTimer;
- private final static String providerProp =
- "edu.emory.mathcs.backport.java.util.concurrent.NanoTimerProvider";
-
- static {
- NanoTimer timer = null;
- try {
- String nanoTimerClassName =
- AccessController.doPrivileged(new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty(providerProp);
- }
- });
- if (nanoTimerClassName != null) {
- Class cls = Class.forName(nanoTimerClassName);
- timer = (NanoTimer) cls.newInstance();
- }
- }
- catch (Exception e) {
- System.err.println("WARNING: unable to load the system-property-defined " +
- "nanotime provider; switching to the default");
- e.printStackTrace();
- }
-
- if (timer == null) {
- try {
- timer = new SunPerfProvider();
- }
- catch (Throwable e) {}
- }
-
- if (timer == null) {
- timer = new MillisProvider();
- }
-
- nanoTimer = timer;
- }
-
- private Utils() {}
-
- /**
- * Returns the current value of the most precise available system timer,
- * in nanoseconds. This method can only be used to measure elapsed time and
- * is not related to any other notion of system or wall-clock time. The
- * value returned represents nanoseconds since some fixed but arbitrary
- * time (perhaps in the future, so values may be negative). This method
- * provides nanosecond precision, but not necessarily nanosecond accuracy.
- * No guarantees are made about how frequently values change. Differences
- * in successive calls that span greater than approximately 292 years
- * (2^63 nanoseconds) will not accurately compute elapsed time due to
- * numerical overflow.
- * <p>
- * <em>Implementation note:</em>By default, this method uses
- * <code>sun.misc.Perf</code> on Java 1.4.2, and falls back to
- * System.currentTimeMillis() emulation on earlier JDKs. Custom
- * timer can be provided via the system property
- * <code>edu.emory.mathcs.backport.java.util.concurrent.NanoTimerProvider</code>.
- * The value of the property should name a class implementing
- * {@link NanoTimer} interface.
- * <p>
- * Note: on JDK 1.4.2, <code>sun.misc.Perf</code> timer seems to have
- * resolution of the order of 1 microsecond, measured on Linux.
- *
- * @return The current value of the system timer, in nanoseconds.
- */
- public static long nanoTime() {
- return nanoTimer.nanoTime();
- }
-
- /**
- * Causes the current thread to wait until it is signalled or interrupted,
- * or the specified waiting time elapses. This method originally appears
- * in the {@link Condition} interface, but it was moved to here since it
- * can only be emulated, with very little accuracy guarantees: the
- * efficient implementation requires accurate nanosecond timer and native
- * support for nanosecond-precision wait queues, which are not usually
- * present in JVMs prior to 1.5. Loss of precision may cause total waiting
- * times to be systematically shorter than specified when re-waits occur.
- *
- * <p>The lock associated with this condition is atomically
- * released and the current thread becomes disabled for thread scheduling
- * purposes and lies dormant until <em>one</em> of five things happens:
- * <ul>
- * <li>Some other thread invokes the {@link
- * edu.emory.mathcs.backport.java.util.concurrent.locks.Condition#signal}
- * method for this
- * <tt>Condition</tt> and the current thread happens to be chosen as the
- * thread to be awakened; or
- * <li>Some other thread invokes the {@link
- * edu.emory.mathcs.backport.java.util.concurrent.locks.Condition#signalAll}
- * method for this
- * <tt>Condition</tt>; or
- * <li>Some other thread {@link Thread#interrupt interrupts} the current
- * thread, and interruption of thread suspension is supported; or
- * <li>The specified waiting time elapses; or
- * <li>A &quot;<em>spurious wakeup</em>&quot; occurs.
- * </ul>
- *
- * <p>In all cases, before this method can return the current thread must
- * re-acquire the lock associated with this condition. When the
- * thread returns it is <em>guaranteed</em> to hold this lock.
- *
- * <p>If the current thread:
- * <ul>
- * <li>has its interrupted status set on entry to this method; or
- * <li>is {@link Thread#interrupt interrupted} while waiting
- * and interruption of thread suspension is supported,
- * </ul>
- * then {@link InterruptedException} is thrown and the current thread's
- * interrupted status is cleared. It is not specified, in the first
- * case, whether or not the test for interruption occurs before the lock
- * is released.
- *
- * <p>The method returns an estimate of the number of nanoseconds
- * remaining to wait given the supplied <tt>nanosTimeout</tt>
- * value upon return, or a value less than or equal to zero if it
- * timed out. Accuracy of this estimate is directly dependent on the
- * accuracy of {@link #nanoTime}. This value can be used to determine
- * whether and how long to re-wait in cases where the wait returns but an
- * awaited condition still does not hold. Typical uses of this method take
- * the following form:
- *
- * <pre>
- * synchronized boolean aMethod(long timeout, TimeUnit unit) {
- * long nanosTimeout = unit.toNanos(timeout);
- * while (!conditionBeingWaitedFor) {
- * if (nanosTimeout &gt; 0)
- * nanosTimeout = theCondition.awaitNanos(nanosTimeout);
- * else
- * return false;
- * }
- * // ...
- * }
- * </pre>
- *
- * <p><b>Implementation Considerations</b>
- * <p>The current thread is assumed to hold the lock associated with this
- * <tt>Condition</tt> when this method is called.
- * It is up to the implementation to determine if this is
- * the case and if not, how to respond. Typically, an exception will be
- * thrown (such as {@link IllegalMonitorStateException}) and the
- * implementation must document that fact.
- *
- * <p>A condition implementation can favor responding to an interrupt over
- * normal method return in response to a signal, or over indicating the
- * elapse of the specified waiting time. In either case the implementation
- * must ensure that the signal is redirected to another waiting thread, if
- * there is one.
- *
- * @param cond the condition to wait for
- * @param nanosTimeout the maximum time to wait, in nanoseconds
- * @return A value less than or equal to zero if the wait has
- * timed out; otherwise an estimate, that
- * is strictly less than the <tt>nanosTimeout</tt> argument,
- * of the time still remaining when this method returned.
- *
- * @throws InterruptedException if the current thread is interrupted (and
- * interruption of thread suspension is supported).
- */
- public static long awaitNanos(Condition cond, long nanosTimeout)
- throws InterruptedException
- {
- if (nanosTimeout <= 0) return nanosTimeout;
- long now = nanoTime();
- cond.await(nanosTimeout, TimeUnit.NANOSECONDS);
- return nanosTimeout - (nanoTime() - now);
- }
-
- private static final class SunPerfProvider implements NanoTimer {
- final Perf perf;
- final long multiplier, divisor;
- SunPerfProvider() {
- perf =
- AccessController.doPrivileged(new PrivilegedAction<Perf>() {
- public Perf run() {
- return Perf.getPerf();
- }
- });
- // trying to avoid BOTH overflow and rounding errors
- long numerator = 1000000000;
- long denominator = perf.highResFrequency();
- long gcd = gcd(numerator, denominator);
- this.multiplier = numerator / gcd;
- this.divisor = denominator / gcd;
- }
- public long nanoTime() {
- long ctr = perf.highResCounter();
-
- // anything less sophisticated suffers either from rounding errors
- // (FP arithmetics, backport v1.0) or overflow, when gcd is small
- // (a bug in backport v1.0_01 reported by Ramesh Nethi)
-
- return ((ctr / divisor) * multiplier) +
- (ctr % divisor) * multiplier / divisor;
-
- // even the above can theoretically cause problems if your JVM is
- // running for sufficiently long time, but "sufficiently" means 292
- // years (worst case), or 30,000 years (common case).
-
- // Details: when the ticks ctr overflows, there is no way to avoid
- // discontinuity in computed nanos, even in infinite arithmetics,
- // unless we count number of overflows that the ctr went through
- // since the JVM started. This follows from the fact that
- // (2^64*multiplier/divisor) mod (2^64) > 0 in general case.
- // Theoretically we could find out the number of overflows by
- // checking System.currentTimeMillis(), but this is unreliable
- // since the system time can unpredictably change during the JVM
- // lifetime.
- // The time to overflow is 2^63 / ticks frequency. With current
- // ticks frequencies of several MHz, it gives about 30,000 years
- // before the problem happens. If ticks frequency reaches 1 GHz, the
- // time to overflow is 292 years. It is unlikely that the frequency
- // ever exceeds 1 GHz. We could double the time to overflow
- // (to 2^64 / frequency) by using unsigned arithmetics, e.g. by
- // adding the following correction whenever the ticks is negative:
- // -2*((Long.MIN_VALUE / divisor) * multiplier +
- // (Long.MIN_VALUE % divisor) * multiplier / divisor)
- // But, with the worst case of as much as 292 years, it does not
- // seem justified.
- }
- }
-
- private static final class MillisProvider implements NanoTimer {
- MillisProvider() {}
- public long nanoTime() {
- return System.currentTimeMillis() * 1000000;
- }
- }
-
- private static long gcd(long a, long b) {
- long r;
- while (b>0) { r = a % b; a = b; b = r; }
- return a;
- }
-
-
- public static Object[] collectionToArray(Collection c) {
- // guess the array size; expect to possibly be different
- int len = c.size();
- Object[] arr = new Object[len];
- Iterator itr = c.iterator();
- int idx = 0;
- while (true) {
- while (idx < len && itr.hasNext()) {
- arr[idx++] = itr.next();
- }
- if (!itr.hasNext()) {
- if (idx == len) return arr;
- // otherwise have to trim
- return Arrays.copyOf(arr, idx, Object[].class);
- }
- // otherwise, have to grow
- int newcap = ((arr.length/2)+1)*3;
- if (newcap < arr.length) {
- // overflow
- if (arr.length < Integer.MAX_VALUE) {
- newcap = Integer.MAX_VALUE;
- }
- else {
- throw new OutOfMemoryError("required array size too large");
- }
- }
- arr = Arrays.copyOf(arr, newcap, Object[].class);
- len = newcap;
- }
- }
-
- public static Object[] collectionToArray(Collection c, Object[] a) {
- Class aType = a.getClass();
- // guess the array size; expect to possibly be different
- int len = c.size();
- Object[] arr = (a.length >= len ? a :
- (Object[])Array.newInstance(aType.getComponentType(), len));
- Iterator itr = c.iterator();
- int idx = 0;
- while (true) {
- while (idx < len && itr.hasNext()) {
- arr[idx++] = itr.next();
- }
- if (!itr.hasNext()) {
- if (idx == len) return arr;
- if (arr == a) {
- // orig array -> null terminate
- a[idx] = null;
- return a;
- }
- else {
- // have to trim
- return Arrays.copyOf(arr, idx, aType);
- }
- }
- // otherwise, have to grow
- int newcap = ((arr.length/2)+1)*3;
- if (newcap < arr.length) {
- // overflow
- if (arr.length < Integer.MAX_VALUE) {
- newcap = Integer.MAX_VALUE;
- }
- else {
- throw new OutOfMemoryError("required array size too large");
- }
- }
- arr = Arrays.copyOf(arr, newcap, aType);
- len = newcap;
- }
- }
-}
diff --git a/src/actors/scala/actors/threadpool/helpers/WaitQueue.java b/src/actors/scala/actors/threadpool/helpers/WaitQueue.java
deleted file mode 100644
index bcbf29e5c2..0000000000
--- a/src/actors/scala/actors/threadpool/helpers/WaitQueue.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- based on file: QueuedSemaphore.java
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
- History:
- Date Who What
- 11Jun1998 dl Create public version
- 5Aug1998 dl replaced int counters with longs
- 24Aug1999 dl release(n): screen arguments
- */
-
-package scala.actors.threadpool.helpers;
-
-import java.util.Collection;
-import scala.actors.threadpool.*;
-
-/**
- * Base class for internal queue classes for semaphores, etc.
- * Relies on subclasses to actually implement queue mechanics.
- * NOTE: this class is NOT present in java.util.concurrent.
- **/
-
-public abstract class WaitQueue {
-
- public abstract void insert(WaitNode w); // assumed not to block
- public abstract WaitNode extract(); // should return null if empty
- public abstract void putBack(WaitNode w);
-
- public abstract boolean hasNodes();
- public abstract int getLength();
- public abstract Collection getWaitingThreads();
- public abstract boolean isWaiting(Thread thread);
-
- public static interface QueuedSync {
- // invoked with sync on wait node, (atomically) just before enqueuing
- boolean recheck(WaitNode node);
- // invoked with sync on wait node, (atomically) just before signalling
- void takeOver(WaitNode node);
- }
-
- public static class WaitNode {
- boolean waiting = true;
- WaitNode next = null;
- final Thread owner;
-
- public WaitNode() {
- this.owner = Thread.currentThread();
- }
-
- public Thread getOwner() {
- return owner;
- }
-
- public synchronized boolean signal(QueuedSync sync) {
- boolean signalled = waiting;
- if (signalled) {
- waiting = false;
- notify();
- sync.takeOver(this);
- }
- return signalled;
- }
-
- public synchronized boolean doTimedWait(QueuedSync sync, long nanos)
- throws InterruptedException
- {
- if (sync.recheck(this) || !waiting)
- return true;
- else if (nanos <= 0) {
- waiting = false;
- return false;
- }
- else {
- long deadline = Utils.nanoTime() + nanos;
- try {
- for (; ; ) {
- TimeUnit.NANOSECONDS.timedWait(this, nanos);
- if (!waiting) // definitely signalled
- return true;
- else {
- nanos = deadline - Utils.nanoTime();
- if (nanos <= 0) { // timed out
- waiting = false;
- return false;
- }
- }
- }
- }
- catch (InterruptedException ex) {
- if (waiting) { // no notification
- waiting = false; // invalidate for the signaller
- throw ex;
- }
- else { // thread was interrupted after it was notified
- Thread.currentThread().interrupt();
- return true;
- }
- }
- }
- }
-
- public synchronized void doWait(QueuedSync sync)
- throws InterruptedException
- {
- if (!sync.recheck(this)) {
- try {
- while (waiting) wait();
- }
- catch (InterruptedException ex) {
- if (waiting) { // no notification
- waiting = false; // invalidate for the signaller
- throw ex;
- }
- else { // thread was interrupted after it was notified
- Thread.currentThread().interrupt();
- return;
- }
- }
- }
- }
-
- public synchronized void doWaitUninterruptibly(QueuedSync sync) {
- if (!sync.recheck(this)) {
- boolean wasInterrupted = Thread.interrupted();
- try {
- while (waiting) {
- try {
- wait();
- }
- catch (InterruptedException ex) {
- wasInterrupted = true;
- // no need to notify; if we were signalled, we
- // must be not waiting, and we'll act like signalled
- }
- }
- }
- finally {
- if (wasInterrupted) Thread.currentThread().interrupt();
- }
- }
- }
- }
-}
-
diff --git a/src/actors/scala/actors/threadpool/locks/CondVar.java b/src/actors/scala/actors/threadpool/locks/CondVar.java
deleted file mode 100644
index 44df1c0b97..0000000000
--- a/src/actors/scala/actors/threadpool/locks/CondVar.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- File: ConditionVariable.java
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
- History:
- Date Who What
- 11Jun1998 dl Create public version
- */
-
-package scala.actors.threadpool.locks;
-
-import java.util.Collection;
-import java.util.Date;
-import scala.actors.threadpool.*;
-import scala.actors.threadpool.helpers.*;
-
-class CondVar implements Condition, java.io.Serializable {
- private static final long serialVersionUID = -5009898475638427940L;
-
- /** The lock **/
- protected final ExclusiveLock lock;
-
- /**
- * Create a new CondVar that relies on the given mutual
- * exclusion lock.
- * @param lock A non-reentrant mutual exclusion lock.
- **/
-
- CondVar(ExclusiveLock lock) {
- this.lock = lock;
- }
-
- public void awaitUninterruptibly() {
- int holdCount = lock.getHoldCount();
- if (holdCount == 0) {
- throw new IllegalMonitorStateException();
- }
- // avoid instant spurious wakeup if thread already interrupted
- boolean wasInterrupted = Thread.interrupted();
- try {
- synchronized (this) {
- for (int i=holdCount; i>0; i--) lock.unlock();
- try {
- wait();
- }
- catch (InterruptedException ex) {
- wasInterrupted = true;
- // may have masked the signal and there is no way
- // to tell; we must wake up spuriously
- }
- }
- }
- finally {
- for (int i=holdCount; i>0; i--) lock.lock();
- if (wasInterrupted) {
- Thread.currentThread().interrupt();
- }
- }
- }
-
- public void await() throws InterruptedException {
- int holdCount = lock.getHoldCount();
- if (holdCount == 0) {
- throw new IllegalMonitorStateException();
- }
- if (Thread.interrupted()) throw new InterruptedException();
- try {
- synchronized (this) {
- for (int i=holdCount; i>0; i--) lock.unlock();
- try {
- wait();
- }
- catch (InterruptedException ex) {
- notify();
- throw ex;
- }
- }
- }
- finally {
- for (int i=holdCount; i>0; i--) lock.lock();
- }
- }
-
- public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
- int holdCount = lock.getHoldCount();
- if (holdCount == 0) {
- throw new IllegalMonitorStateException();
- }
- if (Thread.interrupted()) throw new InterruptedException();
- long nanos = unit.toNanos(timeout);
- boolean success = false;
- try {
- synchronized (this) {
- for (int i=holdCount; i>0; i--) lock.unlock();
- try {
- if (nanos > 0) {
- long start = Utils.nanoTime();
- TimeUnit.NANOSECONDS.timedWait(this, nanos);
- // DK: due to coarse-grained (millis) clock, it seems
- // preferable to acknowledge timeout (success == false)
- // when the equality holds (timing is exact)
- success = Utils.nanoTime() - start < nanos;
- }
- }
- catch (InterruptedException ex) {
- notify();
- throw ex;
- }
- }
- }
- finally {
- for (int i=holdCount; i>0; i--) lock.lock();
- }
- return success;
- }
-
-// public long awaitNanos(long timeout) throws InterruptedException {
-// throw new UnsupportedOperationException();
-// }
-//
- public boolean awaitUntil(Date deadline) throws InterruptedException {
- if (deadline == null) throw new NullPointerException();
- int holdCount = lock.getHoldCount();
- if (holdCount == 0) {
- throw new IllegalMonitorStateException();
- }
- long abstime = deadline.getTime();
- if (Thread.interrupted()) throw new InterruptedException();
-
- boolean success = false;
- try {
- synchronized (this) {
- for (int i=holdCount; i>0; i--) lock.unlock();
- try {
- long start = System.currentTimeMillis();
- long msecs = abstime - start;
- if (msecs > 0) {
- wait(msecs);
- // DK: due to coarse-grained (millis) clock, it seems
- // preferable to acknowledge timeout (success == false)
- // when the equality holds (timing is exact)
- success = System.currentTimeMillis() - start < msecs;
- }
- }
- catch (InterruptedException ex) {
- notify();
- throw ex;
- }
- }
- }
- finally {
- for (int i=holdCount; i>0; i--) lock.lock();
- }
- return success;
- }
-
- public synchronized void signal() {
- if (!lock.isHeldByCurrentThread()) {
- throw new IllegalMonitorStateException();
- }
- notify();
- }
-
- public synchronized void signalAll() {
- if (!lock.isHeldByCurrentThread()) {
- throw new IllegalMonitorStateException();
- }
- notifyAll();
- }
-
- protected ExclusiveLock getLock() { return lock; }
-
- protected boolean hasWaiters() {
- throw new UnsupportedOperationException("Use FAIR version");
- }
-
- protected int getWaitQueueLength() {
- throw new UnsupportedOperationException("Use FAIR version");
- }
-
- protected Collection getWaitingThreads() {
- throw new UnsupportedOperationException("Use FAIR version");
- }
-
- static interface ExclusiveLock extends Lock {
- boolean isHeldByCurrentThread();
- int getHoldCount();
- }
-}
diff --git a/src/actors/scala/actors/threadpool/locks/Condition.java b/src/actors/scala/actors/threadpool/locks/Condition.java
deleted file mode 100644
index 0553684321..0000000000
--- a/src/actors/scala/actors/threadpool/locks/Condition.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool.locks;
-
-import scala.actors.threadpool.*;
-import java.util.Date;
-
-/**
- * {@code Condition} factors out the {@code Object} monitor
- * methods ({@link Object#wait() wait}, {@link Object#notify notify}
- * and {@link Object#notifyAll notifyAll}) into distinct objects to
- * give the effect of having multiple wait-sets per object, by
- * combining them with the use of arbitrary {@link Lock} implementations.
- * Where a {@code Lock} replaces the use of {@code synchronized} methods
- * and statements, a {@code Condition} replaces the use of the Object
- * monitor methods.
- *
- * <p>Conditions (also known as <em>condition queues</em> or
- * <em>condition variables</em>) provide a means for one thread to
- * suspend execution (to &quot;wait&quot;) until notified by another
- * thread that some state condition may now be true. Because access
- * to this shared state information occurs in different threads, it
- * must be protected, so a lock of some form is associated with the
- * condition. The key property that waiting for a condition provides
- * is that it <em>atomically</em> releases the associated lock and
- * suspends the current thread, just like {@code Object.wait}.
- *
- * <p>A {@code Condition} instance is intrinsically bound to a lock.
- * To obtain a {@code Condition} instance for a particular {@link Lock}
- * instance use its {@link Lock#newCondition newCondition()} method.
- *
- * <p>As an example, suppose we have a bounded buffer which supports
- * {@code put} and {@code take} methods. If a
- * {@code take} is attempted on an empty buffer, then the thread will block
- * until an item becomes available; if a {@code put} is attempted on a
- * full buffer, then the thread will block until a space becomes available.
- * We would like to keep waiting {@code put} threads and {@code take}
- * threads in separate wait-sets so that we can use the optimization of
- * only notifying a single thread at a time when items or spaces become
- * available in the buffer. This can be achieved using two
- * {@link Condition} instances.
- * <pre>
- * class BoundedBuffer {
- * <b>final Lock lock = new ReentrantLock();</b>
- * final Condition notFull = <b>lock.newCondition(); </b>
- * final Condition notEmpty = <b>lock.newCondition(); </b>
- *
- * final Object[] items = new Object[100];
- * int putptr, takeptr, count;
- *
- * public void put(Object x) throws InterruptedException {
- * <b>lock.lock();
- * try {</b>
- * while (count == items.length)
- * <b>notFull.await();</b>
- * items[putptr] = x;
- * if (++putptr == items.length) putptr = 0;
- * ++count;
- * <b>notEmpty.signal();</b>
- * <b>} finally {
- * lock.unlock();
- * }</b>
- * }
- *
- * public Object take() throws InterruptedException {
- * <b>lock.lock();
- * try {</b>
- * while (count == 0)
- * <b>notEmpty.await();</b>
- * Object x = items[takeptr];
- * if (++takeptr == items.length) takeptr = 0;
- * --count;
- * <b>notFull.signal();</b>
- * return x;
- * <b>} finally {
- * lock.unlock();
- * }</b>
- * }
- * }
- * </pre>
- *
- * (The {@link edu.emory.mathcs.backport.java.util.concurrent.ArrayBlockingQueue} class provides
- * this functionality, so there is no reason to implement this
- * sample usage class.)
- *
- * <p>A {@code Condition} implementation can provide behavior and semantics
- * that is
- * different from that of the {@code Object} monitor methods, such as
- * guaranteed ordering for notifications, or not requiring a lock to be held
- * when performing notifications.
- * If an implementation provides such specialized semantics then the
- * implementation must document those semantics.
- *
- * <p>Note that {@code Condition} instances are just normal objects and can
- * themselves be used as the target in a {@code synchronized} statement,
- * and can have their own monitor {@link Object#wait wait} and
- * {@link Object#notify notification} methods invoked.
- * Acquiring the monitor lock of a {@code Condition} instance, or using its
- * monitor methods, has no specified relationship with acquiring the
- * {@link Lock} associated with that {@code Condition} or the use of its
- * {@linkplain #await waiting} and {@linkplain #signal signalling} methods.
- * It is recommended that to avoid confusion you never use {@code Condition}
- * instances in this way, except perhaps within their own implementation.
- *
- * <p>Except where noted, passing a {@code null} value for any parameter
- * will result in a {@link NullPointerException} being thrown.
- *
- * <h3>Implementation Considerations</h3>
- *
- * <p>When waiting upon a {@code Condition}, a &quot;<em>spurious
- * wakeup</em>&quot; is permitted to occur, in
- * general, as a concession to the underlying platform semantics.
- * This has little practical impact on most application programs as a
- * {@code Condition} should always be waited upon in a loop, testing
- * the state predicate that is being waited for. An implementation is
- * free to remove the possibility of spurious wakeups but it is
- * recommended that applications programmers always assume that they can
- * occur and so always wait in a loop.
- *
- * <p>The three forms of condition waiting
- * (interruptible, non-interruptible, and timed) may differ in their ease of
- * implementation on some platforms and in their performance characteristics.
- * In particular, it may be difficult to provide these features and maintain
- * specific semantics such as ordering guarantees.
- * Further, the ability to interrupt the actual suspension of the thread may
- * not always be feasible to implement on all platforms.
- *
- * <p>Consequently, an implementation is not required to define exactly the
- * same guarantees or semantics for all three forms of waiting, nor is it
- * required to support interruption of the actual suspension of the thread.
- *
- * <p>An implementation is required to
- * clearly document the semantics and guarantees provided by each of the
- * waiting methods, and when an implementation does support interruption of
- * thread suspension then it must obey the interruption semantics as defined
- * in this interface.
- *
- * <p>As interruption generally implies cancellation, and checks for
- * interruption are often infrequent, an implementation can favor responding
- * to an interrupt over normal method return. This is true even if it can be
- * shown that the interrupt occurred after another action may have unblocked
- * the thread. An implementation should document this behavior.
- *
- * @since 1.5
- * @author Doug Lea
- */
-public interface Condition {
-
- /**
- * Causes the current thread to wait until it is signalled or
- * {@linkplain Thread#interrupt interrupted}.
- *
- * <p>The lock associated with this {@code Condition} is atomically
- * released and the current thread becomes disabled for thread scheduling
- * purposes and lies dormant until <em>one</em> of four things happens:
- * <ul>
- * <li>Some other thread invokes the {@link #signal} method for this
- * {@code Condition} and the current thread happens to be chosen as the
- * thread to be awakened; or
- * <li>Some other thread invokes the {@link #signalAll} method for this
- * {@code Condition}; or
- * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
- * current thread, and interruption of thread suspension is supported; or
- * <li>A &quot;<em>spurious wakeup</em>&quot; occurs.
- * </ul>
- *
- * <p>In all cases, before this method can return the current thread must
- * re-acquire the lock associated with this condition. When the
- * thread returns it is <em>guaranteed</em> to hold this lock.
- *
- * <p>If the current thread:
- * <ul>
- * <li>has its interrupted status set on entry to this method; or
- * <li>is {@linkplain Thread#interrupt interrupted} while waiting
- * and interruption of thread suspension is supported,
- * </ul>
- * then {@link InterruptedException} is thrown and the current thread's
- * interrupted status is cleared. It is not specified, in the first
- * case, whether or not the test for interruption occurs before the lock
- * is released.
- *
- * <p><b>Implementation Considerations</b>
- *
- * <p>The current thread is assumed to hold the lock associated with this
- * {@code Condition} when this method is called.
- * It is up to the implementation to determine if this is
- * the case and if not, how to respond. Typically, an exception will be
- * thrown (such as {@link IllegalMonitorStateException}) and the
- * implementation must document that fact.
- *
- * <p>An implementation can favor responding to an interrupt over normal
- * method return in response to a signal. In that case the implementation
- * must ensure that the signal is redirected to another waiting thread, if
- * there is one.
- *
- * @throws InterruptedException if the current thread is interrupted
- * (and interruption of thread suspension is supported)
- */
- void await() throws InterruptedException;
-
- /**
- * Causes the current thread to wait until it is signalled.
- *
- * <p>The lock associated with this condition is atomically
- * released and the current thread becomes disabled for thread scheduling
- * purposes and lies dormant until <em>one</em> of three things happens:
- * <ul>
- * <li>Some other thread invokes the {@link #signal} method for this
- * {@code Condition} and the current thread happens to be chosen as the
- * thread to be awakened; or
- * <li>Some other thread invokes the {@link #signalAll} method for this
- * {@code Condition}; or
- * <li>A &quot;<em>spurious wakeup</em>&quot; occurs.
- * </ul>
- *
- * <p>In all cases, before this method can return the current thread must
- * re-acquire the lock associated with this condition. When the
- * thread returns it is <em>guaranteed</em> to hold this lock.
- *
- * <p>If the current thread's interrupted status is set when it enters
- * this method, or it is {@linkplain Thread#interrupt interrupted}
- * while waiting, it will continue to wait until signalled. When it finally
- * returns from this method its interrupted status will still
- * be set.
- *
- * <p><b>Implementation Considerations</b>
- *
- * <p>The current thread is assumed to hold the lock associated with this
- * {@code Condition} when this method is called.
- * It is up to the implementation to determine if this is
- * the case and if not, how to respond. Typically, an exception will be
- * thrown (such as {@link IllegalMonitorStateException}) and the
- * implementation must document that fact.
- */
- void awaitUninterruptibly();
-
-// /**
-// * Causes the current thread to wait until it is signalled or interrupted,
-// * or the specified waiting time elapses.
-// *
-// * <p>The lock associated with this condition is atomically
-// * released and the current thread becomes disabled for thread scheduling
-// * purposes and lies dormant until <em>one</em> of five things happens:
-// * <ul>
-// * <li>Some other thread invokes the {@link #signal} method for this
-// * <tt>Condition</tt> and the current thread happens to be chosen as the
-// * thread to be awakened; or
-// * <li>Some other thread invokes the {@link #signalAll} method for this
-// * <tt>Condition</tt>; or
-// * <li>Some other thread {@link Thread#interrupt interrupts} the current
-// * thread, and interruption of thread suspension is supported; or
-// * <li>The specified waiting time elapses; or
-// * <li>A &quot;<em>spurious wakeup</em>&quot; occurs.
-// * </ul>
-// *
-// * <p>In all cases, before this method can return the current thread must
-// * re-acquire the lock associated with this condition. When the
-// * thread returns it is <em>guaranteed</em> to hold this lock.
-// *
-// * <p>If the current thread:
-// * <ul>
-// * <li>has its interrupted status set on entry to this method; or
-// * <li>is {@link Thread#interrupt interrupted} while waiting
-// * and interruption of thread suspension is supported,
-// * </ul>
-// * then {@link InterruptedException} is thrown and the current thread's
-// * interrupted status is cleared. It is not specified, in the first
-// * case, whether or not the test for interruption occurs before the lock
-// * is released.
-// *
-// * <p>The method returns an estimate of the number of nanoseconds
-// * remaining to wait given the supplied <tt>nanosTimeout</tt>
-// * value upon return, or a value less than or equal to zero if it
-// * timed out. This value can be used to determine whether and how
-// * long to re-wait in cases where the wait returns but an awaited
-// * condition still does not hold. Typical uses of this method take
-// * the following form:
-// *
-// * <pre>
-// * synchronized boolean aMethod(long timeout, TimeUnit unit) {
-// * long nanosTimeout = unit.toNanos(timeout);
-// * while (!conditionBeingWaitedFor) {
-// * if (nanosTimeout &gt; 0)
-// * nanosTimeout = theCondition.awaitNanos(nanosTimeout);
-// * else
-// * return false;
-// * }
-// * // ...
-// * }
-// * </pre>
-// *
-// * <p> Design note: This method requires a nanosecond argument so
-// * as to avoid truncation errors in reporting remaining times.
-// * Such precision loss would make it difficult for programmers to
-// * ensure that total waiting times are not systematically shorter
-// * than specified when re-waits occur.
-// *
-// * <p><b>Implementation Considerations</b>
-// * <p>The current thread is assumed to hold the lock associated with this
-// * <tt>Condition</tt> when this method is called.
-// * It is up to the implementation to determine if this is
-// * the case and if not, how to respond. Typically, an exception will be
-// * thrown (such as {@link IllegalMonitorStateException}) and the
-// * implementation must document that fact.
-// *
-// * <p>An implementation can favor responding to an interrupt over normal
-// * method return in response to a signal, or over indicating the elapse
-// * of the specified waiting time. In either case the implementation
-// * must ensure that the signal is redirected to another waiting thread, if
-// * there is one.
-// *
-// * @param nanosTimeout the maximum time to wait, in nanoseconds
-// * @return A value less than or equal to zero if the wait has
-// * timed out; otherwise an estimate, that
-// * is strictly less than the <tt>nanosTimeout</tt> argument,
-// * of the time still remaining when this method returned.
-// *
-// * @throws InterruptedException if the current thread is interrupted (and
-// * interruption of thread suspension is supported).
-// */
-// long awaitNanos(long nanosTimeout) throws InterruptedException;
-
- /**
- * Causes the current thread to wait until it is signalled or interrupted,
- * or the specified waiting time elapses. This method is behaviorally
- * equivalent to:<br>
- * <pre>
- * awaitNanos(unit.toNanos(time)) &gt; 0
- * </pre>
- * @param time the maximum time to wait
- * @param unit the time unit of the {@code time} argument
- * @return {@code false} if the waiting time detectably elapsed
- * before return from the method, else {@code true}
- * @throws InterruptedException if the current thread is interrupted
- * (and interruption of thread suspension is supported)
- */
- boolean await(long time, TimeUnit unit) throws InterruptedException;
-
- /**
- * Causes the current thread to wait until it is signalled or interrupted,
- * or the specified deadline elapses.
- *
- * <p>The lock associated with this condition is atomically
- * released and the current thread becomes disabled for thread scheduling
- * purposes and lies dormant until <em>one</em> of five things happens:
- * <ul>
- * <li>Some other thread invokes the {@link #signal} method for this
- * {@code Condition} and the current thread happens to be chosen as the
- * thread to be awakened; or
- * <li>Some other thread invokes the {@link #signalAll} method for this
- * {@code Condition}; or
- * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
- * current thread, and interruption of thread suspension is supported; or
- * <li>The specified deadline elapses; or
- * <li>A &quot;<em>spurious wakeup</em>&quot; occurs.
- * </ul>
- *
- * <p>In all cases, before this method can return the current thread must
- * re-acquire the lock associated with this condition. When the
- * thread returns it is <em>guaranteed</em> to hold this lock.
- *
- *
- * <p>If the current thread:
- * <ul>
- * <li>has its interrupted status set on entry to this method; or
- * <li>is {@linkplain Thread#interrupt interrupted} while waiting
- * and interruption of thread suspension is supported,
- * </ul>
- * then {@link InterruptedException} is thrown and the current thread's
- * interrupted status is cleared. It is not specified, in the first
- * case, whether or not the test for interruption occurs before the lock
- * is released.
- *
- *
- * <p>The return value indicates whether the deadline has elapsed,
- * which can be used as follows:
- * <pre>
- * synchronized boolean aMethod(Date deadline) {
- * boolean stillWaiting = true;
- * while (!conditionBeingWaitedFor) {
- * if (stillWaiting)
- * stillWaiting = theCondition.awaitUntil(deadline);
- * else
- * return false;
- * }
- * // ...
- * }
- * </pre>
- *
- * <p><b>Implementation Considerations</b>
- *
- * <p>The current thread is assumed to hold the lock associated with this
- * {@code Condition} when this method is called.
- * It is up to the implementation to determine if this is
- * the case and if not, how to respond. Typically, an exception will be
- * thrown (such as {@link IllegalMonitorStateException}) and the
- * implementation must document that fact.
- *
- * <p>An implementation can favor responding to an interrupt over normal
- * method return in response to a signal, or over indicating the passing
- * of the specified deadline. In either case the implementation
- * must ensure that the signal is redirected to another waiting thread, if
- * there is one.
- *
- * @param deadline the absolute time to wait until
- * @return {@code false} if the deadline has elapsed upon return, else
- * {@code true}
- * @throws InterruptedException if the current thread is interrupted
- * (and interruption of thread suspension is supported)
- */
- boolean awaitUntil(Date deadline) throws InterruptedException;
-
- /**
- * Wakes up one waiting thread.
- *
- * <p>If any threads are waiting on this condition then one
- * is selected for waking up. That thread must then re-acquire the
- * lock before returning from {@code await}.
- */
- void signal();
-
- /**
- * Wakes up all waiting threads.
- *
- * <p>If any threads are waiting on this condition then they are
- * all woken up. Each thread must re-acquire the lock before it can
- * return from {@code await}.
- */
- void signalAll();
-}
diff --git a/src/actors/scala/actors/threadpool/locks/FIFOCondVar.java b/src/actors/scala/actors/threadpool/locks/FIFOCondVar.java
deleted file mode 100644
index 144ac54d37..0000000000
--- a/src/actors/scala/actors/threadpool/locks/FIFOCondVar.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- File: ConditionVariable.java
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
- History:
- Date Who What
- 11Jun1998 dl Create public version
- */
-
-package scala.actors.threadpool.locks;
-
-import java.util.Collection;
-import java.util.Date;
-import scala.actors.threadpool.*;
-import scala.actors.threadpool.helpers.*;
-
-class FIFOCondVar extends CondVar implements Condition, java.io.Serializable {
- private static final long serialVersionUID = -497497271881010475L;
-
- private static final WaitQueue.QueuedSync sync = new WaitQueue.QueuedSync() {
- public boolean recheck(WaitQueue.WaitNode node) { return false; }
- public void takeOver(WaitQueue.WaitNode node) {}
- };
-
- // wait queue; only accessed when holding the lock
- private final WaitQueue wq = new FIFOWaitQueue();
-
- /**
- * Create a new CondVar that relies on the given mutual exclusion lock.
- * @param lock A non-reentrant mutual exclusion lock.
- */
- FIFOCondVar(ExclusiveLock lock) {
- super(lock);
- }
-
- public void awaitUninterruptibly() {
- int holdCount = lock.getHoldCount();
- if (holdCount == 0) {
- throw new IllegalMonitorStateException();
- }
- WaitQueue.WaitNode n = new WaitQueue.WaitNode();
- wq.insert(n);
- for (int i=holdCount; i>0; i--) lock.unlock();
- try {
- n.doWaitUninterruptibly(sync);
- }
- finally {
- for (int i=holdCount; i>0; i--) lock.lock();
- }
- }
-
- public void await() throws InterruptedException {
- int holdCount = lock.getHoldCount();
- if (holdCount == 0) {
- throw new IllegalMonitorStateException();
- }
- if (Thread.interrupted()) throw new InterruptedException();
- WaitQueue.WaitNode n = new WaitQueue.WaitNode();
- wq.insert(n);
- for (int i=holdCount; i>0; i--) lock.unlock();
- try {
- n.doWait(sync);
- }
- finally {
- for (int i=holdCount; i>0; i--) lock.lock();
- }
- }
-
- public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
- int holdCount = lock.getHoldCount();
- if (holdCount == 0) {
- throw new IllegalMonitorStateException();
- }
- if (Thread.interrupted()) throw new InterruptedException();
- long nanos = unit.toNanos(timeout);
- WaitQueue.WaitNode n = new WaitQueue.WaitNode();
- wq.insert(n);
- boolean success = false;
- for (int i=holdCount; i>0; i--) lock.unlock();
- try {
- success = n.doTimedWait(sync, nanos);
- }
- finally {
- for (int i=holdCount; i>0; i--) lock.lock();
- }
- return success;
- }
-
-// public long awaitNanos(long timeout) throws InterruptedException {
-// throw new UnsupportedOperationException();
-// }
-//
- public boolean awaitUntil(Date deadline) throws InterruptedException {
- if (deadline == null) throw new NullPointerException();
- long abstime = deadline.getTime();
- long start = System.currentTimeMillis();
- long msecs = abstime - start;
- return await(msecs, TimeUnit.MILLISECONDS);
- }
-
- public void signal() {
- if (!lock.isHeldByCurrentThread()) {
- throw new IllegalMonitorStateException();
- }
- for (;;) {
- WaitQueue.WaitNode w = wq.extract();
- if (w == null) return; // no one to signal
- if (w.signal(sync)) return; // notify if still waiting, else skip
- }
- }
-
- public void signalAll() {
- if (!lock.isHeldByCurrentThread()) {
- throw new IllegalMonitorStateException();
- }
- for (;;) {
- WaitQueue.WaitNode w = wq.extract();
- if (w == null) return; // no more to signal
- w.signal(sync);
- }
- }
-
- protected boolean hasWaiters() {
- if (!lock.isHeldByCurrentThread()) {
- throw new IllegalMonitorStateException();
- }
- return wq.hasNodes();
- }
-
- protected int getWaitQueueLength() {
- if (!lock.isHeldByCurrentThread()) {
- throw new IllegalMonitorStateException();
- }
- return wq.getLength();
- }
-
- protected Collection getWaitingThreads() {
- if (!lock.isHeldByCurrentThread()) {
- throw new IllegalMonitorStateException();
- }
- return wq.getWaitingThreads();
- }
-
-
-}
diff --git a/src/actors/scala/actors/threadpool/locks/Lock.java b/src/actors/scala/actors/threadpool/locks/Lock.java
deleted file mode 100644
index 47a4e8e777..0000000000
--- a/src/actors/scala/actors/threadpool/locks/Lock.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool.locks;
-
-import scala.actors.threadpool.TimeUnit;
-
-/**
- * {@code Lock} implementations provide more extensive locking
- * operations than can be obtained using {@code synchronized} methods
- * and statements. They allow more flexible structuring, may have
- * quite different properties, and may support multiple associated
- * {@link Condition} objects.
- *
- * <p>A lock is a tool for controlling access to a shared resource by
- * multiple threads. Commonly, a lock provides exclusive access to a
- * shared resource: only one thread at a time can acquire the lock and
- * all access to the shared resource requires that the lock be
- * acquired first. However, some locks may allow concurrent access to
- * a shared resource, such as the read lock of a {@link ReadWriteLock}.
- *
- * <p>The use of {@code synchronized} methods or statements provides
- * access to the implicit monitor lock associated with every object, but
- * forces all lock acquisition and release to occur in a block-structured way:
- * when multiple locks are acquired they must be released in the opposite
- * order, and all locks must be released in the same lexical scope in which
- * they were acquired.
- *
- * <p>While the scoping mechanism for {@code synchronized} methods
- * and statements makes it much easier to program with monitor locks,
- * and helps avoid many common programming errors involving locks,
- * there are occasions where you need to work with locks in a more
- * flexible way. For example, some algorithms for traversing
- * concurrently accessed data structures require the use of
- * &quot;hand-over-hand&quot; or &quot;chain locking&quot;: you
- * acquire the lock of node A, then node B, then release A and acquire
- * C, then release B and acquire D and so on. Implementations of the
- * {@code Lock} interface enable the use of such techniques by
- * allowing a lock to be acquired and released in different scopes,
- * and allowing multiple locks to be acquired and released in any
- * order.
- *
- * <p>With this increased flexibility comes additional
- * responsibility. The absence of block-structured locking removes the
- * automatic release of locks that occurs with {@code synchronized}
- * methods and statements. In most cases, the following idiom
- * should be used:
- *
- * <pre><tt> Lock l = ...;
- * l.lock();
- * try {
- * // access the resource protected by this lock
- * } finally {
- * l.unlock();
- * }
- * </tt></pre>
- *
- * When locking and unlocking occur in different scopes, care must be
- * taken to ensure that all code that is executed while the lock is
- * held is protected by try-finally or try-catch to ensure that the
- * lock is released when necessary.
- *
- * <p>{@code Lock} implementations provide additional functionality
- * over the use of {@code synchronized} methods and statements by
- * providing a non-blocking attempt to acquire a lock ({@link
- * #tryLock()}), an attempt to acquire the lock that can be
- * interrupted ({@link #lockInterruptibly}, and an attempt to acquire
- * the lock that can timeout ({@link #tryLock(long, TimeUnit)}).
- *
- * <p>A {@code Lock} class can also provide behavior and semantics
- * that is quite different from that of the implicit monitor lock,
- * such as guaranteed ordering, non-reentrant usage, or deadlock
- * detection. If an implementation provides such specialized semantics
- * then the implementation must document those semantics.
- *
- * <p>Note that {@code Lock} instances are just normal objects and can
- * themselves be used as the target in a {@code synchronized} statement.
- * Acquiring the
- * monitor lock of a {@code Lock} instance has no specified relationship
- * with invoking any of the {@link #lock} methods of that instance.
- * It is recommended that to avoid confusion you never use {@code Lock}
- * instances in this way, except within their own implementation.
- *
- * <p>Except where noted, passing a {@code null} value for any
- * parameter will result in a {@link NullPointerException} being
- * thrown.
- *
- * <h3>Memory Synchronization</h3>
- *
- * <p>All {@code Lock} implementations <em>must</em> enforce the same
- * memory synchronization semantics as provided by the built-in monitor
- * lock, as described in <a href="http://java.sun.com/docs/books/jls/">
- * The Java Language Specification, Third Edition (17.4 Memory Model)</a>:
- * <ul>
- * <li>A successful {@code lock} operation has the same memory
- * synchronization effects as a successful <em>Lock</em> action.
- * <li>A successful {@code unlock} operation has the same
- * memory synchronization effects as a successful <em>Unlock</em> action.
- * </ul>
- *
- * Unsuccessful locking and unlocking operations, and reentrant
- * locking/unlocking operations, do not require any memory
- * synchronization effects.
- *
- * <h3>Implementation Considerations</h3>
- *
- * <p> The three forms of lock acquisition (interruptible,
- * non-interruptible, and timed) may differ in their performance
- * characteristics, ordering guarantees, or other implementation
- * qualities. Further, the ability to interrupt the <em>ongoing</em>
- * acquisition of a lock may not be available in a given {@code Lock}
- * class. Consequently, an implementation is not required to define
- * exactly the same guarantees or semantics for all three forms of
- * lock acquisition, nor is it required to support interruption of an
- * ongoing lock acquisition. An implementation is required to clearly
- * document the semantics and guarantees provided by each of the
- * locking methods. It must also obey the interruption semantics as
- * defined in this interface, to the extent that interruption of lock
- * acquisition is supported: which is either totally, or only on
- * method entry.
- *
- * <p>As interruption generally implies cancellation, and checks for
- * interruption are often infrequent, an implementation can favor responding
- * to an interrupt over normal method return. This is true even if it can be
- * shown that the interrupt occurred after another action may have unblocked
- * the thread. An implementation should document this behavior.
- *
- * @see ReentrantLock
- * @see Condition
- * @see ReadWriteLock
- *
- * @since 1.5
- * @author Doug Lea
- */
-public interface Lock {
-
- /**
- * Acquires the lock.
- *
- * <p>If the lock is not available then the current thread becomes
- * disabled for thread scheduling purposes and lies dormant until the
- * lock has been acquired.
- *
- * <p><b>Implementation Considerations</b>
- *
- * <p>A {@code Lock} implementation may be able to detect erroneous use
- * of the lock, such as an invocation that would cause deadlock, and
- * may throw an (unchecked) exception in such circumstances. The
- * circumstances and the exception type must be documented by that
- * {@code Lock} implementation.
- */
- void lock();
-
- /**
- * Acquires the lock unless the current thread is
- * {@linkplain Thread#interrupt interrupted}.
- *
- * <p>Acquires the lock if it is available and returns immediately.
- *
- * <p>If the lock is not available then the current thread becomes
- * disabled for thread scheduling purposes and lies dormant until
- * one of two things happens:
- *
- * <ul>
- * <li>The lock is acquired by the current thread; or
- * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
- * current thread, and interruption of lock acquisition is supported.
- * </ul>
- *
- * <p>If the current thread:
- * <ul>
- * <li>has its interrupted status set on entry to this method; or
- * <li>is {@linkplain Thread#interrupt interrupted} while acquiring the
- * lock, and interruption of lock acquisition is supported,
- * </ul>
- * then {@link InterruptedException} is thrown and the current thread's
- * interrupted status is cleared.
- *
- * <p><b>Implementation Considerations</b>
- *
- * <p>The ability to interrupt a lock acquisition in some
- * implementations may not be possible, and if possible may be an
- * expensive operation. The programmer should be aware that this
- * may be the case. An implementation should document when this is
- * the case.
- *
- * <p>An implementation can favor responding to an interrupt over
- * normal method return.
- *
- * <p>A {@code Lock} implementation may be able to detect
- * erroneous use of the lock, such as an invocation that would
- * cause deadlock, and may throw an (unchecked) exception in such
- * circumstances. The circumstances and the exception type must
- * be documented by that {@code Lock} implementation.
- *
- * @throws InterruptedException if the current thread is
- * interrupted while acquiring the lock (and interruption
- * of lock acquisition is supported).
- */
- void lockInterruptibly() throws InterruptedException;
-
- /**
- * Acquires the lock only if it is free at the time of invocation.
- *
- * <p>Acquires the lock if it is available and returns immediately
- * with the value {@code true}.
- * If the lock is not available then this method will return
- * immediately with the value {@code false}.
- *
- * <p>A typical usage idiom for this method would be:
- * <pre>
- * Lock lock = ...;
- * if (lock.tryLock()) {
- * try {
- * // manipulate protected state
- * } finally {
- * lock.unlock();
- * }
- * } else {
- * // perform alternative actions
- * }
- * </pre>
- * This usage ensures that the lock is unlocked if it was acquired, and
- * doesn't try to unlock if the lock was not acquired.
- *
- * @return {@code true} if the lock was acquired and
- * {@code false} otherwise
- */
- boolean tryLock();
-
- /**
- * Acquires the lock if it is free within the given waiting time and the
- * current thread has not been {@linkplain Thread#interrupt interrupted}.
- *
- * <p>If the lock is available this method returns immediately
- * with the value {@code true}.
- * If the lock is not available then
- * the current thread becomes disabled for thread scheduling
- * purposes and lies dormant until one of three things happens:
- * <ul>
- * <li>The lock is acquired by the current thread; or
- * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
- * current thread, and interruption of lock acquisition is supported; or
- * <li>The specified waiting time elapses
- * </ul>
- *
- * <p>If the lock is acquired then the value {@code true} is returned.
- *
- * <p>If the current thread:
- * <ul>
- * <li>has its interrupted status set on entry to this method; or
- * <li>is {@linkplain Thread#interrupt interrupted} while acquiring
- * the lock, and interruption of lock acquisition is supported,
- * </ul>
- * then {@link InterruptedException} is thrown and the current thread's
- * interrupted status is cleared.
- *
- * <p>If the specified waiting time elapses then the value {@code false}
- * is returned.
- * If the time is
- * less than or equal to zero, the method will not wait at all.
- *
- * <p><b>Implementation Considerations</b>
- *
- * <p>The ability to interrupt a lock acquisition in some implementations
- * may not be possible, and if possible may
- * be an expensive operation.
- * The programmer should be aware that this may be the case. An
- * implementation should document when this is the case.
- *
- * <p>An implementation can favor responding to an interrupt over normal
- * method return, or reporting a timeout.
- *
- * <p>A {@code Lock} implementation may be able to detect
- * erroneous use of the lock, such as an invocation that would cause
- * deadlock, and may throw an (unchecked) exception in such circumstances.
- * The circumstances and the exception type must be documented by that
- * {@code Lock} implementation.
- *
- * @param time the maximum time to wait for the lock
- * @param unit the time unit of the {@code time} argument
- * @return {@code true} if the lock was acquired and {@code false}
- * if the waiting time elapsed before the lock was acquired
- *
- * @throws InterruptedException if the current thread is interrupted
- * while acquiring the lock (and interruption of lock
- * acquisition is supported)
- */
- boolean tryLock(long time, TimeUnit unit) throws InterruptedException;
-
- /**
- * Releases the lock.
- *
- * <p><b>Implementation Considerations</b>
- *
- * <p>A {@code Lock} implementation will usually impose
- * restrictions on which thread can release a lock (typically only the
- * holder of the lock can release it) and may throw
- * an (unchecked) exception if the restriction is violated.
- * Any restrictions and the exception
- * type must be documented by that {@code Lock} implementation.
- */
- void unlock();
-
- /**
- * Returns a new {@link Condition} instance that is bound to this
- * {@code Lock} instance.
- *
- * <p>Before waiting on the condition the lock must be held by the
- * current thread.
- * A call to {@link Condition#await()} will atomically release the lock
- * before waiting and re-acquire the lock before the wait returns.
- *
- * <p><b>Implementation Considerations</b>
- *
- * <p>The exact operation of the {@link Condition} instance depends on
- * the {@code Lock} implementation and must be documented by that
- * implementation.
- *
- * @return A new {@link Condition} instance for this {@code Lock} instance
- * @throws UnsupportedOperationException if this {@code Lock}
- * implementation does not support conditions
- */
- Condition newCondition();
-}
diff --git a/src/actors/scala/actors/threadpool/locks/ReadWriteLock.java b/src/actors/scala/actors/threadpool/locks/ReadWriteLock.java
deleted file mode 100644
index 02983f9bd4..0000000000
--- a/src/actors/scala/actors/threadpool/locks/ReadWriteLock.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool.locks;
-
-/**
- * A <tt>ReadWriteLock</tt> maintains a pair of associated {@link
- * Lock locks}, one for read-only operations and one for writing.
- * The {@link #readLock read lock} may be held simultaneously by
- * multiple reader threads, so long as there are no writers. The
- * {@link #writeLock write lock} is exclusive.
- *
- * <p>All <tt>ReadWriteLock</tt> implementations must guarantee that
- * the memory synchronization effects of <tt>writeLock</tt> operations
- * (as specified in the {@link Lock} interface) also hold with respect
- * to the associated <tt>readLock</tt>. That is, a thread successfully
- * acquiring the read lock will see all updates made upon previous
- * release of the write lock.
- *
- * <p>A read-write lock allows for a greater level of concurrency in
- * accessing shared data than that permitted by a mutual exclusion lock.
- * It exploits the fact that while only a single thread at a time (a
- * <em>writer</em> thread) can modify the shared data, in many cases any
- * number of threads can concurrently read the data (hence <em>reader</em>
- * threads).
- * In theory, the increase in concurrency permitted by the use of a read-write
- * lock will lead to performance improvements over the use of a mutual
- * exclusion lock. In practice this increase in concurrency will only be fully
- * realized on a multi-processor, and then only if the access patterns for
- * the shared data are suitable.
- *
- * <p>Whether or not a read-write lock will improve performance over the use
- * of a mutual exclusion lock depends on the frequency that the data is
- * read compared to being modified, the duration of the read and write
- * operations, and the contention for the data - that is, the number of
- * threads that will try to read or write the data at the same time.
- * For example, a collection that is initially populated with data and
- * thereafter infrequently modified, while being frequently searched
- * (such as a directory of some kind) is an ideal candidate for the use of
- * a read-write lock. However, if updates become frequent then the data
- * spends most of its time being exclusively locked and there is little, if any
- * increase in concurrency. Further, if the read operations are too short
- * the overhead of the read-write lock implementation (which is inherently
- * more complex than a mutual exclusion lock) can dominate the execution
- * cost, particularly as many read-write lock implementations still serialize
- * all threads through a small section of code. Ultimately, only profiling
- * and measurement will establish whether the use of a read-write lock is
- * suitable for your application.
- *
- *
- * <p>Although the basic operation of a read-write lock is straight-forward,
- * there are many policy decisions that an implementation must make, which
- * may affect the effectiveness of the read-write lock in a given application.
- * Examples of these policies include:
- * <ul>
- * <li>Determining whether to grant the read lock or the write lock, when
- * both readers and writers are waiting, at the time that a writer releases
- * the write lock. Writer preference is common, as writes are expected to be
- * short and infrequent. Reader preference is less common as it can lead to
- * lengthy delays for a write if the readers are frequent and long-lived as
- * expected. Fair, or &quot;in-order&quot; implementations are also possible.
- *
- * <li>Determining whether readers that request the read lock while a
- * reader is active and a writer is waiting, are granted the read lock.
- * Preference to the reader can delay the writer indefinitely, while
- * preference to the writer can reduce the potential for concurrency.
- *
- * <li>Determining whether the locks are reentrant: can a thread with the
- * write lock reacquire it? Can it acquire a read lock while holding the
- * write lock? Is the read lock itself reentrant?
- *
- * <li>Can the write lock be downgraded to a read lock without allowing
- * an intervening writer? Can a read lock be upgraded to a write lock,
- * in preference to other waiting readers or writers?
- *
- * </ul>
- * You should consider all of these things when evaluating the suitability
- * of a given implementation for your application.
- *
- * @see ReentrantReadWriteLock
- * @see Lock
- * @see ReentrantLock
- *
- * @since 1.5
- * @author Doug Lea
- */
-public interface ReadWriteLock {
- /**
- * Returns the lock used for reading.
- *
- * @return the lock used for reading.
- */
- Lock readLock();
-
- /**
- * Returns the lock used for writing.
- *
- * @return the lock used for writing.
- */
- Lock writeLock();
-}
diff --git a/src/actors/scala/actors/threadpool/locks/ReentrantLock.java b/src/actors/scala/actors/threadpool/locks/ReentrantLock.java
deleted file mode 100644
index b42ddd611b..0000000000
--- a/src/actors/scala/actors/threadpool/locks/ReentrantLock.java
+++ /dev/null
@@ -1,959 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool.locks;
-
-import java.util.Collection;
-import scala.actors.threadpool.*;
-import scala.actors.threadpool.helpers.*;
-
-/**
- * A reentrant mutual exclusion {@link Lock} with the same basic
- * behavior and semantics as the implicit monitor lock accessed using
- * {@code synchronized} methods and statements, but with extended
- * capabilities.
- *
- * <p>A {@code ReentrantLock} is <em>owned</em> by the thread last
- * successfully locking, but not yet unlocking it. A thread invoking
- * {@code lock} will return, successfully acquiring the lock, when
- * the lock is not owned by another thread. The method will return
- * immediately if the current thread already owns the lock. This can
- * be checked using methods {@link #isHeldByCurrentThread}, and {@link
- * #getHoldCount}.
- *
- * <p>The constructor for this class accepts an optional
- * <em>fairness</em> parameter. When set {@code true}, under
- * contention, locks favor granting access to the longest-waiting
- * thread. Otherwise this lock does not guarantee any particular
- * access order. Programs using fair locks accessed by many threads
- * may display lower overall throughput (i.e., are slower; often much
- * slower) than those using the default setting, but have smaller
- * variances in times to obtain locks and guarantee lack of
- * starvation. Note however, that fairness of locks does not guarantee
- * fairness of thread scheduling. Thus, one of many threads using a
- * fair lock may obtain it multiple times in succession while other
- * active threads are not progressing and not currently holding the
- * lock.
- * Also note that the untimed {@link #tryLock() tryLock} method does not
- * honor the fairness setting. It will succeed if the lock
- * is available even if other threads are waiting.
- *
- * <p>It is recommended practice to <em>always</em> immediately
- * follow a call to {@code lock} with a {@code try} block, most
- * typically in a before/after construction such as:
- *
- * <pre>
- * class X {
- * private final ReentrantLock lock = new ReentrantLock();
- * // ...
- *
- * public void m() {
- * lock.lock(); // block until condition holds
- * try {
- * // ... method body
- * } finally {
- * lock.unlock()
- * }
- * }
- * }
- * </pre>
- *
- * <p>In addition to implementing the {@link Lock} interface, this
- * class defines methods {@code isLocked} and
- * {@code getLockQueueLength}, as well as some associated
- * {@code protected} access methods that may be useful for
- * instrumentation and monitoring.
- *
- * <p>Serialization of this class behaves in the same way as built-in
- * locks: a deserialized lock is in the unlocked state, regardless of
- * its state when serialized.
- *
- * <p>This lock supports a maximum of 2147483647 recursive locks by
- * the same thread. Attempts to exceed this limit result in
- * {@link Error} throws from locking methods.
- *
- * @since 1.5
- * @author Doug Lea
- * @author Dawid Kurzyniec
- */
-public class ReentrantLock implements Lock, java.io.Serializable,
- CondVar.ExclusiveLock {
- private static final long serialVersionUID = 7373984872572414699L;
-
- private final Sync sync;
-
- /**
- * Base of synchronization control for this lock. Subclassed
- * into fair and nonfair versions below.
- */
- static abstract class Sync implements java.io.Serializable {
- private static final long serialVersionUID = -5179523762034025860L;
-
- protected transient Thread owner_ = null;
- protected transient int holds_ = 0;
-
- protected Sync() {}
-
- /**
- * Performs {@link Lock#lock}. The main reason for subclassing
- * is to allow fast path for nonfair version.
- */
- public abstract void lock();
-
- public abstract void lockInterruptibly() throws InterruptedException;
-
- final void incHolds() {
- int nextHolds = ++holds_;
- if (nextHolds < 0)
- throw new Error("Maximum lock count exceeded");
- holds_ = nextHolds;
- }
-
- public boolean tryLock() {
- Thread caller = Thread.currentThread();
- synchronized (this) {
- if (owner_ == null) {
- owner_ = caller;
- holds_ = 1;
- return true;
- }
- else if (caller == owner_) {
- incHolds();
- return true;
- }
- }
- return false;
- }
-
- public abstract boolean tryLock(long nanos) throws InterruptedException;
-
- public abstract void unlock();
-
- public synchronized int getHoldCount() {
- return isHeldByCurrentThread() ? holds_ : 0;
- }
-
- public synchronized boolean isHeldByCurrentThread() {
- return holds_ > 0 && Thread.currentThread() == owner_;
- }
-
- public synchronized boolean isLocked() {
- return owner_ != null;
- }
-
- public abstract boolean isFair();
-
- protected synchronized Thread getOwner() {
- return owner_;
- }
-
- public boolean hasQueuedThreads() {
- throw new UnsupportedOperationException("Use FAIR version");
- }
-
- public int getQueueLength() {
- throw new UnsupportedOperationException("Use FAIR version");
- }
-
- public Collection getQueuedThreads() {
- throw new UnsupportedOperationException("Use FAIR version");
- }
-
- public boolean isQueued(Thread thread) {
- throw new UnsupportedOperationException("Use FAIR version");
- }
- }
-
- /**
- * Sync object for non-fair locks
- */
- final static class NonfairSync extends Sync {
- private static final long serialVersionUID = 7316153563782823691L;
-
- NonfairSync() {}
-
- /**
- * Performs lock. Try immediate barge, backing up to normal
- * acquire on failure.
- */
- public void lock() {
- Thread caller = Thread.currentThread();
- synchronized (this) {
- if (owner_ == null) {
- owner_ = caller;
- holds_ = 1;
- return;
- }
- else if (caller == owner_) {
- incHolds();
- return;
- }
- else {
- boolean wasInterrupted = Thread.interrupted();
- try {
- while (true) {
- try {
- wait();
- }
- catch (InterruptedException e) {
- wasInterrupted = true;
- // no need to notify; if we were signalled, we
- // will act as signalled, ignoring the
- // interruption
- }
- if (owner_ == null) {
- owner_ = caller;
- holds_ = 1;
- return;
- }
- }
- }
- finally {
- if (wasInterrupted) Thread.currentThread().interrupt();
- }
- }
- }
- }
-
- public void lockInterruptibly() throws InterruptedException {
- if (Thread.interrupted()) throw new InterruptedException();
- Thread caller = Thread.currentThread();
- synchronized (this) {
- if (owner_ == null) {
- owner_ = caller;
- holds_ = 1;
- return;
- }
- else if (caller == owner_) {
- incHolds();
- return;
- }
- else {
- try {
- do { wait(); } while (owner_ != null);
- owner_ = caller;
- holds_ = 1;
- return;
- }
- catch (InterruptedException ex) {
- if (owner_ == null) notify();
- throw ex;
- }
- }
- }
- }
-
- public boolean tryLock(long nanos) throws InterruptedException {
- if (Thread.interrupted()) throw new InterruptedException();
- Thread caller = Thread.currentThread();
-
- synchronized (this) {
- if (owner_ == null) {
- owner_ = caller;
- holds_ = 1;
- return true;
- }
- else if (caller == owner_) {
- incHolds();
- return true;
- }
- else if (nanos <= 0)
- return false;
- else {
- long deadline = Utils.nanoTime() + nanos;
- try {
- for (; ; ) {
- TimeUnit.NANOSECONDS.timedWait(this, nanos);
- if (caller == owner_) {
- incHolds();
- return true;
- }
- else if (owner_ == null) {
- owner_ = caller;
- holds_ = 1;
- return true;
- }
- else {
- nanos = deadline - Utils.nanoTime();
- if (nanos <= 0)
- return false;
- }
- }
- }
- catch (InterruptedException ex) {
- if (owner_ == null) notify();
- throw ex;
- }
- }
- }
- }
-
- public synchronized void unlock() {
- if (Thread.currentThread() != owner_)
- throw new IllegalMonitorStateException("Not owner");
-
- if (--holds_ == 0) {
- owner_ = null;
- notify();
- }
- }
-
- public final boolean isFair() {
- return false;
- }
- }
-
- /**
- * Sync object for fair locks
- */
- final static class FairSync extends Sync implements WaitQueue.QueuedSync {
- private static final long serialVersionUID = -3000897897090466540L;
-
- private transient WaitQueue wq_ = new FIFOWaitQueue();
-
- FairSync() {}
-
- public synchronized boolean recheck(WaitQueue.WaitNode node) {
- Thread caller = Thread.currentThread();
- if (owner_ == null) {
- owner_ = caller;
- holds_ = 1;
- return true;
- }
- else if (caller == owner_) {
- incHolds();
- return true;
- }
- wq_.insert(node);
- return false;
- }
-
- public synchronized void takeOver(WaitQueue.WaitNode node) {
- // assert (holds_ == 1 && owner_ == Thread.currentThread()
- owner_ = node.getOwner();
- }
-
- public void lock() {
- Thread caller = Thread.currentThread();
- synchronized (this) {
- if (owner_ == null) {
- owner_ = caller;
- holds_ = 1;
- return;
- }
- else if (caller == owner_) {
- incHolds();
- return;
- }
- }
- WaitQueue.WaitNode n = new WaitQueue.WaitNode();
- n.doWaitUninterruptibly(this);
- }
-
- public void lockInterruptibly() throws InterruptedException {
- if (Thread.interrupted()) throw new InterruptedException();
- Thread caller = Thread.currentThread();
- synchronized (this) {
- if (owner_ == null) {
- owner_ = caller;
- holds_ = 1;
- return;
- }
- else if (caller == owner_) {
- incHolds();
- return;
- }
- }
- WaitQueue.WaitNode n = new WaitQueue.WaitNode();
- n.doWait(this);
- }
-
- public boolean tryLock(long nanos) throws InterruptedException {
- if (Thread.interrupted()) throw new InterruptedException();
- Thread caller = Thread.currentThread();
- synchronized (this) {
- if (owner_ == null) {
- owner_ = caller;
- holds_ = 1;
- return true;
- }
- else if (caller == owner_) {
- incHolds();
- return true;
- }
- }
- WaitQueue.WaitNode n = new WaitQueue.WaitNode();
- return n.doTimedWait(this, nanos);
- }
-
- protected synchronized WaitQueue.WaitNode getSignallee(Thread caller) {
- if (caller != owner_)
- throw new IllegalMonitorStateException("Not owner");
- // assert (holds_ > 0)
- if (holds_ >= 2) { // current thread will keep the lock
- --holds_;
- return null;
- }
- // assert (holds_ == 1)
- WaitQueue.WaitNode w = wq_.extract();
- if (w == null) { // if none, clear for new arrivals
- owner_ = null;
- holds_ = 0;
- }
- return w;
- }
-
- public void unlock() {
- Thread caller = Thread.currentThread();
- for (;;) {
- WaitQueue.WaitNode w = getSignallee(caller);
- if (w == null) return; // no one to signal
- if (w.signal(this)) return; // notify if still waiting, else skip
- }
- }
-
- public final boolean isFair() {
- return true;
- }
-
- public synchronized boolean hasQueuedThreads() {
- return wq_.hasNodes();
- }
-
- public synchronized int getQueueLength() {
- return wq_.getLength();
- }
-
- public synchronized Collection getQueuedThreads() {
- return wq_.getWaitingThreads();
- }
-
- public synchronized boolean isQueued(Thread thread) {
- return wq_.isWaiting(thread);
- }
-
- private void readObject(java.io.ObjectInputStream in)
- throws java.io.IOException, ClassNotFoundException {
- in.defaultReadObject();
- synchronized (this) {
- wq_ = new FIFOWaitQueue();
- }
- }
- }
-
- /**
- * Creates an instance of {@code ReentrantLock}.
- * This is equivalent to using {@code ReentrantLock(false)}.
- */
- public ReentrantLock() {
- sync = new NonfairSync();
- }
-
- /**
- * Creates an instance of {@code ReentrantLock} with the
- * given fairness policy.
- *
- * @param fair {@code true} if this lock should use a fair ordering policy
- */
- public ReentrantLock(boolean fair) {
- sync = (fair)? (Sync)new FairSync() : new NonfairSync();
- }
-
-
- /**
- * Acquires the lock.
- *
- * <p>Acquires the lock if it is not held by another thread and returns
- * immediately, setting the lock hold count to one.
- *
- * <p>If the current thread already holds the lock then the hold
- * count is incremented by one and the method returns immediately.
- *
- * <p>If the lock is held by another thread then the
- * current thread becomes disabled for thread scheduling
- * purposes and lies dormant until the lock has been acquired,
- * at which time the lock hold count is set to one.
- */
- public void lock() {
- sync.lock();
- }
-
- /**
- * Acquires the lock unless the current thread is
- * {@linkplain Thread#interrupt interrupted}.
- *
- * <p>Acquires the lock if it is not held by another thread and returns
- * immediately, setting the lock hold count to one.
- *
- * <p>If the current thread already holds this lock then the hold count
- * is incremented by one and the method returns immediately.
- *
- * <p>If the lock is held by another thread then the
- * current thread becomes disabled for thread scheduling
- * purposes and lies dormant until one of two things happens:
- *
- * <ul>
- *
- * <li>The lock is acquired by the current thread; or
- *
- * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
- * current thread.
- *
- * </ul>
- *
- * <p>If the lock is acquired by the current thread then the lock hold
- * count is set to one.
- *
- * <p>If the current thread:
- *
- * <ul>
- *
- * <li>has its interrupted status set on entry to this method; or
- *
- * <li>is {@linkplain Thread#interrupt interrupted} while acquiring
- * the lock,
- *
- * </ul>
- *
- * then {@link InterruptedException} is thrown and the current thread's
- * interrupted status is cleared.
- *
- * <p>In this implementation, as this method is an explicit
- * interruption point, preference is given to responding to the
- * interrupt over normal or reentrant acquisition of the lock.
- *
- * @throws InterruptedException if the current thread is interrupted
- */
- public void lockInterruptibly() throws InterruptedException {
- sync.lockInterruptibly();
- }
-
- /**
- * Acquires the lock only if it is not held by another thread at the time
- * of invocation.
- *
- * <p>Acquires the lock if it is not held by another thread and
- * returns immediately with the value {@code true}, setting the
- * lock hold count to one. Even when this lock has been set to use a
- * fair ordering policy, a call to {@code tryLock()} <em>will</em>
- * immediately acquire the lock if it is available, whether or not
- * other threads are currently waiting for the lock.
- * This &quot;barging&quot; behavior can be useful in certain
- * circumstances, even though it breaks fairness. If you want to honor
- * the fairness setting for this lock, then use
- * {@link #tryLock(long, TimeUnit) tryLock(0, TimeUnit.SECONDS) }
- * which is almost equivalent (it also detects interruption).
- *
- * <p> If the current thread already holds this lock then the hold
- * count is incremented by one and the method returns {@code true}.
- *
- * <p>If the lock is held by another thread then this method will return
- * immediately with the value {@code false}.
- *
- * @return {@code true} if the lock was free and was acquired by the
- * current thread, or the lock was already held by the current
- * thread; and {@code false} otherwise
- */
- public boolean tryLock() {
- return sync.tryLock();
- }
-
- /**
- * Acquires the lock if it is not held by another thread within the given
- * waiting time and the current thread has not been
- * {@linkplain Thread#interrupt interrupted}.
- *
- * <p>Acquires the lock if it is not held by another thread and returns
- * immediately with the value {@code true}, setting the lock hold count
- * to one. If this lock has been set to use a fair ordering policy then
- * an available lock <em>will not</em> be acquired if any other threads
- * are waiting for the lock. This is in contrast to the {@link #tryLock()}
- * method. If you want a timed {@code tryLock} that does permit barging on
- * a fair lock then combine the timed and un-timed forms together:
- *
- * <pre>if (lock.tryLock() || lock.tryLock(timeout, unit) ) { ... }
- * </pre>
- *
- * <p>If the current thread
- * already holds this lock then the hold count is incremented by one and
- * the method returns {@code true}.
- *
- * <p>If the lock is held by another thread then the
- * current thread becomes disabled for thread scheduling
- * purposes and lies dormant until one of three things happens:
- *
- * <ul>
- *
- * <li>The lock is acquired by the current thread; or
- *
- * <li>Some other thread {@linkplain Thread#interrupt interrupts}
- * the current thread; or
- *
- * <li>The specified waiting time elapses
- *
- * </ul>
- *
- * <p>If the lock is acquired then the value {@code true} is returned and
- * the lock hold count is set to one.
- *
- * <p>If the current thread:
- *
- * <ul>
- *
- * <li>has its interrupted status set on entry to this method; or
- *
- * <li>is {@linkplain Thread#interrupt interrupted} while
- * acquiring the lock,
- *
- * </ul>
- * then {@link InterruptedException} is thrown and the current thread's
- * interrupted status is cleared.
- *
- * <p>If the specified waiting time elapses then the value {@code false}
- * is returned. If the time is less than or equal to zero, the method
- * will not wait at all.
- *
- * <p>In this implementation, as this method is an explicit
- * interruption point, preference is given to responding to the
- * interrupt over normal or reentrant acquisition of the lock, and
- * over reporting the elapse of the waiting time.
- *
- * @param timeout the time to wait for the lock
- * @param unit the time unit of the timeout argument
- * @return {@code true} if the lock was free and was acquired by the
- * current thread, or the lock was already held by the current
- * thread; and {@code false} if the waiting time elapsed before
- * the lock could be acquired
- * @throws InterruptedException if the current thread is interrupted
- * @throws NullPointerException if the time unit is null
- *
- */
- public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException {
- return sync.tryLock(unit.toNanos(timeout));
- }
-
- /**
- * Attempts to release this lock.
- *
- * <p>If the current thread is the holder of this lock then the hold
- * count is decremented. If the hold count is now zero then the lock
- * is released. If the current thread is not the holder of this
- * lock then {@link IllegalMonitorStateException} is thrown.
- *
- * @throws IllegalMonitorStateException if the current thread does not
- * hold this lock
- */
- public void unlock() {
- sync.unlock();
- }
-
- /**
- * Returns a {@link Condition} instance for use with this
- * {@link Lock} instance.
- *
- * <p>The returned {@link Condition} instance supports the same
- * usages as do the {@link Object} monitor methods ({@link
- * Object#wait() wait}, {@link Object#notify notify}, and {@link
- * Object#notifyAll notifyAll}) when used with the built-in
- * monitor lock.
- *
- * <ul>
- *
- * <li>If this lock is not held when any of the {@link Condition}
- * {@linkplain Condition#await() waiting} or {@linkplain
- * Condition#signal signalling} methods are called, then an {@link
- * IllegalMonitorStateException} is thrown.
- *
- * <li>When the condition {@linkplain Condition#await() waiting}
- * methods are called the lock is released and, before they
- * return, the lock is reacquired and the lock hold count restored
- * to what it was when the method was called.
- *
- * <li>If a thread is {@linkplain Thread#interrupt interrupted}
- * while waiting then the wait will terminate, an {@link
- * InterruptedException} will be thrown, and the thread's
- * interrupted status will be cleared.
- *
- * <li> Waiting threads are signalled in FIFO order.
- *
- * <li>The ordering of lock reacquisition for threads returning
- * from waiting methods is the same as for threads initially
- * acquiring the lock, which is in the default case not specified,
- * but for <em>fair</em> locks favors those threads that have been
- * waiting the longest.
- *
- * </ul>
- *
- * @return the Condition object
- */
- public Condition newCondition() {
- return isFair() ? (Condition)new FIFOCondVar(this) : new CondVar(this);
- }
-
- /**
- * Queries the number of holds on this lock by the current thread.
- *
- * <p>A thread has a hold on a lock for each lock action that is not
- * matched by an unlock action.
- *
- * <p>The hold count information is typically only used for testing and
- * debugging purposes. For example, if a certain section of code should
- * not be entered with the lock already held then we can assert that
- * fact:
- *
- * <pre>
- * class X {
- * ReentrantLock lock = new ReentrantLock();
- * // ...
- * public void m() {
- * assert lock.getHoldCount() == 0;
- * lock.lock();
- * try {
- * // ... method body
- * } finally {
- * lock.unlock();
- * }
- * }
- * }
- * </pre>
- *
- * @return the number of holds on this lock by the current thread,
- * or zero if this lock is not held by the current thread
- */
- public int getHoldCount() {
- return sync.getHoldCount();
- }
-
- /**
- * Queries if this lock is held by the current thread.
- *
- * <p>Analogous to the {@link Thread#holdsLock} method for built-in
- * monitor locks, this method is typically used for debugging and
- * testing. For example, a method that should only be called while
- * a lock is held can assert that this is the case:
- *
- * <pre>
- * class X {
- * ReentrantLock lock = new ReentrantLock();
- * // ...
- *
- * public void m() {
- * assert lock.isHeldByCurrentThread();
- * // ... method body
- * }
- * }
- * </pre>
- *
- * <p>It can also be used to ensure that a reentrant lock is used
- * in a non-reentrant manner, for example:
- *
- * <pre>
- * class X {
- * ReentrantLock lock = new ReentrantLock();
- * // ...
- *
- * public void m() {
- * assert !lock.isHeldByCurrentThread();
- * lock.lock();
- * try {
- * // ... method body
- * } finally {
- * lock.unlock();
- * }
- * }
- * }
- * </pre>
- *
- * @return {@code true} if current thread holds this lock and
- * {@code false} otherwise
- */
- public boolean isHeldByCurrentThread() {
- return sync.isHeldByCurrentThread();
- }
-
- /**
- * Queries if this lock is held by any thread. This method is
- * designed for use in monitoring of the system state,
- * not for synchronization control.
- *
- * @return {@code true} if any thread holds this lock and
- * {@code false} otherwise
- */
- public boolean isLocked() {
- return sync.isLocked();
- }
-
- /**
- * Returns {@code true} if this lock has fairness set true.
- *
- * @return {@code true} if this lock has fairness set true
- */
- public final boolean isFair() {
- return sync.isFair();
- }
-
- /**
- * Returns the thread that currently owns this lock, or
- * {@code null} if not owned. When this method is called by a
- * thread that is not the owner, the return value reflects a
- * best-effort approximation of current lock status. For example,
- * the owner may be momentarily {@code null} even if there are
- * threads trying to acquire the lock but have not yet done so.
- * This method is designed to facilitate construction of
- * subclasses that provide more extensive lock monitoring
- * facilities.
- *
- * @return the owner, or {@code null} if not owned
- */
- protected Thread getOwner() {
- return sync.getOwner();
- }
-
- /**
- * Queries whether any threads are waiting to acquire this lock. Note that
- * because cancellations may occur at any time, a {@code true}
- * return does not guarantee that any other thread will ever
- * acquire this lock. This method is designed primarily for use in
- * monitoring of the system state.
- *
- * @return {@code true} if there may be other threads waiting to
- * acquire the lock
- */
- public final boolean hasQueuedThreads() {
- return sync.hasQueuedThreads();
- }
-
-
- /**
- * Queries whether the given thread is waiting to acquire this
- * lock. Note that because cancellations may occur at any time, a
- * {@code true} return does not guarantee that this thread
- * will ever acquire this lock. This method is designed primarily for use
- * in monitoring of the system state.
- *
- * @param thread the thread
- * @return {@code true} if the given thread is queued waiting for this lock
- * @throws NullPointerException if the thread is null
- */
- public final boolean hasQueuedThread(Thread thread) {
- return sync.isQueued(thread);
- }
-
-
- /**
- * Returns an estimate of the number of threads waiting to
- * acquire this lock. The value is only an estimate because the number of
- * threads may change dynamically while this method traverses
- * internal data structures. This method is designed for use in
- * monitoring of the system state, not for synchronization
- * control.
- *
- * @return the estimated number of threads waiting for this lock
- */
- public final int getQueueLength() {
- return sync.getQueueLength();
- }
-
- /**
- * Returns a collection containing threads that may be waiting to
- * acquire this lock. Because the actual set of threads may change
- * dynamically while constructing this result, the returned
- * collection is only a best-effort estimate. The elements of the
- * returned collection are in no particular order. This method is
- * designed to facilitate construction of subclasses that provide
- * more extensive monitoring facilities.
- *
- * @return the collection of threads
- */
- protected Collection getQueuedThreads() {
- return sync.getQueuedThreads();
- }
-
- /**
- * Queries whether any threads are waiting on the given condition
- * associated with this lock. Note that because timeouts and
- * interrupts may occur at any time, a {@code true} return does
- * not guarantee that a future {@code signal} will awaken any
- * threads. This method is designed primarily for use in
- * monitoring of the system state.
- *
- * @param condition the condition
- * @return {@code true} if there are any waiting threads
- * @throws IllegalMonitorStateException if this lock is not held
- * @throws IllegalArgumentException if the given condition is
- * not associated with this lock
- * @throws NullPointerException if the condition is null
- */
- public boolean hasWaiters(Condition condition) {
- return asCondVar(condition).hasWaiters();
- }
-
- /**
- * Returns an estimate of the number of threads waiting on the
- * given condition associated with this lock. Note that because
- * timeouts and interrupts may occur at any time, the estimate
- * serves only as an upper bound on the actual number of waiters.
- * This method is designed for use in monitoring of the system
- * state, not for synchronization control.
- *
- * @param condition the condition
- * @return the estimated number of waiting threads
- * @throws IllegalMonitorStateException if this lock is not held
- * @throws IllegalArgumentException if the given condition is
- * not associated with this lock
- * @throws NullPointerException if the condition is null
- */
- public int getWaitQueueLength(Condition condition) {
- return asCondVar(condition).getWaitQueueLength();
- }
-
- /**
- * Returns a collection containing those threads that may be
- * waiting on the given condition associated with this lock.
- * Because the actual set of threads may change dynamically while
- * constructing this result, the returned collection is only a
- * best-effort estimate. The elements of the returned collection
- * are in no particular order. This method is designed to
- * facilitate construction of subclasses that provide more
- * extensive condition monitoring facilities.
- *
- * @param condition the condition
- * @return the collection of threads
- * @throws IllegalMonitorStateException if this lock is not held
- * @throws IllegalArgumentException if the given condition is
- * not associated with this lock
- * @throws NullPointerException if the condition is null
- */
- protected Collection getWaitingThreads(Condition condition) {
- return asCondVar(condition).getWaitingThreads();
- }
-
- /**
- * Returns a string identifying this lock, as well as its lock state.
- * The state, in brackets, includes either the String {@code "Unlocked"}
- * or the String {@code "Locked by"} followed by the
- * {@linkplain Thread#getName name} of the owning thread.
- *
- * @return a string identifying this lock, as well as its lock state
- */
- public String toString() {
- Thread o = getOwner();
- return super.toString() + ((o == null) ?
- "[Unlocked]" :
- "[Locked by thread " + o.getName() + "]");
- }
-
- private CondVar asCondVar(Condition condition) {
- if (condition == null)
- throw new NullPointerException();
- if (!(condition instanceof CondVar))
- throw new IllegalArgumentException("not owner");
- CondVar condVar = (CondVar)condition;
- if (condVar.lock != this)
- throw new IllegalArgumentException("not owner");
- return condVar;
- }
-}
diff --git a/src/actors/scala/actors/threadpool/locks/ReentrantReadWriteLock.java b/src/actors/scala/actors/threadpool/locks/ReentrantReadWriteLock.java
deleted file mode 100644
index 914d242100..0000000000
--- a/src/actors/scala/actors/threadpool/locks/ReentrantReadWriteLock.java
+++ /dev/null
@@ -1,1341 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package scala.actors.threadpool.locks;
-
-import java.util.HashMap;
-import scala.actors.threadpool.*;
-import scala.actors.threadpool.helpers.*;
-
-/**
- * An implementation of {@link ReadWriteLock} supporting similar
- * semantics to {@link ReentrantLock}.
- * <p>This class has the following properties:
- *
- * <ul>
- * <li><b>Acquisition order</b>
- *
- * <p>The order of entry
- * to the read and write lock is unspecified, subject to reentrancy
- * constraints. A nonfair lock that is continuously contended may
- * indefinitely postpone one or more reader or writer threads, but
- * will normally have higher throughput than a fair lock.
- * <p>
- *
- * DEPARTURE FROM java.util.concurrent: this implementation impose
- * a writer-preference and thus its acquisition order may be different
- * than in java.util.concurrent.
- *
- * <li><b>Reentrancy</b>
- *
- * <p>This lock allows both readers and writers to reacquire read or
- * write locks in the style of a {@link ReentrantLock}. Non-reentrant
- * readers are not allowed until all write locks held by the writing
- * thread have been released.
- *
- * <p>Additionally, a writer can acquire the read lock, but not
- * vice-versa. Among other applications, reentrancy can be useful
- * when write locks are held during calls or callbacks to methods that
- * perform reads under read locks. If a reader tries to acquire the
- * write lock it will never succeed.
- *
- * <li><b>Lock downgrading</b>
- * <p>Reentrancy also allows downgrading from the write lock to a read lock,
- * by acquiring the write lock, then the read lock and then releasing the
- * write lock. However, upgrading from a read lock to the write lock is
- * <b>not</b> possible.
- *
- * <li><b>Interruption of lock acquisition</b>
- * <p>The read lock and write lock both support interruption during lock
- * acquisition.
- *
- * <li><b>{@link Condition} support</b>
- * <p>The write lock provides a {@link Condition} implementation that
- * behaves in the same way, with respect to the write lock, as the
- * {@link Condition} implementation provided by
- * {@link ReentrantLock#newCondition} does for {@link ReentrantLock}.
- * This {@link Condition} can, of course, only be used with the write lock.
- *
- * <p>The read lock does not support a {@link Condition} and
- * {@code readLock().newCondition()} throws
- * {@code UnsupportedOperationException}.
- *
- * <li><b>Instrumentation</b>
- * <p>This class supports methods to determine whether locks
- * are held or contended. These methods are designed for monitoring
- * system state, not for synchronization control.
- * </ul>
- *
- * <p>Serialization of this class behaves in the same way as built-in
- * locks: a deserialized lock is in the unlocked state, regardless of
- * its state when serialized.
- *
- * <p><b>Sample usages</b>. Here is a code sketch showing how to exploit
- * reentrancy to perform lock downgrading after updating a cache (exception
- * handling is elided for simplicity):
- * <pre>
- * class CachedData {
- * Object data;
- * volatile boolean cacheValid;
- * ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
- *
- * void processCachedData() {
- * rwl.readLock().lock();
- * if (!cacheValid) {
- * // Must release read lock before acquiring write lock
- * rwl.readLock().unlock();
- * rwl.writeLock().lock();
- * // Recheck state because another thread might have acquired
- * // write lock and changed state before we did.
- * if (!cacheValid) {
- * data = ...
- * cacheValid = true;
- * }
- * // Downgrade by acquiring read lock before releasing write lock
- * rwl.readLock().lock();
- * rwl.writeLock().unlock(); // Unlock write, still hold read
- * }
- *
- * use(data);
- * rwl.readLock().unlock();
- * }
- * }
- * </pre>
- *
- * ReentrantReadWriteLocks can be used to improve concurrency in some
- * uses of some kinds of Collections. This is typically worthwhile
- * only when the collections are expected to be large, accessed by
- * more reader threads than writer threads, and entail operations with
- * overhead that outweighs synchronization overhead. For example, here
- * is a class using a TreeMap that is expected to be large and
- * concurrently accessed.
- *
- * <pre>{@code
- * class RWDictionary {
- * private final Map<String, Data> m = new TreeMap<String, Data>();
- * private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
- * private final Lock r = rwl.readLock();
- * private final Lock w = rwl.writeLock();
- *
- * public Data get(String key) {
- * r.lock();
- * try { return m.get(key); }
- * finally { r.unlock(); }
- * }
- * public String[] allKeys() {
- * r.lock();
- * try { return m.keySet().toArray(); }
- * finally { r.unlock(); }
- * }
- * public Data put(String key, Data value) {
- * w.lock();
- * try { return m.put(key, value); }
- * finally { w.unlock(); }
- * }
- * public void clear() {
- * w.lock();
- * try { m.clear(); }
- * finally { w.unlock(); }
- * }
- * }}</pre>
- *
- * <h3>Implementation Notes</h3>
- *
- * <p>This lock supports a maximum of 65535 recursive write locks
- * and 65535 read locks. Attempts to exceed these limits result in
- * {@link Error} throws from locking methods.
- *
- * @since 1.5
- * @author Doug Lea
- *
- */
-public class ReentrantReadWriteLock implements ReadWriteLock, java.io.Serializable {
- private static final long serialVersionUID = -3463448656717690166L;
-
- final ReadLock readerLock_ = new ReadLock(this);
- final WriteLock writerLock_ = new WriteLock(this);
-
- final Sync sync;
-
- /**
- * Creates a new {@code ReentrantReadWriteLock} with
- * default (nonfair) ordering properties.
- */
- public ReentrantReadWriteLock() {
- this.sync = new NonfairSync();
- }
-
- public Lock writeLock() { return writerLock_; }
- public Lock readLock() { return readerLock_; }
-
- /**
- * Synchronization implementation for ReentrantReadWriteLock.
- * Subclassed into fair and nonfair versions.
- */
- private abstract static class Sync implements java.io.Serializable {
-
- private static final int NONE = 0;
- private static final int READER = 1;
- private static final int WRITER = 2;
-
- transient int activeReaders_ = 0;
- transient Thread activeWriter_ = null;
- transient int waitingReaders_ = 0;
- transient int waitingWriters_ = 0;
-
- /** Number of acquires on write lock by activeWriter_ thread **/
- transient int writeHolds_ = 0;
-
- /** Number of acquires on read lock by any reader thread **/
- transient HashMap<Thread, Integer> readers_ = new HashMap<Thread, Integer>();
-
- /** cache/reuse the special Integer value one to speed up readlocks **/
- static final Integer IONE = new Integer(1);
-
- Sync() {}
-
- /*
- Each of these variants is needed to maintain atomicity
- of wait counts during wait loops. They could be
- made faster by manually inlining each other. We hope that
- compilers do this for us though.
- */
-
- synchronized boolean startReadFromNewReader() {
- boolean pass = startRead();
- if (!pass) ++waitingReaders_;
- return pass;
- }
-
- synchronized boolean startWriteFromNewWriter() {
- boolean pass = startWrite();
- if (!pass) ++waitingWriters_;
- return pass;
- }
-
- synchronized boolean startReadFromWaitingReader() {
- boolean pass = startRead();
- if (pass) --waitingReaders_;
- return pass;
- }
-
- synchronized boolean startWriteFromWaitingWriter() {
- boolean pass = startWrite();
- if (pass) --waitingWriters_;
- return pass;
- }
-
- /*
- A bunch of small synchronized methods are needed
- to allow communication from the Lock objects
- back to this object, that serves as controller
- */
-
- synchronized void cancelledWaitingReader() { --waitingReaders_; }
- synchronized void cancelledWaitingWriter() { --waitingWriters_; }
-
- boolean allowReader() {
- return (activeWriter_ == null && waitingWriters_ == 0) ||
- activeWriter_ == Thread.currentThread();
- }
-
- synchronized boolean startRead() {
- Thread t = Thread.currentThread();
- Object c = readers_.get(t);
- if (c != null) { // already held -- just increment hold count
- readers_.put(t, new Integer( ( (Integer) (c)).intValue() + 1));
- ++activeReaders_;
- return true;
- }
- else if (allowReader()) {
- readers_.put(t, IONE);
- ++activeReaders_;
- return true;
- }
- else
- return false;
- }
-
- synchronized boolean startWrite() {
- if (activeWriter_ == Thread.currentThread()) { // already held; re-acquire
- ++writeHolds_;
- return true;
- }
- else if (writeHolds_ == 0) {
- if (activeReaders_ == 0 ||
- (readers_.size() == 1 &&
- readers_.get(Thread.currentThread()) != null)) {
- activeWriter_ = Thread.currentThread();
- writeHolds_ = 1;
- return true;
- }
- else
- return false;
- }
- else
- return false;
- }
-
- synchronized int endRead() {
- Thread t = Thread.currentThread();
- Object c = readers_.get(t);
- if (c == null)
- throw new IllegalMonitorStateException();
- --activeReaders_;
- if (c != IONE) { // more than one hold; decrement count
- int h = ( (Integer) (c)).intValue() - 1;
- Integer ih = (h == 1) ? IONE : new Integer(h);
- readers_.put(t, ih);
- return NONE;
- }
- else {
- readers_.remove(t);
-
- if (writeHolds_ > 0) // a write lock is still held by current thread
- return NONE;
- else if (activeReaders_ == 0 && waitingWriters_ > 0)
- return WRITER;
- else
- return NONE;
- }
- }
-
- synchronized int endWrite() {
- if (activeWriter_ != Thread.currentThread()) {
- throw new IllegalMonitorStateException();
- }
- --writeHolds_;
- if (writeHolds_ > 0) // still being held
- return NONE;
- else {
- activeWriter_ = null;
- if (waitingReaders_ > 0 && allowReader())
- return READER;
- else if (waitingWriters_ > 0)
- return WRITER;
- else
- return NONE;
- }
- }
-
- synchronized Thread getOwner() {
- return activeWriter_;
- }
-
- synchronized int getReadLockCount() {
- return activeReaders_;
- }
-
- synchronized boolean isWriteLocked() {
- return activeWriter_ != null;
- }
-
- synchronized boolean isWriteLockedByCurrentThread() {
- return activeWriter_ == Thread.currentThread();
- }
-
- synchronized int getWriteHoldCount() {
- return isWriteLockedByCurrentThread() ? writeHolds_ : 0;
- }
-
- synchronized int getReadHoldCount() {
- if (activeReaders_ == 0) return 0;
- Thread t = Thread.currentThread();
- Integer i = readers_.get(t);
- return (i == null) ? 0 : i.intValue();
- }
-
- final synchronized boolean hasQueuedThreads() {
- return waitingWriters_ > 0 || waitingReaders_ > 0;
- }
-
- final synchronized int getQueueLength() {
- return waitingWriters_ + waitingReaders_;
- }
-
- private void readObject(java.io.ObjectInputStream in)
- throws java.io.IOException, ClassNotFoundException {
- in.defaultReadObject();
- // readers_ is transient, need to reinitialize. Let's flush the memory
- // and ensure visibility by synchronizing (all other accesses to
- // readers_ are also synchronized on "this")
- synchronized (this) {
- readers_ = new HashMap<Thread, Integer>();
- }
- }
- }
-
- /**
- * Nonfair version of Sync
- */
- private static class NonfairSync extends Sync {
- private static final long serialVersionUID = -2392241841540339773L;
-
- NonfairSync() {}
- }
-
- /**
- * The lock returned by method {@link ReentrantReadWriteLock#readLock}.
- */
- public static class ReadLock implements Lock, java.io.Serializable {
-
- private static final long serialVersionUID = -5992448646407690164L;
-
- final ReentrantReadWriteLock lock;
-
- /**
- * Constructor for use by subclasses
- *
- * @param lock the outer lock object
- * @throws NullPointerException if the lock is null
- */
- protected ReadLock(ReentrantReadWriteLock lock) {
- if (lock == null) throw new NullPointerException();
- this.lock = lock;
- }
-
- /**
- * Acquires the read lock.
- *
- * <p>Acquires the read lock if the write lock is not held by
- * another thread and returns immediately.
- *
- * <p>If the write lock is held by another thread then
- * the current thread becomes disabled for thread scheduling
- * purposes and lies dormant until the read lock has been acquired.
- */
- public void lock() {
- synchronized (this) {
- if (lock.sync.startReadFromNewReader()) return;
- boolean wasInterrupted = Thread.interrupted();
- try {
- while (true) {
- try {
- ReadLock.this.wait();
- }
- catch (InterruptedException ex) {
- wasInterrupted = true;
- // no need to propagate the potentially masked
- // signal, since readers are always notified all
- }
- if (lock.sync.startReadFromWaitingReader()) return;
- }
- }
- finally {
- if (wasInterrupted) Thread.currentThread().interrupt();
- }
- }
- }
-
- /**
- * Acquires the read lock unless the current thread is
- * {@linkplain Thread#interrupt interrupted}.
- *
- * <p>Acquires the read lock if the write lock is not held
- * by another thread and returns immediately.
- *
- * <p>If the write lock is held by another thread then the
- * current thread becomes disabled for thread scheduling
- * purposes and lies dormant until one of two things happens:
- *
- * <ul>
- *
- * <li>The read lock is acquired by the current thread; or
- *
- * <li>Some other thread {@linkplain Thread#interrupt interrupts}
- * the current thread.
- *
- * </ul>
- *
- * <p>If the current thread:
- *
- * <ul>
- *
- * <li>has its interrupted status set on entry to this method; or
- *
- * <li>is {@linkplain Thread#interrupt interrupted} while
- * acquiring the read lock,
- *
- * </ul>
- *
- * then {@link InterruptedException} is thrown and the current
- * thread's interrupted status is cleared.
- *
- * <p>In this implementation, as this method is an explicit
- * interruption point, preference is given to responding to
- * the interrupt over normal or reentrant acquisition of the
- * lock.
- *
- * @throws InterruptedException if the current thread is interrupted
- */
- public void lockInterruptibly() throws InterruptedException {
- if (Thread.interrupted()) throw new InterruptedException();
- InterruptedException ie = null;
- synchronized (this) {
- if (!lock.sync.startReadFromNewReader()) {
- for (; ; ) {
- try {
- ReadLock.this.wait();
- if (lock.sync.startReadFromWaitingReader())
- return;
- }
- catch (InterruptedException ex) {
- lock.sync.cancelledWaitingReader();
- ie = ex;
- break;
- }
- }
- }
- }
- if (ie != null) {
- // fall through outside synch on interrupt.
- // This notification is not really needed here,
- // but may be in plausible subclasses
- lock.writerLock_.signalWaiters();
- throw ie;
- }
- }
-
- /**
- * Acquires the read lock only if the write lock is not held by
- * another thread at the time of invocation.
- *
- * <p>Acquires the read lock if the write lock is not held by
- * another thread and returns immediately with the value
- * {@code true}. Even when this lock has been set to use a
- * fair ordering policy, a call to {@code tryLock()}
- * <em>will</em> immediately acquire the read lock if it is
- * available, whether or not other threads are currently
- * waiting for the read lock. This &quot;barging&quot; behavior
- * can be useful in certain circumstances, even though it
- * breaks fairness. If you want to honor the fairness setting
- * for this lock, then use {@link #tryLock(long, TimeUnit)
- * tryLock(0, TimeUnit.SECONDS) } which is almost equivalent
- * (it also detects interruption).
- *
- * <p>If the write lock is held by another thread then
- * this method will return immediately with the value
- * {@code false}.
- *
- * @return {@code true} if the read lock was acquired
- */
- public boolean tryLock() {
- return lock.sync.startRead();
- }
-
- /**
- * Acquires the read lock if the write lock is not held by
- * another thread within the given waiting time and the
- * current thread has not been {@linkplain Thread#interrupt
- * interrupted}.
- *
- * <p>Acquires the read lock if the write lock is not held by
- * another thread and returns immediately with the value
- * {@code true}. If this lock has been set to use a fair
- * ordering policy then an available lock <em>will not</em> be
- * acquired if any other threads are waiting for the
- * lock. This is in contrast to the {@link #tryLock()}
- * method. If you want a timed {@code tryLock} that does
- * permit barging on a fair lock then combine the timed and
- * un-timed forms together:
- *
- * <pre>if (lock.tryLock() || lock.tryLock(timeout, unit) ) { ... }
- * </pre>
- *
- * <p>If the write lock is held by another thread then the
- * current thread becomes disabled for thread scheduling
- * purposes and lies dormant until one of three things happens:
- *
- * <ul>
- *
- * <li>The read lock is acquired by the current thread; or
- *
- * <li>Some other thread {@linkplain Thread#interrupt interrupts}
- * the current thread; or
- *
- * <li>The specified waiting time elapses.
- *
- * </ul>
- *
- * <p>If the read lock is acquired then the value {@code true} is
- * returned.
- *
- * <p>If the current thread:
- *
- * <ul>
- *
- * <li>has its interrupted status set on entry to this method; or
- *
- * <li>is {@linkplain Thread#interrupt interrupted} while
- * acquiring the read lock,
- *
- * </ul> then {@link InterruptedException} is thrown and the
- * current thread's interrupted status is cleared.
- *
- * <p>If the specified waiting time elapses then the value
- * {@code false} is returned. If the time is less than or
- * equal to zero, the method will not wait at all.
- *
- * <p>In this implementation, as this method is an explicit
- * interruption point, preference is given to responding to
- * the interrupt over normal or reentrant acquisition of the
- * lock, and over reporting the elapse of the waiting time.
- *
- * @param timeout the time to wait for the read lock
- * @param unit the time unit of the timeout argument
- * @return {@code true} if the read lock was acquired
- * @throws InterruptedException if the current thread is interrupted
- * @throws NullPointerException if the time unit is null
- *
- */
- public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException {
- if (Thread.interrupted()) throw new InterruptedException();
- InterruptedException ie = null;
- long nanos = unit.toNanos(timeout);
- synchronized (this) {
- if (nanos <= 0)
- return lock.sync.startRead();
- else if (lock.sync.startReadFromNewReader())
- return true;
- else {
- long deadline = Utils.nanoTime() + nanos;
- for (; ; ) {
- try {
- TimeUnit.NANOSECONDS.timedWait(ReadLock.this, nanos);
- }
- catch (InterruptedException ex) {
- lock.sync.cancelledWaitingReader();
- ie = ex;
- break;
- }
- if (lock.sync.startReadFromWaitingReader())
- return true;
- else {
- nanos = deadline - Utils.nanoTime();
- if (nanos <= 0) {
- lock.sync.cancelledWaitingReader();
- break;
- }
- }
- }
- }
- }
- // safeguard on interrupt or timeout:
- lock.writerLock_.signalWaiters();
- if (ie != null)
- throw ie;
- else
- return false; // timed out
- }
-
- /**
- * Attempts to release this lock.
- *
- * <p> If the number of readers is now zero then the lock
- * is made available for write lock attempts.
- */
- public void unlock() {
- switch (lock.sync.endRead()) {
- case Sync.NONE: return;
- case Sync.READER: lock.readerLock_.signalWaiters(); return;
- case Sync.WRITER: lock.writerLock_.signalWaiters(); return;
- }
- }
-
- /**
- * Throws {@code UnsupportedOperationException} because
- * {@code ReadLocks} do not support conditions.
- *
- * @throws UnsupportedOperationException always
- */
- public Condition newCondition() {
- throw new UnsupportedOperationException();
- }
-
- synchronized void signalWaiters() {
- notifyAll();
- }
-
- /**
- * Returns a string identifying this lock, as well as its lock state.
- * The state, in brackets, includes the String {@code "Read locks ="}
- * followed by the number of held read locks.
- *
- * @return a string identifying this lock, as well as its lock state
- */
- public String toString() {
- int r = lock.getReadLockCount();
- return super.toString() +
- "[Read locks = " + r + "]";
- }
-
- }
-
- /**
- * The lock returned by method {@link ReentrantReadWriteLock#writeLock}.
- */
- public static class WriteLock implements Lock, CondVar.ExclusiveLock,
- java.io.Serializable {
-
- private static final long serialVersionUID = -4992448646407690164L;
- final ReentrantReadWriteLock lock;
-
- /**
- * Constructor for use by subclasses
- *
- * @param lock the outer lock object
- * @throws NullPointerException if the lock is null
- */
- protected WriteLock(ReentrantReadWriteLock lock) {
- if (lock == null) throw new NullPointerException();
- this.lock = lock;
- }
-
- /**
- * Acquires the write lock.
- *
- * <p>Acquires the write lock if neither the read nor write lock
- * are held by another thread
- * and returns immediately, setting the write lock hold count to
- * one.
- *
- * <p>If the current thread already holds the write lock then the
- * hold count is incremented by one and the method returns
- * immediately.
- *
- * <p>If the lock is held by another thread then the current
- * thread becomes disabled for thread scheduling purposes and
- * lies dormant until the write lock has been acquired, at which
- * time the write lock hold count is set to one.
- */
- public void lock() {
- synchronized (this) {
- if (lock.sync.startWriteFromNewWriter()) return;
- boolean wasInterrupted = Thread.interrupted();
- try {
- while (true) {
- try {
- WriteLock.this.wait();
- }
- catch (InterruptedException ex) {
- wasInterrupted = true;
- // no need to notify; if we were notified,
- // we will act as notified, and succeed in
- // startWrite and return
- }
- if (lock.sync.startWriteFromWaitingWriter()) return;
- }
- }
- finally {
- if (wasInterrupted) Thread.currentThread().interrupt();
- }
- }
- }
-
- /**
- * Acquires the write lock unless the current thread is
- * {@linkplain Thread#interrupt interrupted}.
- *
- * <p>Acquires the write lock if neither the read nor write lock
- * are held by another thread
- * and returns immediately, setting the write lock hold count to
- * one.
- *
- * <p>If the current thread already holds this lock then the
- * hold count is incremented by one and the method returns
- * immediately.
- *
- * <p>If the lock is held by another thread then the current
- * thread becomes disabled for thread scheduling purposes and
- * lies dormant until one of two things happens:
- *
- * <ul>
- *
- * <li>The write lock is acquired by the current thread; or
- *
- * <li>Some other thread {@linkplain Thread#interrupt interrupts}
- * the current thread.
- *
- * </ul>
- *
- * <p>If the write lock is acquired by the current thread then the
- * lock hold count is set to one.
- *
- * <p>If the current thread:
- *
- * <ul>
- *
- * <li>has its interrupted status set on entry to this method;
- * or
- *
- * <li>is {@linkplain Thread#interrupt interrupted} while
- * acquiring the write lock,
- *
- * </ul>
- *
- * then {@link InterruptedException} is thrown and the current
- * thread's interrupted status is cleared.
- *
- * <p>In this implementation, as this method is an explicit
- * interruption point, preference is given to responding to
- * the interrupt over normal or reentrant acquisition of the
- * lock.
- *
- * @throws InterruptedException if the current thread is interrupted
- */
- public void lockInterruptibly() throws InterruptedException {
- if (Thread.interrupted()) throw new InterruptedException();
- InterruptedException ie = null;
- synchronized (this) {
- if (!lock.sync.startWriteFromNewWriter()) {
- for (; ; ) {
- try {
- WriteLock.this.wait();
- if (lock.sync.startWriteFromWaitingWriter())
- return;
- }
- catch (InterruptedException ex) {
- lock.sync.cancelledWaitingWriter();
- WriteLock.this.notify();
- ie = ex;
- break;
- }
- }
- }
- }
- if (ie != null) {
- // Fall through outside synch on interrupt.
- // On exception, we may need to signal readers.
- // It is not worth checking here whether it is strictly necessary.
- lock.readerLock_.signalWaiters();
- throw ie;
- }
- }
-
- /**
- * Acquires the write lock only if it is not held by another thread
- * at the time of invocation.
- *
- * <p>Acquires the write lock if neither the read nor write lock
- * are held by another thread
- * and returns immediately with the value {@code true},
- * setting the write lock hold count to one. Even when this lock has
- * been set to use a fair ordering policy, a call to
- * {@code tryLock()} <em>will</em> immediately acquire the
- * lock if it is available, whether or not other threads are
- * currently waiting for the write lock. This &quot;barging&quot;
- * behavior can be useful in certain circumstances, even
- * though it breaks fairness. If you want to honor the
- * fairness setting for this lock, then use {@link
- * #tryLock(long, TimeUnit) tryLock(0, TimeUnit.SECONDS) }
- * which is almost equivalent (it also detects interruption).
- *
- * <p> If the current thread already holds this lock then the
- * hold count is incremented by one and the method returns
- * {@code true}.
- *
- * <p>If the lock is held by another thread then this method
- * will return immediately with the value {@code false}.
- *
- * @return {@code true} if the lock was free and was acquired
- * by the current thread, or the write lock was already held
- * by the current thread; and {@code false} otherwise.
- */
- public boolean tryLock() {
- return lock.sync.startWrite();
- }
-
- /**
- * Acquires the write lock if it is not held by another thread
- * within the given waiting time and the current thread has
- * not been {@linkplain Thread#interrupt interrupted}.
- *
- * <p>Acquires the write lock if neither the read nor write lock
- * are held by another thread
- * and returns immediately with the value {@code true},
- * setting the write lock hold count to one. If this lock has been
- * set to use a fair ordering policy then an available lock
- * <em>will not</em> be acquired if any other threads are
- * waiting for the write lock. This is in contrast to the {@link
- * #tryLock()} method. If you want a timed {@code tryLock}
- * that does permit barging on a fair lock then combine the
- * timed and un-timed forms together:
- *
- * <pre>if (lock.tryLock() || lock.tryLock(timeout, unit) ) { ... }
- * </pre>
- *
- * <p>If the current thread already holds this lock then the
- * hold count is incremented by one and the method returns
- * {@code true}.
- *
- * <p>If the lock is held by another thread then the current
- * thread becomes disabled for thread scheduling purposes and
- * lies dormant until one of three things happens:
- *
- * <ul>
- *
- * <li>The write lock is acquired by the current thread; or
- *
- * <li>Some other thread {@linkplain Thread#interrupt interrupts}
- * the current thread; or
- *
- * <li>The specified waiting time elapses
- *
- * </ul>
- *
- * <p>If the write lock is acquired then the value {@code true} is
- * returned and the write lock hold count is set to one.
- *
- * <p>If the current thread:
- *
- * <ul>
- *
- * <li>has its interrupted status set on entry to this method;
- * or
- *
- * <li>is {@linkplain Thread#interrupt interrupted} while
- * acquiring the write lock,
- *
- * </ul>
- *
- * then {@link InterruptedException} is thrown and the current
- * thread's interrupted status is cleared.
- *
- * <p>If the specified waiting time elapses then the value
- * {@code false} is returned. If the time is less than or
- * equal to zero, the method will not wait at all.
- *
- * <p>In this implementation, as this method is an explicit
- * interruption point, preference is given to responding to
- * the interrupt over normal or reentrant acquisition of the
- * lock, and over reporting the elapse of the waiting time.
- *
- * @param timeout the time to wait for the write lock
- * @param unit the time unit of the timeout argument
- *
- * @return {@code true} if the lock was free and was acquired
- * by the current thread, or the write lock was already held by the
- * current thread; and {@code false} if the waiting time
- * elapsed before the lock could be acquired.
- *
- * @throws InterruptedException if the current thread is interrupted
- * @throws NullPointerException if the time unit is null
- *
- */
- public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException {
- if (Thread.interrupted()) throw new InterruptedException();
- InterruptedException ie = null;
- long nanos = unit.toNanos(timeout);
- synchronized (this) {
- if (nanos <= 0)
- return lock.sync.startWrite();
- else if (lock.sync.startWriteFromNewWriter())
- return true;
- else {
- long deadline = Utils.nanoTime() + nanos;
- for (; ; ) {
- try {
- TimeUnit.NANOSECONDS.timedWait(WriteLock.this, nanos);
- }
- catch (InterruptedException ex) {
- lock.sync.cancelledWaitingWriter();
- WriteLock.this.notify();
- ie = ex;
- break;
- }
- if (lock.sync.startWriteFromWaitingWriter())
- return true;
- else {
- nanos = deadline - Utils.nanoTime();
- if (nanos <= 0) {
- lock.sync.cancelledWaitingWriter();
- WriteLock.this.notify();
- break;
- }
- }
- }
- }
- }
-
- lock.readerLock_.signalWaiters();
- if (ie != null)
- throw ie;
- else
- return false; // timed out
- }
-
- /**
- * Attempts to release this lock.
- *
- * <p>If the current thread is the holder of this lock then
- * the hold count is decremented. If the hold count is now
- * zero then the lock is released. If the current thread is
- * not the holder of this lock then {@link
- * IllegalMonitorStateException} is thrown.
- *
- * @throws IllegalMonitorStateException if the current thread does not
- * hold this lock.
- */
- public void unlock() {
- switch (lock.sync.endWrite()) {
- case Sync.NONE: return;
- case Sync.READER: lock.readerLock_.signalWaiters(); return;
- case Sync.WRITER: lock.writerLock_.signalWaiters(); return;
- }
- }
-
- /**
- * Returns a {@link Condition} instance for use with this
- * {@link Lock} instance.
- * <p>The returned {@link Condition} instance supports the same
- * usages as do the {@link Object} monitor methods ({@link
- * Object#wait() wait}, {@link Object#notify notify}, and {@link
- * Object#notifyAll notifyAll}) when used with the built-in
- * monitor lock.
- *
- * <ul>
- *
- * <li>If this write lock is not held when any {@link
- * Condition} method is called then an {@link
- * IllegalMonitorStateException} is thrown. (Read locks are
- * held independently of write locks, so are not checked or
- * affected. However it is essentially always an error to
- * invoke a condition waiting method when the current thread
- * has also acquired read locks, since other threads that
- * could unblock it will not be able to acquire the write
- * lock.)
- *
- * <li>When the condition {@linkplain Condition#await() waiting}
- * methods are called the write lock is released and, before
- * they return, the write lock is reacquired and the lock hold
- * count restored to what it was when the method was called.
- *
- * <li>If a thread is {@linkplain Thread#interrupt interrupted} while
- * waiting then the wait will terminate, an {@link
- * InterruptedException} will be thrown, and the thread's
- * interrupted status will be cleared.
- *
- * <li> Waiting threads are signalled in FIFO order.
- *
- * <li>The ordering of lock reacquisition for threads returning
- * from waiting methods is the same as for threads initially
- * acquiring the lock, which is in the default case not specified,
- * but for <em>fair</em> locks favors those threads that have been
- * waiting the longest.
- *
- * </ul>
- *
- * @return the Condition object
- */
- public Condition newCondition() {
- return new CondVar(this);
- }
-
- synchronized void signalWaiters() {
- notify();
- }
-
- /**
- * Returns a string identifying this lock, as well as its lock
- * state. The state, in brackets includes either the String
- * {@code "Unlocked"} or the String {@code "Locked by"}
- * followed by the {@linkplain Thread#getName name} of the owning thread.
- *
- * @return a string identifying this lock, as well as its lock state
- */
- public String toString() {
- Thread o = lock.getOwner();
- return super.toString() + ((o == null) ?
- "[Unlocked]" :
- "[Locked by thread " + o.getName() + "]");
- }
-
- /**
- * Queries if this write lock is held by the current thread.
- * Identical in effect to {@link
- * ReentrantReadWriteLock#isWriteLockedByCurrentThread}.
- *
- * @return {@code true} if the current thread holds this lock and
- * {@code false} otherwise
- * @since 1.6
- */
- public boolean isHeldByCurrentThread() {
- return lock.sync.isWriteLockedByCurrentThread();
- }
-
- /**
- * Queries the number of holds on this write lock by the current
- * thread. A thread has a hold on a lock for each lock action
- * that is not matched by an unlock action. Identical in effect
- * to {@link ReentrantReadWriteLock#getWriteHoldCount}.
- *
- * @return the number of holds on this lock by the current thread,
- * or zero if this lock is not held by the current thread
- * @since 1.6
- */
- public int getHoldCount() {
- return lock.sync.getWriteHoldCount();
- }
-
- }
-
- // Instrumentation and status
-
- /**
- * Returns {@code true} if this lock has fairness set true.
- *
- * @return {@code true} if this lock has fairness set true
- */
- public final boolean isFair() {
- return false;
- }
-
- /**
- * Returns the thread that currently owns the write lock, or
- * {@code null} if not owned. When this method is called by a
- * thread that is not the owner, the return value reflects a
- * best-effort approximation of current lock status. For example,
- * the owner may be momentarily {@code null} even if there are
- * threads trying to acquire the lock but have not yet done so.
- * This method is designed to facilitate construction of
- * subclasses that provide more extensive lock monitoring
- * facilities.
- *
- * @return the owner, or {@code null} if not owned
- */
- protected Thread getOwner() {
- return sync.getOwner();
- }
-
- /**
- * Queries the number of read locks held for this lock. This
- * method is designed for use in monitoring system state, not for
- * synchronization control.
- * @return the number of read locks held.
- */
- public int getReadLockCount() {
- return sync.getReadLockCount();
- }
-
- /**
- * Queries if the write lock is held by any thread. This method is
- * designed for use in monitoring system state, not for
- * synchronization control.
- *
- * @return {@code true} if any thread holds the write lock and
- * {@code false} otherwise
- */
- public boolean isWriteLocked() {
- return sync.isWriteLocked();
- }
-
- /**
- * Queries if the write lock is held by the current thread.
- *
- * @return {@code true} if the current thread holds the write lock and
- * {@code false} otherwise
- */
- public boolean isWriteLockedByCurrentThread() {
- return sync.isWriteLockedByCurrentThread();
- }
-
- /**
- * Queries the number of reentrant write holds on this lock by the
- * current thread. A writer thread has a hold on a lock for
- * each lock action that is not matched by an unlock action.
- *
- * @return the number of holds on the write lock by the current thread,
- * or zero if the write lock is not held by the current thread
- */
- public int getWriteHoldCount() {
- return sync.getWriteHoldCount();
- }
-
- /**
- * Queries the number of reentrant read holds on this lock by the
- * current thread. A reader thread has a hold on a lock for
- * each lock action that is not matched by an unlock action.
- *
- * @return the number of holds on the read lock by the current thread,
- * or zero if the read lock is not held by the current thread
- * @since 1.6
- */
- public int getReadHoldCount() {
- return sync.getReadHoldCount();
- }
-
-
-// /**
-// * Returns a collection containing threads that may be waiting to
-// * acquire the write lock. Because the actual set of threads may
-// * change dynamically while constructing this result, the returned
-// * collection is only a best-effort estimate. The elements of the
-// * returned collection are in no particular order. This method is
-// * designed to facilitate construction of subclasses that provide
-// * more extensive lock monitoring facilities.
-// * @return the collection of threads
-// */
-// protected Collection getQueuedWriterThreads() {
-// return sync.getExclusiveQueuedThreads();
-// }
-//
-// /**
-// * Returns a collection containing threads that may be waiting to
-// * acquire the read lock. Because the actual set of threads may
-// * change dynamically while constructing this result, the returned
-// * collection is only a best-effort estimate. The elements of the
-// * returned collection are in no particular order. This method is
-// * designed to facilitate construction of subclasses that provide
-// * more extensive lock monitoring facilities.
-// * @return the collection of threads
-// */
-// protected Collection getQueuedReaderThreads() {
-// return sync.getSharedQueuedThreads();
-// }
-//
- /**
- * Queries whether any threads are waiting to acquire the read or
- * write lock. Note that because cancellations may occur at any
- * time, a {@code true} return does not guarantee that any other
- * thread will ever acquire a lock. This method is designed
- * primarily for use in monitoring of the system state.
- *
- * @return {@code true} if there may be other threads waiting to
- * acquire the lock
- */
- public final boolean hasQueuedThreads() {
- return sync.hasQueuedThreads();
- }
-//
-// /**
-// * Queries whether the given thread is waiting to acquire either
-// * the read or write lock. Note that because cancellations may
-// * occur at any time, a <tt>true</tt> return does not guarantee
-// * that this thread will ever acquire a lock. This method is
-// * designed primarily for use in monitoring of the system state.
-// *
-// * @param thread the thread
-// * @return true if the given thread is queued waiting for this lock.
-// * @throws NullPointerException if thread is null
-// */
-// public final boolean hasQueuedThread(Thread thread) {
-// return sync.isQueued(thread);
-// }
-
- /**
- * Returns an estimate of the number of threads waiting to acquire
- * either the read or write lock. The value is only an estimate
- * because the number of threads may change dynamically while this
- * method traverses internal data structures. This method is
- * designed for use in monitoring of the system state, not for
- * synchronization control.
- *
- * @return the estimated number of threads waiting for this lock
- */
- public final int getQueueLength() {
- return sync.getQueueLength();
- }
-
-// /**
-// * Returns a collection containing threads that may be waiting to
-// * acquire either the read or write lock. Because the actual set
-// * of threads may change dynamically while constructing this
-// * result, the returned collection is only a best-effort estimate.
-// * The elements of the returned collection are in no particular
-// * order. This method is designed to facilitate construction of
-// * subclasses that provide more extensive monitoring facilities.
-// * @return the collection of threads
-// */
-// protected Collection getQueuedThreads() {
-// return sync.getQueuedThreads();
-// }
-//
-// /**
-// * Queries whether any threads are waiting on the given condition
-// * associated with the write lock. Note that because timeouts and
-// * interrupts may occur at any time, a <tt>true</tt> return does
-// * not guarantee that a future <tt>signal</tt> will awaken any
-// * threads. This method is designed primarily for use in
-// * monitoring of the system state.
-// * @param condition the condition
-// * @return <tt>true</tt> if there are any waiting threads.
-// * @throws IllegalMonitorStateException if this lock
-// * is not held
-// * @throws IllegalArgumentException if the given condition is
-// * not associated with this lock
-// * @throws NullPointerException if condition null
-// */
-// public boolean hasWaiters(Condition condition) {
-// if (condition == null)
-// throw new NullPointerException();
-// if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject))
-// throw new IllegalArgumentException("not owner");
-// return sync.hasWaiters((AbstractQueuedSynchronizer.ConditionObject)condition);
-// }
-
-// /**
-// * Returns an estimate of the number of threads waiting on the
-// * given condition associated with the write lock. Note that because
-// * timeouts and interrupts may occur at any time, the estimate
-// * serves only as an upper bound on the actual number of waiters.
-// * This method is designed for use in monitoring of the system
-// * state, not for synchronization control.
-// * @param condition the condition
-// * @return the estimated number of waiting threads.
-// * @throws IllegalMonitorStateException if this lock
-// * is not held
-// * @throws IllegalArgumentException if the given condition is
-// * not associated with this lock
-// * @throws NullPointerException if condition null
-// */
-// public int getWaitQueueLength(Condition condition) {
-// if (condition == null)
-// throw new NullPointerException();
-// if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject))
-// throw new IllegalArgumentException("not owner");
-// return sync.getWaitQueueLength((AbstractQueuedSynchronizer.ConditionObject)condition);
-// }
-//
-// /**
-// * Returns a collection containing those threads that may be
-// * waiting on the given condition associated with the write lock.
-// * Because the actual set of threads may change dynamically while
-// * constructing this result, the returned collection is only a
-// * best-effort estimate. The elements of the returned collection
-// * are in no particular order. This method is designed to
-// * facilitate construction of subclasses that provide more
-// * extensive condition monitoring facilities.
-// * @param condition the condition
-// * @return the collection of threads
-// * @throws IllegalMonitorStateException if this lock
-// * is not held
-// * @throws IllegalArgumentException if the given condition is
-// * not associated with this lock
-// * @throws NullPointerException if condition null
-// */
-// protected Collection getWaitingThreads(Condition condition) {
-// if (condition == null)
-// throw new NullPointerException();
-// if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject))
-// throw new IllegalArgumentException("not owner");
-// return sync.getWaitingThreads((AbstractQueuedSynchronizer.ConditionObject)condition);
-// }
-
- /**
- * Returns a string identifying this lock, as well as its lock state.
- * The state, in brackets, includes the String {@code "Write locks ="}
- * followed by the number of reentrantly held write locks, and the
- * String {@code "Read locks ="} followed by the number of held
- * read locks.
- *
- * @return a string identifying this lock, as well as its lock state
- */
- public String toString() {
- return super.toString() +
- "[Write locks = " + getWriteHoldCount() +
- ", Read locks = " + getReadLockCount() + "]";
- }
-}
diff --git a/src/build/bnd/scala-actors.bnd b/src/build/bnd/scala-actors.bnd
deleted file mode 100644
index 69885fc2bf..0000000000
--- a/src/build/bnd/scala-actors.bnd
+++ /dev/null
@@ -1,7 +0,0 @@
-Bundle-Name: Scala Actors
-Bundle-SymbolicName: org.scala-lang.scala-actors
-ver: @VERSION@
-Bundle-Version: ${ver}
-Export-Package: *;version=${ver}
-Import-Package: scala.*;version="${range;[==,=+);${ver}}",*
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
diff --git a/src/build/bnd/scala-compiler-doc.bnd b/src/build/bnd/scala-compiler-doc.bnd
index 9d6d0304d1..5b662e8cef 100644
--- a/src/build/bnd/scala-compiler-doc.bnd
+++ b/src/build/bnd/scala-compiler-doc.bnd
@@ -4,4 +4,5 @@ ver: @SCALA_COMPILER_DOC_VERSION@
Bundle-Version: ${ver}
Export-Package: *;version=${ver}
Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Include-Resource: @@SOURCE_JARNAME@
diff --git a/src/build/bnd/scala-compiler-interactive.bnd b/src/build/bnd/scala-compiler-interactive.bnd
index 07e3de35b0..fbfff60801 100644
--- a/src/build/bnd/scala-compiler-interactive.bnd
+++ b/src/build/bnd/scala-compiler-interactive.bnd
@@ -4,4 +4,5 @@ ver: @SCALA_COMPILER_INTERACTIVE_VERSION@
Bundle-Version: ${ver}
Export-Package: *;version=${ver}
Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Include-Resource: @@SOURCE_JARNAME@
diff --git a/src/build/bnd/scala-compiler.bnd b/src/build/bnd/scala-compiler.bnd
index 2bd24d780d..3e60c4973c 100644
--- a/src/build/bnd/scala-compiler.bnd
+++ b/src/build/bnd/scala-compiler.bnd
@@ -9,4 +9,5 @@ Import-Package: jline.*;resolution:=optional, \
scala.xml.*;version="${range;[====,====];@XML_VERSION@}";resolution:=optional, \
scala.*;version="${range;[==,=+);${ver}}", \
*
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Include-Resource: @@SOURCE_JARNAME@
diff --git a/src/build/bnd/scala-continuations-library.bnd b/src/build/bnd/scala-continuations-library.bnd
deleted file mode 100644
index b36718cc5b..0000000000
--- a/src/build/bnd/scala-continuations-library.bnd
+++ /dev/null
@@ -1,7 +0,0 @@
-Bundle-Name: Scala Delimited Continuations Library
-Bundle-SymbolicName: org.scala-lang.plugins.scala-continuations-library
-ver: @CONTINUATIONS_LIBRARY_VERSION@
-Bundle-Version: ${ver}
-Export-Package: *;version=${ver}
-Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
diff --git a/src/build/bnd/scala-continuations-plugin.bnd b/src/build/bnd/scala-continuations-plugin.bnd
deleted file mode 100644
index 2f2464b452..0000000000
--- a/src/build/bnd/scala-continuations-plugin.bnd
+++ /dev/null
@@ -1,7 +0,0 @@
-Bundle-Name: Scala Delimited Continuations Compiler Plugin
-Bundle-SymbolicName: org.scala-lang.plugins.scala-continuations-plugin
-ver: @CONTINUATIONS_PLUGIN_VERSION@
-Bundle-Version: ${ver}
-Export-Package: *;version=${ver}
-Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
diff --git a/src/build/bnd/scala-library.bnd b/src/build/bnd/scala-library.bnd
index 7eb4fa4b2a..e211c5d1ad 100644
--- a/src/build/bnd/scala-library.bnd
+++ b/src/build/bnd/scala-library.bnd
@@ -4,4 +4,5 @@ ver: @VERSION@
Bundle-Version: ${ver}
Export-Package: *;version=${ver}
Import-Package: sun.misc;resolution:=optional, *
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Include-Resource: @@SOURCE_JARNAME@
diff --git a/src/build/bnd/scala-parser-combinators.bnd b/src/build/bnd/scala-parser-combinators.bnd
index ef8646cbd0..515084f4a8 100644
--- a/src/build/bnd/scala-parser-combinators.bnd
+++ b/src/build/bnd/scala-parser-combinators.bnd
@@ -4,4 +4,5 @@ ver: @PARSER_COMBINATORS_VERSION@
Bundle-Version: ${ver}
Export-Package: *;version=${ver}
Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Include-Resource: @@SOURCE_JARNAME@
diff --git a/src/build/bnd/scala-reflect.bnd b/src/build/bnd/scala-reflect.bnd
index e4bc54e52e..59db311f8d 100644
--- a/src/build/bnd/scala-reflect.bnd
+++ b/src/build/bnd/scala-reflect.bnd
@@ -6,4 +6,5 @@ Export-Package: *;version=${ver}
Import-Package: scala.*;version="${range;[==,=+);${ver}}", \
scala.tools.nsc;resolution:=optional;version="${range;[==,=+);${ver}}", \
*
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Include-Resource: @@SOURCE_JARNAME@
diff --git a/src/build/bnd/scala-swing.bnd b/src/build/bnd/scala-swing.bnd
index f8b50baa91..24cd9f6f90 100644
--- a/src/build/bnd/scala-swing.bnd
+++ b/src/build/bnd/scala-swing.bnd
@@ -4,4 +4,5 @@ ver: @SCALA_SWING_VERSION@
Bundle-Version: ${ver}
Export-Package: *;version=${ver}
Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6,JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Include-Resource: @@SOURCE_JARNAME@
diff --git a/src/build/bnd/scala-xml.bnd b/src/build/bnd/scala-xml.bnd
index 01bf0144eb..b7b19824e8 100644
--- a/src/build/bnd/scala-xml.bnd
+++ b/src/build/bnd/scala-xml.bnd
@@ -4,4 +4,5 @@ ver: @XML_VERSION@
Bundle-Version: ${ver}
Export-Package: *;version=${ver}
Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",*
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Include-Resource: @@SOURCE_JARNAME@
diff --git a/src/build/dbuild-meta-json-gen.scala b/src/build/dbuild-meta-json-gen.scala
index d1d4c12b3f..043ad19b2e 100644
--- a/src/build/dbuild-meta-json-gen.scala
+++ b/src/build/dbuild-meta-json-gen.scala
@@ -1,16 +1,22 @@
-// use this script to generate dbuild-meta.json
-// make sure the version is specified correctly,
-// update the dependency structure and
-// check out distributed-build and run `sbt console`:
-// TODO: also generate build.xml and eclipse config from a similar data-structure
+// Use this script to generate dbuild-meta.json
-import distributed.project.model._
+// To generate the file:
+// - check out https://github.com/typesafehub/dbuild
+// - run `sbt metadata/console`
+// - paste the code below
+
+// The `version` field is required for the ProjMeta data structure. However, dbuild will
+// overwrite the version specified here with the version number found in the build.number
+// file, so the actual value doesn't matter, see ScalaBuildSystem:
+// https://github.com/typesafehub/dbuild/blob/25b087759cc52876712c594ea4172148beea1310/support/src/main/scala/com/typesafe/dbuild/support/scala/ScalaBuildSystem.scala#L351
+
+import com.typesafe.dbuild.model._
val meta =
- ExtractedBuildMeta("2.11.0", Seq(
+ ProjMeta(version = "2.12.0", projects = Seq(
Project("scala-library", "org.scala-lang",
Seq(ProjectRef("scala-library", "org.scala-lang")),
- Seq.empty), // TODO: forkjoin
+ Seq.empty),
Project("scala-reflect", "org.scala-lang",
Seq(ProjectRef("scala-reflect", "org.scala-lang")),
Seq(ProjectRef("scala-library", "org.scala-lang"))),
@@ -19,7 +25,6 @@ val meta =
Seq(ProjectRef("scala-reflect", "org.scala-lang"),
ProjectRef("scala-xml", "org.scala-lang.modules"),
ProjectRef("scala-parser-combinators", "org.scala-lang.modules")
- // asm
)),
// Project("scala-repl", "org.scala-lang",
@@ -30,10 +35,6 @@ val meta =
// Seq(ProjectRef("scala-interactive", "org.scala-lang")),
// Seq(ProjectRef("scala-compiler", "org.scala-lang"), ProjectRef("scaladoc", "org.scala-lang"))),
- Project("scala-actors", "org.scala-lang",
- Seq(ProjectRef("scala-actors", "org.scala-lang")),
- Seq(ProjectRef("scala-library", "org.scala-lang"))),
-
// Project("scaladoc", "org.scala-lang",
// Seq(ProjectRef("scaladoc", "org.scala-lang")),
// Seq(ProjectRef("scala-compiler", "org.scala-lang"),ProjectRef("scala-partest", "org.scala-lang"), ProjectRef("scala-xml", "org.scala-lang"), ProjectRef("scala-parser-combinators", "org.scala-lang"))),
@@ -44,4 +45,4 @@ val meta =
))
-println(Utils.writeValue(meta))
+println(Utils.writeValueFormatted(meta))
diff --git a/src/build/maven/scala-actors-pom.xml b/src/build/maven/scala-actors-pom.xml
deleted file mode 100644
index a0ebcecad1..0000000000
--- a/src/build/maven/scala-actors-pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-actors</artifactId>
- <packaging>jar</packaging>
- <version>@VERSION@</version>
- <name>Scala Actors library</name>
- <description>Deprecated Actors Library for Scala</description>
- <url>http://www.scala-lang.org/</url>
- <inceptionYear>2006</inceptionYear>
- <organization>
- <name>LAMP/EPFL</name>
- <url>http://lamp.epfl.ch/</url>
- </organization>
- <licenses>
- <license>
- <name>BSD 3-Clause</name>
- <url>http://www.scala-lang.org/license.html</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
- <scm>
- <connection>scm:git:git://github.com/scala/scala.git</connection>
- <url>https://github.com/scala/scala.git</url>
- </scm>
- <issueManagement>
- <system>JIRA</system>
- <url>https://issues.scala-lang.org/</url>
- </issueManagement>
- <properties>
- <info.apiURL>http://www.scala-lang.org/api/@VERSION@/</info.apiURL>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- <version>@VERSION@</version>
- </dependency>
- </dependencies>
- <developers>
- <developer>
- <id>lamp</id>
- <name>EPFL LAMP</name>
- </developer>
- <developer>
- <id>Typesafe</id>
- <name>Typesafe, Inc.</name>
- </developer>
- </developers>
-</project>
diff --git a/src/build/maven/scala-dist-pom.xml b/src/build/maven/scala-dist-pom.xml
index 9477e14285..1f6b6710ac 100644
--- a/src/build/maven/scala-dist-pom.xml
+++ b/src/build/maven/scala-dist-pom.xml
@@ -44,12 +44,6 @@
<artifactId>scalap</artifactId>
<version>@VERSION@</version>
</dependency>
- <dependency>
- <groupId>org.scala-lang.plugins</groupId>
- <!-- plugins are fully cross-versioned. But, we don't publish with 2.11.0-SNAPSHOT, instead use full version of the last non-snapshot version -->
- <artifactId>scala-continuations-plugin_@SCALA_FULL_VERSION@</artifactId>
- <version>@CONTINUATIONS_PLUGIN_VERSION@</version>
- </dependency>
<!-- duplicated from scala-compiler, where it's optional,
so that resolving scala-dist's transitive dependencies does not include jline,
even though we need to include it in the dist, but macros depending on the compiler
diff --git a/src/build/maven/scala-library-all-pom.xml b/src/build/maven/scala-library-all-pom.xml
index 3fcf207559..074c067742 100644
--- a/src/build/maven/scala-library-all-pom.xml
+++ b/src/build/maven/scala-library-all-pom.xml
@@ -49,31 +49,11 @@
<artifactId>scala-parser-combinators_@SCALA_BINARY_VERSION@</artifactId>
<version>@PARSER_COMBINATORS_VERSION@</version>
</dependency>
- <!--
- the continuations plugin is a dependency of scala-dist, as scala-library-all should be
- a drop-in replacement for scala-library, and as such should not (indirectly)
- depend on plugins/the compiler.
- -->
- <dependency>
- <groupId>org.scala-lang.plugins</groupId>
- <artifactId>scala-continuations-library_@SCALA_BINARY_VERSION@</artifactId>
- <version>@CONTINUATIONS_LIBRARY_VERSION@</version>
- </dependency>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-swing_@SCALA_BINARY_VERSION@</artifactId>
<version>@SCALA_SWING_VERSION@</version>
</dependency>
- <dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_@SCALA_BINARY_VERSION@</artifactId>
- <version>@AKKA_ACTOR_VERSION@</version>
- </dependency>
- <dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-actors-migration_@SCALA_BINARY_VERSION@</artifactId>
- <version>@ACTORS_MIGRATION_VERSION@</version>
- </dependency>
</dependencies>
<developers>
<developer>
diff --git a/src/compiler/scala/tools/cmd/Property.scala b/src/compiler/scala/tools/cmd/Property.scala
index b1d951a5c4..e6262a7e40 100644
--- a/src/compiler/scala/tools/cmd/Property.scala
+++ b/src/compiler/scala/tools/cmd/Property.scala
@@ -9,6 +9,7 @@ package cmd
import nsc.io._
import java.util.Properties
import java.io.FileInputStream
+import scala.sys.SystemProperties
/** Contains logic for translating a property key/value pair into
* equivalent command line arguments. The default settings will
@@ -58,7 +59,7 @@ trait Property extends Reference {
returning(new Properties)(_ load new FileInputStream(file.path))
def systemPropertiesToOptions: List[String] =
- propertiesToOptions(System.getProperties)
+ propertiesToOptions(new SystemProperties().toList)
def propertiesToOptions(file: File): List[String] =
propertiesToOptions(loadProperties(file))
diff --git a/src/compiler/scala/tools/nsc/Driver.scala b/src/compiler/scala/tools/nsc/Driver.scala
index 6befa76b3f..b30744c4df 100644
--- a/src/compiler/scala/tools/nsc/Driver.scala
+++ b/src/compiler/scala/tools/nsc/Driver.scala
@@ -1,7 +1,7 @@
package scala
package tools.nsc
-import scala.tools.nsc.reporters.ConsoleReporter
+import scala.tools.nsc.reporters.{ ConsoleReporter, Reporter }
import Properties.{ versionMsg, residentPromptString }
import scala.reflect.internal.util.FakePos
@@ -9,39 +9,43 @@ abstract class Driver {
val prompt = residentPromptString
- var reporter: ConsoleReporter = _
+ var reporter: Reporter = _
protected var command: CompilerCommand = _
protected var settings: Settings = _
+ /** Forward errors to the (current) reporter. */
protected def scalacError(msg: String): Unit = {
reporter.error(FakePos("scalac"), msg + "\n scalac -help gives more information")
}
+ /** True to continue compilation. */
protected def processSettingsHook(): Boolean = {
- if (settings.version) { reporter echo versionMsg ; false } else true
+ if (settings.version) { reporter echo versionMsg ; false }
+ else !reporter.hasErrors
}
protected def newCompiler(): Global
- protected def doCompile(compiler: Global) {
+ protected def doCompile(compiler: Global): Unit = {
if (command.files.isEmpty) {
reporter.echo(command.usageMsg)
reporter.echo(compiler.pluginOptionsHelp)
} else {
val run = new compiler.Run()
run compile command.files
- reporter.printSummary()
+ reporter.finish()
}
}
- def process(args: Array[String]) {
+ def process(args: Array[String]): Boolean = {
val ss = new Settings(scalacError)
- reporter = new ConsoleReporter(ss)
+ reporter = new ConsoleReporter(ss) // for reporting early config errors, before compiler is constructed
command = new CompilerCommand(args.toList, ss)
settings = command.settings
if (processSettingsHook()) {
val compiler = newCompiler()
+ reporter = compiler.reporter // adopt the configured reporter
try {
if (reporter.hasErrors)
reporter.flush()
@@ -57,11 +61,9 @@ abstract class Driver {
case _ => throw ex // unexpected error, tell the outside world.
}
}
- }
+ } else if (reporter.hasErrors) reporter.flush()
+ !reporter.hasErrors
}
- def main(args: Array[String]) {
- process(args)
- sys.exit(if (reporter.hasErrors) 1 else 0)
- }
+ def main(args: Array[String]): Unit = sys.exit(if (process(args)) 0 else 1)
}
diff --git a/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala b/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
index 1289d55c37..e99cce9186 100644
--- a/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
+++ b/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
@@ -9,7 +9,7 @@ import java.net.URL
import scala.tools.util.PathResolverFactory
class GenericRunnerSettings(error: String => Unit) extends Settings(error) {
- def classpathURLs: Seq[URL] = PathResolverFactory.create(this).resultAsURLs
+ lazy val classpathURLs: Seq[URL] = PathResolverFactory.create(this).resultAsURLs
val howtorun =
ChoiceSetting(
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 3469726455..5cb31c1b64 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -15,7 +15,7 @@ import io.{ SourceReader, AbstractFile, Path }
import reporters.{ Reporter, ConsoleReporter }
import util.{ ClassFileLookup, ClassPath, MergedClassPath, StatisticsInfo, returning }
import scala.reflect.ClassTag
-import scala.reflect.internal.util.{ SourceFile, NoSourceFile, BatchSourceFile, ScriptSourceFile }
+import scala.reflect.internal.util.{ ScalaClassLoader, SourceFile, NoSourceFile, BatchSourceFile, ScriptSourceFile }
import scala.reflect.internal.pickling.PickleBuffer
import symtab.{ Flags, SymbolTable, SymbolTrackers }
import symtab.classfile.Pickler
@@ -90,7 +90,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
this(new Settings(err => reporter.error(null, err)), reporter)
def this(settings: Settings) =
- this(settings, new ConsoleReporter(settings))
+ this(settings, Global.reporter(settings))
def picklerPhase: Phase = if (currentRun.isDefined) currentRun.picklerPhase else NoPhase
@@ -1373,13 +1373,17 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
unitbuf += unit
compiledFiles += unit.source.file.path
}
- private def checkDeprecatedSettings(unit: CompilationUnit) {
+ private def warnDeprecatedAndConflictingSettings(unit: CompilationUnit) {
// issue warnings for any usage of deprecated settings
settings.userSetSettings filter (_.isDeprecated) foreach { s =>
currentRun.reporting.deprecationWarning(NoPosition, s.name + " is deprecated: " + s.deprecationMessage.get)
}
- if (settings.target.value.contains("jvm-1.5"))
- currentRun.reporting.deprecationWarning(NoPosition, settings.target.name + ":" + settings.target.value + " is deprecated: use target for Java 1.6 or above.")
+ val supportedTarget = "jvm-1.8"
+ if (settings.target.value != supportedTarget) {
+ currentRun.reporting.deprecationWarning(NoPosition, settings.target.name + ":" + settings.target.value + " is deprecated and has no effect, setting to " + supportedTarget)
+ settings.target.value = supportedTarget
+ }
+ settings.conflictWarning.foreach(reporter.warning(NoPosition, _))
}
/* An iterator returning all the units being compiled in this run */
@@ -1470,7 +1474,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
def compileSources(sources: List[SourceFile]) = if (!reporter.hasErrors) {
def checkDeprecations() = {
- checkDeprecatedSettings(newCompilationUnit(""))
+ warnDeprecatedAndConflictingSettings(newCompilationUnit(""))
reporting.summarizeErrors()
}
@@ -1492,7 +1496,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
val startTime = currentTime
reporter.reset()
- checkDeprecatedSettings(unitbuf.head)
+ warnDeprecatedAndConflictingSettings(unitbuf.head)
globalPhase = fromPhase
while (globalPhase.hasNext && !reporter.hasErrors) {
@@ -1700,4 +1704,12 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
object Global {
def apply(settings: Settings, reporter: Reporter): Global = new Global(settings, reporter)
+
+ def apply(settings: Settings): Global = new Global(settings, reporter(settings))
+
+ private def reporter(settings: Settings): Reporter = {
+ //val loader = ScalaClassLoader(getClass.getClassLoader) // apply does not make delegate
+ val loader = new ClassLoader(getClass.getClassLoader) with ScalaClassLoader
+ loader.create[Reporter](settings.reporter.value, settings.errorFn)(settings)
+ }
}
diff --git a/src/compiler/scala/tools/nsc/Main.scala b/src/compiler/scala/tools/nsc/Main.scala
index a66ee572a9..e2cf49907b 100644
--- a/src/compiler/scala/tools/nsc/Main.scala
+++ b/src/compiler/scala/tools/nsc/Main.scala
@@ -17,7 +17,8 @@ class MainClass extends Driver with EvalLoop {
new compiler.Run() compile command.files
}
- override def newCompiler(): Global = Global(settings, reporter)
+ override def newCompiler(): Global = Global(settings)
+
override def doCompile(compiler: Global) {
if (settings.resident) resident(compiler)
else super.doCompile(compiler)
diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala
index 6442ef2d54..c70690e697 100755
--- a/src/compiler/scala/tools/nsc/ast/DocComments.scala
+++ b/src/compiler/scala/tools/nsc/ast/DocComments.scala
@@ -129,25 +129,6 @@ trait DocComments { self: Global =>
getDocComment(sym) map getUseCases getOrElse List()
}
- private val wikiReplacements = List(
- ("""(\n\s*\*?)(\s*\n)""" .r, """$1 <p>$2"""),
- ("""<([^\w/])""" .r, """&lt;$1"""),
- ("""([^\w/])>""" .r, """$1&gt;"""),
- ("""\{\{\{(.*(?:\n.*)*)\}\}\}""".r, """<pre>$1</pre>"""),
- ("""`([^`]*)`""" .r, """<code>$1</code>"""),
- ("""__([^_]*)__""" .r, """<u>$1</u>"""),
- ("""''([^']*)''""" .r, """<i>$1</i>"""),
- ("""'''([^']*)'''""" .r, """<b>$1</b>"""),
- ("""\^([^^]*)\^""" .r, """<sup>$1</sup>"""),
- (""",,([^,]*),,""" .r, """<sub>$1</sub>"""))
-
- /** Returns just the wiki expansion (this would correspond to
- * a comment in the input format of the JavaDoc tool, modulo differences
- * in tags.)
- */
- def expandWiki(str: String): String =
- (str /: wikiReplacements) { (str1, regexRepl) => regexRepl._1 replaceAllIn(str1, regexRepl._2) }
-
private def getDocComment(sym: Symbol): Option[DocComment] =
mapFind(sym :: allInheritedOverriddenSymbols(sym))(docComments get _)
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 4f195c2985..b76fb3d823 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -665,6 +665,15 @@ self =>
}
def isLiteral = isLiteralToken(in.token)
+ def isSimpleExprIntroToken(token: Token): Boolean = isLiteralToken(token) || (token match {
+ case IDENTIFIER | BACKQUOTED_IDENT |
+ THIS | SUPER | NEW | USCORE |
+ LPAREN | LBRACE | XMLSTART => true
+ case _ => false
+ })
+
+ def isSimpleExprIntro: Boolean = isExprIntroToken(in.token)
+
def isExprIntroToken(token: Token): Boolean = isLiteralToken(token) || (token match {
case IDENTIFIER | BACKQUOTED_IDENT |
THIS | SUPER | IF | FOR | NEW | USCORE | TRY | WHILE |
@@ -1565,11 +1574,14 @@ self =>
def prefixExpr(): Tree = {
if (isUnaryOp) {
atPos(in.offset) {
- val name = nme.toUnaryName(rawIdent().toTermName)
- if (name == nme.UNARY_- && isNumericLit)
- simpleExprRest(literal(isNegated = true), canApply = true)
- else
- Select(stripParens(simpleExpr()), name)
+ if (lookingAhead(isSimpleExprIntro)) {
+ val uname = nme.toUnaryName(rawIdent().toTermName)
+ if (uname == nme.UNARY_- && isNumericLit)
+ simpleExprRest(literal(isNegated = true), canApply = true)
+ else
+ Select(stripParens(simpleExpr()), uname)
+ }
+ else simpleExpr()
}
}
else simpleExpr()
diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
index 3e23291e92..01eff71057 100644
--- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
+++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
@@ -1145,7 +1145,7 @@ abstract class GenICode extends SubComponent {
// a package here, check if there's a package object.
val sym = (
if (!tree.symbol.isPackageClass) tree.symbol
- else tree.symbol.info.member(nme.PACKAGE) match {
+ else tree.symbol.info.packageObject match {
case NoSymbol => abort("Cannot use package as value: " + tree)
case s =>
devWarning(s"Found ${tree.symbol} where a package object is required. Converting to ${s.moduleClass}")
@@ -1502,7 +1502,7 @@ abstract class GenICode extends SubComponent {
if (!settings.optimise) {
if (l.tpe <:< BoxedNumberClass.tpe) {
if (r.tpe <:< BoxedNumberClass.tpe) platform.externalEqualsNumNum
- else if (r.tpe <:< BoxedCharacterClass.tpe) platform.externalEqualsNumObject // will be externalEqualsNumChar in 2.12, SI-9030
+ else if (r.tpe <:< BoxedCharacterClass.tpe) platform.externalEqualsNumChar
else platform.externalEqualsNumObject
} else platform.externalEquals
} else {
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/AsmUtils.scala b/src/compiler/scala/tools/nsc/backend/jvm/AsmUtils.scala
index 0df1b2029d..cd7e0b83e8 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/AsmUtils.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/AsmUtils.scala
@@ -10,6 +10,7 @@ import java.io.{StringWriter, PrintWriter}
import scala.tools.asm.util.{CheckClassAdapter, TraceClassVisitor, TraceMethodVisitor, Textifier}
import scala.tools.asm.{ClassWriter, Attribute, ClassReader}
import scala.collection.convert.decorateAsScala._
+import scala.tools.nsc.backend.jvm.analysis.InitialProducer
import scala.tools.nsc.backend.jvm.opt.InlineInfoAttributePrototype
object AsmUtils {
@@ -81,13 +82,16 @@ object AsmUtils {
/**
* Returns a human-readable representation of the given instruction.
*/
- def textify(insn: AbstractInsnNode): String = {
- val trace = new TraceMethodVisitor(new Textifier)
- insn.accept(trace)
- val sw = new StringWriter
- val pw = new PrintWriter(sw)
- trace.p.print(pw)
- sw.toString.trim
+ def textify(insn: AbstractInsnNode): String = insn match {
+ case _: InitialProducer =>
+ insn.toString
+ case _ =>
+ val trace = new TraceMethodVisitor(new Textifier)
+ insn.accept(trace)
+ val sw = new StringWriter
+ val pw = new PrintWriter(sw)
+ trace.p.print(pw)
+ sw.toString.trim
}
/**
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeAsmCommon.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeAsmCommon.scala
index daa31c5dfe..93f5159f89 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeAsmCommon.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeAsmCommon.scala
@@ -256,14 +256,17 @@ final class BCodeAsmCommon[G <: Global](val global: G) {
if (hasAbstractMethod) ACC_ABSTRACT else 0
}
GenBCode.mkFlags(
- if (classSym.isPublic) ACC_PUBLIC else 0,
- if (classSym.isFinal) ACC_FINAL else 0,
+ // SI-9393: the classfile / java source parser make java annotation symbols look like classes.
+ // here we recover the actual classfile flags.
+ if (classSym.hasJavaAnnotationFlag) ACC_ANNOTATION | ACC_INTERFACE | ACC_ABSTRACT else 0,
+ if (classSym.isPublic) ACC_PUBLIC else 0,
+ if (classSym.isFinal) ACC_FINAL else 0,
// see the link above. javac does the same: ACC_SUPER for all classes, but not interfaces.
- if (classSym.isInterface) ACC_INTERFACE else ACC_SUPER,
+ if (classSym.isInterface) ACC_INTERFACE else ACC_SUPER,
// for Java enums, we cannot trust `hasAbstractFlag` (see comment in enumFlags)
- if (!classSym.hasEnumFlag && classSym.hasAbstractFlag) ACC_ABSTRACT else 0,
- if (classSym.isArtifact) ACC_SYNTHETIC else 0,
- if (classSym.hasEnumFlag) enumFlags else 0
+ if (!classSym.hasJavaEnumFlag && classSym.hasAbstractFlag) ACC_ABSTRACT else 0,
+ if (classSym.isArtifact) ACC_SYNTHETIC else 0,
+ if (classSym.hasJavaEnumFlag) enumFlags else 0
)
}
@@ -310,10 +313,10 @@ final class BCodeAsmCommon[G <: Global](val global: G) {
}
private def retentionPolicyOf(annot: AnnotationInfo): Symbol =
- annot.atp.typeSymbol.getAnnotation(AnnotationRetentionAttr).map(_.assocs).map(assoc =>
+ annot.atp.typeSymbol.getAnnotation(AnnotationRetentionAttr).map(_.assocs).flatMap(assoc =>
assoc.collectFirst {
case (`nme`.value, LiteralAnnotArg(Constant(value: Symbol))) => value
- }).flatten.getOrElse(AnnotationRetentionPolicyClassValue)
+ }).getOrElse(AnnotationRetentionPolicyClassValue)
def implementedInterfaces(classSym: Symbol): List[Symbol] = {
// Additional interface parents based on annotations and other cues
@@ -322,9 +325,18 @@ final class BCodeAsmCommon[G <: Global](val global: G) {
case _ => None
}
- def isInterfaceOrTrait(sym: Symbol) = sym.isInterface || sym.isTrait
+ // SI-9393: java annotations are interfaces, but the classfile / java source parsers make them look like classes.
+ def isInterfaceOrTrait(sym: Symbol) = sym.isInterface || sym.isTrait || sym.hasJavaAnnotationFlag
- val allParents = classSym.info.parents ++ classSym.annotations.flatMap(newParentForAnnotation)
+ val classParents = {
+ val parents = classSym.info.parents
+ // SI-9393: the classfile / java source parsers add Annotation and ClassfileAnnotation to the
+ // parents of a java annotations. undo this for the backend (where we need classfile-level information).
+ if (classSym.hasJavaAnnotationFlag) parents.filterNot(c => c.typeSymbol == ClassfileAnnotationClass || c.typeSymbol == AnnotationClass)
+ else parents
+ }
+
+ val allParents = classParents ++ classSym.annotations.flatMap(newParentForAnnotation)
// We keep the superClass when computing minimizeParents to eliminate more interfaces.
// Example: T can be eliminated from D
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala
index 40ba0c010b..22ac8f84d4 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala
@@ -632,10 +632,11 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder {
case _ =>
abort(s"Cannot instantiate $tpt of kind: $generatedType")
}
- case Apply(_, args) if app.hasAttachment[delambdafy.LambdaMetaFactoryCapable] =>
+ case Apply(fun, args) if app.hasAttachment[delambdafy.LambdaMetaFactoryCapable] =>
val attachment = app.attachments.get[delambdafy.LambdaMetaFactoryCapable].get
genLoadArguments(args, paramTKs(app))
genInvokeDynamicLambda(attachment.target, attachment.arity, attachment.functionalInterface)
+ generatedType = asmMethodType(fun.symbol).returnType
case Apply(fun @ _, List(expr)) if currentRun.runDefinitions.isBox(fun.symbol) =>
val nativeKind = tpeTK(expr)
@@ -842,8 +843,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder {
* loading another throwable first).
*
* New (http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.10.1)
- * - Requires consistent stack map frames. GenBCode generates stack frames if -target:jvm-1.6
- * or higher.
+ * - Requires consistent stack map frames. GenBCode always generates stack frames.
* - In practice: the ASM library computes stack map frames for us (ClassWriter). Emitting
* correct frames after an ATHROW is probably complex, so ASM uses the following strategy:
* - Every time when generating an ATHROW, a new basic block is started.
@@ -921,7 +921,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder {
def genLoadModule(tree: Tree): BType = {
val module = (
if (!tree.symbol.isPackageClass) tree.symbol
- else tree.symbol.info.member(nme.PACKAGE) match {
+ else tree.symbol.info.packageObject match {
case NoSymbol => abort(s"SI-5604: Cannot use package as value: $tree")
case s => abort(s"SI-5604: found package class where package object expected: $tree")
}
@@ -1231,7 +1231,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder {
val equalsMethod: Symbol = {
if (l.tpe <:< BoxedNumberClass.tpe) {
if (r.tpe <:< BoxedNumberClass.tpe) platform.externalEqualsNumNum
- else if (r.tpe <:< BoxedCharacterClass.tpe) platform.externalEqualsNumObject // will be externalEqualsNumChar in 2.12, SI-9030
+ else if (r.tpe <:< BoxedCharacterClass.tpe) platform.externalEqualsNumChar
else platform.externalEqualsNumObject
} else platform.externalEquals
}
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala
index 6aa3a62295..0f381a4325 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala
@@ -329,7 +329,8 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
// If the `sym` is a java module class, we use the java class instead. This ensures that we
// register the class (instead of the module class) in innerClassBufferASM.
// The two symbols have the same name, so the resulting internalName is the same.
- val classSym = if (sym.isJavaDefined && sym.isModuleClass) sym.linkedClassOfClass else sym
+ // Phase travel (exitingPickler) required for SI-6613 - linkedCoC is only reliable in early phases (nesting)
+ val classSym = if (sym.isJavaDefined && sym.isModuleClass) exitingPickler(sym.linkedClassOfClass) else sym
getClassBTypeAndRegisterInnerClass(classSym).internalName
}
@@ -692,7 +693,7 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
* cache = new java.util.HashMap()
* $deserializeLambdaCache$ = cache
* }
- * return scala.compat.java8.runtime.LambdaDeserializer.deserializeLambda(MethodHandles.lookup(), cache, l);
+ * return scala.runtime.LambdaDeserializer.deserializeLambda(MethodHandles.lookup(), cache, l);
* }
*/
def addLambdaDeserialize(clazz: Symbol, jclass: asm.ClassVisitor): Unit = {
@@ -714,7 +715,8 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
{
val mv = cw.visitMethod(ACC_PRIVATE + ACC_STATIC + ACC_SYNTHETIC, "$deserializeLambda$", "(Ljava/lang/invoke/SerializedLambda;)Ljava/lang/Object;", null, null)
mv.visitCode()
- mv.visitFieldInsn(GETSTATIC, clazz.javaBinaryName.encoded, "$deserializeLambdaCache$", "Ljava/util/Map;")
+ // javaBinaryName returns the internal name of a class. Also used in BTypesFromsymbols.classBTypeFromSymbol.
+ mv.visitFieldInsn(GETSTATIC, clazz.javaBinaryName.toString, "$deserializeLambdaCache$", "Ljava/util/Map;")
mv.visitVarInsn(ASTORE, 1)
mv.visitVarInsn(ALOAD, 1)
val l0 = new asm.Label()
@@ -724,13 +726,13 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
mv.visitMethodInsn(INVOKESPECIAL, "java/util/HashMap", "<init>", "()V", false)
mv.visitVarInsn(ASTORE, 1)
mv.visitVarInsn(ALOAD, 1)
- mv.visitFieldInsn(PUTSTATIC, clazz.javaBinaryName.encoded, "$deserializeLambdaCache$", "Ljava/util/Map;")
+ mv.visitFieldInsn(PUTSTATIC, clazz.javaBinaryName.toString, "$deserializeLambdaCache$", "Ljava/util/Map;")
mv.visitLabel(l0)
- mv.visitFrame(asm.Opcodes.F_APPEND,1, Array("java/util/Map"), 0, null)
+ mv.visitFieldInsn(GETSTATIC, "scala/runtime/LambdaDeserializer$", "MODULE$", "Lscala/runtime/LambdaDeserializer$;")
mv.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodHandles", "lookup", "()Ljava/lang/invoke/MethodHandles$Lookup;", false)
mv.visitVarInsn(ALOAD, 1)
mv.visitVarInsn(ALOAD, 0)
- mv.visitMethodInsn(INVOKESTATIC, "scala/compat/java8/runtime/LambdaDeserializer", "deserializeLambda", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/util/Map;Ljava/lang/invoke/SerializedLambda;)Ljava/lang/Object;", false)
+ mv.visitMethodInsn(INVOKEVIRTUAL, "scala/runtime/LambdaDeserializer$", "deserializeLambda", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/util/Map;Ljava/lang/invoke/SerializedLambda;)Ljava/lang/Object;", false)
mv.visitInsn(ARETURN)
mv.visitEnd()
}
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeIdiomatic.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeIdiomatic.scala
index eb0da7caef..535e1a8620 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeIdiomatic.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeIdiomatic.scala
@@ -28,9 +28,6 @@ abstract class BCodeIdiomatic extends SubComponent {
import coreBTypes._
val classfileVersion: Int = settings.target.value match {
- case "jvm-1.5" => asm.Opcodes.V1_5
- case "jvm-1.6" => asm.Opcodes.V1_6
- case "jvm-1.7" => asm.Opcodes.V1_7
case "jvm-1.8" => asm.Opcodes.V1_8
}
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala
index c7c2e43f82..a9b6a312e9 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala
@@ -153,9 +153,9 @@ abstract class BCodeSkelBuilder extends BCodeHelpers {
*/
private def initJClass(jclass: asm.ClassVisitor) {
- val ps = claszSymbol.info.parents
- val superClass: String = if (ps.isEmpty) ObjectReference.internalName else internalName(ps.head.typeSymbol)
- val interfaceNames = classBTypeFromSymbol(claszSymbol).info.get.interfaces map {
+ val bType = classBTypeFromSymbol(claszSymbol)
+ val superClass = bType.info.get.superClass.getOrElse(ObjectReference).internalName
+ val interfaceNames = bType.info.get.interfaces map {
case classBType =>
if (classBType.isNestedClass.get) { innerClassBufferASM += classBType }
classBType.internalName
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala
index cf29c8090b..45d9cc3ff3 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala
@@ -216,7 +216,18 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
}
private def setClassInfo(classSym: Symbol, classBType: ClassBType): ClassBType = {
- val superClassSym = if (classSym.isImplClass) ObjectClass else classSym.superClass
+ // Check for isImplClass: trait implementation classes have NoSymbol as superClass
+ // Check for hasAnnotationFlag for SI-9393: the classfile / java source parsers add
+ // scala.annotation.Annotation as superclass to java annotations. In reality, java
+ // annotation classfiles have superclass Object (like any interface classfile).
+ val superClassSym = if (classSym.isImplClass || classSym.hasJavaAnnotationFlag) ObjectClass else {
+ val sc = classSym.superClass
+ // SI-9393: Java annotation classes don't have the ABSTRACT/INTERFACE flag, so they appear
+ // (wrongly) as superclasses. Fix this for BTypes: the java annotation will appear as interface
+ // (handled by method implementedInterfaces), the superclass is set to Object.
+ if (sc.hasJavaAnnotationFlag) ObjectClass
+ else sc
+ }
assert(
if (classSym == ObjectClass)
superClassSym == NoSymbol
@@ -351,7 +362,15 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
val isTopLevel = innerClassSym.rawowner.isPackageClass
// impl classes are considered top-level, see comment in BTypes
if (isTopLevel || considerAsTopLevelImplementationArtifact(innerClassSym)) None
- else {
+ else if (innerClassSym.rawowner.isTerm) {
+ // This case should never be reached: the lambdalift phase mutates the rawowner field of all
+ // classes to be the enclosing class. SI-9392 shows an errant macro that leaves a reference
+ // to a local class symbol that no longer exists, which is not updated by lambdalift.
+ devWarning(innerClassSym.pos,
+ s"""The class symbol $innerClassSym with the term symbol ${innerClassSym.rawowner} as `rawowner` reached the backend.
+ |Most likely this indicates a stale reference to a non-existing class introduced by a macro, see SI-9392.""".stripMargin)
+ None
+ } else {
// See comment in BTypes, when is a class marked static in the InnerClass table.
val isStaticNestedClass = isOriginallyStaticOwner(innerClassSym.originalOwner)
@@ -559,7 +578,7 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
if (sym.isBridge) ACC_BRIDGE | ACC_SYNTHETIC else 0,
if (sym.isArtifact) ACC_SYNTHETIC else 0,
if (sym.isClass && !sym.isInterface) ACC_SUPER else 0,
- if (sym.hasEnumFlag) ACC_ENUM else 0,
+ if (sym.hasJavaEnumFlag) ACC_ENUM else 0,
if (sym.isVarargsMethod) ACC_VARARGS else 0,
if (sym.hasFlag(symtab.Flags.SYNCHRONIZED)) ACC_SYNCHRONIZED else 0,
if (sym.isDeprecated) asm.Opcodes.ACC_DEPRECATED else 0
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BackendReporting.scala b/src/compiler/scala/tools/nsc/backend/jvm/BackendReporting.scala
index 4fc05cafdc..b41d0de92f 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/BackendReporting.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/BackendReporting.scala
@@ -1,7 +1,7 @@
package scala.tools.nsc
package backend.jvm
-import scala.tools.asm.tree.{AbstractInsnNode, MethodNode}
+import scala.tools.asm.tree.{InvokeDynamicInsnNode, AbstractInsnNode, MethodNode}
import scala.tools.nsc.backend.jvm.BTypes.InternalName
import scala.reflect.internal.util.Position
import scala.tools.nsc.settings.ScalaSettings
@@ -246,11 +246,16 @@ object BackendReporting {
case class ResultingMethodTooLarge(calleeDeclarationClass: InternalName, name: String, descriptor: String,
callsiteClass: InternalName, callsiteName: String, callsiteDesc: String) extends CannotInlineWarning
+ case object UnknownInvokeDynamicInstruction extends OptimizerWarning {
+ override def toString = "The callee contains an InvokeDynamic instruction with an unknown bootstrap method (not a LambdaMetaFactory)."
+ def emitWarning(settings: ScalaSettings): Boolean = settings.YoptWarningEmitAtInlineFailed
+ }
+
/**
* Used in `rewriteClosureApplyInvocations` when a closure apply callsite cannot be rewritten
* to the closure body method.
*/
- trait RewriteClosureApplyToClosureBodyFailed extends OptimizerWarning {
+ sealed trait RewriteClosureApplyToClosureBodyFailed extends OptimizerWarning {
def pos: Position
override def emitWarning(settings: ScalaSettings): Boolean = this match {
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
index 2f1cd732da..7096f16d75 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
@@ -307,7 +307,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self =>
if (sym.isBridge) ACC_BRIDGE | ACC_SYNTHETIC else 0,
if (sym.isArtifact) ACC_SYNTHETIC else 0,
if (sym.isClass && !sym.isInterface) ACC_SUPER else 0,
- if (sym.hasEnumFlag) ACC_ENUM else 0,
+ if (sym.hasJavaEnumFlag) ACC_ENUM else 0,
if (sym.isVarargsMethod) ACC_VARARGS else 0,
if (sym.hasFlag(Flags.SYNCHRONIZED)) ACC_SYNCHRONIZED else 0
)
@@ -441,9 +441,6 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self =>
// -----------------------------------------------------------------------------------------
private val classfileVersion: Int = settings.target.value match {
- case "jvm-1.5" => asm.Opcodes.V1_5
- case "jvm-1.6" => asm.Opcodes.V1_6
- case "jvm-1.7" => asm.Opcodes.V1_7
case "jvm-1.8" => asm.Opcodes.V1_8
}
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenBCode.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenBCode.scala
index af962c4ce0..00b4b8b667 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenBCode.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenBCode.scala
@@ -252,6 +252,9 @@ abstract class GenBCode extends BCodeSyncAndTry {
localOptimizations(item.plain)
addToQ3(item)
} catch {
+ case e: java.lang.RuntimeException if e.getMessage != null && (e.getMessage contains "too large!") =>
+ reporter.error(NoPosition,
+ s"Could not write class ${item.plain.name} because it exceeds JVM code size limits. ${e.getMessage}")
case ex: Throwable =>
ex.printStackTrace()
error(s"Error while emitting ${item.plain.name}\n${ex.getMessage}")
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzer.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzer.scala
index 40f91cbed4..1c24acba03 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzer.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzer.scala
@@ -57,8 +57,20 @@ import scala.collection.convert.decorateAsScala._
* copying operations.
*/
class ProdConsAnalyzer(methodNode: MethodNode, classInternalName: InternalName) {
+
+ /* Timers for benchmarking ProdCons
+ import scala.reflect.internal.util.Statistics._
+ import ProdConsAnalyzer._
+ val analyzerTimer = newSubTimer(classInternalName + "#" + methodNode.name + " - analysis", prodConsAnalyzerTimer)
+ val consumersTimer = newSubTimer(classInternalName + "#" + methodNode.name + " - consumers", prodConsAnalyzerTimer)
+ */
+
val analyzer = new Analyzer(new InitialProducerSourceInterpreter)
+
+// val start = analyzerTimer.start()
analyzer.analyze(classInternalName, methodNode)
+// analyzerTimer.stop(start)
+// println(analyzerTimer.line)
def frameAt(insn: AbstractInsnNode) = analyzer.frameAt(insn, methodNode)
@@ -103,7 +115,11 @@ class ProdConsAnalyzer(methodNode: MethodNode, classInternalName: InternalName)
def initialProducersForValueAt(insn: AbstractInsnNode, slot: Int): Set[AbstractInsnNode] = {
def initialProducers(insn: AbstractInsnNode, producedSlot: Int): Set[AbstractInsnNode] = {
if (isCopyOperation(insn)) {
- _initialProducersCache.getOrElseUpdate((insn, producedSlot), {
+ val key = (insn, producedSlot)
+ _initialProducersCache.getOrElseUpdate(key, {
+ // prevent infinite recursion if an instruction is its own producer or consumer
+ // see cyclicProdCons in ProdConsAnalyzerTest
+ _initialProducersCache(key) = Set.empty
val (sourceValue, sourceValueSlot) = copyOperationSourceValue(insn, producedSlot)
sourceValue.insns.iterator.asScala.flatMap(initialProducers(_, sourceValueSlot)).toSet
})
@@ -121,7 +137,11 @@ class ProdConsAnalyzer(methodNode: MethodNode, classInternalName: InternalName)
def ultimateConsumersOfValueAt(insn: AbstractInsnNode, slot: Int): Set[AbstractInsnNode] = {
def ultimateConsumers(insn: AbstractInsnNode, consumedSlot: Int): Set[AbstractInsnNode] = {
if (isCopyOperation(insn)) {
- _ultimateConsumersCache.getOrElseUpdate((insn, consumedSlot), {
+ val key = (insn, consumedSlot)
+ _ultimateConsumersCache.getOrElseUpdate(key, {
+ // prevent infinite recursion if an instruction is its own producer or consumer
+ // see cyclicProdCons in ProdConsAnalyzerTest
+ _ultimateConsumersCache(key) = Set.empty
for {
producedSlot <- copyOperationProducedValueSlots(insn, consumedSlot)
consumer <- consumersOfValueAt(insn.getNext, producedSlot)
@@ -384,6 +404,7 @@ class ProdConsAnalyzer(methodNode: MethodNode, classInternalName: InternalName)
/** For each instruction, a set of potential consumers of the produced values. */
private lazy val _consumersOfOutputsFrom: Map[AbstractInsnNode, Vector[Set[AbstractInsnNode]]] = {
+// val start = consumersTimer.start()
var res = Map.empty[AbstractInsnNode, Vector[Set[AbstractInsnNode]]]
for {
insn <- methodNode.instructions.iterator.asScala
@@ -396,6 +417,8 @@ class ProdConsAnalyzer(methodNode: MethodNode, classInternalName: InternalName)
val outputIndex = producedSlots.indexOf(i)
res = res.updated(producer, currentConsumers.updated(outputIndex, currentConsumers(outputIndex) + insn))
}
+// consumersTimer.stop(start)
+// println(consumersTimer.line)
res
}
@@ -403,6 +426,11 @@ class ProdConsAnalyzer(methodNode: MethodNode, classInternalName: InternalName)
private val _ultimateConsumersCache: mutable.AnyRefMap[(AbstractInsnNode, Int), Set[AbstractInsnNode]] = mutable.AnyRefMap.empty
}
+object ProdConsAnalyzer {
+ import scala.reflect.internal.util.Statistics._
+ val prodConsAnalyzerTimer = newTimer("Time in ProdConsAnalyzer", "jvm")
+}
+
/**
* A class for pseudo-instructions representing the initial producers of local values that have
* no producer instruction in the method:
@@ -431,9 +459,9 @@ abstract class InitialProducer extends AbstractInsnNode(-1) {
override def accept(cv: MethodVisitor): Unit = throw new UnsupportedOperationException
}
-case class ParameterProducer(local: Int) extends InitialProducer
-case class UninitializedLocalProducer(local: Int) extends InitialProducer
-case class ExceptionProducer(handlerFrame: Frame[_ <: Value]) extends InitialProducer
+case class ParameterProducer(local: Int) extends InitialProducer
+case class UninitializedLocalProducer(local: Int) extends InitialProducer
+case class ExceptionProducer[V <: Value](handlerFrame: Frame[V]) extends InitialProducer
class InitialProducerSourceInterpreter extends SourceInterpreter {
override def newParameterValue(isInstanceMethod: Boolean, local: Int, tp: Type): SourceValue = {
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/BytecodeUtils.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/BytecodeUtils.scala
index 0ec550981a..df8dcc690a 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/opt/BytecodeUtils.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/BytecodeUtils.scala
@@ -12,7 +12,7 @@ import scala.collection.mutable
import scala.reflect.internal.util.Collections._
import scala.tools.asm.commons.CodeSizeEvaluator
import scala.tools.asm.tree.analysis._
-import scala.tools.asm.{MethodWriter, ClassWriter, Label, Opcodes}
+import scala.tools.asm.{MethodWriter, ClassWriter, Label, Opcodes, Type}
import scala.tools.asm.tree._
import GenBCode._
import scala.collection.convert.decorateAsScala._
@@ -104,6 +104,8 @@ object BytecodeUtils {
def isStrictfpMethod(methodNode: MethodNode): Boolean = (methodNode.access & Opcodes.ACC_STRICT) != 0
+ def isReference(t: Type) = t.getSort == Type.OBJECT || t.getSort == Type.ARRAY
+
def nextExecutableInstruction(instruction: AbstractInsnNode, alsoKeep: AbstractInsnNode => Boolean = Set()): Option[AbstractInsnNode] = {
var result = instruction
do { result = result.getNext }
@@ -331,6 +333,26 @@ object BytecodeUtils {
}
/**
+ * This method is used by optimizer components to eliminate phantom values of instruction
+ * that load a value of type `Nothing$` or `Null$`. Such values on the stack don't interact well
+ * with stack map frames.
+ *
+ * For example, `opt.getOrElse(throw e)` is re-written to an invocation of the lambda body, a
+ * method with return type `Nothing$`. Similarly for `opt.getOrElse(null)` and `Null$`.
+ *
+ * During bytecode generation this is handled by BCodeBodyBuilder.adapt. See the comment in that
+ * method which explains the issue with such phantom values.
+ */
+ def fixLoadedNothingOrNullValue(loadedType: Type, loadInstr: AbstractInsnNode, methodNode: MethodNode, bTypes: BTypes): Unit = {
+ if (loadedType == bTypes.coreBTypes.RT_NOTHING.toASMType) {
+ methodNode.instructions.insert(loadInstr, new InsnNode(Opcodes.ATHROW))
+ } else if (loadedType == bTypes.coreBTypes.RT_NULL.toASMType) {
+ methodNode.instructions.insert(loadInstr, new InsnNode(Opcodes.ACONST_NULL))
+ methodNode.instructions.insert(loadInstr, new InsnNode(Opcodes.POP))
+ }
+ }
+
+ /**
* A wrapper to make ASM's Analyzer a bit easier to use.
*/
class AsmAnalyzer[V <: Value](methodNode: MethodNode, classInternalName: InternalName, interpreter: Interpreter[V] = new BasicInterpreter) {
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala
index 8abecdb261..96455c0e38 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala
@@ -9,7 +9,7 @@ package opt
import scala.reflect.internal.util.{NoPosition, Position}
import scala.tools.asm.tree.analysis.{Value, Analyzer, BasicInterpreter}
-import scala.tools.asm.{Opcodes, Type}
+import scala.tools.asm.{Opcodes, Type, Handle}
import scala.tools.asm.tree._
import scala.collection.concurrent
import scala.collection.convert.decorateAsScala._
@@ -24,7 +24,7 @@ class CallGraph[BT <: BTypes](val btypes: BT) {
val callsites: concurrent.Map[MethodInsnNode, Callsite] = recordPerRunCache(concurrent.TrieMap.empty)
- val closureInstantiations: concurrent.Map[InvokeDynamicInsnNode, (MethodNode, ClassBType)] = recordPerRunCache(concurrent.TrieMap.empty)
+ val closureInstantiations: concurrent.Map[InvokeDynamicInsnNode, ClosureInstantiation] = recordPerRunCache(concurrent.TrieMap.empty)
def addClass(classNode: ClassNode): Unit = {
val classType = classBTypeFromClassNode(classNode)
@@ -33,14 +33,14 @@ class CallGraph[BT <: BTypes](val btypes: BT) {
(calls, closureInits) = analyzeCallsites(m, classType)
} {
calls foreach (callsite => callsites(callsite.callsiteInstruction) = callsite)
- closureInits foreach (indy => closureInstantiations(indy) = (m, classType))
+ closureInits foreach (lmf => closureInstantiations(lmf.indy) = ClosureInstantiation(lmf, m, classType))
}
}
/**
* Returns a list of callsites in the method, plus a list of closure instantiation indy instructions.
*/
- def analyzeCallsites(methodNode: MethodNode, definingClass: ClassBType): (List[Callsite], List[InvokeDynamicInsnNode]) = {
+ def analyzeCallsites(methodNode: MethodNode, definingClass: ClassBType): (List[Callsite], List[LambdaMetaFactoryCall]) = {
case class CallsiteInfo(safeToInline: Boolean, safeToRewrite: Boolean,
annotatedInline: Boolean, annotatedNoInline: Boolean,
@@ -129,7 +129,7 @@ class CallGraph[BT <: BTypes](val btypes: BT) {
}
val callsites = new collection.mutable.ListBuffer[Callsite]
- val closureInstantiations = new collection.mutable.ListBuffer[InvokeDynamicInsnNode]
+ val closureInstantiations = new collection.mutable.ListBuffer[LambdaMetaFactoryCall]
methodNode.instructions.iterator.asScala foreach {
case call: MethodInsnNode =>
@@ -173,8 +173,8 @@ class CallGraph[BT <: BTypes](val btypes: BT) {
callsitePosition = callsitePositions.getOrElse(call, NoPosition)
)
- case indy: InvokeDynamicInsnNode =>
- if (closureOptimizer.isClosureInstantiation(indy)) closureInstantiations += indy
+ case LambdaMetaFactoryCall(indy, samMethodType, implMethod, instantiatedMethodType) =>
+ closureInstantiations += LambdaMetaFactoryCall(indy, samMethodType, implMethod, instantiatedMethodType)
case _ =>
}
@@ -236,4 +236,82 @@ class CallGraph[BT <: BTypes](val btypes: BT) {
calleeInfoWarning: Option[CalleeInfoWarning]) {
assert(!(safeToInline && safeToRewrite), s"A callee of ${callee.name} can be either safeToInline or safeToRewrite, but not both.")
}
+
+ final case class ClosureInstantiation(lambdaMetaFactoryCall: LambdaMetaFactoryCall, ownerMethod: MethodNode, ownerClass: ClassBType) {
+ override def toString = s"ClosureInstantiation($lambdaMetaFactoryCall, ${ownerMethod.name + ownerMethod.desc}, $ownerClass)"
+ }
+ final case class LambdaMetaFactoryCall(indy: InvokeDynamicInsnNode, samMethodType: Type, implMethod: Handle, instantiatedMethodType: Type)
+
+ object LambdaMetaFactoryCall {
+ private val lambdaMetaFactoryInternalName: InternalName = "java/lang/invoke/LambdaMetafactory"
+
+ private val metafactoryHandle = {
+ val metafactoryMethodName: String = "metafactory"
+ val metafactoryDesc: String = "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"
+ new Handle(Opcodes.H_INVOKESTATIC, lambdaMetaFactoryInternalName, metafactoryMethodName, metafactoryDesc)
+ }
+
+ private val altMetafactoryHandle = {
+ val altMetafactoryMethodName: String = "altMetafactory"
+ val altMetafactoryDesc: String = "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;"
+ new Handle(Opcodes.H_INVOKESTATIC, lambdaMetaFactoryInternalName, altMetafactoryMethodName, altMetafactoryDesc)
+ }
+
+ def unapply(insn: AbstractInsnNode): Option[(InvokeDynamicInsnNode, Type, Handle, Type)] = insn match {
+ case indy: InvokeDynamicInsnNode if indy.bsm == metafactoryHandle || indy.bsm == altMetafactoryHandle =>
+ indy.bsmArgs match {
+ case Array(samMethodType: Type, implMethod: Handle, instantiatedMethodType: Type, xs@_*) => // xs binding because IntelliJ gets confused about _@_*
+ // LambdaMetaFactory performs a number of automatic adaptations when invoking the lambda
+ // implementation method (casting, boxing, unboxing, and primitive widening, see Javadoc).
+ //
+ // The closure optimizer supports only one of those adaptations: it will cast arguments
+ // to the correct type when re-writing a closure call to the body method. Example:
+ //
+ // val fun: String => String = l => l
+ // val l = List("")
+ // fun(l.head)
+ //
+ // The samMethodType of Function1 is `(Object)Object`, while the instantiatedMethodType
+ // is `(String)String`. The return type of `List.head` is `Object`.
+ //
+ // The implMethod has the signature `C$anonfun(String)String`.
+ //
+ // At the closure callsite, we have an `INVOKEINTERFACE Function1.apply (Object)Object`,
+ // so the object returned by `List.head` can be directly passed into the call (no cast).
+ //
+ // The closure object will cast the object to String before passing it to the implMethod.
+ //
+ // When re-writing the closure callsite to the implMethod, we have to insert a cast.
+ //
+ // The check below ensures that
+ // (1) the implMethod type has the expected singature (captured types plus argument types
+ // from instantiatedMethodType)
+ // (2) the receiver of the implMethod matches the first captured type
+ // (3) all parameters that are not the same in samMethodType and instantiatedMethodType
+ // are reference types, so that we can insert casts to perform the same adaptation
+ // that the closure object would.
+
+ val isStatic = implMethod.getTag == Opcodes.H_INVOKESTATIC
+ val indyParamTypes = Type.getArgumentTypes(indy.desc)
+ val instantiatedMethodArgTypes = instantiatedMethodType.getArgumentTypes
+ val expectedImplMethodType = {
+ val paramTypes = (if (isStatic) indyParamTypes else indyParamTypes.tail) ++ instantiatedMethodArgTypes
+ Type.getMethodType(instantiatedMethodType.getReturnType, paramTypes: _*)
+ }
+
+ val isIndyLambda = (
+ Type.getType(implMethod.getDesc) == expectedImplMethodType // (1)
+ && (isStatic || implMethod.getOwner == indyParamTypes(0).getInternalName) // (2)
+ && samMethodType.getArgumentTypes.corresponds(instantiatedMethodArgTypes)((samArgType, instArgType) =>
+ samArgType == instArgType || isReference(samArgType) && isReference(instArgType)) // (3)
+ )
+
+ if (isIndyLambda) Some((indy, samMethodType, implMethod, instantiatedMethodType))
+ else None
+
+ case _ => None
+ }
+ case _ => None
+ }
+ }
}
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala
index 1648a53ed8..92b9b34006 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala
@@ -8,8 +8,9 @@ package backend.jvm
package opt
import scala.annotation.switch
+import scala.collection.immutable
import scala.reflect.internal.util.NoPosition
-import scala.tools.asm.{Handle, Type, Opcodes}
+import scala.tools.asm.{Type, Opcodes}
import scala.tools.asm.tree._
import scala.tools.nsc.backend.jvm.BTypes.InternalName
import scala.tools.nsc.backend.jvm.analysis.ProdConsAnalyzer
@@ -23,90 +24,157 @@ class ClosureOptimizer[BT <: BTypes](val btypes: BT) {
import btypes._
import callGraph._
+ /**
+ * If a closure is allocated and invoked within the same method, re-write the invocation to the
+ * closure body method.
+ *
+ * Note that the closure body method (generated by delambdafy:method) takes additional parameters
+ * for the values captured by the closure. The bytecode is transformed from
+ *
+ * [generate captured values]
+ * [closure init, capturing values]
+ * [...]
+ * [load closure object]
+ * [generate closure invocation arguments]
+ * [invoke closure.apply]
+ *
+ * to
+ *
+ * [generate captured values]
+ * [store captured values into new locals]
+ * [load the captured values from locals] // a future optimization will eliminate the closure
+ * [closure init, capturing values] // instantiation if the closure object becomes unused
+ * [...]
+ * [load closure object]
+ * [generate closure invocation arguments]
+ * [store argument values into new locals]
+ * [drop the closure object]
+ * [load captured values from locals]
+ * [load argument values from locals]
+ * [invoke the closure body method]
+ */
def rewriteClosureApplyInvocations(): Unit = {
- closureInstantiations foreach {
- case (indy, (methodNode, ownerClass)) =>
- val warnings = rewriteClosureApplyInvocations(indy, methodNode, ownerClass)
- warnings.foreach(w => backendReporting.inlinerWarning(w.pos, w.toString))
+ implicit object closureInitOrdering extends Ordering[ClosureInstantiation] {
+ override def compare(x: ClosureInstantiation, y: ClosureInstantiation): Int = {
+ val cls = x.ownerClass.internalName compareTo y.ownerClass.internalName
+ if (cls != 0) return cls
+
+ val mName = x.ownerMethod.name compareTo y.ownerMethod.name
+ if (mName != 0) return mName
+
+ val mDesc = x.ownerMethod.desc compareTo y.ownerMethod.desc
+ if (mDesc != 0) return mDesc
+
+ def pos(inst: ClosureInstantiation) = inst.ownerMethod.instructions.indexOf(inst.lambdaMetaFactoryCall.indy)
+ pos(x) - pos(y)
+ }
}
- }
- private val lambdaMetaFactoryInternalName: InternalName = "java/lang/invoke/LambdaMetafactory"
+ // Grouping the closure instantiations by method allows running the ProdConsAnalyzer only once per
+ // method. Also sort the instantiations: If there are multiple closure instantiations in a method,
+ // closure invocations need to be re-written in a consistent order for bytecode stability. The local
+ // variable slots for storing captured values depends on the order of rewriting.
+ val closureInstantiationsByMethod: Map[MethodNode, immutable.TreeSet[ClosureInstantiation]] = {
+ closureInstantiations.values.groupBy(_.ownerMethod).mapValues(immutable.TreeSet.empty ++ _)
+ }
- private val metafactoryHandle = {
- val metafactoryMethodName: String = "metafactory"
- val metafactoryDesc: String = "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"
- new Handle(H_INVOKESTATIC, lambdaMetaFactoryInternalName, metafactoryMethodName, metafactoryDesc)
- }
+ // For each closure instantiation, a list of callsites of the closure that can be re-written
+ // If a callsite cannot be rewritten, for example because the lambda body method is not accessible,
+ // a warning is returned instead.
+ val callsitesToRewrite: List[(ClosureInstantiation, List[Either[RewriteClosureApplyToClosureBodyFailed, (MethodInsnNode, Int)]])] = {
+ closureInstantiationsByMethod.iterator.flatMap({
+ case (methodNode, closureInits) =>
+ // A lazy val to ensure the analysis only runs if necessary (the value is passed by name to `closureCallsites`)
+ lazy val prodCons = new ProdConsAnalyzer(methodNode, closureInits.head.ownerClass.internalName)
+ closureInits.iterator.map(init => (init, closureCallsites(init, prodCons)))
+ }).toList // mapping to a list (not a map) to keep the sorting of closureInstantiationsByMethod
+ }
- private val altMetafactoryHandle = {
- val altMetafactoryMethodName: String = "altMetafactory"
- val altMetafactoryDesc: String = "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;"
- new Handle(H_INVOKESTATIC, lambdaMetaFactoryInternalName, altMetafactoryMethodName, altMetafactoryDesc)
+ // Rewrite all closure callsites (or issue inliner warnings for those that cannot be rewritten)
+ for ((closureInit, callsites) <- callsitesToRewrite) {
+ // Local variables that hold the captured values and the closure invocation arguments.
+ // They are lazy vals to ensure that locals for captured values are only allocated if there's
+ // actually a callsite to rewrite (an not only warnings to be issued).
+ lazy val (localsForCapturedValues, argumentLocalsList) = localsForClosureRewrite(closureInit)
+ for (callsite <- callsites) callsite match {
+ case Left(warning) =>
+ backendReporting.inlinerWarning(warning.pos, warning.toString)
+
+ case Right((invocation, stackHeight)) =>
+ rewriteClosureApplyInvocation(closureInit, invocation, stackHeight, localsForCapturedValues, argumentLocalsList)
+ }
+ }
}
- def isClosureInstantiation(indy: InvokeDynamicInsnNode): Boolean = {
- (indy.bsm == metafactoryHandle || indy.bsm == altMetafactoryHandle) &&
- {
- indy.bsmArgs match {
- case Array(samMethodType: Type, implMethod: Handle, instantiatedMethodType: Type, xs @ _*) =>
- // LambdaMetaFactory performs a number of automatic adaptations when invoking the lambda
- // implementation method (casting, boxing, unboxing, and primitive widening, see Javadoc).
- //
- // The closure optimizer supports only one of those adaptations: it will cast arguments
- // to the correct type when re-writing a closure call to the body method. Example:
- //
- // val fun: String => String = l => l
- // val l = List("")
- // fun(l.head)
- //
- // The samMethodType of Function1 is `(Object)Object`, while the instantiatedMethodType
- // is `(String)String`. The return type of `List.head` is `Object`.
- //
- // The implMethod has the signature `C$anonfun(String)String`.
- //
- // At the closure callsite, we have an `INVOKEINTERFACE Function1.apply (Object)Object`,
- // so the object returned by `List.head` can be directly passed into the call (no cast).
- //
- // The closure object will cast the object to String before passing it to the implMethod.
- //
- // When re-writing the closure callsite to the implMethod, we have to insert a cast.
- //
- // The check below ensures that
- // (1) the implMethod type has the expected singature (captured types plus argument types
- // from instantiatedMethodType)
- // (2) the receiver of the implMethod matches the first captured type
- // (3) all parameters that are not the same in samMethodType and instantiatedMethodType
- // are reference types, so that we can insert casts to perform the same adaptation
- // that the closure object would.
-
- val isStatic = implMethod.getTag == H_INVOKESTATIC
- val indyParamTypes = Type.getArgumentTypes(indy.desc)
- val instantiatedMethodArgTypes = instantiatedMethodType.getArgumentTypes
- val expectedImplMethodType = {
- val paramTypes = (if (isStatic) indyParamTypes else indyParamTypes.tail) ++ instantiatedMethodArgTypes
- Type.getMethodType(instantiatedMethodType.getReturnType, paramTypes: _*)
- }
-
- {
- Type.getType(implMethod.getDesc) == expectedImplMethodType // (1)
- } && {
- isStatic || implMethod.getOwner == indyParamTypes(0).getInternalName // (2)
- } && {
- def isReference(t: Type) = t.getSort == Type.OBJECT || t.getSort == Type.ARRAY
- (samMethodType.getArgumentTypes, instantiatedMethodArgTypes).zipped forall {
- case (samArgType, instArgType) =>
- samArgType == instArgType || isReference(samArgType) && isReference(instArgType) // (3)
- }
- }
-
+ /**
+ * Insert instructions to store the values captured by a closure instantiation into local variables,
+ * and load the values back to the stack.
+ *
+ * Returns the list of locals holding those captured values, and a list of locals that should be
+ * used at the closure invocation callsite to store the arguments passed to the closure invocation.
+ */
+ private def localsForClosureRewrite(closureInit: ClosureInstantiation): (LocalsList, LocalsList) = {
+ val ownerMethod = closureInit.ownerMethod
+ val captureLocals = storeCaptures(closureInit)
+
+ // allocate locals for storing the arguments of the closure apply callsites.
+ // if there are multiple callsites, the same locals are re-used.
+ val argTypes = closureInit.lambdaMetaFactoryCall.samMethodType.getArgumentTypes
+ val firstArgLocal = ownerMethod.maxLocals
+
+ // The comment in the unapply method of `LambdaMetaFactoryCall` explains why we have to introduce
+ // casts for arguments that have different types in samMethodType and instantiatedMethodType.
+ val castLoadTypes = {
+ val instantiatedMethodType = closureInit.lambdaMetaFactoryCall.instantiatedMethodType
+ (argTypes, instantiatedMethodType.getArgumentTypes).zipped map {
+ case (samArgType, instantiatedArgType) if samArgType != instantiatedArgType =>
+ // the LambdaMetaFactoryCall extractor ensures that the two types are reference types,
+ // so we don't end up casting primitive values.
+ Some(instantiatedArgType)
case _ =>
- false
+ None
}
}
+ val argLocals = LocalsList.fromTypes(firstArgLocal, argTypes, castLoadTypes)
+ ownerMethod.maxLocals = firstArgLocal + argLocals.size
+
+ (captureLocals, argLocals)
+ }
+
+ /**
+ * Find all callsites of a closure within the method where the closure is allocated.
+ */
+ private def closureCallsites(closureInit: ClosureInstantiation, prodCons: => ProdConsAnalyzer): List[Either[RewriteClosureApplyToClosureBodyFailed, (MethodInsnNode, Int)]] = {
+ val ownerMethod = closureInit.ownerMethod
+ val ownerClass = closureInit.ownerClass
+ val lambdaBodyHandle = closureInit.lambdaMetaFactoryCall.implMethod
+
+ ownerMethod.instructions.iterator.asScala.collect({
+ case invocation: MethodInsnNode if isSamInvocation(invocation, closureInit, prodCons) =>
+ // TODO: This is maybe over-cautious.
+ // We are checking if the closure body method is accessible at the closure callsite.
+ // If the closure allocation has access to the body method, then the callsite (in the same
+ // method as the alloction) should have access too.
+ val bodyAccessible: Either[OptimizerWarning, Boolean] = for {
+ (bodyMethodNode, declClass) <- byteCodeRepository.methodNode(lambdaBodyHandle.getOwner, lambdaBodyHandle.getName, lambdaBodyHandle.getDesc): Either[OptimizerWarning, (MethodNode, InternalName)]
+ isAccessible <- inliner.memberIsAccessible(bodyMethodNode.access, classBTypeFromParsedClassfile(declClass), classBTypeFromParsedClassfile(lambdaBodyHandle.getOwner), ownerClass)
+ } yield {
+ isAccessible
+ }
+
+ def pos = callGraph.callsites.get(invocation).map(_.callsitePosition).getOrElse(NoPosition)
+ val stackSize: Either[RewriteClosureApplyToClosureBodyFailed, Int] = bodyAccessible match {
+ case Left(w) => Left(RewriteClosureAccessCheckFailed(pos, w))
+ case Right(false) => Left(RewriteClosureIllegalAccess(pos, ownerClass.internalName))
+ case _ => Right(prodCons.frameAt(invocation).getStackSize)
+ }
+
+ stackSize.right.map((invocation, _))
+ }).toList
}
- def isSamInvocation(invocation: MethodInsnNode, indy: InvokeDynamicInsnNode, prodCons: => ProdConsAnalyzer): Boolean = {
+ private def isSamInvocation(invocation: MethodInsnNode, closureInit: ClosureInstantiation, prodCons: => ProdConsAnalyzer): Boolean = {
+ val indy = closureInit.lambdaMetaFactoryCall.indy
if (invocation.getOpcode == INVOKESTATIC) false
else {
def closureIsReceiver = {
@@ -120,20 +188,95 @@ class ClosureOptimizer[BT <: BTypes](val btypes: BT) {
}
invocation.name == indy.name && {
- val indySamMethodDesc = indy.bsmArgs(0).asInstanceOf[Type].getDescriptor // safe, checked in isClosureInstantiation
+ val indySamMethodDesc = closureInit.lambdaMetaFactoryCall.samMethodType.getDescriptor
indySamMethodDesc == invocation.desc
} &&
- closureIsReceiver // most expensive check last
+ closureIsReceiver // most expensive check last
+ }
+ }
+
+ private def rewriteClosureApplyInvocation(closureInit: ClosureInstantiation, invocation: MethodInsnNode, stackHeight: Int, localsForCapturedValues: LocalsList, argumentLocalsList: LocalsList): Unit = {
+ val ownerMethod = closureInit.ownerMethod
+ val lambdaBodyHandle = closureInit.lambdaMetaFactoryCall.implMethod
+
+ // store arguments
+ insertStoreOps(invocation, ownerMethod, argumentLocalsList)
+
+ // drop the closure from the stack
+ ownerMethod.instructions.insertBefore(invocation, new InsnNode(POP))
+
+ // load captured values and arguments
+ insertLoadOps(invocation, ownerMethod, localsForCapturedValues)
+ insertLoadOps(invocation, ownerMethod, argumentLocalsList)
+
+ // update maxStack
+ val capturesStackSize = localsForCapturedValues.size
+ val invocationStackHeight = stackHeight + capturesStackSize - 1 // -1 because the closure is gone
+ if (invocationStackHeight > ownerMethod.maxStack)
+ ownerMethod.maxStack = invocationStackHeight
+
+ // replace the callsite with a new call to the body method
+ val bodyOpcode = (lambdaBodyHandle.getTag: @switch) match {
+ case H_INVOKEVIRTUAL => INVOKEVIRTUAL
+ case H_INVOKESTATIC => INVOKESTATIC
+ case H_INVOKESPECIAL => INVOKESPECIAL
+ case H_INVOKEINTERFACE => INVOKEINTERFACE
+ case H_NEWINVOKESPECIAL =>
+ val insns = ownerMethod.instructions
+ insns.insertBefore(invocation, new TypeInsnNode(NEW, lambdaBodyHandle.getOwner))
+ insns.insertBefore(invocation, new InsnNode(DUP))
+ INVOKESPECIAL
}
+ val isInterface = bodyOpcode == INVOKEINTERFACE
+ val bodyInvocation = new MethodInsnNode(bodyOpcode, lambdaBodyHandle.getOwner, lambdaBodyHandle.getName, lambdaBodyHandle.getDesc, isInterface)
+ ownerMethod.instructions.insertBefore(invocation, bodyInvocation)
+
+ val returnType = Type.getReturnType(lambdaBodyHandle.getDesc)
+ fixLoadedNothingOrNullValue(returnType, bodyInvocation, ownerMethod, btypes) // see comment of that method
+
+ ownerMethod.instructions.remove(invocation)
+
+ // update the call graph
+ val originalCallsite = callGraph.callsites.remove(invocation)
+
+ // the method node is needed for building the call graph entry
+ val bodyMethod = byteCodeRepository.methodNode(lambdaBodyHandle.getOwner, lambdaBodyHandle.getName, lambdaBodyHandle.getDesc)
+ def bodyMethodIsBeingCompiled = byteCodeRepository.classNodeAndSource(lambdaBodyHandle.getOwner).map(_._2 == CompilationUnit).getOrElse(false)
+ val bodyMethodCallsite = Callsite(
+ callsiteInstruction = bodyInvocation,
+ callsiteMethod = ownerMethod,
+ callsiteClass = closureInit.ownerClass,
+ callee = bodyMethod.map({
+ case (bodyMethodNode, bodyMethodDeclClass) => Callee(
+ callee = bodyMethodNode,
+ calleeDeclarationClass = classBTypeFromParsedClassfile(bodyMethodDeclClass),
+ safeToInline = compilerSettings.YoptInlineGlobal || bodyMethodIsBeingCompiled,
+ safeToRewrite = false, // the lambda body method is not a trait interface method
+ annotatedInline = false,
+ annotatedNoInline = false,
+ calleeInfoWarning = None)
+ }),
+ argInfos = Nil,
+ callsiteStackHeight = invocationStackHeight,
+ receiverKnownNotNull = true, // see below (*)
+ callsitePosition = originalCallsite.map(_.callsitePosition).getOrElse(NoPosition)
+ )
+ // (*) The documentation in class LambdaMetafactory says:
+ // "if implMethod corresponds to an instance method, the first capture argument
+ // (corresponding to the receiver) must be non-null"
+ // Explanation: If the lambda body method is non-static, the receiver is a captured
+ // value. It can only be captured within some instance method, so we know it's non-null.
+ callGraph.callsites(bodyInvocation) = bodyMethodCallsite
}
/**
- * Stores the values captured by a closure creation into fresh local variables.
- * Returns the list of locals holding the captured values.
+ * Stores the values captured by a closure creation into fresh local variables, and loads the
+ * values back onto the stack. Returns the list of locals holding the captured values.
*/
- private def storeCaptures(indy: InvokeDynamicInsnNode, methodNode: MethodNode): LocalsList = {
+ private def storeCaptures(closureInit: ClosureInstantiation): LocalsList = {
+ val indy = closureInit.lambdaMetaFactoryCall.indy
val capturedTypes = Type.getArgumentTypes(indy.desc)
- val firstCaptureLocal = methodNode.maxLocals
+ val firstCaptureLocal = closureInit.ownerMethod.maxLocals
// This could be optimized: in many cases the captured values are produced by LOAD instructions.
// If the variable is not modified within the method, we could avoid introducing yet another
@@ -144,10 +287,10 @@ class ClosureOptimizer[BT <: BTypes](val btypes: BT) {
// This is checked in `isClosureInstantiation`: the types of the captured variables in the indy
// instruction match exactly the corresponding parameter types in the body method.
val localsForCaptures = LocalsList.fromTypes(firstCaptureLocal, capturedTypes, castLoadTypes = _ => None)
- methodNode.maxLocals = firstCaptureLocal + localsForCaptures.size
+ closureInit.ownerMethod.maxLocals = firstCaptureLocal + localsForCaptures.size
- insertStoreOps(indy, methodNode, localsForCaptures)
- insertLoadOps(indy, methodNode, localsForCaptures)
+ insertStoreOps(indy, closureInit.ownerMethod, localsForCaptures)
+ insertLoadOps(indy, closureInit.ownerMethod, localsForCaptures)
localsForCaptures
}
@@ -184,145 +327,6 @@ class ClosureOptimizer[BT <: BTypes](val btypes: BT) {
}
}
- def rewriteClosureApplyInvocations(indy: InvokeDynamicInsnNode, methodNode: MethodNode, ownerClass: ClassBType): List[RewriteClosureApplyToClosureBodyFailed] = {
- val lambdaBodyHandle = indy.bsmArgs(1).asInstanceOf[Handle] // safe, checked in isClosureInstantiation
-
- // Kept as a lazy val to make sure the analysis is only computed if it's actually needed.
- // ProdCons is used to identify closure body invocations (see isSamInvocation), but only if the
- // callsite has the right name and signature. If the method has no invcation instruction with
- // the right name and signature, the analysis is not executed.
- lazy val prodCons = new ProdConsAnalyzer(methodNode, ownerClass.internalName)
-
- // First collect all callsites without modifying the instructions list yet.
- // Once we start modifying the instruction list, prodCons becomes unusable.
-
- // A list of callsites and stack heights. If the invocation cannot be rewritten, a warning
- // message is stored in the stack height value.
- val invocationsToRewrite: List[(MethodInsnNode, Either[RewriteClosureApplyToClosureBodyFailed, Int])] = methodNode.instructions.iterator.asScala.collect({
- case invocation: MethodInsnNode if isSamInvocation(invocation, indy, prodCons) =>
- val bodyAccessible: Either[OptimizerWarning, Boolean] = for {
- (bodyMethodNode, declClass) <- byteCodeRepository.methodNode(lambdaBodyHandle.getOwner, lambdaBodyHandle.getName, lambdaBodyHandle.getDesc): Either[OptimizerWarning, (MethodNode, InternalName)]
- isAccessible <- inliner.memberIsAccessible(bodyMethodNode.access, classBTypeFromParsedClassfile(declClass), classBTypeFromParsedClassfile(lambdaBodyHandle.getOwner), ownerClass)
- } yield {
- isAccessible
- }
-
- def pos = callGraph.callsites.get(invocation).map(_.callsitePosition).getOrElse(NoPosition)
- val stackSize: Either[RewriteClosureApplyToClosureBodyFailed, Int] = bodyAccessible match {
- case Left(w) => Left(RewriteClosureAccessCheckFailed(pos, w))
- case Right(false) => Left(RewriteClosureIllegalAccess(pos, ownerClass.internalName))
- case _ => Right(prodCons.frameAt(invocation).getStackSize)
- }
-
- (invocation, stackSize)
- }).toList
-
- if (invocationsToRewrite.isEmpty) Nil
- else {
- // lazy val to make sure locals for captures and arguments are only allocated if there's
- // effectively a callsite to rewrite.
- lazy val (localsForCapturedValues, argumentLocalsList) = {
- val captureLocals = storeCaptures(indy, methodNode)
-
- // allocate locals for storing the arguments of the closure apply callsites.
- // if there are multiple callsites, the same locals are re-used.
- val argTypes = indy.bsmArgs(0).asInstanceOf[Type].getArgumentTypes // safe, checked in isClosureInstantiation
- val firstArgLocal = methodNode.maxLocals
-
- // The comment in `isClosureInstantiation` explains why we have to introduce casts for
- // arguments that have different types in samMethodType and instantiatedMethodType.
- val castLoadTypes = {
- val instantiatedMethodType = indy.bsmArgs(2).asInstanceOf[Type]
- (argTypes, instantiatedMethodType.getArgumentTypes).zipped map {
- case (samArgType, instantiatedArgType) if samArgType != instantiatedArgType =>
- // isClosureInstantiation ensures that the two types are reference types, so we don't
- // end up casting primitive values.
- Some(instantiatedArgType)
- case _ =>
- None
- }
- }
- val argLocals = LocalsList.fromTypes(firstArgLocal, argTypes, castLoadTypes)
- methodNode.maxLocals = firstArgLocal + argLocals.size
-
- (captureLocals, argLocals)
- }
-
- val warnings = invocationsToRewrite flatMap {
- case (invocation, Left(warning)) => Some(warning)
-
- case (invocation, Right(stackHeight)) =>
- // store arguments
- insertStoreOps(invocation, methodNode, argumentLocalsList)
-
- // drop the closure from the stack
- methodNode.instructions.insertBefore(invocation, new InsnNode(POP))
-
- // load captured values and arguments
- insertLoadOps(invocation, methodNode, localsForCapturedValues)
- insertLoadOps(invocation, methodNode, argumentLocalsList)
-
- // update maxStack
- val capturesStackSize = localsForCapturedValues.size
- val invocationStackHeight = stackHeight + capturesStackSize - 1 // -1 because the closure is gone
- if (invocationStackHeight > methodNode.maxStack)
- methodNode.maxStack = invocationStackHeight
-
- // replace the callsite with a new call to the body method
- val bodyOpcode = (lambdaBodyHandle.getTag: @switch) match {
- case H_INVOKEVIRTUAL => INVOKEVIRTUAL
- case H_INVOKESTATIC => INVOKESTATIC
- case H_INVOKESPECIAL => INVOKESPECIAL
- case H_INVOKEINTERFACE => INVOKEINTERFACE
- case H_NEWINVOKESPECIAL =>
- val insns = methodNode.instructions
- insns.insertBefore(invocation, new TypeInsnNode(NEW, lambdaBodyHandle.getOwner))
- insns.insertBefore(invocation, new InsnNode(DUP))
- INVOKESPECIAL
- }
- val isInterface = bodyOpcode == INVOKEINTERFACE
- val bodyInvocation = new MethodInsnNode(bodyOpcode, lambdaBodyHandle.getOwner, lambdaBodyHandle.getName, lambdaBodyHandle.getDesc, isInterface)
- methodNode.instructions.insertBefore(invocation, bodyInvocation)
- methodNode.instructions.remove(invocation)
-
- // update the call graph
- val originalCallsite = callGraph.callsites.remove(invocation)
-
- // the method node is needed for building the call graph entry
- val bodyMethod = byteCodeRepository.methodNode(lambdaBodyHandle.getOwner, lambdaBodyHandle.getName, lambdaBodyHandle.getDesc)
- def bodyMethodIsBeingCompiled = byteCodeRepository.classNodeAndSource(lambdaBodyHandle.getOwner).map(_._2 == CompilationUnit).getOrElse(false)
- val bodyMethodCallsite = Callsite(
- callsiteInstruction = bodyInvocation,
- callsiteMethod = methodNode,
- callsiteClass = ownerClass,
- callee = bodyMethod.map({
- case (bodyMethodNode, bodyMethodDeclClass) => Callee(
- callee = bodyMethodNode,
- calleeDeclarationClass = classBTypeFromParsedClassfile(bodyMethodDeclClass),
- safeToInline = compilerSettings.YoptInlineGlobal || bodyMethodIsBeingCompiled,
- safeToRewrite = false, // the lambda body method is not a trait interface method
- annotatedInline = false,
- annotatedNoInline = false,
- calleeInfoWarning = None)
- }),
- argInfos = Nil,
- callsiteStackHeight = invocationStackHeight,
- receiverKnownNotNull = true, // see below (*)
- callsitePosition = originalCallsite.map(_.callsitePosition).getOrElse(NoPosition)
- )
- // (*) The documentation in class LambdaMetafactory says:
- // "if implMethod corresponds to an instance method, the first capture argument
- // (corresponding to the receiver) must be non-null"
- // Explanation: If the lambda body method is non-static, the receiver is a captured
- // value. It can only be captured within some instance method, so we know it's non-null.
- callGraph.callsites(bodyInvocation) = bodyMethodCallsite
- None
- }
-
- warnings.toList
- }
- }
-
/**
* A list of local variables. Each local stores information about its type, see class [[Local]].
*/
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala
index e8e848161c..8477f5461a 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala
@@ -9,6 +9,7 @@ package opt
import scala.annotation.tailrec
import scala.tools.asm
+import asm.Handle
import asm.Opcodes._
import asm.tree._
import scala.collection.convert.decorateAsScala._
@@ -455,9 +456,9 @@ class Inliner[BT <: BTypes](val btypes: BT) {
case indy: InvokeDynamicInsnNode =>
callGraph.closureInstantiations.get(indy) match {
- case Some((methodNode, ownerClass)) =>
+ case Some(closureInit) =>
val newIndy = instructionMap(indy).asInstanceOf[InvokeDynamicInsnNode]
- callGraph.closureInstantiations(newIndy) = (callsiteMethod, callsiteClass)
+ callGraph.closureInstantiations(newIndy) = ClosureInstantiation(closureInit.lambdaMetaFactoryCall.copy(indy = newIndy), callsiteMethod, callsiteClass)
case None =>
}
@@ -687,9 +688,67 @@ class Inliner[BT <: BTypes](val btypes: BT) {
}
}
- case ivd: InvokeDynamicInsnNode =>
- // TODO @lry check necessary conditions to inline an indy, instead of giving up
- Right(false)
+ case _: InvokeDynamicInsnNode if destinationClass == calleeDeclarationClass =>
+ // within the same class, any indy instruction can be inlined
+ Right(true)
+
+ // does the InvokeDynamicInsnNode call LambdaMetaFactory?
+ case LambdaMetaFactoryCall(_, _, implMethod, _) =>
+ // an indy instr points to a "call site specifier" (CSP) [1]
+ // - a reference to a bootstrap method [2]
+ // - bootstrap method name
+ // - references to constant arguments, which can be:
+ // - constant (string, long, int, float, double)
+ // - class
+ // - method type (without name)
+ // - method handle
+ // - a method name+type
+ //
+ // execution [3]
+ // - resolve the CSP, yielding the boostrap method handle, the static args and the name+type
+ // - resolution entails accessibility checking [4]
+ // - execute the `invoke` method of the boostrap method handle (which is signature polymorphic, check its javadoc)
+ // - the descriptor for the call is made up from the actual arguments on the stack:
+ // - the first parameters are "MethodHandles.Lookup, String, MethodType", then the types of the constant arguments,
+ // - the return type is CallSite
+ // - the values for the call are
+ // - the bootstrap method handle of the CSP is the receiver
+ // - the Lookup object for the class in which the callsite occurs (obtained as through calling MethodHandles.lookup())
+ // - the method name of the CSP
+ // - the method type of the CSP
+ // - the constants of the CSP (primitives are not boxed)
+ // - the resulting `CallSite` object
+ // - has as `type` the method type of the CSP
+ // - is popped from the operand stack
+ // - the `invokeExact` method (signature polymorphic!) of the `target` method handle of the CallSite is invoked
+ // - the method descriptor is that of the CSP
+ // - the receiver is the target of the CallSite
+ // - the other argument values are those that were on the operand stack at the indy instruction (indyLambda: the captured values)
+ //
+ // [1] http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.10
+ // [2] http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.23
+ // [3] http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-6.html#jvms-6.5.invokedynamic
+ // [4] http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-5.html#jvms-5.4.3
+
+ // We cannot generically check if an `invokedynamic` instruction can be safely inlined into
+ // a different class, that depends on the bootstrap method. The Lookup object passed to the
+ // bootstrap method is a capability to access private members of the callsite class. We can
+ // only move the invokedynamic to a new class if we know that the bootstrap method doesn't
+ // use this capability for otherwise non-accessible members.
+ // In the case of indyLambda, it depends on the visibility of the implMethod handle. If
+ // the implMethod is public, lambdaMetaFactory doesn't use the Lookup object's extended
+ // capability, and we can safely inline the instruction into a different class.
+
+ val methodRefClass = classBTypeFromParsedClassfile(implMethod.getOwner)
+ for {
+ (methodNode, methodDeclClassNode) <- byteCodeRepository.methodNode(methodRefClass.internalName, implMethod.getName, implMethod.getDesc): Either[OptimizerWarning, (MethodNode, InternalName)]
+ methodDeclClass = classBTypeFromParsedClassfile(methodDeclClassNode)
+ res <- memberIsAccessible(methodNode.access, methodDeclClass, methodRefClass, destinationClass)
+ } yield {
+ res
+ }
+
+ case _: InvokeDynamicInsnNode => Left(UnknownInvokeDynamicInstruction)
case ci: LdcInsnNode => ci.cst match {
case t: asm.Type => classIsAccessible(bTypeForDescriptorOrInternalNameFromClassfile(t.getInternalName), destinationClass)
diff --git a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala
index 9708cba281..eb25eb6e06 100644
--- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala
+++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala
@@ -370,7 +370,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
flags |= Flags.FINAL
in.nextToken()
case DEFAULT =>
- flags |= Flags.DEFAULTMETHOD
+ flags |= Flags.JAVA_DEFAULTMETHOD
in.nextToken()
case NATIVE =>
addAnnot(NativeAttr)
@@ -489,8 +489,8 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
val vparams = formalParams()
if (!isVoid) rtpt = optArrayBrackets(rtpt)
optThrows()
- val isStatic = mods hasFlag Flags.STATIC
- val bodyOk = !inInterface || ((mods hasFlag Flags.DEFAULTMETHOD) || isStatic)
+ val isConcreteInterfaceMethod = !inInterface || (mods hasFlag Flags.JAVA_DEFAULTMETHOD) || (mods hasFlag Flags.STATIC)
+ val bodyOk = !(mods1 hasFlag Flags.DEFERRED) && isConcreteInterfaceMethod
val body =
if (bodyOk && in.token == LBRACE) {
methodBody()
@@ -509,7 +509,9 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
EmptyTree
}
}
- if (inInterface && !isStatic) mods1 |= Flags.DEFERRED
+ // for abstract methods (of classes), the `DEFERRED` flag is alredy set.
+ // here we also set it for interface methods that are not static and not default.
+ if (!isConcreteInterfaceMethod) mods1 |= Flags.DEFERRED
List {
atPos(pos) {
DefDef(mods1, name.toTermName, tparams, List(vparams), rtpt, body)
@@ -749,7 +751,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
val (statics, body) = typeBody(AT, name)
val templ = makeTemplate(annotationParents, body)
addCompanionObject(statics, atPos(pos) {
- ClassDef(mods, name, List(), templ)
+ ClassDef(mods | Flags.JAVA_ANNOTATION, name, List(), templ)
})
}
@@ -807,7 +809,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
if (hasAbstractMember) Flags.ABSTRACT else 0l
}
addCompanionObject(consts ::: statics ::: predefs, atPos(pos) {
- ClassDef(mods | Flags.ENUM | finalFlag | abstractFlag, name, List(),
+ ClassDef(mods | Flags.JAVA_ENUM | finalFlag | abstractFlag, name, List(),
makeTemplate(superclazz :: interfaces, body))
})
}
@@ -828,7 +830,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
skipAhead()
accept(RBRACE)
}
- ValDef(Modifiers(Flags.ENUM | Flags.STABLE | Flags.JAVA | Flags.STATIC), name.toTermName, enumType, blankExpr)
+ ValDef(Modifiers(Flags.JAVA_ENUM | Flags.STABLE | Flags.JAVA | Flags.STATIC), name.toTermName, enumType, blankExpr)
}
(res, hasClassBody)
}
diff --git a/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala b/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala
index 5bf611a7b0..4bf92fd1fb 100644
--- a/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala
+++ b/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala
@@ -11,8 +11,7 @@ import java.io.{ BufferedReader, IOException, PrintWriter }
import scala.reflect.internal.util._
import StringOps._
-/**
- * This class implements a Reporter that displays messages on a text console.
+/** This class implements a Reporter that displays messages on a text console.
*/
class ConsoleReporter(val settings: Settings, reader: BufferedReader, writer: PrintWriter) extends AbstractReporter {
def this(settings: Settings) = this(settings, Console.in, new PrintWriter(Console.err, true))
@@ -85,5 +84,7 @@ class ConsoleReporter(val settings: Settings, reader: BufferedReader, writer: Pr
}
}
- override def flush() { writer.flush() }
+ override def flush() = writer.flush()
+
+ override def finish() = printSummary()
}
diff --git a/src/compiler/scala/tools/nsc/settings/AbsScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/AbsScalaSettings.scala
index 6b339b2a6d..8386722b63 100644
--- a/src/compiler/scala/tools/nsc/settings/AbsScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/AbsScalaSettings.scala
@@ -31,6 +31,7 @@ trait AbsScalaSettings {
def BooleanSetting(name: String, descr: String): BooleanSetting
def ChoiceSetting(name: String, helpArg: String, descr: String, choices: List[String], default: String): ChoiceSetting
+ def ChoiceSettingForcedDefault(name: String, helpArg: String, descr: String, choices: List[String], default: String): ChoiceSetting
def IntSetting(name: String, descr: String, default: Int, range: Option[(Int, Int)], parser: String => Option[Int]): IntSetting
def MultiStringSetting(name: String, helpArg: String, descr: String): MultiStringSetting
def MultiChoiceSetting[E <: MultiChoiceEnumeration](name: String, helpArg: String, descr: String, domain: E, default: Option[List[String]]): MultiChoiceSetting[E]
diff --git a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
index b4987e1240..9cc8faf8c2 100644
--- a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
@@ -221,6 +221,13 @@ class MutableSettings(val errorFn: String => Unit)
def BooleanSetting(name: String, descr: String) = add(new BooleanSetting(name, descr))
def ChoiceSetting(name: String, helpArg: String, descr: String, choices: List[String], default: String) =
add(new ChoiceSetting(name, helpArg, descr, choices, default))
+ def ChoiceSettingForcedDefault(name: String, helpArg: String, descr: String, choices: List[String], default: String) =
+ ChoiceSetting(name, helpArg, descr, choices, default).withPostSetHook(sett =>
+ if (sett.value != default) {
+ sett.withDeprecationMessage(s"${name}:${sett.value} is deprecated, forcing use of $default")
+ sett.value = default
+ }
+ )
def IntSetting(name: String, descr: String, default: Int, range: Option[(Int, Int)], parser: String => Option[Int]) =
add(new IntSetting(name, descr, default, range, parser))
def MultiStringSetting(name: String, arg: String, descr: String) = add(new MultiStringSetting(name, arg, descr))
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
index 0cdece59e1..f15bd3c31c 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@@ -22,13 +22,9 @@ trait ScalaSettings extends AbsScalaSettings
/** Set of settings */
protected[scala] lazy val allSettings = mutable.HashSet[Setting]()
- /** Against my better judgment, giving in to martin here and allowing
- * CLASSPATH to be used automatically. So for the user-specified part
- * of the classpath:
- *
- * - If -classpath or -cp is given, it is that
- * - Otherwise, if CLASSPATH is set, it is that
- * - If neither of those, then "." is used.
+ /** The user class path, specified by `-classpath` or `-cp`,
+ * defaults to the value of CLASSPATH env var if it is set, as in Java,
+ * or else to `"."` for the current user directory.
*/
protected def defaultClasspath = sys.env.getOrElse("CLASSPATH", ".")
@@ -134,8 +130,9 @@ trait ScalaSettings extends AbsScalaSettings
val Xshowobj = StringSetting ("-Xshow-object", "object", "Show internal representation of object.", "")
val showPhases = BooleanSetting ("-Xshow-phases", "Print a synopsis of compiler phases.")
val sourceReader = StringSetting ("-Xsource-reader", "classname", "Specify a custom method for reading source files.", "")
+ val reporter = StringSetting ("-Xreporter", "classname", "Specify a custom reporter for compiler messages.", "scala.tools.nsc.reporters.ConsoleReporter")
val strictInference = BooleanSetting ("-Xstrict-inference", "Don't infer known-unsound types")
- val source = ScalaVersionSetting ("-Xsource", "version", "Treat compiler input as Scala source for the specified version, see SI-8126.", initial = ScalaVersion("2.11"))
+ val source = ScalaVersionSetting ("-Xsource", "version", "Treat compiler input as Scala source for the specified version, see SI-8126.", initial = ScalaVersion("2.12"))
val XnoPatmatAnalysis = BooleanSetting ("-Xno-patmat-analysis", "Don't perform exhaustivity/unreachability analysis. Also, ignore @switch annotation.")
val XfullLubs = BooleanSetting ("-Xfull-lubs", "Retains pre 2.10 behavior of less aggressive truncation of least upper bounds.")
@@ -222,9 +219,8 @@ trait ScalaSettings extends AbsScalaSettings
val YdisableUnreachablePrevention = BooleanSetting("-Ydisable-unreachable-prevention", "Disable the prevention of unreachable blocks in code generation.")
val YnoLoadImplClass = BooleanSetting ("-Yno-load-impl-class", "Do not load $class.class files.")
- val exposeEmptyPackage = BooleanSetting("-Yexpose-empty-package", "Internal only: expose the empty package.").internalOnly()
- // the current standard is "inline" but we are moving towards "method"
- val Ydelambdafy = ChoiceSetting ("-Ydelambdafy", "strategy", "Strategy used for translating lambdas into JVM code.", List("inline", "method"), "inline")
+ val exposeEmptyPackage = BooleanSetting ("-Yexpose-empty-package", "Internal only: expose the empty package.").internalOnly()
+ val Ydelambdafy = ChoiceSetting ("-Ydelambdafy", "strategy", "Strategy used for translating lambdas into JVM code.", List("inline", "method"), "method")
val YskipInlineInfoAttribute = BooleanSetting("-Yskip-inline-info-attribute", "Do not add the ScalaInlineInfo attribute to classfiles generated by -Ybackend:GenASM")
@@ -357,7 +353,7 @@ trait ScalaSettings extends AbsScalaSettings
*/
val Ybackend = ChoiceSetting ("-Ybackend", "choice of bytecode emitter", "Choice of bytecode emitter.",
List("GenASM", "GenBCode"),
- "GenASM")
+ "GenBCode")
// Feature extensions
val XmacroSettings = MultiStringSetting("-Xmacro-settings", "option", "Custom settings for macros.")
@@ -388,6 +384,23 @@ trait ScalaSettings extends AbsScalaSettings
val Normal = "normal"
val Discard = "discard"
}
+
+ def conflictWarning: Option[String] = {
+ def oldOptimiseFlagsInGenBCode: Option[String] = {
+ val optFlags: List[Setting] = if (optimise.value) List(optimise) else optimiseSettings.filter(_.value)
+ if (isBCodeActive && optFlags.nonEmpty) {
+ val msg = s"""Compiler settings for the 2.11 optimizer (${optFlags.map(_.name).mkString(", ")}) are incompatible with -Ybackend:GenBCode (which is the default in 2.12).
+ |The optimizer settings are ignored. See -Yopt:help for enabling the new optimizer in 2.12.""".stripMargin
+ Some(msg)
+ } else
+ None
+ }
+
+ List(oldOptimiseFlagsInGenBCode /*, moreToCome */).flatten match {
+ case Nil => None
+ case warnings => Some("Conflicting compiler settings were detected. Some settings will be ignored.\n" + warnings.mkString("\n"))
+ }
+ }
}
object ClassPathRepresentationType {
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaVersion.scala b/src/compiler/scala/tools/nsc/settings/ScalaVersion.scala
index 43bdad5882..0b051ef89d 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaVersion.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaVersion.scala
@@ -68,45 +68,37 @@ case object AnyScalaVersion extends ScalaVersion {
* Factory methods for producing ScalaVersions
*/
object ScalaVersion {
- private val dot = "\\."
- private val dash = "\\-"
- private def not(s:String) = s"[^${s}]"
- private val R = s"((${not(dot)}*)(${dot}(${not(dot)}*)(${dot}(${not(dash)}*)(${dash}(.*))?)?)?)".r
-
- def apply(versionString : String, errorHandler: String => Unit): ScalaVersion = {
- def errorAndValue() = {
- errorHandler(
- s"There was a problem parsing ${versionString}. " +
- "Versions should be in the form major[.minor[.revision]] " +
- "where each part is a positive number, as in 2.10.1. " +
- "The minor and revision parts are optional."
- )
- AnyScalaVersion
- }
+ private val dot = """\."""
+ private val dash = "-"
+ private val vchar = """\d""" //"[^-+.]"
+ private val vpat = s"(?s)($vchar+)(?:$dot($vchar+)(?:$dot($vchar+)(?:$dash(.*))?)?)?".r
+ private val rcpat = """(?i)rc(\d*)""".r
+ private val mspat = """(?i)m(\d*)""".r
+
+ def apply(versionString: String, errorHandler: String => Unit): ScalaVersion = {
+ def error() = errorHandler(
+ s"Bad version (${versionString}) not major[.minor[.revision[-suffix]]]"
+ )
def toInt(s: String) = s match {
case null | "" => 0
- case _ => s.toInt
+ case _ => s.toInt
}
- def isInt(s: String) = util.Try(toInt(s)).isSuccess
-
def toBuild(s: String) = s match {
case null | "FINAL" => Final
- case s if (s.toUpperCase.startsWith("RC") && isInt(s.substring(2))) => RC(toInt(s.substring(2)))
- case s if (s.toUpperCase.startsWith("M") && isInt(s.substring(1))) => Milestone(toInt(s.substring(1)))
- case _ => Development(s)
+ case rcpat(i) => RC(toInt(i))
+ case mspat(i) => Milestone(toInt(i))
+ case _ /* | "" */ => Development(s)
}
- try versionString match {
+ versionString match {
case "none" => NoScalaVersion
- case "any" => AnyScalaVersion
- case R(_, majorS, _, minorS, _, revS, _, buildS) =>
+ case "" => NoScalaVersion
+ case "any" => AnyScalaVersion
+ case vpat(majorS, minorS, revS, buildS) =>
SpecificScalaVersion(toInt(majorS), toInt(minorS), toInt(revS), toBuild(buildS))
- case _ =>
- errorAndValue()
- } catch {
- case e: NumberFormatException => errorAndValue()
+ case _ => error() ; AnyScalaVersion
}
}
diff --git a/src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala
index d42c0dd730..f197a4930d 100644
--- a/src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala
@@ -38,8 +38,8 @@ trait StandardScalaSettings {
val nowarn = BooleanSetting ("-nowarn", "Generate no warnings.")
val optimise: BooleanSetting // depends on post hook which mutates other settings
val print = BooleanSetting ("-print", "Print program with Scala-specific features removed.")
- val target = ChoiceSetting ("-target", "target", "Target platform for object files. All JVM 1.5 targets are deprecated.",
- List("jvm-1.5", "jvm-1.6", "jvm-1.7", "jvm-1.8"), "jvm-1.6")
+ val target = ChoiceSettingForcedDefault ("-target", "target", "Target platform for object files. All JVM 1.5 - 1.7 targets are deprecated.",
+ List("jvm-1.5", "jvm-1.6", "jvm-1.7", "jvm-1.8"), "jvm-1.8")
val unchecked = BooleanSetting ("-unchecked", "Enable additional warnings where generated code depends on assumptions.")
val uniqid = BooleanSetting ("-uniqid", "Uniquely tag all identifiers in debugging output.")
val usejavacp = BooleanSetting ("-usejavacp", "Utilize the java.class.path in classpath resolution.")
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index 660028eab8..06a0299d2a 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -284,7 +284,7 @@ abstract class ClassfileParser {
def getType(index: Int): Type = getType(null, index)
def getType(sym: Symbol, index: Int): Type = sigToType(sym, getExternalName(index))
- def getSuperClass(index: Int): Symbol = if (index == 0) AnyClass else getClassSymbol(index)
+ def getSuperClass(index: Int): Symbol = if (index == 0) AnyClass else getClassSymbol(index) // the only classfile that is allowed to have `0` in the super_class is java/lang/Object (see jvm spec)
private def createConstant(index: Int): Constant = {
val start = starts(index)
@@ -862,7 +862,7 @@ abstract class ClassfileParser {
srcfile0 = settings.outputDirs.srcFilesFor(in.file, srcpath).find(_.exists)
case tpnme.CodeATTR =>
if (sym.owner.isInterface) {
- sym setFlag DEFAULTMETHOD
+ sym setFlag JAVA_DEFAULTMETHOD
log(s"$sym in ${sym.owner} is a java8+ default method.")
}
in.skip(attrLen)
diff --git a/src/compiler/scala/tools/nsc/transform/Constructors.scala b/src/compiler/scala/tools/nsc/transform/Constructors.scala
index 86685d46de..7c66bda46b 100644
--- a/src/compiler/scala/tools/nsc/transform/Constructors.scala
+++ b/src/compiler/scala/tools/nsc/transform/Constructors.scala
@@ -165,11 +165,19 @@ abstract class Constructors extends Statics with Transform with ast.TreeDSL {
return
}
+ // Note: elision of outer reference is based on a class-wise analysis, if a class might have subclasses,
+ // it doesn't work. For example, `LocalParent` retains the outer reference in:
+ //
+ // class Outer { def test = {class LocalParent; class LocalChild extends LocalParent } }
+ //
+ // See run/t9408.scala for related test cases.
+ val isEffectivelyFinal = clazz.isEffectivelyFinal
def isParamCandidateForElision(sym: Symbol) = (sym.isParamAccessor && sym.isPrivateLocal)
- def isOuterCandidateForElision(sym: Symbol) = (sym.isOuterAccessor && sym.owner.isEffectivelyFinal && !sym.isOverridingSymbol)
+ def isOuterCandidateForElision(sym: Symbol) = (sym.isOuterAccessor && isEffectivelyFinal && !sym.isOverridingSymbol)
- val paramCandidatesForElision: Set[ /*Field*/ Symbol] = (clazz.info.decls.toSet filter isParamCandidateForElision)
- val outerCandidatesForElision: Set[ /*Method*/ Symbol] = (clazz.info.decls.toSet filter isOuterCandidateForElision)
+ val decls = clazz.info.decls.toSet
+ val paramCandidatesForElision: Set[ /*Field*/ Symbol] = (decls filter isParamCandidateForElision)
+ val outerCandidatesForElision: Set[ /*Method*/ Symbol] = (decls filter isOuterCandidateForElision)
omittables ++= paramCandidatesForElision
omittables ++= outerCandidatesForElision
diff --git a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
index 5a7f6c52da..ddf003bb98 100644
--- a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
+++ b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
@@ -18,7 +18,7 @@ import scala.collection.mutable.LinkedHashMap
*
* From a lambda, Delambdafy will create:
*
- * Under -target:jvm-1.7 and below:
+ * Under GenASM
*
* 1) a new top level class that
a) has fields and a constructor taking the captured environment (including possibly the "this"
@@ -27,7 +27,7 @@ import scala.collection.mutable.LinkedHashMap
* c) if needed a bridge method for the apply method
* 2) an instantiation of the newly created class which replaces the lambda
*
- * Under -target:jvm-1.8 with GenBCode:
+ * Under GenBCode:
*
* 1) An application of the captured arguments to a fictional symbol representing the lambda factory.
* This will be translated by the backed into an invokedynamic using a bootstrap method in JDK8's `LambdaMetaFactory`.
@@ -571,10 +571,7 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre
// The functional interface that can be used to adapt the lambda target method `target` to the
// given function type. Returns `NoSymbol` if the compiler settings are unsuitable.
private def java8CompatFunctionalInterface(target: Symbol, functionType: Type): (Symbol, Boolean) = {
- val canUseLambdaMetafactory: Boolean = {
- val isTarget18 = settings.target.value.contains("jvm-1.8")
- settings.isBCodeActive && isTarget18
- }
+ val canUseLambdaMetafactory = settings.isBCodeActive
val sym = functionType.typeSymbol
val pack = currentRun.runDefinitions.Scala_Java8_CompatPackage
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index a04625c9c5..833f25537c 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -341,8 +341,8 @@ abstract class Erasure extends AddInterfaces
buf append (if (restpe.typeSymbol == UnitClass || sym0.isConstructor) VOID_TAG.toString else jsig(restpe))
buf.toString
- case RefinedType(parent :: _, decls) =>
- boxedSig(parent)
+ case RefinedType(parents, decls) =>
+ boxedSig(intersectionDominator(parents))
case ClassInfoType(parents, _, _) =>
superSig(parents)
case AnnotatedType(_, atp) =>
diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
index 540de2cfe1..f12f6c4e18 100644
--- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
+++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
@@ -446,8 +446,10 @@ abstract class ExplicitOuter extends InfoTransform
//
// See SI-6552 for an example of why `sym.owner.enclMethod hasAnnotation ScalaInlineClass`
// is not suitable; if we make a method-local class non-private, it mangles outer pointer names.
- if (currentClass != sym.owner ||
- (closestEnclMethod(currentOwner) hasAnnotation ScalaInlineClass))
+ def enclMethodIsInline = closestEnclMethod(currentOwner) hasAnnotation ScalaInlineClass
+ // SI-8710 The extension method condition reflects our knowledge that a call to `new Meter(12).privateMethod`
+ // with later be rewritten (in erasure) to `Meter.privateMethod$extension(12)`.
+ if ((currentClass != sym.owner || enclMethodIsInline) && !sym.isMethodWithExtension)
sym.makeNotPrivate(sym.owner)
val qsym = qual.tpe.widen.typeSymbol
diff --git a/src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala b/src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
index 116047a2ad..6349fc3fb9 100644
--- a/src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
+++ b/src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
@@ -208,7 +208,7 @@ abstract class ExtensionMethods extends Transform with TypingTransformers {
def makeExtensionMethodSymbol = {
val extensionName = extensionNames(origMeth).head.toTermName
val extensionMeth = (
- companion.moduleClass.newMethod(extensionName, tree.pos.focus, origMeth.flags & ~OVERRIDE & ~PROTECTED & ~LOCAL | FINAL)
+ companion.moduleClass.newMethod(extensionName, tree.pos.focus, origMeth.flags & ~OVERRIDE & ~PROTECTED & ~PRIVATE & ~LOCAL | FINAL)
setAnnotations origMeth.annotations
)
origMeth.removeAnnotation(TailrecClass) // it's on the extension method, now.
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index 7a9dfda43e..72e2174bf8 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -237,7 +237,7 @@ abstract class UnCurry extends InfoTransform
def canUseDelamdafyMethod = (
(inConstructorFlag == 0) // Avoiding synthesizing code prone to SI-6666, SI-8363 by using old-style lambda translation
- && (!isSpecialized || (settings.isBCodeActive && settings.target.value == "jvm-1.8")) // DelambdafyTransformer currently only emits generic FunctionN-s, use the old style in the meantime
+ && (!isSpecialized || settings.isBCodeActive) // DelambdafyTransformer currently only emits generic FunctionN-s, use the old style in the meantime
)
if (inlineFunctionExpansion || !canUseDelamdafyMethod) {
val parents = addSerializable(abstractFunctionForFunctionType(fun.tpe))
diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala
index a11906ace1..00de77a8d4 100644
--- a/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala
+++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala
@@ -138,7 +138,7 @@ trait TreeAndTypeAnalysis extends Debugging {
if(grouped) {
def enumerateChildren(sym: Symbol) = {
- sym.children.toList
+ sym.sealedChildren.toList
.sortBy(_.sealedSortName)
.filterNot(x => x.isSealed && x.isAbstractClass && !isPrimitiveValueClass(x))
}
diff --git a/src/compiler/scala/tools/nsc/typechecker/Checkable.scala b/src/compiler/scala/tools/nsc/typechecker/Checkable.scala
index fc632e0d0d..8bcd5e6f12 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Checkable.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Checkable.scala
@@ -212,8 +212,8 @@ trait Checkable {
)
/** Are all children of these symbols pairwise irreconcilable? */
def allChildrenAreIrreconcilable(sym1: Symbol, sym2: Symbol) = (
- sym1.children.toList forall (c1 =>
- sym2.children.toList forall (c2 =>
+ sym1.sealedChildren.toList forall (c1 =>
+ sym2.sealedChildren.toList forall (c2 =>
areIrreconcilableAsParents(c1, c2)
)
)
diff --git a/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala b/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
index 56ed0ee16c..2f4771e9d4 100644
--- a/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
@@ -75,7 +75,7 @@ abstract class ConstantFolder {
case nme.AND => Constant(x.booleanValue & y.booleanValue)
case nme.EQ => Constant(x.booleanValue == y.booleanValue)
case nme.NE => Constant(x.booleanValue != y.booleanValue)
- case _ => null
+ case _ => null
}
private def foldSubrangeOp(op: Name, x: Constant, y: Constant): Constant = op match {
case nme.OR => Constant(x.intValue | y.intValue)
@@ -95,14 +95,20 @@ abstract class ConstantFolder {
case nme.MUL => Constant(x.intValue * y.intValue)
case nme.DIV => Constant(x.intValue / y.intValue)
case nme.MOD => Constant(x.intValue % y.intValue)
- case _ => null
+ case _ => null
}
private def foldLongOp(op: Name, x: Constant, y: Constant): Constant = op match {
case nme.OR => Constant(x.longValue | y.longValue)
case nme.XOR => Constant(x.longValue ^ y.longValue)
case nme.AND => Constant(x.longValue & y.longValue)
- case nme.LSL => Constant(x.longValue << y.longValue)
+ case nme.LSL if x.tag <= IntTag
+ => Constant(x.intValue << y.longValue)
+ case nme.LSL => Constant(x.longValue << y.longValue)
+ case nme.LSR if x.tag <= IntTag
+ => Constant(x.intValue >>> y.longValue)
case nme.LSR => Constant(x.longValue >>> y.longValue)
+ case nme.ASR if x.tag <= IntTag
+ => Constant(x.intValue >> y.longValue)
case nme.ASR => Constant(x.longValue >> y.longValue)
case nme.EQ => Constant(x.longValue == y.longValue)
case nme.NE => Constant(x.longValue != y.longValue)
@@ -115,7 +121,7 @@ abstract class ConstantFolder {
case nme.MUL => Constant(x.longValue * y.longValue)
case nme.DIV => Constant(x.longValue / y.longValue)
case nme.MOD => Constant(x.longValue % y.longValue)
- case _ => null
+ case _ => null
}
private def foldFloatOp(op: Name, x: Constant, y: Constant): Constant = op match {
case nme.EQ => Constant(x.floatValue == y.floatValue)
@@ -129,7 +135,7 @@ abstract class ConstantFolder {
case nme.MUL => Constant(x.floatValue * y.floatValue)
case nme.DIV => Constant(x.floatValue / y.floatValue)
case nme.MOD => Constant(x.floatValue % y.floatValue)
- case _ => null
+ case _ => null
}
private def foldDoubleOp(op: Name, x: Constant, y: Constant): Constant = op match {
case nme.EQ => Constant(x.doubleValue == y.doubleValue)
@@ -143,7 +149,7 @@ abstract class ConstantFolder {
case nme.MUL => Constant(x.doubleValue * y.doubleValue)
case nme.DIV => Constant(x.doubleValue / y.doubleValue)
case nme.MOD => Constant(x.doubleValue % y.doubleValue)
- case _ => null
+ case _ => null
}
private def foldBinop(op: Name, x: Constant, y: Constant): Constant = {
@@ -162,7 +168,7 @@ abstract class ConstantFolder {
case _ => null
}
catch {
- case ex: ArithmeticException => null
+ case _: ArithmeticException => null
}
}
}
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index 43f2655311..2ccf375c45 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -24,7 +24,8 @@ trait Contexts { self: Analyzer =>
object NoContext
extends Context(EmptyTree, NoSymbol, EmptyScope, NoCompilationUnit,
- null) { // We can't pass the uninitialized `this`. Instead, we treat null specially in `Context#outer`
+ // We can't pass the uninitialized `this`. Instead, we treat null specially in `Context#outer`
+ null) {
enclClass = this
enclMethod = this
@@ -48,12 +49,11 @@ trait Contexts { self: Analyzer =>
def ambiguousDefnAndImport(owner: Symbol, imp: ImportInfo) =
LookupAmbiguous(s"it is both defined in $owner and imported subsequently by \n$imp")
- private lazy val startContext = {
- NoContext.make(
+ private lazy val startContext = NoContext.make(
Template(List(), noSelfType, List()) setSymbol global.NoSymbol setType global.NoType,
rootMirror.RootClass,
- rootMirror.RootClass.info.decls)
- }
+ rootMirror.RootClass.info.decls
+ )
private lazy val allUsedSelectors =
mutable.Map[ImportInfo, Set[ImportSelector]]() withDefaultValue Set()
@@ -802,6 +802,14 @@ trait Contexts { self: Analyzer =>
(e ne null) && (e.owner == scope) && (!settings.isScala212 || e.sym.exists)
})
+ /** Do something with the symbols with name `name` imported via the import in `imp`,
+ * if any such symbol is accessible from this context and is a qualifying implicit.
+ */
+ private def withQualifyingImplicitAlternatives(imp: ImportInfo, name: Name, pre: Type)(f: Symbol => Unit) = for {
+ sym <- importedAccessibleSymbol(imp, name, requireExplicit = false, record = false).alternatives
+ if isQualifyingImplicit(name, sym, pre, imported = true)
+ } f(sym)
+
private def collectImplicits(syms: Scope, pre: Type, imported: Boolean = false): List[ImplicitInfo] =
for (sym <- syms.toList if isQualifyingImplicit(sym.name, sym, pre, imported)) yield
new ImplicitInfo(sym.name, pre, sym)
@@ -809,12 +817,8 @@ trait Contexts { self: Analyzer =>
private def collectImplicitImports(imp: ImportInfo): List[ImplicitInfo] = {
val qual = imp.qual
- val pre =
- if (qual.tpe.typeSymbol.isPackageClass)
- // SI-6225 important if the imported symbol is inherited by the the package object.
- singleType(qual.tpe, qual.tpe member nme.PACKAGE)
- else
- qual.tpe
+ val qualSym = qual.tpe.typeSymbol
+ val pre = qual.tpe
def collect(sels: List[ImportSelector]): List[ImplicitInfo] = sels match {
case List() =>
List()
@@ -823,9 +827,9 @@ trait Contexts { self: Analyzer =>
case ImportSelector(from, _, to, _) :: sels1 =>
var impls = collect(sels1) filter (info => info.name != from)
if (to != nme.WILDCARD) {
- for (sym <- importedAccessibleSymbol(imp, to).alternatives)
- if (isQualifyingImplicit(to, sym, pre, imported = true))
- impls = new ImplicitInfo(to, pre, sym) :: impls
+ withQualifyingImplicitAlternatives(imp, to, pre) { sym =>
+ impls = new ImplicitInfo(to, pre, sym) :: impls
+ }
}
impls
}
@@ -885,7 +889,8 @@ trait Contexts { self: Analyzer =>
Some(collectImplicitImports(imports.head))
} else if (owner.isPackageClass) {
// the corresponding package object may contain implicit members.
- Some(collectImplicits(owner.tpe.implicitMembers, owner.tpe))
+ val pre = owner.packageObject.typeOfThis
+ Some(collectImplicits(pre.implicitMembers, pre))
} else Some(Nil)
}
@@ -949,58 +954,21 @@ trait Contexts { self: Analyzer =>
/** The symbol with name `name` imported via the import in `imp`,
* if any such symbol is accessible from this context.
*/
- def importedAccessibleSymbol(imp: ImportInfo, name: Name): Symbol =
- importedAccessibleSymbol(imp, name, requireExplicit = false)
-
- private def importedAccessibleSymbol(imp: ImportInfo, name: Name, requireExplicit: Boolean): Symbol =
- imp.importedSymbol(name, requireExplicit) filter (s => isAccessible(s, imp.qual.tpe, superAccess = false))
-
- /** Is `sym` defined in package object of package `pkg`?
- * Since sym may be defined in some parent of the package object,
- * we cannot inspect its owner only; we have to go through the
- * info of the package object. However to avoid cycles we'll check
- * what other ways we can before pushing that way.
+ private def importedAccessibleSymbol(imp: ImportInfo, name: Name, requireExplicit: Boolean, record: Boolean): Symbol =
+ imp.importedSymbol(name, requireExplicit, record) filter (s => isAccessible(s, imp.qual.tpe, superAccess = false))
+
+ private def requiresQualifier(s: Symbol) = (
+ s.owner.isClass
+ && !s.owner.isPackageClass
+ && !s.isTypeParameterOrSkolem
+ && !s.isExistentiallyBound
+ )
+
+ /** Must `sym` defined in package object of package `pkg`, if
+ * it selected from a prefix with `pkg` as its type symbol?
*/
- def isInPackageObject(sym: Symbol, pkg: Symbol): Boolean = {
- def uninitialized(what: String) = {
- log(s"Cannot look for $sym in package object of $pkg; $what is not initialized.")
- false
- }
- def pkgClass = if (pkg.isTerm) pkg.moduleClass else pkg
- def matchesInfo = (
- // need to be careful here to not get a cyclic reference during bootstrap
- if (pkg.isInitialized) {
- val module = pkg.info member nme.PACKAGEkw
- if (module.isInitialized)
- module.info.member(sym.name).alternatives contains sym
- else
- uninitialized("" + module)
- }
- else uninitialized("" + pkg)
- )
- def inPackageObject(sym: Symbol) = (
- // To be in the package object, one of these must be true:
- // 1) sym.owner is a package object class, and sym.owner.owner is the package class for `pkg`
- // 2) sym.owner is inherited by the correct package object class
- // We try to establish 1) by inspecting the owners directly, and then we try
- // to rule out 2), and only if both those fail do we resort to looking in the info.
- !sym.hasPackageFlag && sym.owner.exists && (
- if (sym.owner.isPackageObjectClass)
- sym.owner.owner == pkgClass
- else
- !sym.owner.isPackageClass && matchesInfo
- )
- )
-
- // An overloaded symbol might not have the expected owner!
- // The alternatives must be inspected directly.
- pkgClass.isPackageClass && (
- if (sym.isOverloaded)
- sym.alternatives forall (isInPackageObject(_, pkg))
- else
- inPackageObject(sym)
- )
- }
+ def isInPackageObject(sym: Symbol, pkg: Symbol): Boolean =
+ pkg.isPackage && sym.owner != pkg && requiresQualifier(sym)
def isNameInScope(name: Name) = lookupSymbol(name, _ => true).isSuccess
@@ -1036,11 +1004,6 @@ trait Contexts { self: Analyzer =>
|| unit.exists && s.sourceFile != unit.source.file
)
)
- def requiresQualifier(s: Symbol) = (
- s.owner.isClass
- && !s.owner.isPackageClass
- && !s.isTypeParameterOrSkolem
- )
def lookupInPrefix(name: Name) = pre member name filter qualifies
def accessibleInPrefix(s: Symbol) = isAccessible(s, pre, superAccess = false)
@@ -1099,7 +1062,7 @@ trait Contexts { self: Analyzer =>
def imp2Explicit = imp2 isExplicitImport name
def lookupImport(imp: ImportInfo, requireExplicit: Boolean) =
- importedAccessibleSymbol(imp, name, requireExplicit) filter qualifies
+ importedAccessibleSymbol(imp, name, requireExplicit, record = true) filter qualifies
// Java: A single-type-import declaration d in a compilation unit c of package p
// that imports a type named n shadows, throughout c, the declarations of:
@@ -1395,7 +1358,6 @@ trait Contexts { self: Analyzer =>
protected def handleError(pos: Position, msg: String): Unit = onTreeCheckerError(pos, msg)
}
-
class ImportInfo(val tree: Import, val depth: Int) {
def pos = tree.pos
def posOf(sel: ImportSelector) = tree.pos withPoint sel.namePos
@@ -1411,19 +1373,20 @@ trait Contexts { self: Analyzer =>
def isExplicitImport(name: Name): Boolean =
tree.selectors exists (_.rename == name.toTermName)
- /** The symbol with name `name` imported from import clause `tree`.
- */
- def importedSymbol(name: Name): Symbol = importedSymbol(name, requireExplicit = false)
+ /** The symbol with name `name` imported from import clause `tree`. */
+ def importedSymbol(name: Name): Symbol = importedSymbol(name, requireExplicit = false, record = true)
- private def recordUsage(sel: ImportSelector, result: Symbol) {
- def posstr = pos.source.file.name + ":" + posOf(sel).line
- def resstr = if (tree.symbol.hasCompleteInfo) s"(qual=$qual, $result)" else s"(expr=${tree.expr}, ${result.fullLocationString})"
- debuglog(s"In $this at $posstr, selector '${selectorString(sel)}' resolved to $resstr")
+ private def recordUsage(sel: ImportSelector, result: Symbol): Unit = {
+ debuglog(s"In $this at ${ pos.source.file.name }:${ posOf(sel).line }, selector '${ selectorString(sel)
+ }' resolved to ${
+ if (tree.symbol.hasCompleteInfo) s"(qual=$qual, $result)"
+ else s"(expr=${tree.expr}, ${result.fullLocationString})"
+ }")
allUsedSelectors(this) += sel
}
/** If requireExplicit is true, wildcard imports are not considered. */
- def importedSymbol(name: Name, requireExplicit: Boolean): Symbol = {
+ def importedSymbol(name: Name, requireExplicit: Boolean, record: Boolean): Symbol = {
var result: Symbol = NoSymbol
var renamed = false
var selectors = tree.selectors
@@ -1440,7 +1403,7 @@ trait Contexts { self: Analyzer =>
if (result == NoSymbol)
selectors = selectors.tail
}
- if (settings.warnUnusedImport && selectors.nonEmpty && result != NoSymbol && pos != NoPosition)
+ if (record && settings.warnUnusedImport && selectors.nonEmpty && result != NoSymbol && pos != NoPosition)
recordUsage(current, result)
// Harden against the fallout from bugs like SI-6745
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index 7ec9cd74a4..196b137a3e 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -1012,15 +1012,12 @@ trait Implicits {
}
case None =>
if (pre.isStable && !pre.typeSymbol.isExistentiallyBound) {
- val companion = companionSymbolOf(sym, context)
- companion.moduleClass match {
- case mc: ModuleClassSymbol =>
- val infos =
- for (im <- mc.implicitMembers.toList) yield new ImplicitInfo(im.name, singleType(pre, companion), im)
- if (infos.nonEmpty)
- infoMap += (sym -> infos)
- case _ =>
- }
+ val pre1 =
+ if (sym.isPackageClass) sym.packageObject.typeOfThis
+ else singleType(pre, companionSymbolOf(sym, context))
+ val infos = pre1.implicitMembers.iterator.map(mem => new ImplicitInfo(mem.name, pre1, mem)).toList
+ if (infos.nonEmpty)
+ infoMap += (sym -> infos)
}
val bts = tp.baseTypeSeq
var i = 1
@@ -1411,7 +1408,7 @@ trait Implicits {
}
if (result.isFailure && settings.debug) // debuglog is not inlined for some reason
- log("no implicits found for "+pt+" "+pt.typeSymbol.info.baseClasses+" "+implicitsOfExpectedType)
+ log(s"no implicits found for ${pt} ${pt.typeSymbol.info.baseClasses} ${implicitsOfExpectedType}")
result
}
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
index ab9fa26bac..bf705e89ad 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -1446,7 +1446,7 @@ trait Infer extends Checkable {
log(s"Attaching AntiPolyType-carrying overloaded type to $sym")
// Multiple alternatives which are within bounds; spin up an
// overloaded type which carries an "AntiPolyType" as a prefix.
- val tparams = newAsSeenFromMap(pre, hd.owner) mapOver hd.typeParams
+ val tparams = new AsSeenFromMap(pre, hd.owner) mapOver hd.typeParams
val bounds = tparams map (_.tpeHK) // see e.g., #1236
val tpe = PolyType(tparams, OverloadedType(AntiPolyType(pre, bounds), alts))
finish(sym setInfo tpe, tpe)
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index c1655467e9..4ad81b60ae 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -145,8 +145,8 @@ trait Namers extends MethodSynthesis {
// while Scala's enum constants live directly in the class.
// We don't check for clazz.superClass == JavaEnumClass, because this causes a illegal
// cyclic reference error. See the commit message for details.
- if (context.unit.isJava) owner.companionClass.hasEnumFlag else owner.hasEnumFlag
- vd.mods.hasAllFlags(ENUM | STABLE | STATIC) && ownerHasEnumFlag
+ if (context.unit.isJava) owner.companionClass.hasJavaEnumFlag else owner.hasJavaEnumFlag
+ vd.mods.hasAllFlags(JAVA_ENUM | STABLE | STATIC) && ownerHasEnumFlag
}
def setPrivateWithin[T <: Symbol](tree: Tree, sym: T, mods: Modifiers): T =
diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
index 39cd610b1c..1bc5daac65 100644
--- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
@@ -9,6 +9,7 @@ package typechecker
import symtab.Flags._
import scala.collection.mutable
import scala.reflect.ClassTag
+import PartialFunction.{ cond => when }
/**
* @author Lukas Rytz
@@ -551,64 +552,73 @@ trait NamesDefaults { self: Analyzer =>
}
}
- /**
- * Removes name assignments from args. Additionally, returns an array mapping
- * argument indices from call-site-order to definition-site-order.
+ /** Removes name assignments from args. Additionally, returns an array mapping
+ * argument indices from call-site-order to definition-site-order.
*
- * Verifies that names are not specified twice, positional args don't appear
- * after named ones.
+ * Verifies that names are not specified twice, and positional args don't appear after named ones.
*/
def removeNames(typer: Typer)(args: List[Tree], params: List[Symbol]): (List[Tree], Array[Int]) = {
implicit val context0 = typer.context
- // maps indices from (order written by user) to (order of definition)
- val argPos = Array.fill(args.length)(-1)
- var positionalAllowed = true
- val namelessArgs = mapWithIndex(args) { (arg, argIndex) =>
- arg match {
- case arg @ AssignOrNamedArg(Ident(name), rhs) =>
- def matchesName(param: Symbol) = !param.isSynthetic && (
- (param.name == name) || (param.deprecatedParamName match {
- case Some(`name`) =>
- context0.deprecationWarning(arg.pos, param,
- s"the parameter name $name has been deprecated. Use ${param.name} instead.")
- true
- case _ => false
- })
- )
- val paramPos = params indexWhere matchesName
- if (paramPos == -1) {
- if (positionalAllowed) {
- argPos(argIndex) = argIndex
- // prevent isNamed from being true when calling doTypedApply recursively,
- // treat the arg as an assignment of type Unit
- Assign(arg.lhs, rhs) setPos arg.pos
- }
- else UnknownParameterNameNamesDefaultError(arg, name)
- }
- else if (argPos contains paramPos) {
+ def matchesName(param: Symbol, name: Name, argIndex: Int) = {
+ def warn(w: String) = context0.deprecationWarning(args(argIndex).pos, param, w)
+ def checkDeprecation(anonOK: Boolean) =
+ when (param.deprecatedParamName) {
+ case Some(`name`) => true
+ case Some(nme.NO_NAME) => anonOK
+ }
+ def checkName = {
+ val res = param.name == name
+ if (res && checkDeprecation(true)) warn(s"naming parameter $name has been deprecated.")
+ res
+ }
+ def checkAltName = {
+ val res = checkDeprecation(false)
+ if (res) warn(s"the parameter name $name has been deprecated. Use ${param.name} instead.")
+ res
+ }
+ !param.isSynthetic && (checkName || checkAltName)
+ }
+ // argPos maps indices from (order written by user) to (order of definition)
+ val argPos = Array.fill(args.length)(-1)
+ val namelessArgs = {
+ var positionalAllowed = true
+ def stripNamedArg(arg: AssignOrNamedArg, argIndex: Int): Tree = {
+ val AssignOrNamedArg(Ident(name), rhs) = arg
+ params indexWhere (p => matchesName(p, name, argIndex)) match {
+ case -1 if positionalAllowed =>
+ // prevent isNamed from being true when calling doTypedApply recursively,
+ // treat the arg as an assignment of type Unit
+ Assign(arg.lhs, rhs) setPos arg.pos
+ case -1 =>
+ UnknownParameterNameNamesDefaultError(arg, name)
+ case paramPos if argPos contains paramPos =>
val existingArgIndex = argPos.indexWhere(_ == paramPos)
- val otherName = args(paramPos) match {
- case AssignOrNamedArg(Ident(oName), rhs) if oName != name => Some(oName)
- case _ => None
+ val otherName = Some(args(paramPos)) collect {
+ case AssignOrNamedArg(Ident(oName), _) if oName != name => oName
}
DoubleParamNamesDefaultError(arg, name, existingArgIndex+1, otherName)
- } else if (isAmbiguousAssignment(typer, params(paramPos), arg))
+ case paramPos if isAmbiguousAssignment(typer, params(paramPos), arg) =>
AmbiguousReferenceInNamesDefaultError(arg, name)
- else {
- // if the named argument is on the original parameter
- // position, positional after named is allowed.
- if (argIndex != paramPos)
- positionalAllowed = false
- argPos(argIndex) = paramPos
+ case paramPos if paramPos != argIndex =>
+ positionalAllowed = false // named arg is not in original parameter order: require names after this
+ argPos(argIndex) = paramPos // fix up the arg position
rhs
- }
- case _ =>
- argPos(argIndex) = argIndex
- if (positionalAllowed) arg
- else PositionalAfterNamedNamesDefaultError(arg)
+ case _ => rhs
+ }
+ }
+ mapWithIndex(args) {
+ case (arg: AssignOrNamedArg, argIndex) =>
+ val t = stripNamedArg(arg, argIndex)
+ if (!t.isErroneous && argPos(argIndex) < 0) argPos(argIndex) = argIndex
+ t
+ case (arg, argIndex) =>
+ if (positionalAllowed) {
+ argPos(argIndex) = argIndex
+ arg
+ } else
+ PositionalAfterNamedNamesDefaultError(arg)
}
}
-
(namelessArgs, argPos)
}
}
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index 36423fa2aa..0198529ef7 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -421,7 +421,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans
overrideError("cannot be used here - classes can only override abstract types")
} else if (other.isEffectivelyFinal) { // (1.2)
overrideError("cannot override final member")
- } else if (!other.isDeferredOrDefault && !other.hasFlag(DEFAULTMETHOD) && !member.isAnyOverride && !member.isSynthetic) { // (*)
+ } else if (!other.isDeferredOrJavaDefault && !other.hasFlag(JAVA_DEFAULTMETHOD) && !member.isAnyOverride && !member.isSynthetic) { // (*)
// (*) Synthetic exclusion for (at least) default getters, fixes SI-5178. We cannot assign the OVERRIDE flag to
// the default getter: one default getter might sometimes override, sometimes not. Example in comment on ticket.
if (isNeitherInClass && !(other.owner isSubClass member.owner))
@@ -604,7 +604,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans
def checkNoAbstractMembers(): Unit = {
// Avoid spurious duplicates: first gather any missing members.
def memberList = clazz.info.nonPrivateMembersAdmitting(VBRIDGE)
- val (missing, rest) = memberList partition (m => m.isDeferredNotDefault && !ignoreDeferred(m))
+ val (missing, rest) = memberList partition (m => m.isDeferredNotJavaDefault && !ignoreDeferred(m))
// Group missing members by the name of the underlying symbol,
// to consolidate getters and setters.
val grouped = missing groupBy (sym => analyzer.underlyingSymbol(sym).name)
diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
index 966e8f1abe..d65d2092ad 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
@@ -87,24 +87,6 @@ trait SyntheticMethods extends ast.TreeDSL {
def accessors = clazz.caseFieldAccessors
val arity = accessors.size
- // If this is ProductN[T1, T2, ...], accessorLub is the lub of T1, T2, ..., .
- // !!! Hidden behind -Xexperimental due to bummer type inference bugs.
- // Refining from Iterator[Any] leads to types like
- //
- // Option[Int] { def productIterator: Iterator[String] }
- //
- // appearing legitimately, but this breaks invariant places
- // like Tags and Arrays which are not robust and infer things
- // which they shouldn't.
- val accessorLub = (
- if (settings.Xexperimental) {
- global.lub(accessors map (_.tpe.finalResultType)) match {
- case RefinedType(parents, decls) if !decls.isEmpty => intersectionType(parents)
- case tp => tp
- }
- }
- else AnyTpe
- )
def forwardToRuntime(method: Symbol): Tree =
forwardMethod(method, getMember(ScalaRunTimeModule, (method.name prepend "_")))(mkThis :: _)
@@ -125,8 +107,8 @@ trait SyntheticMethods extends ast.TreeDSL {
}
}
def productIteratorMethod = {
- createMethod(nme.productIterator, iteratorOfType(accessorLub))(_ =>
- gen.mkMethodCall(ScalaRunTimeModule, nme.typedProductIterator, List(accessorLub), List(mkThis))
+ createMethod(nme.productIterator, iteratorOfType(AnyTpe))(_ =>
+ gen.mkMethodCall(ScalaRunTimeModule, nme.typedProductIterator, List(AnyTpe), List(mkThis))
)
}
@@ -246,7 +228,7 @@ trait SyntheticMethods extends ast.TreeDSL {
List(
Product_productPrefix -> (() => constantNullary(nme.productPrefix, clazz.name.decode)),
Product_productArity -> (() => constantNullary(nme.productArity, arity)),
- Product_productElement -> (() => perElementMethod(nme.productElement, accessorLub)(mkThisSelect)),
+ Product_productElement -> (() => perElementMethod(nme.productElement, AnyTpe)(mkThisSelect)),
Product_iterator -> (() => productIteratorMethod),
Product_canEqual -> (() => canEqualMethod)
// This is disabled pending a reimplementation which doesn't add any
@@ -380,7 +362,14 @@ trait SyntheticMethods extends ast.TreeDSL {
for (ddef @ DefDef(_, _, _, _, _, _) <- templ.body ; if isRewrite(ddef.symbol)) {
val original = ddef.symbol
- val newAcc = deriveMethod(ddef.symbol, name => context.unit.freshTermName(name + "$")) { newAcc =>
+ val i = original.owner.caseFieldAccessors.indexOf(original)
+ def freshAccessorName = {
+ devWarning(s"Unable to find $original among case accessors of ${original.owner}: ${original.owner.caseFieldAccessors}")
+ context.unit.freshTermName(original.name + "$")
+ }
+ def nameSuffixedByParamIndex = original.name.append(nme.CASE_ACCESSOR + "$" + i).toTermName
+ val newName = if (i < 0) freshAccessorName else nameSuffixedByParamIndex
+ val newAcc = deriveMethod(ddef.symbol, name => newName) { newAcc =>
newAcc.makePublic
newAcc resetFlag (ACCESSOR | PARAMACCESSOR | OVERRIDE)
ddef.rhs.duplicate
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index fd1a6f293f..cc15a2485f 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -542,7 +542,11 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
}
val qual = typedQualifier { atPos(tree.pos.makeTransparent) {
tree match {
- case Ident(_) => Ident(rootMirror.getPackageObjectWithMember(pre, sym))
+ case Ident(_) =>
+ val packageObject =
+ if (sym.owner.isModuleClass) sym.owner.sourceModule // historical optimization, perhaps no longer needed
+ else pre.typeSymbol.packageObject
+ Ident(packageObject)
case Select(qual, _) => Select(qual, nme.PACKAGEkw)
case SelectFromTypeTree(qual, _) => Select(qual, nme.PACKAGEkw)
}
@@ -928,24 +932,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
def insertApply(): Tree = {
assert(!context.inTypeConstructorAllowed, mode) //@M
val adapted = adaptToName(tree, nme.apply)
- def stabilize0(pre: Type): Tree = stabilize(adapted, pre, MonoQualifierModes, WildcardType)
-
- // TODO reconcile the overlap between Typers#stablize and TreeGen.stabilize
- val qual = adapted match {
- case This(_) =>
- gen.stabilize(adapted)
- case Ident(_) =>
- val owner = adapted.symbol.owner
- val pre =
- if (owner.isPackageClass) owner.thisType
- else if (owner.isClass) context.enclosingSubClassContext(owner).prefix
- else NoPrefix
- stabilize0(pre)
- case Select(qualqual, _) =>
- stabilize0(qualqual.tpe)
- case other =>
- other
- }
+ val qual = gen.stabilize(adapted)
typedPos(tree.pos, mode, pt) {
Select(qual setPos tree.pos.makeTransparent, nme.apply)
}
@@ -1707,6 +1694,8 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
psym addChild context.owner
else
pending += ParentSealedInheritanceError(parent, psym)
+ if (psym.isLocalToBlock && !phase.erasedTypes)
+ psym addChild context.owner
val parentTypeOfThis = parent.tpe.dealias.typeOfThis
if (!(selfType <:< parentTypeOfThis) &&
@@ -2228,7 +2217,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
val allParams = meth.paramss.flatten
for (p <- allParams) {
for (n <- p.deprecatedParamName) {
- if (allParams.exists(p1 => p1.name == n || (p != p1 && p1.deprecatedParamName.exists(_ == n))))
+ if (allParams.exists(p1 => p != p1 && (p1.name == n || p1.deprecatedParamName.exists(_ == n))))
DeprecatedParamNameError(p, n)
}
}
@@ -5228,7 +5217,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
if (refTyped.isErrorTyped) {
setError(tree)
} else {
- tree setType refTyped.tpe.resultType
+ tree setType refTyped.tpe.resultType.deconst
if (refTyped.isErrorTyped || treeInfo.admitsTypeSelection(refTyped)) tree
else UnstableTreeError(tree)
}
diff --git a/src/compiler/scala/tools/reflect/WrappedProperties.scala b/src/compiler/scala/tools/reflect/WrappedProperties.scala
index 523287fc66..348d000d15 100644
--- a/src/compiler/scala/tools/reflect/WrappedProperties.scala
+++ b/src/compiler/scala/tools/reflect/WrappedProperties.scala
@@ -30,9 +30,10 @@ trait WrappedProperties extends PropertiesTrait {
def systemProperties: List[(String, String)] = {
import scala.collection.JavaConverters._
wrap {
+ // SI-7269,7775 Avoid `ConcurrentModificationException` and nulls if another thread modifies properties
val props = System.getProperties
- // SI-7269 Be careful to avoid `ConcurrentModificationException` if another thread modifies the properties map
- props.stringPropertyNames().asScala.toList.map(k => (k, props.get(k).asInstanceOf[String]))
+ val it = props.stringPropertyNames().asScala.iterator map (k => (k, props getProperty k)) filter (_._2 ne null)
+ it.toList
} getOrElse Nil
}
}
diff --git a/src/compiler/scala/tools/util/PathResolver.scala b/src/compiler/scala/tools/util/PathResolver.scala
index 8e5b1e0a5c..09c6c9d744 100644
--- a/src/compiler/scala/tools/util/PathResolver.scala
+++ b/src/compiler/scala/tools/util/PathResolver.scala
@@ -52,7 +52,7 @@ object PathResolver {
*/
object Environment {
private def searchForBootClasspath =
- systemProperties find (_._1 endsWith ".boot.class.path") map (_._2) getOrElse ""
+ systemProperties collectFirst { case (k, v) if k endsWith ".boot.class.path" => v } getOrElse ""
/** Environment variables which java pays attention to so it
* seems we do as well.
@@ -254,17 +254,7 @@ abstract class PathResolverBase[BaseClassPathType <: ClassFileLookup[AbstractFil
* TODO: we should refactor this as a separate -bootstrap option to have a clean implementation, no? */
def sourcePath = if (!settings.isScaladoc) cmdLineOrElse("sourcepath", Defaults.scalaSourcePath) else ""
- /** Against my better judgment, giving in to martin here and allowing
- * CLASSPATH to be used automatically. So for the user-specified part
- * of the classpath:
- *
- * - If -classpath or -cp is given, it is that
- * - Otherwise, if CLASSPATH is set, it is that
- * - If neither of those, then "." is used.
- */
- def userClassPath =
- if (!settings.classpath.isDefault) settings.classpath.value
- else sys.env.getOrElse("CLASSPATH", ".")
+ def userClassPath = settings.classpath.value // default is specified by settings and can be overridden there
import classPathFactory._
diff --git a/src/eclipse/partest/.classpath b/src/eclipse/partest/.classpath
index 50757ad2ba..de4acf8aa0 100644
--- a/src/eclipse/partest/.classpath
+++ b/src/eclipse/partest/.classpath
@@ -5,7 +5,7 @@
<classpathentry combineaccessrules="false" kind="src" path="/repl"/>
<classpathentry kind="var" path="M2_REPO/com/googlecode/java-diff-utils/diffutils/1.3.0/diffutils-1.3.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/scala-sbt/test-interface/1.0/test-interface-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/scala-lang/modules/scala-partest_2.11/1.0.7/scala-partest_2.11-1.0.7.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/scala-lang/modules/scala-partest_2.12.0-M1/1.0.7/scala-partest_2.12.0-M1-1.0.7.jar"/>
<classpathentry kind="var" path="SCALA_BASEDIR/lib/ant/ant.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/scala-compiler"/>
diff --git a/src/eclipse/scaladoc/.classpath b/src/eclipse/scaladoc/.classpath
index c8f0e89b8a..2b8282cfb3 100644
--- a/src/eclipse/scaladoc/.classpath
+++ b/src/eclipse/scaladoc/.classpath
@@ -6,8 +6,8 @@
<classpathentry combineaccessrules="false" kind="src" path="/scala-compiler"/>
<classpathentry combineaccessrules="false" kind="src" path="/scala-library"/>
<classpathentry combineaccessrules="false" kind="src" path="/partest-extras"/>
- <classpathentry kind="var" path="M2_REPO/org/scala-lang/modules/scala-xml_2.11.0-M7/1.0.0-RC7/scala-xml_2.11.0-M7-1.0.0-RC7.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/scala-lang/modules/scala-parser-combinators_2.11.0-M7/1.0.0-RC5/scala-parser-combinators_2.11.0-M7-1.0.0-RC5.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/scala-lang/modules/scala-partest_2.11.0-M7/1.0.0-RC8/scala-partest_2.11.0-M7-1.0.0-RC8.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/scala-lang/modules/scala-xml_2.12.0-M1/1.0.4/scala-xml_2.12.0-M1-1.0.4"/>
+ <classpathentry kind="var" path="M2_REPO/org/scala-lang/modules/scala-parser-combinators_2.12.0-M1/1.0.4/scala-parser-combinators_2.12.0-M1-1.0.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/scala-lang/modules/scala-partest_2.12.0-M1/1.0.7/scala-partest_2.12.0-M1-1.0.7.jar"/>
<classpathentry kind="output" path="build-quick-scaladoc"/>
</classpath>
diff --git a/src/forkjoin/scala/concurrent/forkjoin/ForkJoinPool.java b/src/forkjoin/scala/concurrent/forkjoin/ForkJoinPool.java
deleted file mode 100644
index 6578504155..0000000000
--- a/src/forkjoin/scala/concurrent/forkjoin/ForkJoinPool.java
+++ /dev/null
@@ -1,3759 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-package scala.concurrent.forkjoin;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.AbstractExecutorService;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.RunnableFuture;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @since 1.8
- * @author Doug Lea
- */
-/*public*/ abstract class CountedCompleter<T> extends ForkJoinTask<T> {
- private static final long serialVersionUID = 5232453752276485070L;
-
- /** This task's completer, or null if none */
- final CountedCompleter<?> completer;
- /** The number of pending tasks until completion */
- volatile int pending;
-
- /**
- * Creates a new CountedCompleter with the given completer
- * and initial pending count.
- *
- * @param completer this task's completer, or {@code null} if none
- * @param initialPendingCount the initial pending count
- */
- protected CountedCompleter(CountedCompleter<?> completer,
- int initialPendingCount) {
- this.completer = completer;
- this.pending = initialPendingCount;
- }
-
- /**
- * Creates a new CountedCompleter with the given completer
- * and an initial pending count of zero.
- *
- * @param completer this task's completer, or {@code null} if none
- */
- protected CountedCompleter(CountedCompleter<?> completer) {
- this.completer = completer;
- }
-
- /**
- * Creates a new CountedCompleter with no completer
- * and an initial pending count of zero.
- */
- protected CountedCompleter() {
- this.completer = null;
- }
-
- /**
- * The main computation performed by this task.
- */
- public abstract void compute();
-
- /**
- * Performs an action when method {@link #tryComplete} is invoked
- * and the pending count is zero, or when the unconditional
- * method {@link #complete} is invoked. By default, this method
- * does nothing. You can distinguish cases by checking the
- * identity of the given caller argument. If not equal to {@code
- * this}, then it is typically a subtask that may contain results
- * (and/or links to other results) to combine.
- *
- * @param caller the task invoking this method (which may
- * be this task itself)
- */
- public void onCompletion(CountedCompleter<?> caller) {
- }
-
- /**
- * Performs an action when method {@link #completeExceptionally}
- * is invoked or method {@link #compute} throws an exception, and
- * this task has not otherwise already completed normally. On
- * entry to this method, this task {@link
- * ForkJoinTask#isCompletedAbnormally}. The return value of this
- * method controls further propagation: If {@code true} and this
- * task has a completer, then this completer is also completed
- * exceptionally. The default implementation of this method does
- * nothing except return {@code true}.
- *
- * @param ex the exception
- * @param caller the task invoking this method (which may
- * be this task itself)
- * @return true if this exception should be propagated to this
- * task's completer, if one exists
- */
- public boolean onExceptionalCompletion(Throwable ex, CountedCompleter<?> caller) {
- return true;
- }
-
- /**
- * Returns the completer established in this task's constructor,
- * or {@code null} if none.
- *
- * @return the completer
- */
- public final CountedCompleter<?> getCompleter() {
- return completer;
- }
-
- /**
- * Returns the current pending count.
- *
- * @return the current pending count
- */
- public final int getPendingCount() {
- return pending;
- }
-
- /**
- * Sets the pending count to the given value.
- *
- * @param count the count
- */
- public final void setPendingCount(int count) {
- pending = count;
- }
-
- /**
- * Adds (atomically) the given value to the pending count.
- *
- * @param delta the value to add
- */
- public final void addToPendingCount(int delta) {
- int c; // note: can replace with intrinsic in jdk8
- do {} while (!U.compareAndSwapInt(this, PENDING, c = pending, c+delta));
- }
-
- /**
- * Sets (atomically) the pending count to the given count only if
- * it currently holds the given expected value.
- *
- * @param expected the expected value
- * @param count the new value
- * @return true if successful
- */
- public final boolean compareAndSetPendingCount(int expected, int count) {
- return U.compareAndSwapInt(this, PENDING, expected, count);
- }
-
- /**
- * If the pending count is nonzero, (atomically) decrements it.
- *
- * @return the initial (undecremented) pending count holding on entry
- * to this method
- */
- public final int decrementPendingCountUnlessZero() {
- int c;
- do {} while ((c = pending) != 0 &&
- !U.compareAndSwapInt(this, PENDING, c, c - 1));
- return c;
- }
-
- /**
- * Returns the root of the current computation; i.e., this
- * task if it has no completer, else its completer's root.
- *
- * @return the root of the current computation
- */
- public final CountedCompleter<?> getRoot() {
- CountedCompleter<?> a = this, p;
- while ((p = a.completer) != null)
- a = p;
- return a;
- }
-
- /**
- * If the pending count is nonzero, decrements the count;
- * otherwise invokes {@link #onCompletion} and then similarly
- * tries to complete this task's completer, if one exists,
- * else marks this task as complete.
- */
- public final void tryComplete() {
- CountedCompleter<?> a = this, s = a;
- for (int c;;) {
- if ((c = a.pending) == 0) {
- a.onCompletion(s);
- if ((a = (s = a).completer) == null) {
- s.quietlyComplete();
- return;
- }
- }
- else if (U.compareAndSwapInt(a, PENDING, c, c - 1))
- return;
- }
- }
-
- /**
- * Equivalent to {@link #tryComplete} but does not invoke {@link
- * #onCompletion} along the completion path: If the pending count
- * is nonzero, decrements the count; otherwise, similarly tries to
- * complete this task's completer, if one exists, else marks this
- * task as complete. This method may be useful in cases where
- * {@code onCompletion} should not, or need not, be invoked for
- * each completer in a computation.
- */
- public final void propagateCompletion() {
- CountedCompleter<?> a = this, s = a;
- for (int c;;) {
- if ((c = a.pending) == 0) {
- if ((a = (s = a).completer) == null) {
- s.quietlyComplete();
- return;
- }
- }
- else if (U.compareAndSwapInt(a, PENDING, c, c - 1))
- return;
- }
- }
-
- /**
- * Regardless of pending count, invokes {@link #onCompletion},
- * marks this task as complete and further triggers {@link
- * #tryComplete} on this task's completer, if one exists. The
- * given rawResult is used as an argument to {@link #setRawResult}
- * before invoking {@link #onCompletion} or marking this task as
- * complete; its value is meaningful only for classes overriding
- * {@code setRawResult}.
- *
- * <p>This method may be useful when forcing completion as soon as
- * any one (versus all) of several subtask results are obtained.
- * However, in the common (and recommended) case in which {@code
- * setRawResult} is not overridden, this effect can be obtained
- * more simply using {@code quietlyCompleteRoot();}.
- *
- * @param rawResult the raw result
- */
- public void complete(T rawResult) {
- CountedCompleter<?> p;
- setRawResult(rawResult);
- onCompletion(this);
- quietlyComplete();
- if ((p = completer) != null)
- p.tryComplete();
- }
-
-
- /**
- * If this task's pending count is zero, returns this task;
- * otherwise decrements its pending count and returns {@code
- * null}. This method is designed to be used with {@link
- * #nextComplete} in completion traversal loops.
- *
- * @return this task, if pending count was zero, else {@code null}
- */
- public final CountedCompleter<?> firstComplete() {
- for (int c;;) {
- if ((c = pending) == 0)
- return this;
- else if (U.compareAndSwapInt(this, PENDING, c, c - 1))
- return null;
- }
- }
-
- /**
- * If this task does not have a completer, invokes {@link
- * ForkJoinTask#quietlyComplete} and returns {@code null}. Or, if
- * this task's pending count is non-zero, decrements its pending
- * count and returns {@code null}. Otherwise, returns the
- * completer. This method can be used as part of a completion
- * traversal loop for homogeneous task hierarchies:
- *
- * <pre> {@code
- * for (CountedCompleter<?> c = firstComplete();
- * c != null;
- * c = c.nextComplete()) {
- * // ... process c ...
- * }}</pre>
- *
- * @return the completer, or {@code null} if none
- */
- public final CountedCompleter<?> nextComplete() {
- CountedCompleter<?> p;
- if ((p = completer) != null)
- return p.firstComplete();
- else {
- quietlyComplete();
- return null;
- }
- }
-
- /**
- * Equivalent to {@code getRoot().quietlyComplete()}.
- */
- public final void quietlyCompleteRoot() {
- for (CountedCompleter<?> a = this, p;;) {
- if ((p = a.completer) == null) {
- a.quietlyComplete();
- return;
- }
- a = p;
- }
- }
-
- /**
- * Supports ForkJoinTask exception propagation.
- */
- void internalPropagateException(Throwable ex) {
- CountedCompleter<?> a = this, s = a;
- while (a.onExceptionalCompletion(ex, s) &&
- (a = (s = a).completer) != null && a.status >= 0)
- a.recordExceptionalCompletion(ex);
- }
-
- /**
- * Implements execution conventions for CountedCompleters.
- */
- protected final boolean exec() {
- compute();
- return false;
- }
-
- /**
- * Returns the result of the computation. By default
- * returns {@code null}, which is appropriate for {@code Void}
- * actions, but in other cases should be overridden, almost
- * always to return a field or function of a field that
- * holds the result upon completion.
- *
- * @return the result of the computation
- */
- public T getRawResult() { return null; }
-
- /**
- * A method that result-bearing CountedCompleters may optionally
- * use to help maintain result data. By default, does nothing.
- * Overrides are not recommended. However, if this method is
- * overridden to update existing objects or fields, then it must
- * in general be defined to be thread-safe.
- */
- protected void setRawResult(T t) { }
-
- // Unsafe mechanics
- private static final sun.misc.Unsafe U;
- private static final long PENDING;
- static {
- try {
- U = getUnsafe();
- PENDING = U.objectFieldOffset
- (CountedCompleter.class.getDeclaredField("pending"));
- } catch (Exception e) {
- throw new Error(e);
- }
- }
-
- /**
- * Returns a sun.misc.Unsafe. Suitable for use in a 3rd party package.
- * Replace with a simple call to Unsafe.getUnsafe when integrating
- * into a jdk.
- *
- * @return a sun.misc.Unsafe
- */
- private static sun.misc.Unsafe getUnsafe() {
- return scala.concurrent.util.Unsafe.instance;
- }
-}
-
-/**
- * An {@link ExecutorService} for running {@link ForkJoinTask}s.
- * A {@code ForkJoinPool} provides the entry point for submissions
- * from non-{@code ForkJoinTask} clients, as well as management and
- * monitoring operations.
- *
- * <p>A {@code ForkJoinPool} differs from other kinds of {@link
- * ExecutorService} mainly by virtue of employing
- * <em>work-stealing</em>: all threads in the pool attempt to find and
- * execute tasks submitted to the pool and/or created by other active
- * tasks (eventually blocking waiting for work if none exist). This
- * enables efficient processing when most tasks spawn other subtasks
- * (as do most {@code ForkJoinTask}s), as well as when many small
- * tasks are submitted to the pool from external clients. Especially
- * when setting <em>asyncMode</em> to true in constructors, {@code
- * ForkJoinPool}s may also be appropriate for use with event-style
- * tasks that are never joined.
- *
- * <p>A static {@link #commonPool()} is available and appropriate for
- * most applications. The common pool is used by any ForkJoinTask that
- * is not explicitly submitted to a specified pool. Using the common
- * pool normally reduces resource usage (its threads are slowly
- * reclaimed during periods of non-use, and reinstated upon subsequent
- * use).
- *
- * <p>For applications that require separate or custom pools, a {@code
- * ForkJoinPool} may be constructed with a given target parallelism
- * level; by default, equal to the number of available processors. The
- * pool attempts to maintain enough active (or available) threads by
- * dynamically adding, suspending, or resuming internal worker
- * threads, even if some tasks are stalled waiting to join
- * others. However, no such adjustments are guaranteed in the face of
- * blocked I/O or other unmanaged synchronization. The nested {@link
- * ManagedBlocker} interface enables extension of the kinds of
- * synchronization accommodated.
- *
- * <p>In addition to execution and lifecycle control methods, this
- * class provides status check methods (for example
- * {@link #getStealCount}) that are intended to aid in developing,
- * tuning, and monitoring fork/join applications. Also, method
- * {@link #toString} returns indications of pool state in a
- * convenient form for informal monitoring.
- *
- * <p>As is the case with other ExecutorServices, there are three
- * main task execution methods summarized in the following table.
- * These are designed to be used primarily by clients not already
- * engaged in fork/join computations in the current pool. The main
- * forms of these methods accept instances of {@code ForkJoinTask},
- * but overloaded forms also allow mixed execution of plain {@code
- * Runnable}- or {@code Callable}- based activities as well. However,
- * tasks that are already executing in a pool should normally instead
- * use the within-computation forms listed in the table unless using
- * async event-style tasks that are not usually joined, in which case
- * there is little difference among choice of methods.
- *
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
- * <tr>
- * <td></td>
- * <td ALIGN=CENTER> <b>Call from non-fork/join clients</b></td>
- * <td ALIGN=CENTER> <b>Call from within fork/join computations</b></td>
- * </tr>
- * <tr>
- * <td> <b>Arrange async execution</td>
- * <td> {@link #execute(ForkJoinTask)}</td>
- * <td> {@link ForkJoinTask#fork}</td>
- * </tr>
- * <tr>
- * <td> <b>Await and obtain result</td>
- * <td> {@link #invoke(ForkJoinTask)}</td>
- * <td> {@link ForkJoinTask#invoke}</td>
- * </tr>
- * <tr>
- * <td> <b>Arrange exec and obtain Future</td>
- * <td> {@link #submit(ForkJoinTask)}</td>
- * <td> {@link ForkJoinTask#fork} (ForkJoinTasks <em>are</em> Futures)</td>
- * </tr>
- * </table>
- *
- * <p>The common pool is by default constructed with default
- * parameters, but these may be controlled by setting three {@link
- * System#getProperty system properties} with prefix {@code
- * java.util.concurrent.ForkJoinPool.common}: {@code parallelism} --
- * an integer greater than zero, {@code threadFactory} -- the class
- * name of a {@link ForkJoinWorkerThreadFactory}, and {@code
- * exceptionHandler} -- the class name of a {@link
- * java.lang.Thread.UncaughtExceptionHandler
- * Thread.UncaughtExceptionHandler}. Upon any error in establishing
- * these settings, default parameters are used.
- *
- * <p><b>Implementation notes</b>: This implementation restricts the
- * maximum number of running threads to 32767. Attempts to create
- * pools with greater than the maximum number result in
- * {@code IllegalArgumentException}.
- *
- * <p>This implementation rejects submitted tasks (that is, by throwing
- * {@link RejectedExecutionException}) only when the pool is shut down
- * or internal resources have been exhausted.
- *
- * @since 1.7
- * @author Doug Lea
- */
-public class ForkJoinPool extends AbstractExecutorService {
-
- /*
- * Implementation Overview
- *
- * This class and its nested classes provide the main
- * functionality and control for a set of worker threads:
- * Submissions from non-FJ threads enter into submission queues.
- * Workers take these tasks and typically split them into subtasks
- * that may be stolen by other workers. Preference rules give
- * first priority to processing tasks from their own queues (LIFO
- * or FIFO, depending on mode), then to randomized FIFO steals of
- * tasks in other queues.
- *
- * WorkQueues
- * ==========
- *
- * Most operations occur within work-stealing queues (in nested
- * class WorkQueue). These are special forms of Deques that
- * support only three of the four possible end-operations -- push,
- * pop, and poll (aka steal), under the further constraints that
- * push and pop are called only from the owning thread (or, as
- * extended here, under a lock), while poll may be called from
- * other threads. (If you are unfamiliar with them, you probably
- * want to read Herlihy and Shavit's book "The Art of
- * Multiprocessor programming", chapter 16 describing these in
- * more detail before proceeding.) The main work-stealing queue
- * design is roughly similar to those in the papers "Dynamic
- * Circular Work-Stealing Deque" by Chase and Lev, SPAA 2005
- * (http://research.sun.com/scalable/pubs/index.html) and
- * "Idempotent work stealing" by Michael, Saraswat, and Vechev,
- * PPoPP 2009 (http://portal.acm.org/citation.cfm?id=1504186).
- * The main differences ultimately stem from GC requirements that
- * we null out taken slots as soon as we can, to maintain as small
- * a footprint as possible even in programs generating huge
- * numbers of tasks. To accomplish this, we shift the CAS
- * arbitrating pop vs poll (steal) from being on the indices
- * ("base" and "top") to the slots themselves. So, both a
- * successful pop and poll mainly entail a CAS of a slot from
- * non-null to null. Because we rely on CASes of references, we
- * do not need tag bits on base or top. They are simple ints as
- * used in any circular array-based queue (see for example
- * ArrayDeque). Updates to the indices must still be ordered in a
- * way that guarantees that top == base means the queue is empty,
- * but otherwise may err on the side of possibly making the queue
- * appear nonempty when a push, pop, or poll have not fully
- * committed. Note that this means that the poll operation,
- * considered individually, is not wait-free. One thief cannot
- * successfully continue until another in-progress one (or, if
- * previously empty, a push) completes. However, in the
- * aggregate, we ensure at least probabilistic non-blockingness.
- * If an attempted steal fails, a thief always chooses a different
- * random victim target to try next. So, in order for one thief to
- * progress, it suffices for any in-progress poll or new push on
- * any empty queue to complete. (This is why we normally use
- * method pollAt and its variants that try once at the apparent
- * base index, else consider alternative actions, rather than
- * method poll.)
- *
- * This approach also enables support of a user mode in which local
- * task processing is in FIFO, not LIFO order, simply by using
- * poll rather than pop. This can be useful in message-passing
- * frameworks in which tasks are never joined. However neither
- * mode considers affinities, loads, cache localities, etc, so
- * rarely provide the best possible performance on a given
- * machine, but portably provide good throughput by averaging over
- * these factors. (Further, even if we did try to use such
- * information, we do not usually have a basis for exploiting it.
- * For example, some sets of tasks profit from cache affinities,
- * but others are harmed by cache pollution effects.)
- *
- * WorkQueues are also used in a similar way for tasks submitted
- * to the pool. We cannot mix these tasks in the same queues used
- * for work-stealing (this would contaminate lifo/fifo
- * processing). Instead, we randomly associate submission queues
- * with submitting threads, using a form of hashing. The
- * ThreadLocal Submitter class contains a value initially used as
- * a hash code for choosing existing queues, but may be randomly
- * repositioned upon contention with other submitters. In
- * essence, submitters act like workers except that they are
- * restricted to executing local tasks that they submitted (or in
- * the case of CountedCompleters, others with the same root task).
- * However, because most shared/external queue operations are more
- * expensive than internal, and because, at steady state, external
- * submitters will compete for CPU with workers, ForkJoinTask.join
- * and related methods disable them from repeatedly helping to
- * process tasks if all workers are active. Insertion of tasks in
- * shared mode requires a lock (mainly to protect in the case of
- * resizing) but we use only a simple spinlock (using bits in
- * field qlock), because submitters encountering a busy queue move
- * on to try or create other queues -- they block only when
- * creating and registering new queues.
- *
- * Management
- * ==========
- *
- * The main throughput advantages of work-stealing stem from
- * decentralized control -- workers mostly take tasks from
- * themselves or each other. We cannot negate this in the
- * implementation of other management responsibilities. The main
- * tactic for avoiding bottlenecks is packing nearly all
- * essentially atomic control state into two volatile variables
- * that are by far most often read (not written) as status and
- * consistency checks.
- *
- * Field "ctl" contains 64 bits holding all the information needed
- * to atomically decide to add, inactivate, enqueue (on an event
- * queue), dequeue, and/or re-activate workers. To enable this
- * packing, we restrict maximum parallelism to (1<<15)-1 (which is
- * far in excess of normal operating range) to allow ids, counts,
- * and their negations (used for thresholding) to fit into 16bit
- * fields.
- *
- * Field "plock" is a form of sequence lock with a saturating
- * shutdown bit (similarly for per-queue "qlocks"), mainly
- * protecting updates to the workQueues array, as well as to
- * enable shutdown. When used as a lock, it is normally only very
- * briefly held, so is nearly always available after at most a
- * brief spin, but we use a monitor-based backup strategy to
- * block when needed.
- *
- * Recording WorkQueues. WorkQueues are recorded in the
- * "workQueues" array that is created upon first use and expanded
- * if necessary. Updates to the array while recording new workers
- * and unrecording terminated ones are protected from each other
- * by a lock but the array is otherwise concurrently readable, and
- * accessed directly. To simplify index-based operations, the
- * array size is always a power of two, and all readers must
- * tolerate null slots. Worker queues are at odd indices. Shared
- * (submission) queues are at even indices, up to a maximum of 64
- * slots, to limit growth even if array needs to expand to add
- * more workers. Grouping them together in this way simplifies and
- * speeds up task scanning.
- *
- * All worker thread creation is on-demand, triggered by task
- * submissions, replacement of terminated workers, and/or
- * compensation for blocked workers. However, all other support
- * code is set up to work with other policies. To ensure that we
- * do not hold on to worker references that would prevent GC, ALL
- * accesses to workQueues are via indices into the workQueues
- * array (which is one source of some of the messy code
- * constructions here). In essence, the workQueues array serves as
- * a weak reference mechanism. Thus for example the wait queue
- * field of ctl stores indices, not references. Access to the
- * workQueues in associated methods (for example signalWork) must
- * both index-check and null-check the IDs. All such accesses
- * ignore bad IDs by returning out early from what they are doing,
- * since this can only be associated with termination, in which
- * case it is OK to give up. All uses of the workQueues array
- * also check that it is non-null (even if previously
- * non-null). This allows nulling during termination, which is
- * currently not necessary, but remains an option for
- * resource-revocation-based shutdown schemes. It also helps
- * reduce JIT issuance of uncommon-trap code, which tends to
- * unnecessarily complicate control flow in some methods.
- *
- * Event Queuing. Unlike HPC work-stealing frameworks, we cannot
- * let workers spin indefinitely scanning for tasks when none can
- * be found immediately, and we cannot start/resume workers unless
- * there appear to be tasks available. On the other hand, we must
- * quickly prod them into action when new tasks are submitted or
- * generated. In many usages, ramp-up time to activate workers is
- * the main limiting factor in overall performance (this is
- * compounded at program start-up by JIT compilation and
- * allocation). So we try to streamline this as much as possible.
- * We park/unpark workers after placing in an event wait queue
- * when they cannot find work. This "queue" is actually a simple
- * Treiber stack, headed by the "id" field of ctl, plus a 15bit
- * counter value (that reflects the number of times a worker has
- * been inactivated) to avoid ABA effects (we need only as many
- * version numbers as worker threads). Successors are held in
- * field WorkQueue.nextWait. Queuing deals with several intrinsic
- * races, mainly that a task-producing thread can miss seeing (and
- * signalling) another thread that gave up looking for work but
- * has not yet entered the wait queue. We solve this by requiring
- * a full sweep of all workers (via repeated calls to method
- * scan()) both before and after a newly waiting worker is added
- * to the wait queue. During a rescan, the worker might release
- * some other queued worker rather than itself, which has the same
- * net effect. Because enqueued workers may actually be rescanning
- * rather than waiting, we set and clear the "parker" field of
- * WorkQueues to reduce unnecessary calls to unpark. (This
- * requires a secondary recheck to avoid missed signals.) Note
- * the unusual conventions about Thread.interrupts surrounding
- * parking and other blocking: Because interrupts are used solely
- * to alert threads to check termination, which is checked anyway
- * upon blocking, we clear status (using Thread.interrupted)
- * before any call to park, so that park does not immediately
- * return due to status being set via some other unrelated call to
- * interrupt in user code.
- *
- * Signalling. We create or wake up workers only when there
- * appears to be at least one task they might be able to find and
- * execute. However, many other threads may notice the same task
- * and each signal to wake up a thread that might take it. So in
- * general, pools will be over-signalled. When a submission is
- * added or another worker adds a task to a queue that has fewer
- * than two tasks, they signal waiting workers (or trigger
- * creation of new ones if fewer than the given parallelism level
- * -- signalWork), and may leave a hint to the unparked worker to
- * help signal others upon wakeup). These primary signals are
- * buttressed by others (see method helpSignal) whenever other
- * threads scan for work or do not have a task to process. On
- * most platforms, signalling (unpark) overhead time is noticeably
- * long, and the time between signalling a thread and it actually
- * making progress can be very noticeably long, so it is worth
- * offloading these delays from critical paths as much as
- * possible.
- *
- * Trimming workers. To release resources after periods of lack of
- * use, a worker starting to wait when the pool is quiescent will
- * time out and terminate if the pool has remained quiescent for a
- * given period -- a short period if there are more threads than
- * parallelism, longer as the number of threads decreases. This
- * will slowly propagate, eventually terminating all workers after
- * periods of non-use.
- *
- * Shutdown and Termination. A call to shutdownNow atomically sets
- * a plock bit and then (non-atomically) sets each worker's
- * qlock status, cancels all unprocessed tasks, and wakes up
- * all waiting workers. Detecting whether termination should
- * commence after a non-abrupt shutdown() call requires more work
- * and bookkeeping. We need consensus about quiescence (i.e., that
- * there is no more work). The active count provides a primary
- * indication but non-abrupt shutdown still requires a rechecking
- * scan for any workers that are inactive but not queued.
- *
- * Joining Tasks
- * =============
- *
- * Any of several actions may be taken when one worker is waiting
- * to join a task stolen (or always held) by another. Because we
- * are multiplexing many tasks on to a pool of workers, we can't
- * just let them block (as in Thread.join). We also cannot just
- * reassign the joiner's run-time stack with another and replace
- * it later, which would be a form of "continuation", that even if
- * possible is not necessarily a good idea since we sometimes need
- * both an unblocked task and its continuation to progress.
- * Instead we combine two tactics:
- *
- * Helping: Arranging for the joiner to execute some task that it
- * would be running if the steal had not occurred.
- *
- * Compensating: Unless there are already enough live threads,
- * method tryCompensate() may create or re-activate a spare
- * thread to compensate for blocked joiners until they unblock.
- *
- * A third form (implemented in tryRemoveAndExec) amounts to
- * helping a hypothetical compensator: If we can readily tell that
- * a possible action of a compensator is to steal and execute the
- * task being joined, the joining thread can do so directly,
- * without the need for a compensation thread (although at the
- * expense of larger run-time stacks, but the tradeoff is
- * typically worthwhile).
- *
- * The ManagedBlocker extension API can't use helping so relies
- * only on compensation in method awaitBlocker.
- *
- * The algorithm in tryHelpStealer entails a form of "linear"
- * helping: Each worker records (in field currentSteal) the most
- * recent task it stole from some other worker. Plus, it records
- * (in field currentJoin) the task it is currently actively
- * joining. Method tryHelpStealer uses these markers to try to
- * find a worker to help (i.e., steal back a task from and execute
- * it) that could hasten completion of the actively joined task.
- * In essence, the joiner executes a task that would be on its own
- * local deque had the to-be-joined task not been stolen. This may
- * be seen as a conservative variant of the approach in Wagner &
- * Calder "Leapfrogging: a portable technique for implementing
- * efficient futures" SIGPLAN Notices, 1993
- * (http://portal.acm.org/citation.cfm?id=155354). It differs in
- * that: (1) We only maintain dependency links across workers upon
- * steals, rather than use per-task bookkeeping. This sometimes
- * requires a linear scan of workQueues array to locate stealers,
- * but often doesn't because stealers leave hints (that may become
- * stale/wrong) of where to locate them. It is only a hint
- * because a worker might have had multiple steals and the hint
- * records only one of them (usually the most current). Hinting
- * isolates cost to when it is needed, rather than adding to
- * per-task overhead. (2) It is "shallow", ignoring nesting and
- * potentially cyclic mutual steals. (3) It is intentionally
- * racy: field currentJoin is updated only while actively joining,
- * which means that we miss links in the chain during long-lived
- * tasks, GC stalls etc (which is OK since blocking in such cases
- * is usually a good idea). (4) We bound the number of attempts
- * to find work (see MAX_HELP) and fall back to suspending the
- * worker and if necessary replacing it with another.
- *
- * Helping actions for CountedCompleters are much simpler: Method
- * helpComplete can take and execute any task with the same root
- * as the task being waited on. However, this still entails some
- * traversal of completer chains, so is less efficient than using
- * CountedCompleters without explicit joins.
- *
- * It is impossible to keep exactly the target parallelism number
- * of threads running at any given time. Determining the
- * existence of conservatively safe helping targets, the
- * availability of already-created spares, and the apparent need
- * to create new spares are all racy, so we rely on multiple
- * retries of each. Compensation in the apparent absence of
- * helping opportunities is challenging to control on JVMs, where
- * GC and other activities can stall progress of tasks that in
- * turn stall out many other dependent tasks, without us being
- * able to determine whether they will ever require compensation.
- * Even though work-stealing otherwise encounters little
- * degradation in the presence of more threads than cores,
- * aggressively adding new threads in such cases entails risk of
- * unwanted positive feedback control loops in which more threads
- * cause more dependent stalls (as well as delayed progress of
- * unblocked threads to the point that we know they are available)
- * leading to more situations requiring more threads, and so
- * on. This aspect of control can be seen as an (analytically
- * intractable) game with an opponent that may choose the worst
- * (for us) active thread to stall at any time. We take several
- * precautions to bound losses (and thus bound gains), mainly in
- * methods tryCompensate and awaitJoin.
- *
- * Common Pool
- * ===========
- *
- * The static common Pool always exists after static
- * initialization. Since it (or any other created pool) need
- * never be used, we minimize initial construction overhead and
- * footprint to the setup of about a dozen fields, with no nested
- * allocation. Most bootstrapping occurs within method
- * fullExternalPush during the first submission to the pool.
- *
- * When external threads submit to the common pool, they can
- * perform some subtask processing (see externalHelpJoin and
- * related methods). We do not need to record whether these
- * submissions are to the common pool -- if not, externalHelpJoin
- * returns quickly (at the most helping to signal some common pool
- * workers). These submitters would otherwise be blocked waiting
- * for completion, so the extra effort (with liberally sprinkled
- * task status checks) in inapplicable cases amounts to an odd
- * form of limited spin-wait before blocking in ForkJoinTask.join.
- *
- * Style notes
- * ===========
- *
- * There is a lot of representation-level coupling among classes
- * ForkJoinPool, ForkJoinWorkerThread, and ForkJoinTask. The
- * fields of WorkQueue maintain data structures managed by
- * ForkJoinPool, so are directly accessed. There is little point
- * trying to reduce this, since any associated future changes in
- * representations will need to be accompanied by algorithmic
- * changes anyway. Several methods intrinsically sprawl because
- * they must accumulate sets of consistent reads of volatiles held
- * in local variables. Methods signalWork() and scan() are the
- * main bottlenecks, so are especially heavily
- * micro-optimized/mangled. There are lots of inline assignments
- * (of form "while ((local = field) != 0)") which are usually the
- * simplest way to ensure the required read orderings (which are
- * sometimes critical). This leads to a "C"-like style of listing
- * declarations of these locals at the heads of methods or blocks.
- * There are several occurrences of the unusual "do {} while
- * (!cas...)" which is the simplest way to force an update of a
- * CAS'ed variable. There are also other coding oddities (including
- * several unnecessary-looking hoisted null checks) that help
- * some methods perform reasonably even when interpreted (not
- * compiled).
- *
- * The order of declarations in this file is:
- * (1) Static utility functions
- * (2) Nested (static) classes
- * (3) Static fields
- * (4) Fields, along with constants used when unpacking some of them
- * (5) Internal control methods
- * (6) Callbacks and other support for ForkJoinTask methods
- * (7) Exported methods
- * (8) Static block initializing statics in minimally dependent order
- */
-
- // Static utilities
-
- /**
- * If there is a security manager, makes sure caller has
- * permission to modify threads.
- */
- private static void checkPermission() {
- SecurityManager security = System.getSecurityManager();
- if (security != null)
- security.checkPermission(modifyThreadPermission);
- }
-
- // Nested classes
-
- /**
- * Factory for creating new {@link ForkJoinWorkerThread}s.
- * A {@code ForkJoinWorkerThreadFactory} must be defined and used
- * for {@code ForkJoinWorkerThread} subclasses that extend base
- * functionality or initialize threads with different contexts.
- */
- public static interface ForkJoinWorkerThreadFactory {
- /**
- * Returns a new worker thread operating in the given pool.
- *
- * @param pool the pool this thread works in
- * @throws NullPointerException if the pool is null
- */
- public ForkJoinWorkerThread newThread(ForkJoinPool pool);
- }
-
- /**
- * Default ForkJoinWorkerThreadFactory implementation; creates a
- * new ForkJoinWorkerThread.
- */
- static final class DefaultForkJoinWorkerThreadFactory
- implements ForkJoinWorkerThreadFactory {
- public final ForkJoinWorkerThread newThread(ForkJoinPool pool) {
- return new ForkJoinWorkerThread(pool);
- }
- }
-
- /**
- * Per-thread records for threads that submit to pools. Currently
- * holds only pseudo-random seed / index that is used to choose
- * submission queues in method externalPush. In the future, this may
- * also incorporate a means to implement different task rejection
- * and resubmission policies.
- *
- * Seeds for submitters and workers/workQueues work in basically
- * the same way but are initialized and updated using slightly
- * different mechanics. Both are initialized using the same
- * approach as in class ThreadLocal, where successive values are
- * unlikely to collide with previous values. Seeds are then
- * randomly modified upon collisions using xorshifts, which
- * requires a non-zero seed.
- */
- static final class Submitter {
- int seed;
- Submitter(int s) { seed = s; }
- }
-
- /**
- * Class for artificial tasks that are used to replace the target
- * of local joins if they are removed from an interior queue slot
- * in WorkQueue.tryRemoveAndExec. We don't need the proxy to
- * actually do anything beyond having a unique identity.
- */
- static final class EmptyTask extends ForkJoinTask<Void> {
- private static final long serialVersionUID = -7721805057305804111L;
- EmptyTask() { status = ForkJoinTask.NORMAL; } // force done
- public final Void getRawResult() { return null; }
- public final void setRawResult(Void x) {}
- public final boolean exec() { return true; }
- }
-
- /**
- * Queues supporting work-stealing as well as external task
- * submission. See above for main rationale and algorithms.
- * Implementation relies heavily on "Unsafe" intrinsics
- * and selective use of "volatile":
- *
- * Field "base" is the index (mod array.length) of the least valid
- * queue slot, which is always the next position to steal (poll)
- * from if nonempty. Reads and writes require volatile orderings
- * but not CAS, because updates are only performed after slot
- * CASes.
- *
- * Field "top" is the index (mod array.length) of the next queue
- * slot to push to or pop from. It is written only by owner thread
- * for push, or under lock for external/shared push, and accessed
- * by other threads only after reading (volatile) base. Both top
- * and base are allowed to wrap around on overflow, but (top -
- * base) (or more commonly -(base - top) to force volatile read of
- * base before top) still estimates size. The lock ("qlock") is
- * forced to -1 on termination, causing all further lock attempts
- * to fail. (Note: we don't need CAS for termination state because
- * upon pool shutdown, all shared-queues will stop being used
- * anyway.) Nearly all lock bodies are set up so that exceptions
- * within lock bodies are "impossible" (modulo JVM errors that
- * would cause failure anyway.)
- *
- * The array slots are read and written using the emulation of
- * volatiles/atomics provided by Unsafe. Insertions must in
- * general use putOrderedObject as a form of releasing store to
- * ensure that all writes to the task object are ordered before
- * its publication in the queue. All removals entail a CAS to
- * null. The array is always a power of two. To ensure safety of
- * Unsafe array operations, all accesses perform explicit null
- * checks and implicit bounds checks via power-of-two masking.
- *
- * In addition to basic queuing support, this class contains
- * fields described elsewhere to control execution. It turns out
- * to work better memory-layout-wise to include them in this class
- * rather than a separate class.
- *
- * Performance on most platforms is very sensitive to placement of
- * instances of both WorkQueues and their arrays -- we absolutely
- * do not want multiple WorkQueue instances or multiple queue
- * arrays sharing cache lines. (It would be best for queue objects
- * and their arrays to share, but there is nothing available to
- * help arrange that). Unfortunately, because they are recorded
- * in a common array, WorkQueue instances are often moved to be
- * adjacent by garbage collectors. To reduce impact, we use field
- * padding that works OK on common platforms; this effectively
- * trades off slightly slower average field access for the sake of
- * avoiding really bad worst-case access. (Until better JVM
- * support is in place, this padding is dependent on transient
- * properties of JVM field layout rules.) We also take care in
- * allocating, sizing and resizing the array. Non-shared queue
- * arrays are initialized by workers before use. Others are
- * allocated on first use.
- */
- static final class WorkQueue {
- /**
- * Capacity of work-stealing queue array upon initialization.
- * Must be a power of two; at least 4, but should be larger to
- * reduce or eliminate cacheline sharing among queues.
- * Currently, it is much larger, as a partial workaround for
- * the fact that JVMs often place arrays in locations that
- * share GC bookkeeping (especially cardmarks) such that
- * per-write accesses encounter serious memory contention.
- */
- static final int INITIAL_QUEUE_CAPACITY = 1 << 13;
-
- /**
- * Maximum size for queue arrays. Must be a power of two less
- * than or equal to 1 << (31 - width of array entry) to ensure
- * lack of wraparound of index calculations, but defined to a
- * value a bit less than this to help users trap runaway
- * programs before saturating systems.
- */
- static final int MAXIMUM_QUEUE_CAPACITY = 1 << 26; // 64M
-
- // Heuristic padding to ameliorate unfortunate memory placements
- volatile long pad00, pad01, pad02, pad03, pad04, pad05, pad06;
-
- int seed; // for random scanning; initialize nonzero
- volatile int eventCount; // encoded inactivation count; < 0 if inactive
- int nextWait; // encoded record of next event waiter
- int hint; // steal or signal hint (index)
- int poolIndex; // index of this queue in pool (or 0)
- final int mode; // 0: lifo, > 0: fifo, < 0: shared
- int nsteals; // number of steals
- volatile int qlock; // 1: locked, -1: terminate; else 0
- volatile int base; // index of next slot for poll
- int top; // index of next slot for push
- ForkJoinTask<?>[] array; // the elements (initially unallocated)
- final ForkJoinPool pool; // the containing pool (may be null)
- final ForkJoinWorkerThread owner; // owning thread or null if shared
- volatile Thread parker; // == owner during call to park; else null
- volatile ForkJoinTask<?> currentJoin; // task being joined in awaitJoin
- ForkJoinTask<?> currentSteal; // current non-local task being executed
-
- volatile Object pad10, pad11, pad12, pad13, pad14, pad15, pad16, pad17;
- volatile Object pad18, pad19, pad1a, pad1b, pad1c, pad1d;
-
- WorkQueue(ForkJoinPool pool, ForkJoinWorkerThread owner, int mode,
- int seed) {
- this.pool = pool;
- this.owner = owner;
- this.mode = mode;
- this.seed = seed;
- // Place indices in the center of array (that is not yet allocated)
- base = top = INITIAL_QUEUE_CAPACITY >>> 1;
- }
-
- /**
- * Returns the approximate number of tasks in the queue.
- */
- final int queueSize() {
- int n = base - top; // non-owner callers must read base first
- return (n >= 0) ? 0 : -n; // ignore transient negative
- }
-
- /**
- * Provides a more accurate estimate of whether this queue has
- * any tasks than does queueSize, by checking whether a
- * near-empty queue has at least one unclaimed task.
- */
- final boolean isEmpty() {
- ForkJoinTask<?>[] a; int m, s;
- int n = base - (s = top);
- return (n >= 0 ||
- (n == -1 &&
- ((a = array) == null ||
- (m = a.length - 1) < 0 ||
- U.getObject
- (a, (long)((m & (s - 1)) << ASHIFT) + ABASE) == null)));
- }
-
- /**
- * Pushes a task. Call only by owner in unshared queues. (The
- * shared-queue version is embedded in method externalPush.)
- *
- * @param task the task. Caller must ensure non-null.
- * @throws RejectedExecutionException if array cannot be resized
- */
- final void push(ForkJoinTask<?> task) {
- ForkJoinTask<?>[] a; ForkJoinPool p;
- int s = top, m, n;
- if ((a = array) != null) { // ignore if queue removed
- int j = (((m = a.length - 1) & s) << ASHIFT) + ABASE;
- U.putOrderedObject(a, j, task);
- if ((n = (top = s + 1) - base) <= 2) {
- if ((p = pool) != null)
- p.signalWork(this);
- }
- else if (n >= m)
- growArray();
- }
- }
-
- /**
- * Initializes or doubles the capacity of array. Call either
- * by owner or with lock held -- it is OK for base, but not
- * top, to move while resizings are in progress.
- */
- final ForkJoinTask<?>[] growArray() {
- ForkJoinTask<?>[] oldA = array;
- int size = oldA != null ? oldA.length << 1 : INITIAL_QUEUE_CAPACITY;
- if (size > MAXIMUM_QUEUE_CAPACITY)
- throw new RejectedExecutionException("Queue capacity exceeded");
- int oldMask, t, b;
- ForkJoinTask<?>[] a = array = new ForkJoinTask<?>[size];
- if (oldA != null && (oldMask = oldA.length - 1) >= 0 &&
- (t = top) - (b = base) > 0) {
- int mask = size - 1;
- do {
- ForkJoinTask<?> x;
- int oldj = ((b & oldMask) << ASHIFT) + ABASE;
- int j = ((b & mask) << ASHIFT) + ABASE;
- x = (ForkJoinTask<?>)U.getObjectVolatile(oldA, oldj);
- if (x != null &&
- U.compareAndSwapObject(oldA, oldj, x, null))
- U.putObjectVolatile(a, j, x);
- } while (++b != t);
- }
- return a;
- }
-
- /**
- * Takes next task, if one exists, in LIFO order. Call only
- * by owner in unshared queues.
- */
- final ForkJoinTask<?> pop() {
- ForkJoinTask<?>[] a; ForkJoinTask<?> t; int m;
- if ((a = array) != null && (m = a.length - 1) >= 0) {
- for (int s; (s = top - 1) - base >= 0;) {
- long j = ((m & s) << ASHIFT) + ABASE;
- if ((t = (ForkJoinTask<?>)U.getObject(a, j)) == null)
- break;
- if (U.compareAndSwapObject(a, j, t, null)) {
- top = s;
- return t;
- }
- }
- }
- return null;
- }
-
- /**
- * Takes a task in FIFO order if b is base of queue and a task
- * can be claimed without contention. Specialized versions
- * appear in ForkJoinPool methods scan and tryHelpStealer.
- */
- final ForkJoinTask<?> pollAt(int b) {
- ForkJoinTask<?> t; ForkJoinTask<?>[] a;
- if ((a = array) != null) {
- int j = (((a.length - 1) & b) << ASHIFT) + ABASE;
- if ((t = (ForkJoinTask<?>)U.getObjectVolatile(a, j)) != null &&
- base == b &&
- U.compareAndSwapObject(a, j, t, null)) {
- base = b + 1;
- return t;
- }
- }
- return null;
- }
-
- /**
- * Takes next task, if one exists, in FIFO order.
- */
- final ForkJoinTask<?> poll() {
- ForkJoinTask<?>[] a; int b; ForkJoinTask<?> t;
- while ((b = base) - top < 0 && (a = array) != null) {
- int j = (((a.length - 1) & b) << ASHIFT) + ABASE;
- t = (ForkJoinTask<?>)U.getObjectVolatile(a, j);
- if (t != null) {
- if (base == b &&
- U.compareAndSwapObject(a, j, t, null)) {
- base = b + 1;
- return t;
- }
- }
- else if (base == b) {
- if (b + 1 == top)
- break;
- Thread.yield(); // wait for lagging update (very rare)
- }
- }
- return null;
- }
-
- /**
- * Takes next task, if one exists, in order specified by mode.
- */
- final ForkJoinTask<?> nextLocalTask() {
- return mode == 0 ? pop() : poll();
- }
-
- /**
- * Returns next task, if one exists, in order specified by mode.
- */
- final ForkJoinTask<?> peek() {
- ForkJoinTask<?>[] a = array; int m;
- if (a == null || (m = a.length - 1) < 0)
- return null;
- int i = mode == 0 ? top - 1 : base;
- int j = ((i & m) << ASHIFT) + ABASE;
- return (ForkJoinTask<?>)U.getObjectVolatile(a, j);
- }
-
- /**
- * Pops the given task only if it is at the current top.
- * (A shared version is available only via FJP.tryExternalUnpush)
- */
- final boolean tryUnpush(ForkJoinTask<?> t) {
- ForkJoinTask<?>[] a; int s;
- if ((a = array) != null && (s = top) != base &&
- U.compareAndSwapObject
- (a, (((a.length - 1) & --s) << ASHIFT) + ABASE, t, null)) {
- top = s;
- return true;
- }
- return false;
- }
-
- /**
- * Removes and cancels all known tasks, ignoring any exceptions.
- */
- final void cancelAll() {
- ForkJoinTask.cancelIgnoringExceptions(currentJoin);
- ForkJoinTask.cancelIgnoringExceptions(currentSteal);
- for (ForkJoinTask<?> t; (t = poll()) != null; )
- ForkJoinTask.cancelIgnoringExceptions(t);
- }
-
- /**
- * Computes next value for random probes. Scans don't require
- * a very high quality generator, but also not a crummy one.
- * Marsaglia xor-shift is cheap and works well enough. Note:
- * This is manually inlined in its usages in ForkJoinPool to
- * avoid writes inside busy scan loops.
- */
- final int nextSeed() {
- int r = seed;
- r ^= r << 13;
- r ^= r >>> 17;
- return seed = r ^= r << 5;
- }
-
- // Specialized execution methods
-
- /**
- * Pops and runs tasks until empty.
- */
- private void popAndExecAll() {
- // A bit faster than repeated pop calls
- ForkJoinTask<?>[] a; int m, s; long j; ForkJoinTask<?> t;
- while ((a = array) != null && (m = a.length - 1) >= 0 &&
- (s = top - 1) - base >= 0 &&
- (t = ((ForkJoinTask<?>)
- U.getObject(a, j = ((m & s) << ASHIFT) + ABASE)))
- != null) {
- if (U.compareAndSwapObject(a, j, t, null)) {
- top = s;
- t.doExec();
- }
- }
- }
-
- /**
- * Polls and runs tasks until empty.
- */
- private void pollAndExecAll() {
- for (ForkJoinTask<?> t; (t = poll()) != null;)
- t.doExec();
- }
-
- /**
- * If present, removes from queue and executes the given task,
- * or any other cancelled task. Returns (true) on any CAS
- * or consistency check failure so caller can retry.
- *
- * @return false if no progress can be made, else true
- */
- final boolean tryRemoveAndExec(ForkJoinTask<?> task) {
- boolean stat = true, removed = false, empty = true;
- ForkJoinTask<?>[] a; int m, s, b, n;
- if ((a = array) != null && (m = a.length - 1) >= 0 &&
- (n = (s = top) - (b = base)) > 0) {
- for (ForkJoinTask<?> t;;) { // traverse from s to b
- int j = ((--s & m) << ASHIFT) + ABASE;
- t = (ForkJoinTask<?>)U.getObjectVolatile(a, j);
- if (t == null) // inconsistent length
- break;
- else if (t == task) {
- if (s + 1 == top) { // pop
- if (!U.compareAndSwapObject(a, j, task, null))
- break;
- top = s;
- removed = true;
- }
- else if (base == b) // replace with proxy
- removed = U.compareAndSwapObject(a, j, task,
- new EmptyTask());
- break;
- }
- else if (t.status >= 0)
- empty = false;
- else if (s + 1 == top) { // pop and throw away
- if (U.compareAndSwapObject(a, j, t, null))
- top = s;
- break;
- }
- if (--n == 0) {
- if (!empty && base == b)
- stat = false;
- break;
- }
- }
- }
- if (removed)
- task.doExec();
- return stat;
- }
-
- /**
- * Polls for and executes the given task or any other task in
- * its CountedCompleter computation.
- */
- final boolean pollAndExecCC(ForkJoinTask<?> root) {
- ForkJoinTask<?>[] a; int b; Object o;
- outer: while ((b = base) - top < 0 && (a = array) != null) {
- long j = (((a.length - 1) & b) << ASHIFT) + ABASE;
- if ((o = U.getObject(a, j)) == null ||
- !(o instanceof CountedCompleter))
- break;
- for (CountedCompleter<?> t = (CountedCompleter<?>)o, r = t;;) {
- if (r == root) {
- if (base == b &&
- U.compareAndSwapObject(a, j, t, null)) {
- base = b + 1;
- t.doExec();
- return true;
- }
- else
- break; // restart
- }
- if ((r = r.completer) == null)
- break outer; // not part of root computation
- }
- }
- return false;
- }
-
- /**
- * Executes a top-level task and any local tasks remaining
- * after execution.
- */
- final void runTask(ForkJoinTask<?> t) {
- if (t != null) {
- (currentSteal = t).doExec();
- currentSteal = null;
- ++nsteals;
- if (base - top < 0) { // process remaining local tasks
- if (mode == 0)
- popAndExecAll();
- else
- pollAndExecAll();
- }
- }
- }
-
- /**
- * Executes a non-top-level (stolen) task.
- */
- final void runSubtask(ForkJoinTask<?> t) {
- if (t != null) {
- ForkJoinTask<?> ps = currentSteal;
- (currentSteal = t).doExec();
- currentSteal = ps;
- }
- }
-
- /**
- * Returns true if owned and not known to be blocked.
- */
- final boolean isApparentlyUnblocked() {
- Thread wt; Thread.State s;
- return (eventCount >= 0 &&
- (wt = owner) != null &&
- (s = wt.getState()) != Thread.State.BLOCKED &&
- s != Thread.State.WAITING &&
- s != Thread.State.TIMED_WAITING);
- }
-
- // Unsafe mechanics
- private static final sun.misc.Unsafe U;
- private static final long QLOCK;
- private static final int ABASE;
- private static final int ASHIFT;
- static {
- try {
- U = getUnsafe();
- Class<?> k = WorkQueue.class;
- Class<?> ak = ForkJoinTask[].class;
- QLOCK = U.objectFieldOffset
- (k.getDeclaredField("qlock"));
- ABASE = U.arrayBaseOffset(ak);
- int scale = U.arrayIndexScale(ak);
- if ((scale & (scale - 1)) != 0)
- throw new Error("data type scale not a power of two");
- ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
- } catch (Exception e) {
- throw new Error(e);
- }
- }
- }
-
- // static fields (initialized in static initializer below)
-
- /**
- * Creates a new ForkJoinWorkerThread. This factory is used unless
- * overridden in ForkJoinPool constructors.
- */
- public static final ForkJoinWorkerThreadFactory
- defaultForkJoinWorkerThreadFactory;
-
- /**
- * Per-thread submission bookkeeping. Shared across all pools
- * to reduce ThreadLocal pollution and because random motion
- * to avoid contention in one pool is likely to hold for others.
- * Lazily initialized on first submission (but null-checked
- * in other contexts to avoid unnecessary initialization).
- */
- static final ThreadLocal<Submitter> submitters;
-
- /**
- * Permission required for callers of methods that may start or
- * kill threads.
- */
- private static final RuntimePermission modifyThreadPermission;
-
- /**
- * Common (static) pool. Non-null for public use unless a static
- * construction exception, but internal usages null-check on use
- * to paranoically avoid potential initialization circularities
- * as well as to simplify generated code.
- */
- static final ForkJoinPool common;
-
- /**
- * Common pool parallelism. Must equal common.parallelism.
- */
- static final int commonParallelism;
-
- /**
- * Sequence number for creating workerNamePrefix.
- */
- private static int poolNumberSequence;
-
- /**
- * Returns the next sequence number. We don't expect this to
- * ever contend, so use simple builtin sync.
- */
- private static final synchronized int nextPoolId() {
- return ++poolNumberSequence;
- }
-
- // static constants
-
- /**
- * Initial timeout value (in nanoseconds) for the thread
- * triggering quiescence to park waiting for new work. On timeout,
- * the thread will instead try to shrink the number of
- * workers. The value should be large enough to avoid overly
- * aggressive shrinkage during most transient stalls (long GCs
- * etc).
- */
- private static final long IDLE_TIMEOUT = 2000L * 1000L * 1000L; // 2sec
-
- /**
- * Timeout value when there are more threads than parallelism level
- */
- private static final long FAST_IDLE_TIMEOUT = 200L * 1000L * 1000L;
-
- /**
- * Tolerance for idle timeouts, to cope with timer undershoots
- */
- private static final long TIMEOUT_SLOP = 2000000L;
-
- /**
- * The maximum stolen->joining link depth allowed in method
- * tryHelpStealer. Must be a power of two. Depths for legitimate
- * chains are unbounded, but we use a fixed constant to avoid
- * (otherwise unchecked) cycles and to bound staleness of
- * traversal parameters at the expense of sometimes blocking when
- * we could be helping.
- */
- private static final int MAX_HELP = 64;
-
- /**
- * Increment for seed generators. See class ThreadLocal for
- * explanation.
- */
- private static final int SEED_INCREMENT = 0x61c88647;
-
- /*
- * Bits and masks for control variables
- *
- * Field ctl is a long packed with:
- * AC: Number of active running workers minus target parallelism (16 bits)
- * TC: Number of total workers minus target parallelism (16 bits)
- * ST: true if pool is terminating (1 bit)
- * EC: the wait count of top waiting thread (15 bits)
- * ID: poolIndex of top of Treiber stack of waiters (16 bits)
- *
- * When convenient, we can extract the upper 32 bits of counts and
- * the lower 32 bits of queue state, u = (int)(ctl >>> 32) and e =
- * (int)ctl. The ec field is never accessed alone, but always
- * together with id and st. The offsets of counts by the target
- * parallelism and the positionings of fields makes it possible to
- * perform the most common checks via sign tests of fields: When
- * ac is negative, there are not enough active workers, when tc is
- * negative, there are not enough total workers, and when e is
- * negative, the pool is terminating. To deal with these possibly
- * negative fields, we use casts in and out of "short" and/or
- * signed shifts to maintain signedness.
- *
- * When a thread is queued (inactivated), its eventCount field is
- * set negative, which is the only way to tell if a worker is
- * prevented from executing tasks, even though it must continue to
- * scan for them to avoid queuing races. Note however that
- * eventCount updates lag releases so usage requires care.
- *
- * Field plock is an int packed with:
- * SHUTDOWN: true if shutdown is enabled (1 bit)
- * SEQ: a sequence lock, with PL_LOCK bit set if locked (30 bits)
- * SIGNAL: set when threads may be waiting on the lock (1 bit)
- *
- * The sequence number enables simple consistency checks:
- * Staleness of read-only operations on the workQueues array can
- * be checked by comparing plock before vs after the reads.
- */
-
- // bit positions/shifts for fields
- private static final int AC_SHIFT = 48;
- private static final int TC_SHIFT = 32;
- private static final int ST_SHIFT = 31;
- private static final int EC_SHIFT = 16;
-
- // bounds
- private static final int SMASK = 0xffff; // short bits
- private static final int MAX_CAP = 0x7fff; // max #workers - 1
- private static final int EVENMASK = 0xfffe; // even short bits
- private static final int SQMASK = 0x007e; // max 64 (even) slots
- private static final int SHORT_SIGN = 1 << 15;
- private static final int INT_SIGN = 1 << 31;
-
- // masks
- private static final long STOP_BIT = 0x0001L << ST_SHIFT;
- private static final long AC_MASK = ((long)SMASK) << AC_SHIFT;
- private static final long TC_MASK = ((long)SMASK) << TC_SHIFT;
-
- // units for incrementing and decrementing
- private static final long TC_UNIT = 1L << TC_SHIFT;
- private static final long AC_UNIT = 1L << AC_SHIFT;
-
- // masks and units for dealing with u = (int)(ctl >>> 32)
- private static final int UAC_SHIFT = AC_SHIFT - 32;
- private static final int UTC_SHIFT = TC_SHIFT - 32;
- private static final int UAC_MASK = SMASK << UAC_SHIFT;
- private static final int UTC_MASK = SMASK << UTC_SHIFT;
- private static final int UAC_UNIT = 1 << UAC_SHIFT;
- private static final int UTC_UNIT = 1 << UTC_SHIFT;
-
- // masks and units for dealing with e = (int)ctl
- private static final int E_MASK = 0x7fffffff; // no STOP_BIT
- private static final int E_SEQ = 1 << EC_SHIFT;
-
- // plock bits
- private static final int SHUTDOWN = 1 << 31;
- private static final int PL_LOCK = 2;
- private static final int PL_SIGNAL = 1;
- private static final int PL_SPINS = 1 << 8;
-
- // access mode for WorkQueue
- static final int LIFO_QUEUE = 0;
- static final int FIFO_QUEUE = 1;
- static final int SHARED_QUEUE = -1;
-
- // bounds for #steps in scan loop -- must be power 2 minus 1
- private static final int MIN_SCAN = 0x1ff; // cover estimation slop
- private static final int MAX_SCAN = 0x1ffff; // 4 * max workers
-
- // Instance fields
-
- /*
- * Field layout of this class tends to matter more than one would
- * like. Runtime layout order is only loosely related to
- * declaration order and may differ across JVMs, but the following
- * empirically works OK on current JVMs.
- */
-
- // Heuristic padding to ameliorate unfortunate memory placements
- volatile long pad00, pad01, pad02, pad03, pad04, pad05, pad06;
-
- volatile long stealCount; // collects worker counts
- volatile long ctl; // main pool control
- volatile int plock; // shutdown status and seqLock
- volatile int indexSeed; // worker/submitter index seed
- final int config; // mode and parallelism level
- WorkQueue[] workQueues; // main registry
- final ForkJoinWorkerThreadFactory factory;
- final Thread.UncaughtExceptionHandler ueh; // per-worker UEH
- final String workerNamePrefix; // to create worker name string
-
- volatile Object pad10, pad11, pad12, pad13, pad14, pad15, pad16, pad17;
- volatile Object pad18, pad19, pad1a, pad1b;
-
- /**
- * Acquires the plock lock to protect worker array and related
- * updates. This method is called only if an initial CAS on plock
- * fails. This acts as a spinlock for normal cases, but falls back
- * to builtin monitor to block when (rarely) needed. This would be
- * a terrible idea for a highly contended lock, but works fine as
- * a more conservative alternative to a pure spinlock.
- */
- private int acquirePlock() {
- int spins = PL_SPINS, r = 0, ps, nps;
- for (;;) {
- if (((ps = plock) & PL_LOCK) == 0 &&
- U.compareAndSwapInt(this, PLOCK, ps, nps = ps + PL_LOCK))
- return nps;
- else if (r == 0) { // randomize spins if possible
- Thread t = Thread.currentThread(); WorkQueue w; Submitter z;
- if ((t instanceof ForkJoinWorkerThread) &&
- (w = ((ForkJoinWorkerThread)t).workQueue) != null)
- r = w.seed;
- else if ((z = submitters.get()) != null)
- r = z.seed;
- else
- r = 1;
- }
- else if (spins >= 0) {
- r ^= r << 1; r ^= r >>> 3; r ^= r << 10; // xorshift
- if (r >= 0)
- --spins;
- }
- else if (U.compareAndSwapInt(this, PLOCK, ps, ps | PL_SIGNAL)) {
- synchronized (this) {
- if ((plock & PL_SIGNAL) != 0) {
- try {
- wait();
- } catch (InterruptedException ie) {
- try {
- Thread.currentThread().interrupt();
- } catch (SecurityException ignore) {
- }
- }
- }
- else
- notifyAll();
- }
- }
- }
- }
-
- /**
- * Unlocks and signals any thread waiting for plock. Called only
- * when CAS of seq value for unlock fails.
- */
- private void releasePlock(int ps) {
- plock = ps;
- synchronized (this) { notifyAll(); }
- }
-
- /**
- * Tries to create and start one worker if fewer than target
- * parallelism level exist. Adjusts counts etc on failure.
- */
- private void tryAddWorker() {
- long c; int u;
- while ((u = (int)((c = ctl) >>> 32)) < 0 &&
- (u & SHORT_SIGN) != 0 && (int)c == 0) {
- long nc = (long)(((u + UTC_UNIT) & UTC_MASK) |
- ((u + UAC_UNIT) & UAC_MASK)) << 32;
- if (U.compareAndSwapLong(this, CTL, c, nc)) {
- ForkJoinWorkerThreadFactory fac;
- Throwable ex = null;
- ForkJoinWorkerThread wt = null;
- try {
- if ((fac = factory) != null &&
- (wt = fac.newThread(this)) != null) {
- wt.start();
- break;
- }
- } catch (Throwable e) {
- ex = e;
- }
- deregisterWorker(wt, ex);
- break;
- }
- }
- }
-
- // Registering and deregistering workers
-
- /**
- * Callback from ForkJoinWorkerThread to establish and record its
- * WorkQueue. To avoid scanning bias due to packing entries in
- * front of the workQueues array, we treat the array as a simple
- * power-of-two hash table using per-thread seed as hash,
- * expanding as needed.
- *
- * @param wt the worker thread
- * @return the worker's queue
- */
- final WorkQueue registerWorker(ForkJoinWorkerThread wt) {
- Thread.UncaughtExceptionHandler handler; WorkQueue[] ws; int s, ps;
- wt.setDaemon(true);
- if ((handler = ueh) != null)
- wt.setUncaughtExceptionHandler(handler);
- do {} while (!U.compareAndSwapInt(this, INDEXSEED, s = indexSeed,
- s += SEED_INCREMENT) ||
- s == 0); // skip 0
- WorkQueue w = new WorkQueue(this, wt, config >>> 16, s);
- if (((ps = plock) & PL_LOCK) != 0 ||
- !U.compareAndSwapInt(this, PLOCK, ps, ps += PL_LOCK))
- ps = acquirePlock();
- int nps = (ps & SHUTDOWN) | ((ps + PL_LOCK) & ~SHUTDOWN);
- try {
- if ((ws = workQueues) != null) { // skip if shutting down
- int n = ws.length, m = n - 1;
- int r = (s << 1) | 1; // use odd-numbered indices
- if (ws[r &= m] != null) { // collision
- int probes = 0; // step by approx half size
- int step = (n <= 4) ? 2 : ((n >>> 1) & EVENMASK) + 2;
- while (ws[r = (r + step) & m] != null) {
- if (++probes >= n) {
- workQueues = ws = Arrays.copyOf(ws, n <<= 1);
- m = n - 1;
- probes = 0;
- }
- }
- }
- w.eventCount = w.poolIndex = r; // volatile write orders
- ws[r] = w;
- }
- } finally {
- if (!U.compareAndSwapInt(this, PLOCK, ps, nps))
- releasePlock(nps);
- }
- wt.setName(workerNamePrefix.concat(Integer.toString(w.poolIndex)));
- return w;
- }
-
- /**
- * Final callback from terminating worker, as well as upon failure
- * to construct or start a worker. Removes record of worker from
- * array, and adjusts counts. If pool is shutting down, tries to
- * complete termination.
- *
- * @param wt the worker thread or null if construction failed
- * @param ex the exception causing failure, or null if none
- */
- final void deregisterWorker(ForkJoinWorkerThread wt, Throwable ex) {
- WorkQueue w = null;
- if (wt != null && (w = wt.workQueue) != null) {
- int ps;
- w.qlock = -1; // ensure set
- long ns = w.nsteals, sc; // collect steal count
- do {} while (!U.compareAndSwapLong(this, STEALCOUNT,
- sc = stealCount, sc + ns));
- if (((ps = plock) & PL_LOCK) != 0 ||
- !U.compareAndSwapInt(this, PLOCK, ps, ps += PL_LOCK))
- ps = acquirePlock();
- int nps = (ps & SHUTDOWN) | ((ps + PL_LOCK) & ~SHUTDOWN);
- try {
- int idx = w.poolIndex;
- WorkQueue[] ws = workQueues;
- if (ws != null && idx >= 0 && idx < ws.length && ws[idx] == w)
- ws[idx] = null;
- } finally {
- if (!U.compareAndSwapInt(this, PLOCK, ps, nps))
- releasePlock(nps);
- }
- }
-
- long c; // adjust ctl counts
- do {} while (!U.compareAndSwapLong
- (this, CTL, c = ctl, (((c - AC_UNIT) & AC_MASK) |
- ((c - TC_UNIT) & TC_MASK) |
- (c & ~(AC_MASK|TC_MASK)))));
-
- if (!tryTerminate(false, false) && w != null && w.array != null) {
- w.cancelAll(); // cancel remaining tasks
- WorkQueue[] ws; WorkQueue v; Thread p; int u, i, e;
- while ((u = (int)((c = ctl) >>> 32)) < 0 && (e = (int)c) >= 0) {
- if (e > 0) { // activate or create replacement
- if ((ws = workQueues) == null ||
- (i = e & SMASK) >= ws.length ||
- (v = ws[i]) == null)
- break;
- long nc = (((long)(v.nextWait & E_MASK)) |
- ((long)(u + UAC_UNIT) << 32));
- if (v.eventCount != (e | INT_SIGN))
- break;
- if (U.compareAndSwapLong(this, CTL, c, nc)) {
- v.eventCount = (e + E_SEQ) & E_MASK;
- if ((p = v.parker) != null)
- U.unpark(p);
- break;
- }
- }
- else {
- if ((short)u < 0)
- tryAddWorker();
- break;
- }
- }
- }
- if (ex == null) // help clean refs on way out
- ForkJoinTask.helpExpungeStaleExceptions();
- else // rethrow
- ForkJoinTask.rethrow(ex);
- }
-
- // Submissions
-
- /**
- * Unless shutting down, adds the given task to a submission queue
- * at submitter's current queue index (modulo submission
- * range). Only the most common path is directly handled in this
- * method. All others are relayed to fullExternalPush.
- *
- * @param task the task. Caller must ensure non-null.
- */
- final void externalPush(ForkJoinTask<?> task) {
- WorkQueue[] ws; WorkQueue q; Submitter z; int m; ForkJoinTask<?>[] a;
- if ((z = submitters.get()) != null && plock > 0 &&
- (ws = workQueues) != null && (m = (ws.length - 1)) >= 0 &&
- (q = ws[m & z.seed & SQMASK]) != null &&
- U.compareAndSwapInt(q, QLOCK, 0, 1)) { // lock
- int b = q.base, s = q.top, n, an;
- if ((a = q.array) != null && (an = a.length) > (n = s + 1 - b)) {
- int j = (((an - 1) & s) << ASHIFT) + ABASE;
- U.putOrderedObject(a, j, task);
- q.top = s + 1; // push on to deque
- q.qlock = 0;
- if (n <= 2)
- signalWork(q);
- return;
- }
- q.qlock = 0;
- }
- fullExternalPush(task);
- }
-
- /**
- * Full version of externalPush. This method is called, among
- * other times, upon the first submission of the first task to the
- * pool, so must perform secondary initialization. It also
- * detects first submission by an external thread by looking up
- * its ThreadLocal, and creates a new shared queue if the one at
- * index if empty or contended. The plock lock body must be
- * exception-free (so no try/finally) so we optimistically
- * allocate new queues outside the lock and throw them away if
- * (very rarely) not needed.
- *
- * Secondary initialization occurs when plock is zero, to create
- * workQueue array and set plock to a valid value. This lock body
- * must also be exception-free. Because the plock seq value can
- * eventually wrap around zero, this method harmlessly fails to
- * reinitialize if workQueues exists, while still advancing plock.
- */
- private void fullExternalPush(ForkJoinTask<?> task) {
- int r = 0; // random index seed
- for (Submitter z = submitters.get();;) {
- WorkQueue[] ws; WorkQueue q; int ps, m, k;
- if (z == null) {
- if (U.compareAndSwapInt(this, INDEXSEED, r = indexSeed,
- r += SEED_INCREMENT) && r != 0)
- submitters.set(z = new Submitter(r));
- }
- else if (r == 0) { // move to a different index
- r = z.seed;
- r ^= r << 13; // same xorshift as WorkQueues
- r ^= r >>> 17;
- z.seed = r ^ (r << 5);
- }
- else if ((ps = plock) < 0)
- throw new RejectedExecutionException();
- else if (ps == 0 || (ws = workQueues) == null ||
- (m = ws.length - 1) < 0) { // initialize workQueues
- int p = config & SMASK; // find power of two table size
- int n = (p > 1) ? p - 1 : 1; // ensure at least 2 slots
- n |= n >>> 1; n |= n >>> 2; n |= n >>> 4;
- n |= n >>> 8; n |= n >>> 16; n = (n + 1) << 1;
- WorkQueue[] nws = ((ws = workQueues) == null || ws.length == 0 ?
- new WorkQueue[n] : null);
- if (((ps = plock) & PL_LOCK) != 0 ||
- !U.compareAndSwapInt(this, PLOCK, ps, ps += PL_LOCK))
- ps = acquirePlock();
- if (((ws = workQueues) == null || ws.length == 0) && nws != null)
- workQueues = nws;
- int nps = (ps & SHUTDOWN) | ((ps + PL_LOCK) & ~SHUTDOWN);
- if (!U.compareAndSwapInt(this, PLOCK, ps, nps))
- releasePlock(nps);
- }
- else if ((q = ws[k = r & m & SQMASK]) != null) {
- if (q.qlock == 0 && U.compareAndSwapInt(q, QLOCK, 0, 1)) {
- ForkJoinTask<?>[] a = q.array;
- int s = q.top;
- boolean submitted = false;
- try { // locked version of push
- if ((a != null && a.length > s + 1 - q.base) ||
- (a = q.growArray()) != null) { // must presize
- int j = (((a.length - 1) & s) << ASHIFT) + ABASE;
- U.putOrderedObject(a, j, task);
- q.top = s + 1;
- submitted = true;
- }
- } finally {
- q.qlock = 0; // unlock
- }
- if (submitted) {
- signalWork(q);
- return;
- }
- }
- r = 0; // move on failure
- }
- else if (((ps = plock) & PL_LOCK) == 0) { // create new queue
- q = new WorkQueue(this, null, SHARED_QUEUE, r);
- if (((ps = plock) & PL_LOCK) != 0 ||
- !U.compareAndSwapInt(this, PLOCK, ps, ps += PL_LOCK))
- ps = acquirePlock();
- if ((ws = workQueues) != null && k < ws.length && ws[k] == null)
- ws[k] = q;
- int nps = (ps & SHUTDOWN) | ((ps + PL_LOCK) & ~SHUTDOWN);
- if (!U.compareAndSwapInt(this, PLOCK, ps, nps))
- releasePlock(nps);
- }
- else
- r = 0; // try elsewhere while lock held
- }
- }
-
- // Maintaining ctl counts
-
- /**
- * Increments active count; mainly called upon return from blocking.
- */
- final void incrementActiveCount() {
- long c;
- do {} while (!U.compareAndSwapLong(this, CTL, c = ctl, c + AC_UNIT));
- }
-
- /**
- * Tries to create or activate a worker if too few are active.
- *
- * @param q the (non-null) queue holding tasks to be signalled
- */
- final void signalWork(WorkQueue q) {
- int hint = q.poolIndex;
- long c; int e, u, i, n; WorkQueue[] ws; WorkQueue w; Thread p;
- while ((u = (int)((c = ctl) >>> 32)) < 0) {
- if ((e = (int)c) > 0) {
- if ((ws = workQueues) != null && ws.length > (i = e & SMASK) &&
- (w = ws[i]) != null && w.eventCount == (e | INT_SIGN)) {
- long nc = (((long)(w.nextWait & E_MASK)) |
- ((long)(u + UAC_UNIT) << 32));
- if (U.compareAndSwapLong(this, CTL, c, nc)) {
- w.hint = hint;
- w.eventCount = (e + E_SEQ) & E_MASK;
- if ((p = w.parker) != null)
- U.unpark(p);
- break;
- }
- if (q.top - q.base <= 0)
- break;
- }
- else
- break;
- }
- else {
- if ((short)u < 0)
- tryAddWorker();
- break;
- }
- }
- }
-
- // Scanning for tasks
-
- /**
- * Top-level runloop for workers, called by ForkJoinWorkerThread.run.
- */
- final void runWorker(WorkQueue w) {
- w.growArray(); // allocate queue
- do { w.runTask(scan(w)); } while (w.qlock >= 0);
- }
-
- /**
- * Scans for and, if found, returns one task, else possibly
- * inactivates the worker. This method operates on single reads of
- * volatile state and is designed to be re-invoked continuously,
- * in part because it returns upon detecting inconsistencies,
- * contention, or state changes that indicate possible success on
- * re-invocation.
- *
- * The scan searches for tasks across queues (starting at a random
- * index, and relying on registerWorker to irregularly scatter
- * them within array to avoid bias), checking each at least twice.
- * The scan terminates upon either finding a non-empty queue, or
- * completing the sweep. If the worker is not inactivated, it
- * takes and returns a task from this queue. Otherwise, if not
- * activated, it signals workers (that may include itself) and
- * returns so caller can retry. Also returns for true if the
- * worker array may have changed during an empty scan. On failure
- * to find a task, we take one of the following actions, after
- * which the caller will retry calling this method unless
- * terminated.
- *
- * * If pool is terminating, terminate the worker.
- *
- * * If not already enqueued, try to inactivate and enqueue the
- * worker on wait queue. Or, if inactivating has caused the pool
- * to be quiescent, relay to idleAwaitWork to possibly shrink
- * pool.
- *
- * * If already enqueued and none of the above apply, possibly
- * park awaiting signal, else lingering to help scan and signal.
- *
- * * If a non-empty queue discovered or left as a hint,
- * help wake up other workers before return.
- *
- * @param w the worker (via its WorkQueue)
- * @return a task or null if none found
- */
- private final ForkJoinTask<?> scan(WorkQueue w) {
- WorkQueue[] ws; int m;
- int ps = plock; // read plock before ws
- if (w != null && (ws = workQueues) != null && (m = ws.length - 1) >= 0) {
- int ec = w.eventCount; // ec is negative if inactive
- int r = w.seed; r ^= r << 13; r ^= r >>> 17; w.seed = r ^= r << 5;
- w.hint = -1; // update seed and clear hint
- int j = ((m + m + 1) | MIN_SCAN) & MAX_SCAN;
- do {
- WorkQueue q; ForkJoinTask<?>[] a; int b;
- if ((q = ws[(r + j) & m]) != null && (b = q.base) - q.top < 0 &&
- (a = q.array) != null) { // probably nonempty
- int i = (((a.length - 1) & b) << ASHIFT) + ABASE;
- ForkJoinTask<?> t = (ForkJoinTask<?>)
- U.getObjectVolatile(a, i);
- if (q.base == b && ec >= 0 && t != null &&
- U.compareAndSwapObject(a, i, t, null)) {
- if ((q.base = b + 1) - q.top < 0)
- signalWork(q);
- return t; // taken
- }
- else if ((ec < 0 || j < m) && (int)(ctl >> AC_SHIFT) <= 0) {
- w.hint = (r + j) & m; // help signal below
- break; // cannot take
- }
- }
- } while (--j >= 0);
-
- int h, e, ns; long c, sc; WorkQueue q;
- if ((ns = w.nsteals) != 0) {
- if (U.compareAndSwapLong(this, STEALCOUNT,
- sc = stealCount, sc + ns))
- w.nsteals = 0; // collect steals and rescan
- }
- else if (plock != ps) // consistency check
- ; // skip
- else if ((e = (int)(c = ctl)) < 0)
- w.qlock = -1; // pool is terminating
- else {
- if ((h = w.hint) < 0) {
- if (ec >= 0) { // try to enqueue/inactivate
- long nc = (((long)ec |
- ((c - AC_UNIT) & (AC_MASK|TC_MASK))));
- w.nextWait = e; // link and mark inactive
- w.eventCount = ec | INT_SIGN;
- if (ctl != c || !U.compareAndSwapLong(this, CTL, c, nc))
- w.eventCount = ec; // unmark on CAS failure
- else if ((int)(c >> AC_SHIFT) == 1 - (config & SMASK))
- idleAwaitWork(w, nc, c);
- }
- else if (w.eventCount < 0 && ctl == c) {
- Thread wt = Thread.currentThread();
- Thread.interrupted(); // clear status
- U.putObject(wt, PARKBLOCKER, this);
- w.parker = wt; // emulate LockSupport.park
- if (w.eventCount < 0) // recheck
- U.park(false, 0L); // block
- w.parker = null;
- U.putObject(wt, PARKBLOCKER, null);
- }
- }
- if ((h >= 0 || (h = w.hint) >= 0) &&
- (ws = workQueues) != null && h < ws.length &&
- (q = ws[h]) != null) { // signal others before retry
- WorkQueue v; Thread p; int u, i, s;
- for (int n = (config & SMASK) - 1;;) {
- int idleCount = (w.eventCount < 0) ? 0 : -1;
- if (((s = idleCount - q.base + q.top) <= n &&
- (n = s) <= 0) ||
- (u = (int)((c = ctl) >>> 32)) >= 0 ||
- (e = (int)c) <= 0 || m < (i = e & SMASK) ||
- (v = ws[i]) == null)
- break;
- long nc = (((long)(v.nextWait & E_MASK)) |
- ((long)(u + UAC_UNIT) << 32));
- if (v.eventCount != (e | INT_SIGN) ||
- !U.compareAndSwapLong(this, CTL, c, nc))
- break;
- v.hint = h;
- v.eventCount = (e + E_SEQ) & E_MASK;
- if ((p = v.parker) != null)
- U.unpark(p);
- if (--n <= 0)
- break;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * If inactivating worker w has caused the pool to become
- * quiescent, checks for pool termination, and, so long as this is
- * not the only worker, waits for event for up to a given
- * duration. On timeout, if ctl has not changed, terminates the
- * worker, which will in turn wake up another worker to possibly
- * repeat this process.
- *
- * @param w the calling worker
- * @param currentCtl the ctl value triggering possible quiescence
- * @param prevCtl the ctl value to restore if thread is terminated
- */
- private void idleAwaitWork(WorkQueue w, long currentCtl, long prevCtl) {
- if (w != null && w.eventCount < 0 &&
- !tryTerminate(false, false) && (int)prevCtl != 0 &&
- ctl == currentCtl) {
- int dc = -(short)(currentCtl >>> TC_SHIFT);
- long parkTime = dc < 0 ? FAST_IDLE_TIMEOUT: (dc + 1) * IDLE_TIMEOUT;
- long deadline = System.nanoTime() + parkTime - TIMEOUT_SLOP;
- Thread wt = Thread.currentThread();
- while (ctl == currentCtl) {
- Thread.interrupted(); // timed variant of version in scan()
- U.putObject(wt, PARKBLOCKER, this);
- w.parker = wt;
- if (ctl == currentCtl)
- U.park(false, parkTime);
- w.parker = null;
- U.putObject(wt, PARKBLOCKER, null);
- if (ctl != currentCtl)
- break;
- if (deadline - System.nanoTime() <= 0L &&
- U.compareAndSwapLong(this, CTL, currentCtl, prevCtl)) {
- w.eventCount = (w.eventCount + E_SEQ) | E_MASK;
- w.hint = -1;
- w.qlock = -1; // shrink
- break;
- }
- }
- }
- }
-
- /**
- * Scans through queues looking for work while joining a task; if
- * any present, signals. May return early if more signalling is
- * detectably unneeded.
- *
- * @param task return early if done
- * @param origin an index to start scan
- */
- private void helpSignal(ForkJoinTask<?> task, int origin) {
- WorkQueue[] ws; WorkQueue w; Thread p; long c; int m, u, e, i, s;
- if (task != null && task.status >= 0 &&
- (u = (int)(ctl >>> 32)) < 0 && (u >> UAC_SHIFT) < 0 &&
- (ws = workQueues) != null && (m = ws.length - 1) >= 0) {
- outer: for (int k = origin, j = m; j >= 0; --j) {
- WorkQueue q = ws[k++ & m];
- for (int n = m;;) { // limit to at most m signals
- if (task.status < 0)
- break outer;
- if (q == null ||
- ((s = -q.base + q.top) <= n && (n = s) <= 0))
- break;
- if ((u = (int)((c = ctl) >>> 32)) >= 0 ||
- (e = (int)c) <= 0 || m < (i = e & SMASK) ||
- (w = ws[i]) == null)
- break outer;
- long nc = (((long)(w.nextWait & E_MASK)) |
- ((long)(u + UAC_UNIT) << 32));
- if (w.eventCount != (e | INT_SIGN))
- break outer;
- if (U.compareAndSwapLong(this, CTL, c, nc)) {
- w.eventCount = (e + E_SEQ) & E_MASK;
- if ((p = w.parker) != null)
- U.unpark(p);
- if (--n <= 0)
- break;
- }
- }
- }
- }
- }
-
- /**
- * Tries to locate and execute tasks for a stealer of the given
- * task, or in turn one of its stealers, Traces currentSteal ->
- * currentJoin links looking for a thread working on a descendant
- * of the given task and with a non-empty queue to steal back and
- * execute tasks from. The first call to this method upon a
- * waiting join will often entail scanning/search, (which is OK
- * because the joiner has nothing better to do), but this method
- * leaves hints in workers to speed up subsequent calls. The
- * implementation is very branchy to cope with potential
- * inconsistencies or loops encountering chains that are stale,
- * unknown, or so long that they are likely cyclic.
- *
- * @param joiner the joining worker
- * @param task the task to join
- * @return 0 if no progress can be made, negative if task
- * known complete, else positive
- */
- private int tryHelpStealer(WorkQueue joiner, ForkJoinTask<?> task) {
- int stat = 0, steps = 0; // bound to avoid cycles
- if (joiner != null && task != null) { // hoist null checks
- restart: for (;;) {
- ForkJoinTask<?> subtask = task; // current target
- for (WorkQueue j = joiner, v;;) { // v is stealer of subtask
- WorkQueue[] ws; int m, s, h;
- if ((s = task.status) < 0) {
- stat = s;
- break restart;
- }
- if ((ws = workQueues) == null || (m = ws.length - 1) <= 0)
- break restart; // shutting down
- if ((v = ws[h = (j.hint | 1) & m]) == null ||
- v.currentSteal != subtask) {
- for (int origin = h;;) { // find stealer
- if (((h = (h + 2) & m) & 15) == 1 &&
- (subtask.status < 0 || j.currentJoin != subtask))
- continue restart; // occasional staleness check
- if ((v = ws[h]) != null &&
- v.currentSteal == subtask) {
- j.hint = h; // save hint
- break;
- }
- if (h == origin)
- break restart; // cannot find stealer
- }
- }
- for (;;) { // help stealer or descend to its stealer
- ForkJoinTask[] a; int b;
- if (subtask.status < 0) // surround probes with
- continue restart; // consistency checks
- if ((b = v.base) - v.top < 0 && (a = v.array) != null) {
- int i = (((a.length - 1) & b) << ASHIFT) + ABASE;
- ForkJoinTask<?> t =
- (ForkJoinTask<?>)U.getObjectVolatile(a, i);
- if (subtask.status < 0 || j.currentJoin != subtask ||
- v.currentSteal != subtask)
- continue restart; // stale
- stat = 1; // apparent progress
- if (t != null && v.base == b &&
- U.compareAndSwapObject(a, i, t, null)) {
- v.base = b + 1; // help stealer
- joiner.runSubtask(t);
- }
- else if (v.base == b && ++steps == MAX_HELP)
- break restart; // v apparently stalled
- }
- else { // empty -- try to descend
- ForkJoinTask<?> next = v.currentJoin;
- if (subtask.status < 0 || j.currentJoin != subtask ||
- v.currentSteal != subtask)
- continue restart; // stale
- else if (next == null || ++steps == MAX_HELP)
- break restart; // dead-end or maybe cyclic
- else {
- subtask = next;
- j = v;
- break;
- }
- }
- }
- }
- }
- }
- return stat;
- }
-
- /**
- * Analog of tryHelpStealer for CountedCompleters. Tries to steal
- * and run tasks within the target's computation.
- *
- * @param task the task to join
- * @param mode if shared, exit upon completing any task
- * if all workers are active
- */
- private int helpComplete(ForkJoinTask<?> task, int mode) {
- WorkQueue[] ws; WorkQueue q; int m, n, s, u;
- if (task != null && (ws = workQueues) != null &&
- (m = ws.length - 1) >= 0) {
- for (int j = 1, origin = j;;) {
- if ((s = task.status) < 0)
- return s;
- if ((q = ws[j & m]) != null && q.pollAndExecCC(task)) {
- origin = j;
- if (mode == SHARED_QUEUE &&
- ((u = (int)(ctl >>> 32)) >= 0 || (u >> UAC_SHIFT) >= 0))
- break;
- }
- else if ((j = (j + 2) & m) == origin)
- break;
- }
- }
- return 0;
- }
-
- /**
- * Tries to decrement active count (sometimes implicitly) and
- * possibly release or create a compensating worker in preparation
- * for blocking. Fails on contention or termination. Otherwise,
- * adds a new thread if no idle workers are available and pool
- * may become starved.
- */
- final boolean tryCompensate() {
- int pc = config & SMASK, e, i, tc; long c;
- WorkQueue[] ws; WorkQueue w; Thread p;
- if ((ws = workQueues) != null && (e = (int)(c = ctl)) >= 0) {
- if (e != 0 && (i = e & SMASK) < ws.length &&
- (w = ws[i]) != null && w.eventCount == (e | INT_SIGN)) {
- long nc = ((long)(w.nextWait & E_MASK) |
- (c & (AC_MASK|TC_MASK)));
- if (U.compareAndSwapLong(this, CTL, c, nc)) {
- w.eventCount = (e + E_SEQ) & E_MASK;
- if ((p = w.parker) != null)
- U.unpark(p);
- return true; // replace with idle worker
- }
- }
- else if ((tc = (short)(c >>> TC_SHIFT)) >= 0 &&
- (int)(c >> AC_SHIFT) + pc > 1) {
- long nc = ((c - AC_UNIT) & AC_MASK) | (c & ~AC_MASK);
- if (U.compareAndSwapLong(this, CTL, c, nc))
- return true; // no compensation
- }
- else if (tc + pc < MAX_CAP) {
- long nc = ((c + TC_UNIT) & TC_MASK) | (c & ~TC_MASK);
- if (U.compareAndSwapLong(this, CTL, c, nc)) {
- ForkJoinWorkerThreadFactory fac;
- Throwable ex = null;
- ForkJoinWorkerThread wt = null;
- try {
- if ((fac = factory) != null &&
- (wt = fac.newThread(this)) != null) {
- wt.start();
- return true;
- }
- } catch (Throwable rex) {
- ex = rex;
- }
- deregisterWorker(wt, ex); // clean up and return false
- }
- }
- }
- return false;
- }
-
- /**
- * Helps and/or blocks until the given task is done.
- *
- * @param joiner the joining worker
- * @param task the task
- * @return task status on exit
- */
- final int awaitJoin(WorkQueue joiner, ForkJoinTask<?> task) {
- int s = 0;
- if (joiner != null && task != null && (s = task.status) >= 0) {
- ForkJoinTask<?> prevJoin = joiner.currentJoin;
- joiner.currentJoin = task;
- do {} while ((s = task.status) >= 0 && !joiner.isEmpty() &&
- joiner.tryRemoveAndExec(task)); // process local tasks
- if (s >= 0 && (s = task.status) >= 0) {
- helpSignal(task, joiner.poolIndex);
- if ((s = task.status) >= 0 &&
- (task instanceof CountedCompleter))
- s = helpComplete(task, LIFO_QUEUE);
- }
- while (s >= 0 && (s = task.status) >= 0) {
- if ((!joiner.isEmpty() || // try helping
- (s = tryHelpStealer(joiner, task)) == 0) &&
- (s = task.status) >= 0) {
- helpSignal(task, joiner.poolIndex);
- if ((s = task.status) >= 0 && tryCompensate()) {
- if (task.trySetSignal() && (s = task.status) >= 0) {
- synchronized (task) {
- if (task.status >= 0) {
- try { // see ForkJoinTask
- task.wait(); // for explanation
- } catch (InterruptedException ie) {
- }
- }
- else
- task.notifyAll();
- }
- }
- long c; // re-activate
- do {} while (!U.compareAndSwapLong
- (this, CTL, c = ctl, c + AC_UNIT));
- }
- }
- }
- joiner.currentJoin = prevJoin;
- }
- return s;
- }
-
- /**
- * Stripped-down variant of awaitJoin used by timed joins. Tries
- * to help join only while there is continuous progress. (Caller
- * will then enter a timed wait.)
- *
- * @param joiner the joining worker
- * @param task the task
- */
- final void helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) {
- int s;
- if (joiner != null && task != null && (s = task.status) >= 0) {
- ForkJoinTask<?> prevJoin = joiner.currentJoin;
- joiner.currentJoin = task;
- do {} while ((s = task.status) >= 0 && !joiner.isEmpty() &&
- joiner.tryRemoveAndExec(task));
- if (s >= 0 && (s = task.status) >= 0) {
- helpSignal(task, joiner.poolIndex);
- if ((s = task.status) >= 0 &&
- (task instanceof CountedCompleter))
- s = helpComplete(task, LIFO_QUEUE);
- }
- if (s >= 0 && joiner.isEmpty()) {
- do {} while (task.status >= 0 &&
- tryHelpStealer(joiner, task) > 0);
- }
- joiner.currentJoin = prevJoin;
- }
- }
-
- /**
- * Returns a (probably) non-empty steal queue, if one is found
- * during a scan, else null. This method must be retried by
- * caller if, by the time it tries to use the queue, it is empty.
- * @param r a (random) seed for scanning
- */
- private WorkQueue findNonEmptyStealQueue(int r) {
- for (;;) {
- int ps = plock, m; WorkQueue[] ws; WorkQueue q;
- if ((ws = workQueues) != null && (m = ws.length - 1) >= 0) {
- for (int j = (m + 1) << 2; j >= 0; --j) {
- if ((q = ws[(((r + j) << 1) | 1) & m]) != null &&
- q.base - q.top < 0)
- return q;
- }
- }
- if (plock == ps)
- return null;
- }
- }
-
- /**
- * Runs tasks until {@code isQuiescent()}. We piggyback on
- * active count ctl maintenance, but rather than blocking
- * when tasks cannot be found, we rescan until all others cannot
- * find tasks either.
- */
- final void helpQuiescePool(WorkQueue w) {
- for (boolean active = true;;) {
- long c; WorkQueue q; ForkJoinTask<?> t; int b;
- while ((t = w.nextLocalTask()) != null) {
- if (w.base - w.top < 0)
- signalWork(w);
- t.doExec();
- }
- if ((q = findNonEmptyStealQueue(w.nextSeed())) != null) {
- if (!active) { // re-establish active count
- active = true;
- do {} while (!U.compareAndSwapLong
- (this, CTL, c = ctl, c + AC_UNIT));
- }
- if ((b = q.base) - q.top < 0 && (t = q.pollAt(b)) != null) {
- if (q.base - q.top < 0)
- signalWork(q);
- w.runSubtask(t);
- }
- }
- else if (active) { // decrement active count without queuing
- long nc = (c = ctl) - AC_UNIT;
- if ((int)(nc >> AC_SHIFT) + (config & SMASK) == 0)
- return; // bypass decrement-then-increment
- if (U.compareAndSwapLong(this, CTL, c, nc))
- active = false;
- }
- else if ((int)((c = ctl) >> AC_SHIFT) + (config & SMASK) == 0 &&
- U.compareAndSwapLong(this, CTL, c, c + AC_UNIT))
- return;
- }
- }
-
- /**
- * Gets and removes a local or stolen task for the given worker.
- *
- * @return a task, if available
- */
- final ForkJoinTask<?> nextTaskFor(WorkQueue w) {
- for (ForkJoinTask<?> t;;) {
- WorkQueue q; int b;
- if ((t = w.nextLocalTask()) != null)
- return t;
- if ((q = findNonEmptyStealQueue(w.nextSeed())) == null)
- return null;
- if ((b = q.base) - q.top < 0 && (t = q.pollAt(b)) != null) {
- if (q.base - q.top < 0)
- signalWork(q);
- return t;
- }
- }
- }
-
- /**
- * Returns a cheap heuristic guide for task partitioning when
- * programmers, frameworks, tools, or languages have little or no
- * idea about task granularity. In essence by offering this
- * method, we ask users only about tradeoffs in overhead vs
- * expected throughput and its variance, rather than how finely to
- * partition tasks.
- *
- * In a steady state strict (tree-structured) computation, each
- * thread makes available for stealing enough tasks for other
- * threads to remain active. Inductively, if all threads play by
- * the same rules, each thread should make available only a
- * constant number of tasks.
- *
- * The minimum useful constant is just 1. But using a value of 1
- * would require immediate replenishment upon each steal to
- * maintain enough tasks, which is infeasible. Further,
- * partitionings/granularities of offered tasks should minimize
- * steal rates, which in general means that threads nearer the top
- * of computation tree should generate more than those nearer the
- * bottom. In perfect steady state, each thread is at
- * approximately the same level of computation tree. However,
- * producing extra tasks amortizes the uncertainty of progress and
- * diffusion assumptions.
- *
- * So, users will want to use values larger (but not much larger)
- * than 1 to both smooth over transient shortages and hedge
- * against uneven progress; as traded off against the cost of
- * extra task overhead. We leave the user to pick a threshold
- * value to compare with the results of this call to guide
- * decisions, but recommend values such as 3.
- *
- * When all threads are active, it is on average OK to estimate
- * surplus strictly locally. In steady-state, if one thread is
- * maintaining say 2 surplus tasks, then so are others. So we can
- * just use estimated queue length. However, this strategy alone
- * leads to serious mis-estimates in some non-steady-state
- * conditions (ramp-up, ramp-down, other stalls). We can detect
- * many of these by further considering the number of "idle"
- * threads, that are known to have zero queued tasks, so
- * compensate by a factor of (#idle/#active) threads.
- *
- * Note: The approximation of #busy workers as #active workers is
- * not very good under current signalling scheme, and should be
- * improved.
- */
- static int getSurplusQueuedTaskCount() {
- Thread t; ForkJoinWorkerThread wt; ForkJoinPool pool; WorkQueue q;
- if (((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)) {
- int p = (pool = (wt = (ForkJoinWorkerThread)t).pool).config & SMASK;
- int n = (q = wt.workQueue).top - q.base;
- int a = (int)(pool.ctl >> AC_SHIFT) + p;
- return n - (a > (p >>>= 1) ? 0 :
- a > (p >>>= 1) ? 1 :
- a > (p >>>= 1) ? 2 :
- a > (p >>>= 1) ? 4 :
- 8);
- }
- return 0;
- }
-
- // Termination
-
- /**
- * Possibly initiates and/or completes termination. The caller
- * triggering termination runs three passes through workQueues:
- * (0) Setting termination status, followed by wakeups of queued
- * workers; (1) cancelling all tasks; (2) interrupting lagging
- * threads (likely in external tasks, but possibly also blocked in
- * joins). Each pass repeats previous steps because of potential
- * lagging thread creation.
- *
- * @param now if true, unconditionally terminate, else only
- * if no work and no active workers
- * @param enable if true, enable shutdown when next possible
- * @return true if now terminating or terminated
- */
- private boolean tryTerminate(boolean now, boolean enable) {
- int ps;
- if (this == common) // cannot shut down
- return false;
- if ((ps = plock) >= 0) { // enable by setting plock
- if (!enable)
- return false;
- if ((ps & PL_LOCK) != 0 ||
- !U.compareAndSwapInt(this, PLOCK, ps, ps += PL_LOCK))
- ps = acquirePlock();
- int nps = ((ps + PL_LOCK) & ~SHUTDOWN) | SHUTDOWN;
- if (!U.compareAndSwapInt(this, PLOCK, ps, nps))
- releasePlock(nps);
- }
- for (long c;;) {
- if (((c = ctl) & STOP_BIT) != 0) { // already terminating
- if ((short)(c >>> TC_SHIFT) == -(config & SMASK)) {
- synchronized (this) {
- notifyAll(); // signal when 0 workers
- }
- }
- return true;
- }
- if (!now) { // check if idle & no tasks
- WorkQueue[] ws; WorkQueue w;
- if ((int)(c >> AC_SHIFT) != -(config & SMASK))
- return false;
- if ((ws = workQueues) != null) {
- for (int i = 0; i < ws.length; ++i) {
- if ((w = ws[i]) != null) {
- if (!w.isEmpty()) { // signal unprocessed tasks
- signalWork(w);
- return false;
- }
- if ((i & 1) != 0 && w.eventCount >= 0)
- return false; // unqueued inactive worker
- }
- }
- }
- }
- if (U.compareAndSwapLong(this, CTL, c, c | STOP_BIT)) {
- for (int pass = 0; pass < 3; ++pass) {
- WorkQueue[] ws; WorkQueue w; Thread wt;
- if ((ws = workQueues) != null) {
- int n = ws.length;
- for (int i = 0; i < n; ++i) {
- if ((w = ws[i]) != null) {
- w.qlock = -1;
- if (pass > 0) {
- w.cancelAll();
- if (pass > 1 && (wt = w.owner) != null) {
- if (!wt.isInterrupted()) {
- try {
- wt.interrupt();
- } catch (Throwable ignore) {
- }
- }
- U.unpark(wt);
- }
- }
- }
- }
- // Wake up workers parked on event queue
- int i, e; long cc; Thread p;
- while ((e = (int)(cc = ctl) & E_MASK) != 0 &&
- (i = e & SMASK) < n && i >= 0 &&
- (w = ws[i]) != null) {
- long nc = ((long)(w.nextWait & E_MASK) |
- ((cc + AC_UNIT) & AC_MASK) |
- (cc & (TC_MASK|STOP_BIT)));
- if (w.eventCount == (e | INT_SIGN) &&
- U.compareAndSwapLong(this, CTL, cc, nc)) {
- w.eventCount = (e + E_SEQ) & E_MASK;
- w.qlock = -1;
- if ((p = w.parker) != null)
- U.unpark(p);
- }
- }
- }
- }
- }
- }
- }
-
- // external operations on common pool
-
- /**
- * Returns common pool queue for a thread that has submitted at
- * least one task.
- */
- static WorkQueue commonSubmitterQueue() {
- ForkJoinPool p; WorkQueue[] ws; int m; Submitter z;
- return ((z = submitters.get()) != null &&
- (p = common) != null &&
- (ws = p.workQueues) != null &&
- (m = ws.length - 1) >= 0) ?
- ws[m & z.seed & SQMASK] : null;
- }
-
- /**
- * Tries to pop the given task from submitter's queue in common pool.
- */
- static boolean tryExternalUnpush(ForkJoinTask<?> t) {
- ForkJoinPool p; WorkQueue[] ws; WorkQueue q; Submitter z;
- ForkJoinTask<?>[] a; int m, s;
- if (t != null &&
- (z = submitters.get()) != null &&
- (p = common) != null &&
- (ws = p.workQueues) != null &&
- (m = ws.length - 1) >= 0 &&
- (q = ws[m & z.seed & SQMASK]) != null &&
- (s = q.top) != q.base &&
- (a = q.array) != null) {
- long j = (((a.length - 1) & (s - 1)) << ASHIFT) + ABASE;
- if (U.getObject(a, j) == t &&
- U.compareAndSwapInt(q, QLOCK, 0, 1)) {
- if (q.array == a && q.top == s && // recheck
- U.compareAndSwapObject(a, j, t, null)) {
- q.top = s - 1;
- q.qlock = 0;
- return true;
- }
- q.qlock = 0;
- }
- }
- return false;
- }
-
- /**
- * Tries to pop and run local tasks within the same computation
- * as the given root. On failure, tries to help complete from
- * other queues via helpComplete.
- */
- private void externalHelpComplete(WorkQueue q, ForkJoinTask<?> root) {
- ForkJoinTask<?>[] a; int m;
- if (q != null && (a = q.array) != null && (m = (a.length - 1)) >= 0 &&
- root != null && root.status >= 0) {
- for (;;) {
- int s, u; Object o; CountedCompleter<?> task = null;
- if ((s = q.top) - q.base > 0) {
- long j = ((m & (s - 1)) << ASHIFT) + ABASE;
- if ((o = U.getObject(a, j)) != null &&
- (o instanceof CountedCompleter)) {
- CountedCompleter<?> t = (CountedCompleter<?>)o, r = t;
- do {
- if (r == root) {
- if (U.compareAndSwapInt(q, QLOCK, 0, 1)) {
- if (q.array == a && q.top == s &&
- U.compareAndSwapObject(a, j, t, null)) {
- q.top = s - 1;
- task = t;
- }
- q.qlock = 0;
- }
- break;
- }
- } while ((r = r.completer) != null);
- }
- }
- if (task != null)
- task.doExec();
- if (root.status < 0 ||
- (u = (int)(ctl >>> 32)) >= 0 || (u >> UAC_SHIFT) >= 0)
- break;
- if (task == null) {
- helpSignal(root, q.poolIndex);
- if (root.status >= 0)
- helpComplete(root, SHARED_QUEUE);
- break;
- }
- }
- }
- }
-
- /**
- * Tries to help execute or signal availability of the given task
- * from submitter's queue in common pool.
- */
- static void externalHelpJoin(ForkJoinTask<?> t) {
- // Some hard-to-avoid overlap with tryExternalUnpush
- ForkJoinPool p; WorkQueue[] ws; WorkQueue q, w; Submitter z;
- ForkJoinTask<?>[] a; int m, s, n;
- if (t != null &&
- (z = submitters.get()) != null &&
- (p = common) != null &&
- (ws = p.workQueues) != null &&
- (m = ws.length - 1) >= 0 &&
- (q = ws[m & z.seed & SQMASK]) != null &&
- (a = q.array) != null) {
- int am = a.length - 1;
- if ((s = q.top) != q.base) {
- long j = ((am & (s - 1)) << ASHIFT) + ABASE;
- if (U.getObject(a, j) == t &&
- U.compareAndSwapInt(q, QLOCK, 0, 1)) {
- if (q.array == a && q.top == s &&
- U.compareAndSwapObject(a, j, t, null)) {
- q.top = s - 1;
- q.qlock = 0;
- t.doExec();
- }
- else
- q.qlock = 0;
- }
- }
- if (t.status >= 0) {
- if (t instanceof CountedCompleter)
- p.externalHelpComplete(q, t);
- else
- p.helpSignal(t, q.poolIndex);
- }
- }
- }
-
- // Exported methods
-
- // Constructors
-
- /**
- * Creates a {@code ForkJoinPool} with parallelism equal to {@link
- * java.lang.Runtime#availableProcessors}, using the {@linkplain
- * #defaultForkJoinWorkerThreadFactory default thread factory},
- * no UncaughtExceptionHandler, and non-async LIFO processing mode.
- *
- * @throws SecurityException if a security manager exists and
- * the caller is not permitted to modify threads
- * because it does not hold {@link
- * java.lang.RuntimePermission}{@code ("modifyThread")}
- */
- public ForkJoinPool() {
- this(Math.min(MAX_CAP, Runtime.getRuntime().availableProcessors()),
- defaultForkJoinWorkerThreadFactory, null, false);
- }
-
- /**
- * Creates a {@code ForkJoinPool} with the indicated parallelism
- * level, the {@linkplain
- * #defaultForkJoinWorkerThreadFactory default thread factory},
- * no UncaughtExceptionHandler, and non-async LIFO processing mode.
- *
- * @param parallelism the parallelism level
- * @throws IllegalArgumentException if parallelism less than or
- * equal to zero, or greater than implementation limit
- * @throws SecurityException if a security manager exists and
- * the caller is not permitted to modify threads
- * because it does not hold {@link
- * java.lang.RuntimePermission}{@code ("modifyThread")}
- */
- public ForkJoinPool(int parallelism) {
- this(parallelism, defaultForkJoinWorkerThreadFactory, null, false);
- }
-
- /**
- * Creates a {@code ForkJoinPool} with the given parameters.
- *
- * @param parallelism the parallelism level. For default value,
- * use {@link java.lang.Runtime#availableProcessors}.
- * @param factory the factory for creating new threads. For default value,
- * use {@link #defaultForkJoinWorkerThreadFactory}.
- * @param handler the handler for internal worker threads that
- * terminate due to unrecoverable errors encountered while executing
- * tasks. For default value, use {@code null}.
- * @param asyncMode if true,
- * establishes local first-in-first-out scheduling mode for forked
- * tasks that are never joined. This mode may be more appropriate
- * than default locally stack-based mode in applications in which
- * worker threads only process event-style asynchronous tasks.
- * For default value, use {@code false}.
- * @throws IllegalArgumentException if parallelism less than or
- * equal to zero, or greater than implementation limit
- * @throws NullPointerException if the factory is null
- * @throws SecurityException if a security manager exists and
- * the caller is not permitted to modify threads
- * because it does not hold {@link
- * java.lang.RuntimePermission}{@code ("modifyThread")}
- */
- public ForkJoinPool(int parallelism,
- ForkJoinWorkerThreadFactory factory,
- Thread.UncaughtExceptionHandler handler,
- boolean asyncMode) {
- checkPermission();
- if (factory == null)
- throw new NullPointerException();
- if (parallelism <= 0 || parallelism > MAX_CAP)
- throw new IllegalArgumentException();
- this.factory = factory;
- this.ueh = handler;
- this.config = parallelism | (asyncMode ? (FIFO_QUEUE << 16) : 0);
- long np = (long)(-parallelism); // offset ctl counts
- this.ctl = ((np << AC_SHIFT) & AC_MASK) | ((np << TC_SHIFT) & TC_MASK);
- int pn = nextPoolId();
- StringBuilder sb = new StringBuilder("ForkJoinPool-");
- sb.append(Integer.toString(pn));
- sb.append("-worker-");
- this.workerNamePrefix = sb.toString();
- }
-
- /**
- * Constructor for common pool, suitable only for static initialization.
- * Basically the same as above, but uses smallest possible initial footprint.
- */
- ForkJoinPool(int parallelism, long ctl,
- ForkJoinWorkerThreadFactory factory,
- Thread.UncaughtExceptionHandler handler) {
- this.config = parallelism;
- this.ctl = ctl;
- this.factory = factory;
- this.ueh = handler;
- this.workerNamePrefix = "ForkJoinPool.commonPool-worker-";
- }
-
- /**
- * Returns the common pool instance. This pool is statically
- * constructed; its run state is unaffected by attempts to {@link
- * #shutdown} or {@link #shutdownNow}. However this pool and any
- * ongoing processing are automatically terminated upon program
- * {@link System#exit}. Any program that relies on asynchronous
- * task processing to complete before program termination should
- * invoke {@code commonPool().}{@link #awaitQuiescence}, before
- * exit.
- *
- * @return the common pool instance
- * @since 1.8
- */
- public static ForkJoinPool commonPool() {
- // assert common != null : "static init error";
- return common;
- }
-
- // Execution methods
-
- /**
- * Performs the given task, returning its result upon completion.
- * If the computation encounters an unchecked Exception or Error,
- * it is rethrown as the outcome of this invocation. Rethrown
- * exceptions behave in the same way as regular exceptions, but,
- * when possible, contain stack traces (as displayed for example
- * using {@code ex.printStackTrace()}) of both the current thread
- * as well as the thread actually encountering the exception;
- * minimally only the latter.
- *
- * @param task the task
- * @return the task's result
- * @throws NullPointerException if the task is null
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- */
- public <T> T invoke(ForkJoinTask<T> task) {
- if (task == null)
- throw new NullPointerException();
- externalPush(task);
- return task.join();
- }
-
- /**
- * Arranges for (asynchronous) execution of the given task.
- *
- * @param task the task
- * @throws NullPointerException if the task is null
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- */
- public void execute(ForkJoinTask<?> task) {
- if (task == null)
- throw new NullPointerException();
- externalPush(task);
- }
-
- // AbstractExecutorService methods
-
- /**
- * @throws NullPointerException if the task is null
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- */
- public void execute(Runnable task) {
- if (task == null)
- throw new NullPointerException();
- ForkJoinTask<?> job;
- if (task instanceof ForkJoinTask<?>) // avoid re-wrap
- job = (ForkJoinTask<?>) task;
- else
- job = new ForkJoinTask.AdaptedRunnableAction(task);
- externalPush(job);
- }
-
- /**
- * Submits a ForkJoinTask for execution.
- *
- * @param task the task to submit
- * @return the task
- * @throws NullPointerException if the task is null
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- */
- public <T> ForkJoinTask<T> submit(ForkJoinTask<T> task) {
- if (task == null)
- throw new NullPointerException();
- externalPush(task);
- return task;
- }
-
- /**
- * @throws NullPointerException if the task is null
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- */
- public <T> ForkJoinTask<T> submit(Callable<T> task) {
- ForkJoinTask<T> job = new ForkJoinTask.AdaptedCallable<T>(task);
- externalPush(job);
- return job;
- }
-
- /**
- * @throws NullPointerException if the task is null
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- */
- public <T> ForkJoinTask<T> submit(Runnable task, T result) {
- ForkJoinTask<T> job = new ForkJoinTask.AdaptedRunnable<T>(task, result);
- externalPush(job);
- return job;
- }
-
- /**
- * @throws NullPointerException if the task is null
- * @throws RejectedExecutionException if the task cannot be
- * scheduled for execution
- */
- public ForkJoinTask<?> submit(Runnable task) {
- if (task == null)
- throw new NullPointerException();
- ForkJoinTask<?> job;
- if (task instanceof ForkJoinTask<?>) // avoid re-wrap
- job = (ForkJoinTask<?>) task;
- else
- job = new ForkJoinTask.AdaptedRunnableAction(task);
- externalPush(job);
- return job;
- }
-
- /**
- * @throws NullPointerException {@inheritDoc}
- * @throws RejectedExecutionException {@inheritDoc}
- */
- public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) {
- // In previous versions of this class, this method constructed
- // a task to run ForkJoinTask.invokeAll, but now external
- // invocation of multiple tasks is at least as efficient.
- ArrayList<Future<T>> futures = new ArrayList<Future<T>>(tasks.size());
-
- boolean done = false;
- try {
- for (Callable<T> t : tasks) {
- ForkJoinTask<T> f = new ForkJoinTask.AdaptedCallable<T>(t);
- futures.add(f);
- externalPush(f);
- }
- for (int i = 0, size = futures.size(); i < size; i++)
- ((ForkJoinTask<?>)futures.get(i)).quietlyJoin();
- done = true;
- return futures;
- } finally {
- if (!done)
- for (int i = 0, size = futures.size(); i < size; i++)
- futures.get(i).cancel(false);
- }
- }
-
- /**
- * Returns the factory used for constructing new workers.
- *
- * @return the factory used for constructing new workers
- */
- public ForkJoinWorkerThreadFactory getFactory() {
- return factory;
- }
-
- /**
- * Returns the handler for internal worker threads that terminate
- * due to unrecoverable errors encountered while executing tasks.
- *
- * @return the handler, or {@code null} if none
- */
- public Thread.UncaughtExceptionHandler getUncaughtExceptionHandler() {
- return ueh;
- }
-
- /**
- * Returns the targeted parallelism level of this pool.
- *
- * @return the targeted parallelism level of this pool
- */
- public int getParallelism() {
- return config & SMASK;
- }
-
- /**
- * Returns the targeted parallelism level of the common pool.
- *
- * @return the targeted parallelism level of the common pool
- * @since 1.8
- */
- public static int getCommonPoolParallelism() {
- return commonParallelism;
- }
-
- /**
- * Returns the number of worker threads that have started but not
- * yet terminated. The result returned by this method may differ
- * from {@link #getParallelism} when threads are created to
- * maintain parallelism when others are cooperatively blocked.
- *
- * @return the number of worker threads
- */
- public int getPoolSize() {
- return (config & SMASK) + (short)(ctl >>> TC_SHIFT);
- }
-
- /**
- * Returns {@code true} if this pool uses local first-in-first-out
- * scheduling mode for forked tasks that are never joined.
- *
- * @return {@code true} if this pool uses async mode
- */
- public boolean getAsyncMode() {
- return (config >>> 16) == FIFO_QUEUE;
- }
-
- /**
- * Returns an estimate of the number of worker threads that are
- * not blocked waiting to join tasks or for other managed
- * synchronization. This method may overestimate the
- * number of running threads.
- *
- * @return the number of worker threads
- */
- public int getRunningThreadCount() {
- int rc = 0;
- WorkQueue[] ws; WorkQueue w;
- if ((ws = workQueues) != null) {
- for (int i = 1; i < ws.length; i += 2) {
- if ((w = ws[i]) != null && w.isApparentlyUnblocked())
- ++rc;
- }
- }
- return rc;
- }
-
- /**
- * Returns an estimate of the number of threads that are currently
- * stealing or executing tasks. This method may overestimate the
- * number of active threads.
- *
- * @return the number of active threads
- */
- public int getActiveThreadCount() {
- int r = (config & SMASK) + (int)(ctl >> AC_SHIFT);
- return (r <= 0) ? 0 : r; // suppress momentarily negative values
- }
-
- /**
- * Returns {@code true} if all worker threads are currently idle.
- * An idle worker is one that cannot obtain a task to execute
- * because none are available to steal from other threads, and
- * there are no pending submissions to the pool. This method is
- * conservative; it might not return {@code true} immediately upon
- * idleness of all threads, but will eventually become true if
- * threads remain inactive.
- *
- * @return {@code true} if all threads are currently idle
- */
- public boolean isQuiescent() {
- return (int)(ctl >> AC_SHIFT) + (config & SMASK) == 0;
- }
-
- /**
- * Returns an estimate of the total number of tasks stolen from
- * one thread's work queue by another. The reported value
- * underestimates the actual total number of steals when the pool
- * is not quiescent. This value may be useful for monitoring and
- * tuning fork/join programs: in general, steal counts should be
- * high enough to keep threads busy, but low enough to avoid
- * overhead and contention across threads.
- *
- * @return the number of steals
- */
- public long getStealCount() {
- long count = stealCount;
- WorkQueue[] ws; WorkQueue w;
- if ((ws = workQueues) != null) {
- for (int i = 1; i < ws.length; i += 2) {
- if ((w = ws[i]) != null)
- count += w.nsteals;
- }
- }
- return count;
- }
-
- /**
- * Returns an estimate of the total number of tasks currently held
- * in queues by worker threads (but not including tasks submitted
- * to the pool that have not begun executing). This value is only
- * an approximation, obtained by iterating across all threads in
- * the pool. This method may be useful for tuning task
- * granularities.
- *
- * @return the number of queued tasks
- */
- public long getQueuedTaskCount() {
- long count = 0;
- WorkQueue[] ws; WorkQueue w;
- if ((ws = workQueues) != null) {
- for (int i = 1; i < ws.length; i += 2) {
- if ((w = ws[i]) != null)
- count += w.queueSize();
- }
- }
- return count;
- }
-
- /**
- * Returns an estimate of the number of tasks submitted to this
- * pool that have not yet begun executing. This method may take
- * time proportional to the number of submissions.
- *
- * @return the number of queued submissions
- */
- public int getQueuedSubmissionCount() {
- int count = 0;
- WorkQueue[] ws; WorkQueue w;
- if ((ws = workQueues) != null) {
- for (int i = 0; i < ws.length; i += 2) {
- if ((w = ws[i]) != null)
- count += w.queueSize();
- }
- }
- return count;
- }
-
- /**
- * Returns {@code true} if there are any tasks submitted to this
- * pool that have not yet begun executing.
- *
- * @return {@code true} if there are any queued submissions
- */
- public boolean hasQueuedSubmissions() {
- WorkQueue[] ws; WorkQueue w;
- if ((ws = workQueues) != null) {
- for (int i = 0; i < ws.length; i += 2) {
- if ((w = ws[i]) != null && !w.isEmpty())
- return true;
- }
- }
- return false;
- }
-
- /**
- * Removes and returns the next unexecuted submission if one is
- * available. This method may be useful in extensions to this
- * class that re-assign work in systems with multiple pools.
- *
- * @return the next submission, or {@code null} if none
- */
- protected ForkJoinTask<?> pollSubmission() {
- WorkQueue[] ws; WorkQueue w; ForkJoinTask<?> t;
- if ((ws = workQueues) != null) {
- for (int i = 0; i < ws.length; i += 2) {
- if ((w = ws[i]) != null && (t = w.poll()) != null)
- return t;
- }
- }
- return null;
- }
-
- /**
- * Removes all available unexecuted submitted and forked tasks
- * from scheduling queues and adds them to the given collection,
- * without altering their execution status. These may include
- * artificially generated or wrapped tasks. This method is
- * designed to be invoked only when the pool is known to be
- * quiescent. Invocations at other times may not remove all
- * tasks. A failure encountered while attempting to add elements
- * to collection {@code c} may result in elements being in
- * neither, either or both collections when the associated
- * exception is thrown. The behavior of this operation is
- * undefined if the specified collection is modified while the
- * operation is in progress.
- *
- * @param c the collection to transfer elements into
- * @return the number of elements transferred
- */
- protected int drainTasksTo(Collection<? super ForkJoinTask<?>> c) {
- int count = 0;
- WorkQueue[] ws; WorkQueue w; ForkJoinTask<?> t;
- if ((ws = workQueues) != null) {
- for (int i = 0; i < ws.length; ++i) {
- if ((w = ws[i]) != null) {
- while ((t = w.poll()) != null) {
- c.add(t);
- ++count;
- }
- }
- }
- }
- return count;
- }
-
- /**
- * Returns a string identifying this pool, as well as its state,
- * including indications of run state, parallelism level, and
- * worker and task counts.
- *
- * @return a string identifying this pool, as well as its state
- */
- public String toString() {
- // Use a single pass through workQueues to collect counts
- long qt = 0L, qs = 0L; int rc = 0;
- long st = stealCount;
- long c = ctl;
- WorkQueue[] ws; WorkQueue w;
- if ((ws = workQueues) != null) {
- for (int i = 0; i < ws.length; ++i) {
- if ((w = ws[i]) != null) {
- int size = w.queueSize();
- if ((i & 1) == 0)
- qs += size;
- else {
- qt += size;
- st += w.nsteals;
- if (w.isApparentlyUnblocked())
- ++rc;
- }
- }
- }
- }
- int pc = (config & SMASK);
- int tc = pc + (short)(c >>> TC_SHIFT);
- int ac = pc + (int)(c >> AC_SHIFT);
- if (ac < 0) // ignore transient negative
- ac = 0;
- String level;
- if ((c & STOP_BIT) != 0)
- level = (tc == 0) ? "Terminated" : "Terminating";
- else
- level = plock < 0 ? "Shutting down" : "Running";
- return super.toString() +
- "[" + level +
- ", parallelism = " + pc +
- ", size = " + tc +
- ", active = " + ac +
- ", running = " + rc +
- ", steals = " + st +
- ", tasks = " + qt +
- ", submissions = " + qs +
- "]";
- }
-
- /**
- * Possibly initiates an orderly shutdown in which previously
- * submitted tasks are executed, but no new tasks will be
- * accepted. Invocation has no effect on execution state if this
- * is the {@link #commonPool()}, and no additional effect if
- * already shut down. Tasks that are in the process of being
- * submitted concurrently during the course of this method may or
- * may not be rejected.
- *
- * @throws SecurityException if a security manager exists and
- * the caller is not permitted to modify threads
- * because it does not hold {@link
- * java.lang.RuntimePermission}{@code ("modifyThread")}
- */
- public void shutdown() {
- checkPermission();
- tryTerminate(false, true);
- }
-
- /**
- * Possibly attempts to cancel and/or stop all tasks, and reject
- * all subsequently submitted tasks. Invocation has no effect on
- * execution state if this is the {@link #commonPool()}, and no
- * additional effect if already shut down. Otherwise, tasks that
- * are in the process of being submitted or executed concurrently
- * during the course of this method may or may not be
- * rejected. This method cancels both existing and unexecuted
- * tasks, in order to permit termination in the presence of task
- * dependencies. So the method always returns an empty list
- * (unlike the case for some other Executors).
- *
- * @return an empty list
- * @throws SecurityException if a security manager exists and
- * the caller is not permitted to modify threads
- * because it does not hold {@link
- * java.lang.RuntimePermission}{@code ("modifyThread")}
- */
- public List<Runnable> shutdownNow() {
- checkPermission();
- tryTerminate(true, true);
- return Collections.emptyList();
- }
-
- /**
- * Returns {@code true} if all tasks have completed following shut down.
- *
- * @return {@code true} if all tasks have completed following shut down
- */
- public boolean isTerminated() {
- long c = ctl;
- return ((c & STOP_BIT) != 0L &&
- (short)(c >>> TC_SHIFT) == -(config & SMASK));
- }
-
- /**
- * Returns {@code true} if the process of termination has
- * commenced but not yet completed. This method may be useful for
- * debugging. A return of {@code true} reported a sufficient
- * period after shutdown may indicate that submitted tasks have
- * ignored or suppressed interruption, or are waiting for I/O,
- * causing this executor not to properly terminate. (See the
- * advisory notes for class {@link ForkJoinTask} stating that
- * tasks should not normally entail blocking operations. But if
- * they do, they must abort them on interrupt.)
- *
- * @return {@code true} if terminating but not yet terminated
- */
- public boolean isTerminating() {
- long c = ctl;
- return ((c & STOP_BIT) != 0L &&
- (short)(c >>> TC_SHIFT) != -(config & SMASK));
- }
-
- /**
- * Returns {@code true} if this pool has been shut down.
- *
- * @return {@code true} if this pool has been shut down
- */
- public boolean isShutdown() {
- return plock < 0;
- }
-
- /**
- * Blocks until all tasks have completed execution after a
- * shutdown request, or the timeout occurs, or the current thread
- * is interrupted, whichever happens first. Because the {@link
- * #commonPool()} never terminates until program shutdown, when
- * applied to the common pool, this method is equivalent to {@link
- * #awaitQuiescence} but always returns {@code false}.
- *
- * @param timeout the maximum time to wait
- * @param unit the time unit of the timeout argument
- * @return {@code true} if this executor terminated and
- * {@code false} if the timeout elapsed before termination
- * @throws InterruptedException if interrupted while waiting
- */
- public boolean awaitTermination(long timeout, TimeUnit unit)
- throws InterruptedException {
- if (Thread.interrupted())
- throw new InterruptedException();
- if (this == common) {
- awaitQuiescence(timeout, unit);
- return false;
- }
- long nanos = unit.toNanos(timeout);
- if (isTerminated())
- return true;
- long startTime = System.nanoTime();
- boolean terminated = false;
- synchronized (this) {
- for (long waitTime = nanos, millis = 0L;;) {
- if (terminated = isTerminated() ||
- waitTime <= 0L ||
- (millis = unit.toMillis(waitTime)) <= 0L)
- break;
- wait(millis);
- waitTime = nanos - (System.nanoTime() - startTime);
- }
- }
- return terminated;
- }
-
- /**
- * If called by a ForkJoinTask operating in this pool, equivalent
- * in effect to {@link ForkJoinTask#helpQuiesce}. Otherwise,
- * waits and/or attempts to assist performing tasks until this
- * pool {@link #isQuiescent} or the indicated timeout elapses.
- *
- * @param timeout the maximum time to wait
- * @param unit the time unit of the timeout argument
- * @return {@code true} if quiescent; {@code false} if the
- * timeout elapsed.
- */
- public boolean awaitQuiescence(long timeout, TimeUnit unit) {
- long nanos = unit.toNanos(timeout);
- ForkJoinWorkerThread wt;
- Thread thread = Thread.currentThread();
- if ((thread instanceof ForkJoinWorkerThread) &&
- (wt = (ForkJoinWorkerThread)thread).pool == this) {
- helpQuiescePool(wt.workQueue);
- return true;
- }
- long startTime = System.nanoTime();
- WorkQueue[] ws;
- int r = 0, m;
- boolean found = true;
- while (!isQuiescent() && (ws = workQueues) != null &&
- (m = ws.length - 1) >= 0) {
- if (!found) {
- if ((System.nanoTime() - startTime) > nanos)
- return false;
- Thread.yield(); // cannot block
- }
- found = false;
- for (int j = (m + 1) << 2; j >= 0; --j) {
- ForkJoinTask<?> t; WorkQueue q; int b;
- if ((q = ws[r++ & m]) != null && (b = q.base) - q.top < 0) {
- found = true;
- if ((t = q.pollAt(b)) != null) {
- if (q.base - q.top < 0)
- signalWork(q);
- t.doExec();
- }
- break;
- }
- }
- }
- return true;
- }
-
- /**
- * Waits and/or attempts to assist performing tasks indefinitely
- * until the {@link #commonPool()} {@link #isQuiescent}.
- */
- static void quiesceCommonPool() {
- common.awaitQuiescence(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
- }
-
- /**
- * Interface for extending managed parallelism for tasks running
- * in {@link ForkJoinPool}s.
- *
- * <p>A {@code ManagedBlocker} provides two methods. Method
- * {@code isReleasable} must return {@code true} if blocking is
- * not necessary. Method {@code block} blocks the current thread
- * if necessary (perhaps internally invoking {@code isReleasable}
- * before actually blocking). These actions are performed by any
- * thread invoking {@link ForkJoinPool#managedBlock}. The
- * unusual methods in this API accommodate synchronizers that may,
- * but don't usually, block for long periods. Similarly, they
- * allow more efficient internal handling of cases in which
- * additional workers may be, but usually are not, needed to
- * ensure sufficient parallelism. Toward this end,
- * implementations of method {@code isReleasable} must be amenable
- * to repeated invocation.
- *
- * <p>For example, here is a ManagedBlocker based on a
- * ReentrantLock:
- * <pre> {@code
- * class ManagedLocker implements ManagedBlocker {
- * final ReentrantLock lock;
- * boolean hasLock = false;
- * ManagedLocker(ReentrantLock lock) { this.lock = lock; }
- * public boolean block() {
- * if (!hasLock)
- * lock.lock();
- * return true;
- * }
- * public boolean isReleasable() {
- * return hasLock || (hasLock = lock.tryLock());
- * }
- * }}</pre>
- *
- * <p>Here is a class that possibly blocks waiting for an
- * item on a given queue:
- * <pre> {@code
- * class QueueTaker<E> implements ManagedBlocker {
- * final BlockingQueue<E> queue;
- * volatile E item = null;
- * QueueTaker(BlockingQueue<E> q) { this.queue = q; }
- * public boolean block() throws InterruptedException {
- * if (item == null)
- * item = queue.take();
- * return true;
- * }
- * public boolean isReleasable() {
- * return item != null || (item = queue.poll()) != null;
- * }
- * public E getItem() { // call after pool.managedBlock completes
- * return item;
- * }
- * }}</pre>
- */
- public static interface ManagedBlocker {
- /**
- * Possibly blocks the current thread, for example waiting for
- * a lock or condition.
- *
- * @return {@code true} if no additional blocking is necessary
- * (i.e., if isReleasable would return true)
- * @throws InterruptedException if interrupted while waiting
- * (the method is not required to do so, but is allowed to)
- */
- boolean block() throws InterruptedException;
-
- /**
- * Returns {@code true} if blocking is unnecessary.
- */
- boolean isReleasable();
- }
-
- /**
- * Blocks in accord with the given blocker. If the current thread
- * is a {@link ForkJoinWorkerThread}, this method possibly
- * arranges for a spare thread to be activated if necessary to
- * ensure sufficient parallelism while the current thread is blocked.
- *
- * <p>If the caller is not a {@link ForkJoinTask}, this method is
- * behaviorally equivalent to
- * <pre> {@code
- * while (!blocker.isReleasable())
- * if (blocker.block())
- * return;
- * }</pre>
- *
- * If the caller is a {@code ForkJoinTask}, then the pool may
- * first be expanded to ensure parallelism, and later adjusted.
- *
- * @param blocker the blocker
- * @throws InterruptedException if blocker.block did so
- */
- public static void managedBlock(ManagedBlocker blocker)
- throws InterruptedException {
- Thread t = Thread.currentThread();
- if (t instanceof ForkJoinWorkerThread) {
- ForkJoinPool p = ((ForkJoinWorkerThread)t).pool;
- while (!blocker.isReleasable()) { // variant of helpSignal
- WorkQueue[] ws; WorkQueue q; int m, u;
- if ((ws = p.workQueues) != null && (m = ws.length - 1) >= 0) {
- for (int i = 0; i <= m; ++i) {
- if (blocker.isReleasable())
- return;
- if ((q = ws[i]) != null && q.base - q.top < 0) {
- p.signalWork(q);
- if ((u = (int)(p.ctl >>> 32)) >= 0 ||
- (u >> UAC_SHIFT) >= 0)
- break;
- }
- }
- }
- if (p.tryCompensate()) {
- try {
- do {} while (!blocker.isReleasable() &&
- !blocker.block());
- } finally {
- p.incrementActiveCount();
- }
- break;
- }
- }
- }
- else {
- do {} while (!blocker.isReleasable() &&
- !blocker.block());
- }
- }
-
- // AbstractExecutorService overrides. These rely on undocumented
- // fact that ForkJoinTask.adapt returns ForkJoinTasks that also
- // implement RunnableFuture.
-
- protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) {
- return new ForkJoinTask.AdaptedRunnable<T>(runnable, value);
- }
-
- protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) {
- return new ForkJoinTask.AdaptedCallable<T>(callable);
- }
-
- // Unsafe mechanics
- private static final sun.misc.Unsafe U;
- private static final long CTL;
- private static final long PARKBLOCKER;
- private static final int ABASE;
- private static final int ASHIFT;
- private static final long STEALCOUNT;
- private static final long PLOCK;
- private static final long INDEXSEED;
- private static final long QLOCK;
-
- static {
- // initialize field offsets for CAS etc
- try {
- U = getUnsafe();
- Class<?> k = ForkJoinPool.class;
- CTL = U.objectFieldOffset
- (k.getDeclaredField("ctl"));
- STEALCOUNT = U.objectFieldOffset
- (k.getDeclaredField("stealCount"));
- PLOCK = U.objectFieldOffset
- (k.getDeclaredField("plock"));
- INDEXSEED = U.objectFieldOffset
- (k.getDeclaredField("indexSeed"));
- Class<?> tk = Thread.class;
- PARKBLOCKER = U.objectFieldOffset
- (tk.getDeclaredField("parkBlocker"));
- Class<?> wk = WorkQueue.class;
- QLOCK = U.objectFieldOffset
- (wk.getDeclaredField("qlock"));
- Class<?> ak = ForkJoinTask[].class;
- ABASE = U.arrayBaseOffset(ak);
- int scale = U.arrayIndexScale(ak);
- if ((scale & (scale - 1)) != 0)
- throw new Error("data type scale not a power of two");
- ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
- } catch (Exception e) {
- throw new Error(e);
- }
-
- submitters = new ThreadLocal<Submitter>();
- ForkJoinWorkerThreadFactory fac = defaultForkJoinWorkerThreadFactory =
- new DefaultForkJoinWorkerThreadFactory();
- modifyThreadPermission = new RuntimePermission("modifyThread");
-
- /*
- * Establish common pool parameters. For extra caution,
- * computations to set up common pool state are here; the
- * constructor just assigns these values to fields.
- */
-
- int par = 0;
- Thread.UncaughtExceptionHandler handler = null;
- try { // TBD: limit or report ignored exceptions?
- String pp = System.getProperty
- ("java.util.concurrent.ForkJoinPool.common.parallelism");
- String hp = System.getProperty
- ("java.util.concurrent.ForkJoinPool.common.exceptionHandler");
- String fp = System.getProperty
- ("java.util.concurrent.ForkJoinPool.common.threadFactory");
- if (fp != null)
- fac = ((ForkJoinWorkerThreadFactory)ClassLoader.
- getSystemClassLoader().loadClass(fp).newInstance());
- if (hp != null)
- handler = ((Thread.UncaughtExceptionHandler)ClassLoader.
- getSystemClassLoader().loadClass(hp).newInstance());
- if (pp != null)
- par = Integer.parseInt(pp);
- } catch (Exception ignore) {
- }
-
- if (par <= 0)
- par = Runtime.getRuntime().availableProcessors();
- if (par > MAX_CAP)
- par = MAX_CAP;
- commonParallelism = par;
- long np = (long)(-par); // precompute initial ctl value
- long ct = ((np << AC_SHIFT) & AC_MASK) | ((np << TC_SHIFT) & TC_MASK);
-
- common = new ForkJoinPool(par, ct, fac, handler);
- }
-
- /**
- * Returns a sun.misc.Unsafe. Suitable for use in a 3rd party package.
- * Replace with a simple call to Unsafe.getUnsafe when integrating
- * into a jdk.
- *
- * @return a sun.misc.Unsafe
- */
- private static sun.misc.Unsafe getUnsafe() {
- return scala.concurrent.util.Unsafe.instance;
- }
-}
diff --git a/src/forkjoin/scala/concurrent/forkjoin/ForkJoinTask.java b/src/forkjoin/scala/concurrent/forkjoin/ForkJoinTask.java
deleted file mode 100644
index fd1e132b07..0000000000
--- a/src/forkjoin/scala/concurrent/forkjoin/ForkJoinTask.java
+++ /dev/null
@@ -1,1488 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-package scala.concurrent.forkjoin;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.List;
-import java.util.RandomAccess;
-import java.lang.ref.WeakReference;
-import java.lang.ref.ReferenceQueue;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.RunnableFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.locks.ReentrantLock;
-import java.lang.reflect.Constructor;
-
-/**
- * Abstract base class for tasks that run within a {@link ForkJoinPool}.
- * A {@code ForkJoinTask} is a thread-like entity that is much
- * lighter weight than a normal thread. Huge numbers of tasks and
- * subtasks may be hosted by a small number of actual threads in a
- * ForkJoinPool, at the price of some usage limitations.
- *
- * <p>A "main" {@code ForkJoinTask} begins execution when it is
- * explicitly submitted to a {@link ForkJoinPool}, or, if not already
- * engaged in a ForkJoin computation, commenced in the {@link
- * ForkJoinPool#commonPool()} via {@link #fork}, {@link #invoke}, or
- * related methods. Once started, it will usually in turn start other
- * subtasks. As indicated by the name of this class, many programs
- * using {@code ForkJoinTask} employ only methods {@link #fork} and
- * {@link #join}, or derivatives such as {@link
- * #invokeAll(ForkJoinTask...) invokeAll}. However, this class also
- * provides a number of other methods that can come into play in
- * advanced usages, as well as extension mechanics that allow support
- * of new forms of fork/join processing.
- *
- * <p>A {@code ForkJoinTask} is a lightweight form of {@link Future}.
- * The efficiency of {@code ForkJoinTask}s stems from a set of
- * restrictions (that are only partially statically enforceable)
- * reflecting their main use as computational tasks calculating pure
- * functions or operating on purely isolated objects. The primary
- * coordination mechanisms are {@link #fork}, that arranges
- * asynchronous execution, and {@link #join}, that doesn't proceed
- * until the task's result has been computed. Computations should
- * ideally avoid {@code synchronized} methods or blocks, and should
- * minimize other blocking synchronization apart from joining other
- * tasks or using synchronizers such as Phasers that are advertised to
- * cooperate with fork/join scheduling. Subdividable tasks should also
- * not perform blocking I/O, and should ideally access variables that
- * are completely independent of those accessed by other running
- * tasks. These guidelines are loosely enforced by not permitting
- * checked exceptions such as {@code IOExceptions} to be
- * thrown. However, computations may still encounter unchecked
- * exceptions, that are rethrown to callers attempting to join
- * them. These exceptions may additionally include {@link
- * RejectedExecutionException} stemming from internal resource
- * exhaustion, such as failure to allocate internal task
- * queues. Rethrown exceptions behave in the same way as regular
- * exceptions, but, when possible, contain stack traces (as displayed
- * for example using {@code ex.printStackTrace()}) of both the thread
- * that initiated the computation as well as the thread actually
- * encountering the exception; minimally only the latter.
- *
- * <p>It is possible to define and use ForkJoinTasks that may block,
- * but doing do requires three further considerations: (1) Completion
- * of few if any <em>other</em> tasks should be dependent on a task
- * that blocks on external synchronization or I/O. Event-style async
- * tasks that are never joined (for example, those subclassing {@link
- * CountedCompleter}) often fall into this category. (2) To minimize
- * resource impact, tasks should be small; ideally performing only the
- * (possibly) blocking action. (3) Unless the {@link
- * ForkJoinPool.ManagedBlocker} API is used, or the number of possibly
- * blocked tasks is known to be less than the pool's {@link
- * ForkJoinPool#getParallelism} level, the pool cannot guarantee that
- * enough threads will be available to ensure progress or good
- * performance.
- *
- * <p>The primary method for awaiting completion and extracting
- * results of a task is {@link #join}, but there are several variants:
- * The {@link Future#get} methods support interruptible and/or timed
- * waits for completion and report results using {@code Future}
- * conventions. Method {@link #invoke} is semantically
- * equivalent to {@code fork(); join()} but always attempts to begin
- * execution in the current thread. The "<em>quiet</em>" forms of
- * these methods do not extract results or report exceptions. These
- * may be useful when a set of tasks are being executed, and you need
- * to delay processing of results or exceptions until all complete.
- * Method {@code invokeAll} (available in multiple versions)
- * performs the most common form of parallel invocation: forking a set
- * of tasks and joining them all.
- *
- * <p>In the most typical usages, a fork-join pair act like a call
- * (fork) and return (join) from a parallel recursive function. As is
- * the case with other forms of recursive calls, returns (joins)
- * should be performed innermost-first. For example, {@code a.fork();
- * b.fork(); b.join(); a.join();} is likely to be substantially more
- * efficient than joining {@code a} before {@code b}.
- *
- * <p>The execution status of tasks may be queried at several levels
- * of detail: {@link #isDone} is true if a task completed in any way
- * (including the case where a task was cancelled without executing);
- * {@link #isCompletedNormally} is true if a task completed without
- * cancellation or encountering an exception; {@link #isCancelled} is
- * true if the task was cancelled (in which case {@link #getException}
- * returns a {@link java.util.concurrent.CancellationException}); and
- * {@link #isCompletedAbnormally} is true if a task was either
- * cancelled or encountered an exception, in which case {@link
- * #getException} will return either the encountered exception or
- * {@link java.util.concurrent.CancellationException}.
- *
- * <p>The ForkJoinTask class is not usually directly subclassed.
- * Instead, you subclass one of the abstract classes that support a
- * particular style of fork/join processing, typically {@link
- * RecursiveAction} for most computations that do not return results,
- * {@link RecursiveTask} for those that do, and {@link
- * CountedCompleter} for those in which completed actions trigger
- * other actions. Normally, a concrete ForkJoinTask subclass declares
- * fields comprising its parameters, established in a constructor, and
- * then defines a {@code compute} method that somehow uses the control
- * methods supplied by this base class.
- *
- * <p>Method {@link #join} and its variants are appropriate for use
- * only when completion dependencies are acyclic; that is, the
- * parallel computation can be described as a directed acyclic graph
- * (DAG). Otherwise, executions may encounter a form of deadlock as
- * tasks cyclically wait for each other. However, this framework
- * supports other methods and techniques (for example the use of
- * {@link Phaser}, {@link #helpQuiesce}, and {@link #complete}) that
- * may be of use in constructing custom subclasses for problems that
- * are not statically structured as DAGs. To support such usages a
- * ForkJoinTask may be atomically <em>tagged</em> with a {@code short}
- * value using {@link #setForkJoinTaskTag} or {@link
- * #compareAndSetForkJoinTaskTag} and checked using {@link
- * #getForkJoinTaskTag}. The ForkJoinTask implementation does not use
- * these {@code protected} methods or tags for any purpose, but they
- * may be of use in the construction of specialized subclasses. For
- * example, parallel graph traversals can use the supplied methods to
- * avoid revisiting nodes/tasks that have already been processed.
- * (Method names for tagging are bulky in part to encourage definition
- * of methods that reflect their usage patterns.)
- *
- * <p>Most base support methods are {@code final}, to prevent
- * overriding of implementations that are intrinsically tied to the
- * underlying lightweight task scheduling framework. Developers
- * creating new basic styles of fork/join processing should minimally
- * implement {@code protected} methods {@link #exec}, {@link
- * #setRawResult}, and {@link #getRawResult}, while also introducing
- * an abstract computational method that can be implemented in its
- * subclasses, possibly relying on other {@code protected} methods
- * provided by this class.
- *
- * <p>ForkJoinTasks should perform relatively small amounts of
- * computation. Large tasks should be split into smaller subtasks,
- * usually via recursive decomposition. As a very rough rule of thumb,
- * a task should perform more than 100 and less than 10000 basic
- * computational steps, and should avoid indefinite looping. If tasks
- * are too big, then parallelism cannot improve throughput. If too
- * small, then memory and internal task maintenance overhead may
- * overwhelm processing.
- *
- * <p>This class provides {@code adapt} methods for {@link Runnable}
- * and {@link Callable}, that may be of use when mixing execution of
- * {@code ForkJoinTasks} with other kinds of tasks. When all tasks are
- * of this form, consider using a pool constructed in <em>asyncMode</em>.
- *
- * <p>ForkJoinTasks are {@code Serializable}, which enables them to be
- * used in extensions such as remote execution frameworks. It is
- * sensible to serialize tasks only before or after, but not during,
- * execution. Serialization is not relied on during execution itself.
- *
- * @since 1.7
- * @author Doug Lea
- */
-public abstract class ForkJoinTask<V> implements Future<V>, Serializable {
-
- /*
- * See the internal documentation of class ForkJoinPool for a
- * general implementation overview. ForkJoinTasks are mainly
- * responsible for maintaining their "status" field amidst relays
- * to methods in ForkJoinWorkerThread and ForkJoinPool.
- *
- * The methods of this class are more-or-less layered into
- * (1) basic status maintenance
- * (2) execution and awaiting completion
- * (3) user-level methods that additionally report results.
- * This is sometimes hard to see because this file orders exported
- * methods in a way that flows well in javadocs.
- */
-
- /*
- * The status field holds run control status bits packed into a
- * single int to minimize footprint and to ensure atomicity (via
- * CAS). Status is initially zero, and takes on nonnegative
- * values until completed, upon which status (anded with
- * DONE_MASK) holds value NORMAL, CANCELLED, or EXCEPTIONAL. Tasks
- * undergoing blocking waits by other threads have the SIGNAL bit
- * set. Completion of a stolen task with SIGNAL set awakens any
- * waiters via notifyAll. Even though suboptimal for some
- * purposes, we use basic builtin wait/notify to take advantage of
- * "monitor inflation" in JVMs that we would otherwise need to
- * emulate to avoid adding further per-task bookkeeping overhead.
- * We want these monitors to be "fat", i.e., not use biasing or
- * thin-lock techniques, so use some odd coding idioms that tend
- * to avoid them, mainly by arranging that every synchronized
- * block performs a wait, notifyAll or both.
- *
- * These control bits occupy only (some of) the upper half (16
- * bits) of status field. The lower bits are used for user-defined
- * tags.
- */
-
- /** The run status of this task */
- volatile int status; // accessed directly by pool and workers
- static final int DONE_MASK = 0xf0000000; // mask out non-completion bits
- static final int NORMAL = 0xf0000000; // must be negative
- static final int CANCELLED = 0xc0000000; // must be < NORMAL
- static final int EXCEPTIONAL = 0x80000000; // must be < CANCELLED
- static final int SIGNAL = 0x00010000; // must be >= 1 << 16
- static final int SMASK = 0x0000ffff; // short bits for tags
-
- /**
- * Marks completion and wakes up threads waiting to join this
- * task.
- *
- * @param completion one of NORMAL, CANCELLED, EXCEPTIONAL
- * @return completion status on exit
- */
- private int setCompletion(int completion) {
- for (int s;;) {
- if ((s = status) < 0)
- return s;
- if (U.compareAndSwapInt(this, STATUS, s, s | completion)) {
- if ((s >>> 16) != 0)
- synchronized (this) { notifyAll(); }
- return completion;
- }
- }
- }
-
- /**
- * Primary execution method for stolen tasks. Unless done, calls
- * exec and records status if completed, but doesn't wait for
- * completion otherwise.
- *
- * @return status on exit from this method
- */
- final int doExec() {
- int s; boolean completed;
- if ((s = status) >= 0) {
- try {
- completed = exec();
- } catch (Throwable rex) {
- return setExceptionalCompletion(rex);
- }
- if (completed)
- s = setCompletion(NORMAL);
- }
- return s;
- }
-
- /**
- * Tries to set SIGNAL status unless already completed. Used by
- * ForkJoinPool. Other variants are directly incorporated into
- * externalAwaitDone etc.
- *
- * @return true if successful
- */
- final boolean trySetSignal() {
- int s = status;
- return s >= 0 && U.compareAndSwapInt(this, STATUS, s, s | SIGNAL);
- }
-
- /**
- * Blocks a non-worker-thread until completion.
- * @return status upon completion
- */
- private int externalAwaitDone() {
- int s;
- ForkJoinPool.externalHelpJoin(this);
- boolean interrupted = false;
- while ((s = status) >= 0) {
- if (U.compareAndSwapInt(this, STATUS, s, s | SIGNAL)) {
- synchronized (this) {
- if (status >= 0) {
- try {
- wait();
- } catch (InterruptedException ie) {
- interrupted = true;
- }
- }
- else
- notifyAll();
- }
- }
- }
- if (interrupted)
- Thread.currentThread().interrupt();
- return s;
- }
-
- /**
- * Blocks a non-worker-thread until completion or interruption.
- */
- private int externalInterruptibleAwaitDone() throws InterruptedException {
- int s;
- if (Thread.interrupted())
- throw new InterruptedException();
- ForkJoinPool.externalHelpJoin(this);
- while ((s = status) >= 0) {
- if (U.compareAndSwapInt(this, STATUS, s, s | SIGNAL)) {
- synchronized (this) {
- if (status >= 0)
- wait();
- else
- notifyAll();
- }
- }
- }
- return s;
- }
-
-
- /**
- * Implementation for join, get, quietlyJoin. Directly handles
- * only cases of already-completed, external wait, and
- * unfork+exec. Others are relayed to ForkJoinPool.awaitJoin.
- *
- * @return status upon completion
- */
- private int doJoin() {
- int s; Thread t; ForkJoinWorkerThread wt; ForkJoinPool.WorkQueue w;
- return (s = status) < 0 ? s :
- ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) ?
- (w = (wt = (ForkJoinWorkerThread)t).workQueue).
- tryUnpush(this) && (s = doExec()) < 0 ? s :
- wt.pool.awaitJoin(w, this) :
- externalAwaitDone();
- }
-
- /**
- * Implementation for invoke, quietlyInvoke.
- *
- * @return status upon completion
- */
- private int doInvoke() {
- int s; Thread t; ForkJoinWorkerThread wt;
- return (s = doExec()) < 0 ? s :
- ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) ?
- (wt = (ForkJoinWorkerThread)t).pool.awaitJoin(wt.workQueue, this) :
- externalAwaitDone();
- }
-
- // Exception table support
-
- /**
- * Table of exceptions thrown by tasks, to enable reporting by
- * callers. Because exceptions are rare, we don't directly keep
- * them with task objects, but instead use a weak ref table. Note
- * that cancellation exceptions don't appear in the table, but are
- * instead recorded as status values.
- *
- * Note: These statics are initialized below in static block.
- */
- private static final ExceptionNode[] exceptionTable;
- private static final ReentrantLock exceptionTableLock;
- private static final ReferenceQueue<Object> exceptionTableRefQueue;
-
- /**
- * Fixed capacity for exceptionTable.
- */
- private static final int EXCEPTION_MAP_CAPACITY = 32;
-
- /**
- * Key-value nodes for exception table. The chained hash table
- * uses identity comparisons, full locking, and weak references
- * for keys. The table has a fixed capacity because it only
- * maintains task exceptions long enough for joiners to access
- * them, so should never become very large for sustained
- * periods. However, since we do not know when the last joiner
- * completes, we must use weak references and expunge them. We do
- * so on each operation (hence full locking). Also, some thread in
- * any ForkJoinPool will call helpExpungeStaleExceptions when its
- * pool becomes isQuiescent.
- */
- static final class ExceptionNode extends WeakReference<ForkJoinTask<?>> {
- final Throwable ex;
- ExceptionNode next;
- final long thrower; // use id not ref to avoid weak cycles
- ExceptionNode(ForkJoinTask<?> task, Throwable ex, ExceptionNode next) {
- super(task, exceptionTableRefQueue);
- this.ex = ex;
- this.next = next;
- this.thrower = Thread.currentThread().getId();
- }
- }
-
- /**
- * Records exception and sets status.
- *
- * @return status on exit
- */
- final int recordExceptionalCompletion(Throwable ex) {
- int s;
- if ((s = status) >= 0) {
- int h = System.identityHashCode(this);
- final ReentrantLock lock = exceptionTableLock;
- lock.lock();
- try {
- expungeStaleExceptions();
- ExceptionNode[] t = exceptionTable;
- int i = h & (t.length - 1);
- for (ExceptionNode e = t[i]; ; e = e.next) {
- if (e == null) {
- t[i] = new ExceptionNode(this, ex, t[i]);
- break;
- }
- if (e.get() == this) // already present
- break;
- }
- } finally {
- lock.unlock();
- }
- s = setCompletion(EXCEPTIONAL);
- }
- return s;
- }
-
- /**
- * Records exception and possibly propagates.
- *
- * @return status on exit
- */
- private int setExceptionalCompletion(Throwable ex) {
- int s = recordExceptionalCompletion(ex);
- if ((s & DONE_MASK) == EXCEPTIONAL)
- internalPropagateException(ex);
- return s;
- }
-
- /**
- * Hook for exception propagation support for tasks with completers.
- */
- void internalPropagateException(Throwable ex) {
- }
-
- /**
- * Cancels, ignoring any exceptions thrown by cancel. Used during
- * worker and pool shutdown. Cancel is spec'ed not to throw any
- * exceptions, but if it does anyway, we have no recourse during
- * shutdown, so guard against this case.
- */
- static final void cancelIgnoringExceptions(ForkJoinTask<?> t) {
- if (t != null && t.status >= 0) {
- try {
- t.cancel(false);
- } catch (Throwable ignore) {
- }
- }
- }
-
- /**
- * Removes exception node and clears status.
- */
- private void clearExceptionalCompletion() {
- int h = System.identityHashCode(this);
- final ReentrantLock lock = exceptionTableLock;
- lock.lock();
- try {
- ExceptionNode[] t = exceptionTable;
- int i = h & (t.length - 1);
- ExceptionNode e = t[i];
- ExceptionNode pred = null;
- while (e != null) {
- ExceptionNode next = e.next;
- if (e.get() == this) {
- if (pred == null)
- t[i] = next;
- else
- pred.next = next;
- break;
- }
- pred = e;
- e = next;
- }
- expungeStaleExceptions();
- status = 0;
- } finally {
- lock.unlock();
- }
- }
-
- /**
- * Returns a rethrowable exception for the given task, if
- * available. To provide accurate stack traces, if the exception
- * was not thrown by the current thread, we try to create a new
- * exception of the same type as the one thrown, but with the
- * recorded exception as its cause. If there is no such
- * constructor, we instead try to use a no-arg constructor,
- * followed by initCause, to the same effect. If none of these
- * apply, or any fail due to other exceptions, we return the
- * recorded exception, which is still correct, although it may
- * contain a misleading stack trace.
- *
- * @return the exception, or null if none
- */
- private Throwable getThrowableException() {
- if ((status & DONE_MASK) != EXCEPTIONAL)
- return null;
- int h = System.identityHashCode(this);
- ExceptionNode e;
- final ReentrantLock lock = exceptionTableLock;
- lock.lock();
- try {
- expungeStaleExceptions();
- ExceptionNode[] t = exceptionTable;
- e = t[h & (t.length - 1)];
- while (e != null && e.get() != this)
- e = e.next;
- } finally {
- lock.unlock();
- }
- Throwable ex;
- if (e == null || (ex = e.ex) == null)
- return null;
- if (false && e.thrower != Thread.currentThread().getId()) {
- Class<? extends Throwable> ec = ex.getClass();
- try {
- Constructor<?> noArgCtor = null;
- Constructor<?>[] cs = ec.getConstructors();// public ctors only
- for (int i = 0; i < cs.length; ++i) {
- Constructor<?> c = cs[i];
- Class<?>[] ps = c.getParameterTypes();
- if (ps.length == 0)
- noArgCtor = c;
- else if (ps.length == 1 && ps[0] == Throwable.class)
- return (Throwable)(c.newInstance(ex));
- }
- if (noArgCtor != null) {
- Throwable wx = (Throwable)(noArgCtor.newInstance());
- wx.initCause(ex);
- return wx;
- }
- } catch (Exception ignore) {
- }
- }
- return ex;
- }
-
- /**
- * Poll stale refs and remove them. Call only while holding lock.
- */
- private static void expungeStaleExceptions() {
- for (Object x; (x = exceptionTableRefQueue.poll()) != null;) {
- if (x instanceof ExceptionNode) {
- ForkJoinTask<?> key = ((ExceptionNode)x).get();
- ExceptionNode[] t = exceptionTable;
- int i = System.identityHashCode(key) & (t.length - 1);
- ExceptionNode e = t[i];
- ExceptionNode pred = null;
- while (e != null) {
- ExceptionNode next = e.next;
- if (e == x) {
- if (pred == null)
- t[i] = next;
- else
- pred.next = next;
- break;
- }
- pred = e;
- e = next;
- }
- }
- }
- }
-
- /**
- * If lock is available, poll stale refs and remove them.
- * Called from ForkJoinPool when pools become quiescent.
- */
- static final void helpExpungeStaleExceptions() {
- final ReentrantLock lock = exceptionTableLock;
- if (lock.tryLock()) {
- try {
- expungeStaleExceptions();
- } finally {
- lock.unlock();
- }
- }
- }
-
- /**
- * A version of "sneaky throw" to relay exceptions
- */
- static void rethrow(final Throwable ex) {
- if (ex != null) {
- if (ex instanceof Error)
- throw (Error)ex;
- if (ex instanceof RuntimeException)
- throw (RuntimeException)ex;
- ForkJoinTask.<RuntimeException>uncheckedThrow(ex);
- }
- }
-
- /**
- * The sneaky part of sneaky throw, relying on generics
- * limitations to evade compiler complaints about rethrowing
- * unchecked exceptions
- */
- @SuppressWarnings("unchecked") static <T extends Throwable>
- void uncheckedThrow(Throwable t) throws T {
- if (t != null)
- throw (T)t; // rely on vacuous cast
- }
-
- /**
- * Throws exception, if any, associated with the given status.
- */
- private void reportException(int s) {
- if (s == CANCELLED)
- throw new CancellationException();
- if (s == EXCEPTIONAL)
- rethrow(getThrowableException());
- }
-
- // public methods
-
- /**
- * Arranges to asynchronously execute this task in the pool the
- * current task is running in, if applicable, or using the {@link
- * ForkJoinPool#commonPool()} if not {@link #inForkJoinPool}. While
- * it is not necessarily enforced, it is a usage error to fork a
- * task more than once unless it has completed and been
- * reinitialized. Subsequent modifications to the state of this
- * task or any data it operates on are not necessarily
- * consistently observable by any thread other than the one
- * executing it unless preceded by a call to {@link #join} or
- * related methods, or a call to {@link #isDone} returning {@code
- * true}.
- *
- * @return {@code this}, to simplify usage
- */
- public final ForkJoinTask<V> fork() {
- Thread t;
- if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)
- ((ForkJoinWorkerThread)t).workQueue.push(this);
- else
- ForkJoinPool.common.externalPush(this);
- return this;
- }
-
- /**
- * Returns the result of the computation when it {@link #isDone is
- * done}. This method differs from {@link #get()} in that
- * abnormal completion results in {@code RuntimeException} or
- * {@code Error}, not {@code ExecutionException}, and that
- * interrupts of the calling thread do <em>not</em> cause the
- * method to abruptly return by throwing {@code
- * InterruptedException}.
- *
- * @return the computed result
- */
- public final V join() {
- int s;
- if ((s = doJoin() & DONE_MASK) != NORMAL)
- reportException(s);
- return getRawResult();
- }
-
- /**
- * Commences performing this task, awaits its completion if
- * necessary, and returns its result, or throws an (unchecked)
- * {@code RuntimeException} or {@code Error} if the underlying
- * computation did so.
- *
- * @return the computed result
- */
- public final V invoke() {
- int s;
- if ((s = doInvoke() & DONE_MASK) != NORMAL)
- reportException(s);
- return getRawResult();
- }
-
- /**
- * Forks the given tasks, returning when {@code isDone} holds for
- * each task or an (unchecked) exception is encountered, in which
- * case the exception is rethrown. If more than one task
- * encounters an exception, then this method throws any one of
- * these exceptions. If any task encounters an exception, the
- * other may be cancelled. However, the execution status of
- * individual tasks is not guaranteed upon exceptional return. The
- * status of each task may be obtained using {@link
- * #getException()} and related methods to check if they have been
- * cancelled, completed normally or exceptionally, or left
- * unprocessed.
- *
- * @param t1 the first task
- * @param t2 the second task
- * @throws NullPointerException if any task is null
- */
- public static void invokeAll(ForkJoinTask<?> t1, ForkJoinTask<?> t2) {
- int s1, s2;
- t2.fork();
- if ((s1 = t1.doInvoke() & DONE_MASK) != NORMAL)
- t1.reportException(s1);
- if ((s2 = t2.doJoin() & DONE_MASK) != NORMAL)
- t2.reportException(s2);
- }
-
- /**
- * Forks the given tasks, returning when {@code isDone} holds for
- * each task or an (unchecked) exception is encountered, in which
- * case the exception is rethrown. If more than one task
- * encounters an exception, then this method throws any one of
- * these exceptions. If any task encounters an exception, others
- * may be cancelled. However, the execution status of individual
- * tasks is not guaranteed upon exceptional return. The status of
- * each task may be obtained using {@link #getException()} and
- * related methods to check if they have been cancelled, completed
- * normally or exceptionally, or left unprocessed.
- *
- * @param tasks the tasks
- * @throws NullPointerException if any task is null
- */
- public static void invokeAll(ForkJoinTask<?>... tasks) {
- Throwable ex = null;
- int last = tasks.length - 1;
- for (int i = last; i >= 0; --i) {
- ForkJoinTask<?> t = tasks[i];
- if (t == null) {
- if (ex == null)
- ex = new NullPointerException();
- }
- else if (i != 0)
- t.fork();
- else if (t.doInvoke() < NORMAL && ex == null)
- ex = t.getException();
- }
- for (int i = 1; i <= last; ++i) {
- ForkJoinTask<?> t = tasks[i];
- if (t != null) {
- if (ex != null)
- t.cancel(false);
- else if (t.doJoin() < NORMAL)
- ex = t.getException();
- }
- }
- if (ex != null)
- rethrow(ex);
- }
-
- /**
- * Forks all tasks in the specified collection, returning when
- * {@code isDone} holds for each task or an (unchecked) exception
- * is encountered, in which case the exception is rethrown. If
- * more than one task encounters an exception, then this method
- * throws any one of these exceptions. If any task encounters an
- * exception, others may be cancelled. However, the execution
- * status of individual tasks is not guaranteed upon exceptional
- * return. The status of each task may be obtained using {@link
- * #getException()} and related methods to check if they have been
- * cancelled, completed normally or exceptionally, or left
- * unprocessed.
- *
- * @param tasks the collection of tasks
- * @return the tasks argument, to simplify usage
- * @throws NullPointerException if tasks or any element are null
- */
- public static <T extends ForkJoinTask<?>> Collection<T> invokeAll(Collection<T> tasks) {
- if (!(tasks instanceof RandomAccess) || !(tasks instanceof List<?>)) {
- invokeAll(tasks.toArray(new ForkJoinTask<?>[tasks.size()]));
- return tasks;
- }
- @SuppressWarnings("unchecked")
- List<? extends ForkJoinTask<?>> ts =
- (List<? extends ForkJoinTask<?>>) tasks;
- Throwable ex = null;
- int last = ts.size() - 1;
- for (int i = last; i >= 0; --i) {
- ForkJoinTask<?> t = ts.get(i);
- if (t == null) {
- if (ex == null)
- ex = new NullPointerException();
- }
- else if (i != 0)
- t.fork();
- else if (t.doInvoke() < NORMAL && ex == null)
- ex = t.getException();
- }
- for (int i = 1; i <= last; ++i) {
- ForkJoinTask<?> t = ts.get(i);
- if (t != null) {
- if (ex != null)
- t.cancel(false);
- else if (t.doJoin() < NORMAL)
- ex = t.getException();
- }
- }
- if (ex != null)
- rethrow(ex);
- return tasks;
- }
-
- /**
- * Attempts to cancel execution of this task. This attempt will
- * fail if the task has already completed or could not be
- * cancelled for some other reason. If successful, and this task
- * has not started when {@code cancel} is called, execution of
- * this task is suppressed. After this method returns
- * successfully, unless there is an intervening call to {@link
- * #reinitialize}, subsequent calls to {@link #isCancelled},
- * {@link #isDone}, and {@code cancel} will return {@code true}
- * and calls to {@link #join} and related methods will result in
- * {@code CancellationException}.
- *
- * <p>This method may be overridden in subclasses, but if so, must
- * still ensure that these properties hold. In particular, the
- * {@code cancel} method itself must not throw exceptions.
- *
- * <p>This method is designed to be invoked by <em>other</em>
- * tasks. To terminate the current task, you can just return or
- * throw an unchecked exception from its computation method, or
- * invoke {@link #completeExceptionally}.
- *
- * @param mayInterruptIfRunning this value has no effect in the
- * default implementation because interrupts are not used to
- * control cancellation.
- *
- * @return {@code true} if this task is now cancelled
- */
- public boolean cancel(boolean mayInterruptIfRunning) {
- return (setCompletion(CANCELLED) & DONE_MASK) == CANCELLED;
- }
-
- public final boolean isDone() {
- return status < 0;
- }
-
- public final boolean isCancelled() {
- return (status & DONE_MASK) == CANCELLED;
- }
-
- /**
- * Returns {@code true} if this task threw an exception or was cancelled.
- *
- * @return {@code true} if this task threw an exception or was cancelled
- */
- public final boolean isCompletedAbnormally() {
- return status < NORMAL;
- }
-
- /**
- * Returns {@code true} if this task completed without throwing an
- * exception and was not cancelled.
- *
- * @return {@code true} if this task completed without throwing an
- * exception and was not cancelled
- */
- public final boolean isCompletedNormally() {
- return (status & DONE_MASK) == NORMAL;
- }
-
- /**
- * Returns the exception thrown by the base computation, or a
- * {@code CancellationException} if cancelled, or {@code null} if
- * none or if the method has not yet completed.
- *
- * @return the exception, or {@code null} if none
- */
- public final Throwable getException() {
- int s = status & DONE_MASK;
- return ((s >= NORMAL) ? null :
- (s == CANCELLED) ? new CancellationException() :
- getThrowableException());
- }
-
- /**
- * Completes this task abnormally, and if not already aborted or
- * cancelled, causes it to throw the given exception upon
- * {@code join} and related operations. This method may be used
- * to induce exceptions in asynchronous tasks, or to force
- * completion of tasks that would not otherwise complete. Its use
- * in other situations is discouraged. This method is
- * overridable, but overridden versions must invoke {@code super}
- * implementation to maintain guarantees.
- *
- * @param ex the exception to throw. If this exception is not a
- * {@code RuntimeException} or {@code Error}, the actual exception
- * thrown will be a {@code RuntimeException} with cause {@code ex}.
- */
- public void completeExceptionally(Throwable ex) {
- setExceptionalCompletion((ex instanceof RuntimeException) ||
- (ex instanceof Error) ? ex :
- new RuntimeException(ex));
- }
-
- /**
- * Completes this task, and if not already aborted or cancelled,
- * returning the given value as the result of subsequent
- * invocations of {@code join} and related operations. This method
- * may be used to provide results for asynchronous tasks, or to
- * provide alternative handling for tasks that would not otherwise
- * complete normally. Its use in other situations is
- * discouraged. This method is overridable, but overridden
- * versions must invoke {@code super} implementation to maintain
- * guarantees.
- *
- * @param value the result value for this task
- */
- public void complete(V value) {
- try {
- setRawResult(value);
- } catch (Throwable rex) {
- setExceptionalCompletion(rex);
- return;
- }
- setCompletion(NORMAL);
- }
-
- /**
- * Completes this task normally without setting a value. The most
- * recent value established by {@link #setRawResult} (or {@code
- * null} by default) will be returned as the result of subsequent
- * invocations of {@code join} and related operations.
- *
- * @since 1.8
- */
- public final void quietlyComplete() {
- setCompletion(NORMAL);
- }
-
- /**
- * Waits if necessary for the computation to complete, and then
- * retrieves its result.
- *
- * @return the computed result
- * @throws CancellationException if the computation was cancelled
- * @throws ExecutionException if the computation threw an
- * exception
- * @throws InterruptedException if the current thread is not a
- * member of a ForkJoinPool and was interrupted while waiting
- */
- public final V get() throws InterruptedException, ExecutionException {
- int s = (Thread.currentThread() instanceof ForkJoinWorkerThread) ?
- doJoin() : externalInterruptibleAwaitDone();
- Throwable ex;
- if ((s &= DONE_MASK) == CANCELLED)
- throw new CancellationException();
- if (s == EXCEPTIONAL && (ex = getThrowableException()) != null)
- throw new ExecutionException(ex);
- return getRawResult();
- }
-
- /**
- * Waits if necessary for at most the given time for the computation
- * to complete, and then retrieves its result, if available.
- *
- * @param timeout the maximum time to wait
- * @param unit the time unit of the timeout argument
- * @return the computed result
- * @throws CancellationException if the computation was cancelled
- * @throws ExecutionException if the computation threw an
- * exception
- * @throws InterruptedException if the current thread is not a
- * member of a ForkJoinPool and was interrupted while waiting
- * @throws TimeoutException if the wait timed out
- */
- public final V get(long timeout, TimeUnit unit)
- throws InterruptedException, ExecutionException, TimeoutException {
- if (Thread.interrupted())
- throw new InterruptedException();
- // Messy in part because we measure in nanosecs, but wait in millisecs
- int s; long ms;
- long ns = unit.toNanos(timeout);
- if ((s = status) >= 0 && ns > 0L) {
- long deadline = System.nanoTime() + ns;
- ForkJoinPool p = null;
- ForkJoinPool.WorkQueue w = null;
- Thread t = Thread.currentThread();
- if (t instanceof ForkJoinWorkerThread) {
- ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
- p = wt.pool;
- w = wt.workQueue;
- p.helpJoinOnce(w, this); // no retries on failure
- }
- else
- ForkJoinPool.externalHelpJoin(this);
- boolean canBlock = false;
- boolean interrupted = false;
- try {
- while ((s = status) >= 0) {
- if (w != null && w.qlock < 0)
- cancelIgnoringExceptions(this);
- else if (!canBlock) {
- if (p == null || p.tryCompensate())
- canBlock = true;
- }
- else {
- if ((ms = TimeUnit.NANOSECONDS.toMillis(ns)) > 0L &&
- U.compareAndSwapInt(this, STATUS, s, s | SIGNAL)) {
- synchronized (this) {
- if (status >= 0) {
- try {
- wait(ms);
- } catch (InterruptedException ie) {
- if (p == null)
- interrupted = true;
- }
- }
- else
- notifyAll();
- }
- }
- if ((s = status) < 0 || interrupted ||
- (ns = deadline - System.nanoTime()) <= 0L)
- break;
- }
- }
- } finally {
- if (p != null && canBlock)
- p.incrementActiveCount();
- }
- if (interrupted)
- throw new InterruptedException();
- }
- if ((s &= DONE_MASK) != NORMAL) {
- Throwable ex;
- if (s == CANCELLED)
- throw new CancellationException();
- if (s != EXCEPTIONAL)
- throw new TimeoutException();
- if ((ex = getThrowableException()) != null)
- throw new ExecutionException(ex);
- }
- return getRawResult();
- }
-
- /**
- * Joins this task, without returning its result or throwing its
- * exception. This method may be useful when processing
- * collections of tasks when some have been cancelled or otherwise
- * known to have aborted.
- */
- public final void quietlyJoin() {
- doJoin();
- }
-
- /**
- * Commences performing this task and awaits its completion if
- * necessary, without returning its result or throwing its
- * exception.
- */
- public final void quietlyInvoke() {
- doInvoke();
- }
-
- /**
- * Possibly executes tasks until the pool hosting the current task
- * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
- * be of use in designs in which many tasks are forked, but none
- * are explicitly joined, instead executing them until all are
- * processed.
- */
- public static void helpQuiesce() {
- Thread t;
- if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
- ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
- wt.pool.helpQuiescePool(wt.workQueue);
- }
- else
- ForkJoinPool.quiesceCommonPool();
- }
-
- /**
- * Resets the internal bookkeeping state of this task, allowing a
- * subsequent {@code fork}. This method allows repeated reuse of
- * this task, but only if reuse occurs when this task has either
- * never been forked, or has been forked, then completed and all
- * outstanding joins of this task have also completed. Effects
- * under any other usage conditions are not guaranteed.
- * This method may be useful when executing
- * pre-constructed trees of subtasks in loops.
- *
- * <p>Upon completion of this method, {@code isDone()} reports
- * {@code false}, and {@code getException()} reports {@code
- * null}. However, the value returned by {@code getRawResult} is
- * unaffected. To clear this value, you can invoke {@code
- * setRawResult(null)}.
- */
- public void reinitialize() {
- if ((status & DONE_MASK) == EXCEPTIONAL)
- clearExceptionalCompletion();
- else
- status = 0;
- }
-
- /**
- * Returns the pool hosting the current task execution, or null
- * if this task is executing outside of any ForkJoinPool.
- *
- * @see #inForkJoinPool
- * @return the pool, or {@code null} if none
- */
- public static ForkJoinPool getPool() {
- Thread t = Thread.currentThread();
- return (t instanceof ForkJoinWorkerThread) ?
- ((ForkJoinWorkerThread) t).pool : null;
- }
-
- /**
- * Returns {@code true} if the current thread is a {@link
- * ForkJoinWorkerThread} executing as a ForkJoinPool computation.
- *
- * @return {@code true} if the current thread is a {@link
- * ForkJoinWorkerThread} executing as a ForkJoinPool computation,
- * or {@code false} otherwise
- */
- public static boolean inForkJoinPool() {
- return Thread.currentThread() instanceof ForkJoinWorkerThread;
- }
-
- /**
- * Tries to unschedule this task for execution. This method will
- * typically (but is not guaranteed to) succeed if this task is
- * the most recently forked task by the current thread, and has
- * not commenced executing in another thread. This method may be
- * useful when arranging alternative local processing of tasks
- * that could have been, but were not, stolen.
- *
- * @return {@code true} if unforked
- */
- public boolean tryUnfork() {
- Thread t;
- return (((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) ?
- ((ForkJoinWorkerThread)t).workQueue.tryUnpush(this) :
- ForkJoinPool.tryExternalUnpush(this));
- }
-
- /**
- * Returns an estimate of the number of tasks that have been
- * forked by the current worker thread but not yet executed. This
- * value may be useful for heuristic decisions about whether to
- * fork other tasks.
- *
- * @return the number of tasks
- */
- public static int getQueuedTaskCount() {
- Thread t; ForkJoinPool.WorkQueue q;
- if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)
- q = ((ForkJoinWorkerThread)t).workQueue;
- else
- q = ForkJoinPool.commonSubmitterQueue();
- return (q == null) ? 0 : q.queueSize();
- }
-
- /**
- * Returns an estimate of how many more locally queued tasks are
- * held by the current worker thread than there are other worker
- * threads that might steal them, or zero if this thread is not
- * operating in a ForkJoinPool. This value may be useful for
- * heuristic decisions about whether to fork other tasks. In many
- * usages of ForkJoinTasks, at steady state, each worker should
- * aim to maintain a small constant surplus (for example, 3) of
- * tasks, and to process computations locally if this threshold is
- * exceeded.
- *
- * @return the surplus number of tasks, which may be negative
- */
- public static int getSurplusQueuedTaskCount() {
- return ForkJoinPool.getSurplusQueuedTaskCount();
- }
-
- // Extension methods
-
- /**
- * Returns the result that would be returned by {@link #join}, even
- * if this task completed abnormally, or {@code null} if this task
- * is not known to have been completed. This method is designed
- * to aid debugging, as well as to support extensions. Its use in
- * any other context is discouraged.
- *
- * @return the result, or {@code null} if not completed
- */
- public abstract V getRawResult();
-
- /**
- * Forces the given value to be returned as a result. This method
- * is designed to support extensions, and should not in general be
- * called otherwise.
- *
- * @param value the value
- */
- protected abstract void setRawResult(V value);
-
- /**
- * Immediately performs the base action of this task and returns
- * true if, upon return from this method, this task is guaranteed
- * to have completed normally. This method may return false
- * otherwise, to indicate that this task is not necessarily
- * complete (or is not known to be complete), for example in
- * asynchronous actions that require explicit invocations of
- * completion methods. This method may also throw an (unchecked)
- * exception to indicate abnormal exit. This method is designed to
- * support extensions, and should not in general be called
- * otherwise.
- *
- * @return {@code true} if this task is known to have completed normally
- */
- protected abstract boolean exec();
-
- /**
- * Returns, but does not unschedule or execute, a task queued by
- * the current thread but not yet executed, if one is immediately
- * available. There is no guarantee that this task will actually
- * be polled or executed next. Conversely, this method may return
- * null even if a task exists but cannot be accessed without
- * contention with other threads. This method is designed
- * primarily to support extensions, and is unlikely to be useful
- * otherwise.
- *
- * @return the next task, or {@code null} if none are available
- */
- protected static ForkJoinTask<?> peekNextLocalTask() {
- Thread t; ForkJoinPool.WorkQueue q;
- if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)
- q = ((ForkJoinWorkerThread)t).workQueue;
- else
- q = ForkJoinPool.commonSubmitterQueue();
- return (q == null) ? null : q.peek();
- }
-
- /**
- * Unschedules and returns, without executing, the next task
- * queued by the current thread but not yet executed, if the
- * current thread is operating in a ForkJoinPool. This method is
- * designed primarily to support extensions, and is unlikely to be
- * useful otherwise.
- *
- * @return the next task, or {@code null} if none are available
- */
- protected static ForkJoinTask<?> pollNextLocalTask() {
- Thread t;
- return ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) ?
- ((ForkJoinWorkerThread)t).workQueue.nextLocalTask() :
- null;
- }
-
- /**
- * If the current thread is operating in a ForkJoinPool,
- * unschedules and returns, without executing, the next task
- * queued by the current thread but not yet executed, if one is
- * available, or if not available, a task that was forked by some
- * other thread, if available. Availability may be transient, so a
- * {@code null} result does not necessarily imply quiescence of
- * the pool this task is operating in. This method is designed
- * primarily to support extensions, and is unlikely to be useful
- * otherwise.
- *
- * @return a task, or {@code null} if none are available
- */
- protected static ForkJoinTask<?> pollTask() {
- Thread t; ForkJoinWorkerThread wt;
- return ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) ?
- (wt = (ForkJoinWorkerThread)t).pool.nextTaskFor(wt.workQueue) :
- null;
- }
-
- // tag operations
-
- /**
- * Returns the tag for this task.
- *
- * @return the tag for this task
- * @since 1.8
- */
- public final short getForkJoinTaskTag() {
- return (short)status;
- }
-
- /**
- * Atomically sets the tag value for this task.
- *
- * @param tag the tag value
- * @return the previous value of the tag
- * @since 1.8
- */
- public final short setForkJoinTaskTag(short tag) {
- for (int s;;) {
- if (U.compareAndSwapInt(this, STATUS, s = status,
- (s & ~SMASK) | (tag & SMASK)))
- return (short)s;
- }
- }
-
- /**
- * Atomically conditionally sets the tag value for this task.
- * Among other applications, tags can be used as visit markers
- * in tasks operating on graphs, as in methods that check: {@code
- * if (task.compareAndSetForkJoinTaskTag((short)0, (short)1))}
- * before processing, otherwise exiting because the node has
- * already been visited.
- *
- * @param e the expected tag value
- * @param tag the new tag value
- * @return true if successful; i.e., the current value was
- * equal to e and is now tag.
- * @since 1.8
- */
- public final boolean compareAndSetForkJoinTaskTag(short e, short tag) {
- for (int s;;) {
- if ((short)(s = status) != e)
- return false;
- if (U.compareAndSwapInt(this, STATUS, s,
- (s & ~SMASK) | (tag & SMASK)))
- return true;
- }
- }
-
- /**
- * Adaptor for Runnables. This implements RunnableFuture
- * to be compliant with AbstractExecutorService constraints
- * when used in ForkJoinPool.
- */
- static final class AdaptedRunnable<T> extends ForkJoinTask<T>
- implements RunnableFuture<T> {
- final Runnable runnable;
- T result;
- AdaptedRunnable(Runnable runnable, T result) {
- if (runnable == null) throw new NullPointerException();
- this.runnable = runnable;
- this.result = result; // OK to set this even before completion
- }
- public final T getRawResult() { return result; }
- public final void setRawResult(T v) { result = v; }
- public final boolean exec() { runnable.run(); return true; }
- public final void run() { invoke(); }
- private static final long serialVersionUID = 5232453952276885070L;
- }
-
- /**
- * Adaptor for Runnables without results
- */
- static final class AdaptedRunnableAction extends ForkJoinTask<Void>
- implements RunnableFuture<Void> {
- final Runnable runnable;
- AdaptedRunnableAction(Runnable runnable) {
- if (runnable == null) throw new NullPointerException();
- this.runnable = runnable;
- }
- public final Void getRawResult() { return null; }
- public final void setRawResult(Void v) { }
- public final boolean exec() { runnable.run(); return true; }
- public final void run() { invoke(); }
- private static final long serialVersionUID = 5232453952276885070L;
- }
-
- /**
- * Adaptor for Callables
- */
- static final class AdaptedCallable<T> extends ForkJoinTask<T>
- implements RunnableFuture<T> {
- final Callable<? extends T> callable;
- T result;
- AdaptedCallable(Callable<? extends T> callable) {
- if (callable == null) throw new NullPointerException();
- this.callable = callable;
- }
- public final T getRawResult() { return result; }
- public final void setRawResult(T v) { result = v; }
- public final boolean exec() {
- try {
- result = callable.call();
- return true;
- } catch (Error err) {
- throw err;
- } catch (RuntimeException rex) {
- throw rex;
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
- public final void run() { invoke(); }
- private static final long serialVersionUID = 2838392045355241008L;
- }
-
- /**
- * Returns a new {@code ForkJoinTask} that performs the {@code run}
- * method of the given {@code Runnable} as its action, and returns
- * a null result upon {@link #join}.
- *
- * @param runnable the runnable action
- * @return the task
- */
- public static ForkJoinTask<?> adapt(Runnable runnable) {
- return new AdaptedRunnableAction(runnable);
- }
-
- /**
- * Returns a new {@code ForkJoinTask} that performs the {@code run}
- * method of the given {@code Runnable} as its action, and returns
- * the given result upon {@link #join}.
- *
- * @param runnable the runnable action
- * @param result the result upon completion
- * @return the task
- */
- public static <T> ForkJoinTask<T> adapt(Runnable runnable, T result) {
- return new AdaptedRunnable<T>(runnable, result);
- }
-
- /**
- * Returns a new {@code ForkJoinTask} that performs the {@code call}
- * method of the given {@code Callable} as its action, and returns
- * its result upon {@link #join}, translating any checked exceptions
- * encountered into {@code RuntimeException}.
- *
- * @param callable the callable action
- * @return the task
- */
- public static <T> ForkJoinTask<T> adapt(Callable<? extends T> callable) {
- return new AdaptedCallable<T>(callable);
- }
-
- // Serialization support
-
- private static final long serialVersionUID = -7721805057305804111L;
-
- /**
- * Saves this task to a stream (that is, serializes it).
- *
- * @serialData the current run status and the exception thrown
- * during execution, or {@code null} if none
- */
- private void writeObject(java.io.ObjectOutputStream s)
- throws java.io.IOException {
- s.defaultWriteObject();
- s.writeObject(getException());
- }
-
- /**
- * Reconstitutes this task from a stream (that is, deserializes it).
- */
- private void readObject(java.io.ObjectInputStream s)
- throws java.io.IOException, ClassNotFoundException {
- s.defaultReadObject();
- Object ex = s.readObject();
- if (ex != null)
- setExceptionalCompletion((Throwable)ex);
- }
-
- // Unsafe mechanics
- private static final sun.misc.Unsafe U;
- private static final long STATUS;
-
- static {
- exceptionTableLock = new ReentrantLock();
- exceptionTableRefQueue = new ReferenceQueue<Object>();
- exceptionTable = new ExceptionNode[EXCEPTION_MAP_CAPACITY];
- try {
- U = getUnsafe();
- Class<?> k = ForkJoinTask.class;
- STATUS = U.objectFieldOffset
- (k.getDeclaredField("status"));
- } catch (Exception e) {
- throw new Error(e);
- }
- }
-
- /**
- * Returns a sun.misc.Unsafe. Suitable for use in a 3rd party package.
- * Replace with a simple call to Unsafe.getUnsafe when integrating
- * into a jdk.
- *
- * @return a sun.misc.Unsafe
- */
- private static sun.misc.Unsafe getUnsafe() {
- return scala.concurrent.util.Unsafe.instance;
- }
-}
diff --git a/src/forkjoin/scala/concurrent/forkjoin/ForkJoinWorkerThread.java b/src/forkjoin/scala/concurrent/forkjoin/ForkJoinWorkerThread.java
deleted file mode 100644
index e62fc6eb71..0000000000
--- a/src/forkjoin/scala/concurrent/forkjoin/ForkJoinWorkerThread.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-package scala.concurrent.forkjoin;
-
-/**
- * A thread managed by a {@link ForkJoinPool}, which executes
- * {@link ForkJoinTask}s.
- * This class is subclassable solely for the sake of adding
- * functionality -- there are no overridable methods dealing with
- * scheduling or execution. However, you can override initialization
- * and termination methods surrounding the main task processing loop.
- * If you do create such a subclass, you will also need to supply a
- * custom {@link ForkJoinPool.ForkJoinWorkerThreadFactory} to use it
- * in a {@code ForkJoinPool}.
- *
- * @since 1.7
- * @author Doug Lea
- */
-public class ForkJoinWorkerThread extends Thread {
- /*
- * ForkJoinWorkerThreads are managed by ForkJoinPools and perform
- * ForkJoinTasks. For explanation, see the internal documentation
- * of class ForkJoinPool.
- *
- * This class just maintains links to its pool and WorkQueue. The
- * pool field is set immediately upon construction, but the
- * workQueue field is not set until a call to registerWorker
- * completes. This leads to a visibility race, that is tolerated
- * by requiring that the workQueue field is only accessed by the
- * owning thread.
- */
-
- final ForkJoinPool pool; // the pool this thread works in
- final ForkJoinPool.WorkQueue workQueue; // work-stealing mechanics
-
- /**
- * Creates a ForkJoinWorkerThread operating in the given pool.
- *
- * @param pool the pool this thread works in
- * @throws NullPointerException if pool is null
- */
- protected ForkJoinWorkerThread(ForkJoinPool pool) {
- // Use a placeholder until a useful name can be set in registerWorker
- super("aForkJoinWorkerThread");
- this.pool = pool;
- this.workQueue = pool.registerWorker(this);
- }
-
- /**
- * Returns the pool hosting this thread.
- *
- * @return the pool
- */
- public ForkJoinPool getPool() {
- return pool;
- }
-
- /**
- * Returns the index number of this thread in its pool. The
- * returned value ranges from zero to the maximum number of
- * threads (minus one) that have ever been created in the pool.
- * This method may be useful for applications that track status or
- * collect results per-worker rather than per-task.
- *
- * @return the index number
- */
- public int getPoolIndex() {
- return workQueue.poolIndex;
- }
-
- /**
- * Initializes internal state after construction but before
- * processing any tasks. If you override this method, you must
- * invoke {@code super.onStart()} at the beginning of the method.
- * Initialization requires care: Most fields must have legal
- * default values, to ensure that attempted accesses from other
- * threads work correctly even before this thread starts
- * processing tasks.
- */
- protected void onStart() {
- }
-
- /**
- * Performs cleanup associated with termination of this worker
- * thread. If you override this method, you must invoke
- * {@code super.onTermination} at the end of the overridden method.
- *
- * @param exception the exception causing this thread to abort due
- * to an unrecoverable error, or {@code null} if completed normally
- */
- protected void onTermination(Throwable exception) {
- }
-
- /**
- * This method is required to be public, but should never be
- * called explicitly. It performs the main run loop to execute
- * {@link ForkJoinTask}s.
- */
- public void run() {
- Throwable exception = null;
- try {
- onStart();
- pool.runWorker(workQueue);
- } catch (Throwable ex) {
- exception = ex;
- } finally {
- try {
- onTermination(exception);
- } catch (Throwable ex) {
- if (exception == null)
- exception = ex;
- } finally {
- pool.deregisterWorker(this, exception);
- }
- }
- }
-}
diff --git a/src/forkjoin/scala/concurrent/forkjoin/LinkedTransferQueue.java b/src/forkjoin/scala/concurrent/forkjoin/LinkedTransferQueue.java
deleted file mode 100644
index 07e81b395d..0000000000
--- a/src/forkjoin/scala/concurrent/forkjoin/LinkedTransferQueue.java
+++ /dev/null
@@ -1,1335 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-package scala.concurrent.forkjoin;
-
-import java.util.AbstractQueue;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Queue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.LockSupport;
-
-/**
- * An unbounded {@link TransferQueue} based on linked nodes.
- * This queue orders elements FIFO (first-in-first-out) with respect
- * to any given producer. The <em>head</em> of the queue is that
- * element that has been on the queue the longest time for some
- * producer. The <em>tail</em> of the queue is that element that has
- * been on the queue the shortest time for some producer.
- *
- * <p>Beware that, unlike in most collections, the {@code size} method
- * is <em>NOT</em> a constant-time operation. Because of the
- * asynchronous nature of these queues, determining the current number
- * of elements requires a traversal of the elements, and so may report
- * inaccurate results if this collection is modified during traversal.
- * Additionally, the bulk operations {@code addAll},
- * {@code removeAll}, {@code retainAll}, {@code containsAll},
- * {@code equals}, and {@code toArray} are <em>not</em> guaranteed
- * to be performed atomically. For example, an iterator operating
- * concurrently with an {@code addAll} operation might view only some
- * of the added elements.
- *
- * <p>This class and its iterator implement all of the
- * <em>optional</em> methods of the {@link Collection} and {@link
- * Iterator} interfaces.
- *
- * <p>Memory consistency effects: As with other concurrent
- * collections, actions in a thread prior to placing an object into a
- * {@code LinkedTransferQueue}
- * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
- * actions subsequent to the access or removal of that element from
- * the {@code LinkedTransferQueue} in another thread.
- *
- * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
- * Java Collections Framework</a>.
- *
- * @since 1.7
- * @author Doug Lea
- * @param <E> the type of elements held in this collection
- */
-public class LinkedTransferQueue<E> extends AbstractQueue<E>
- implements TransferQueue<E>, java.io.Serializable {
- private static final long serialVersionUID = -3223113410248163686L;
-
- /*
- * *** Overview of Dual Queues with Slack ***
- *
- * Dual Queues, introduced by Scherer and Scott
- * (http://www.cs.rice.edu/~wns1/papers/2004-DISC-DDS.pdf) are
- * (linked) queues in which nodes may represent either data or
- * requests. When a thread tries to enqueue a data node, but
- * encounters a request node, it instead "matches" and removes it;
- * and vice versa for enqueuing requests. Blocking Dual Queues
- * arrange that threads enqueuing unmatched requests block until
- * other threads provide the match. Dual Synchronous Queues (see
- * Scherer, Lea, & Scott
- * http://www.cs.rochester.edu/u/scott/papers/2009_Scherer_CACM_SSQ.pdf)
- * additionally arrange that threads enqueuing unmatched data also
- * block. Dual Transfer Queues support all of these modes, as
- * dictated by callers.
- *
- * A FIFO dual queue may be implemented using a variation of the
- * Michael & Scott (M&S) lock-free queue algorithm
- * (http://www.cs.rochester.edu/u/scott/papers/1996_PODC_queues.pdf).
- * It maintains two pointer fields, "head", pointing to a
- * (matched) node that in turn points to the first actual
- * (unmatched) queue node (or null if empty); and "tail" that
- * points to the last node on the queue (or again null if
- * empty). For example, here is a possible queue with four data
- * elements:
- *
- * head tail
- * | |
- * v v
- * M -> U -> U -> U -> U
- *
- * The M&S queue algorithm is known to be prone to scalability and
- * overhead limitations when maintaining (via CAS) these head and
- * tail pointers. This has led to the development of
- * contention-reducing variants such as elimination arrays (see
- * Moir et al http://portal.acm.org/citation.cfm?id=1074013) and
- * optimistic back pointers (see Ladan-Mozes & Shavit
- * http://people.csail.mit.edu/edya/publications/OptimisticFIFOQueue-journal.pdf).
- * However, the nature of dual queues enables a simpler tactic for
- * improving M&S-style implementations when dual-ness is needed.
- *
- * In a dual queue, each node must atomically maintain its match
- * status. While there are other possible variants, we implement
- * this here as: for a data-mode node, matching entails CASing an
- * "item" field from a non-null data value to null upon match, and
- * vice-versa for request nodes, CASing from null to a data
- * value. (Note that the linearization properties of this style of
- * queue are easy to verify -- elements are made available by
- * linking, and unavailable by matching.) Compared to plain M&S
- * queues, this property of dual queues requires one additional
- * successful atomic operation per enq/deq pair. But it also
- * enables lower cost variants of queue maintenance mechanics. (A
- * variation of this idea applies even for non-dual queues that
- * support deletion of interior elements, such as
- * j.u.c.ConcurrentLinkedQueue.)
- *
- * Once a node is matched, its match status can never again
- * change. We may thus arrange that the linked list of them
- * contain a prefix of zero or more matched nodes, followed by a
- * suffix of zero or more unmatched nodes. (Note that we allow
- * both the prefix and suffix to be zero length, which in turn
- * means that we do not use a dummy header.) If we were not
- * concerned with either time or space efficiency, we could
- * correctly perform enqueue and dequeue operations by traversing
- * from a pointer to the initial node; CASing the item of the
- * first unmatched node on match and CASing the next field of the
- * trailing node on appends. (Plus some special-casing when
- * initially empty). While this would be a terrible idea in
- * itself, it does have the benefit of not requiring ANY atomic
- * updates on head/tail fields.
- *
- * We introduce here an approach that lies between the extremes of
- * never versus always updating queue (head and tail) pointers.
- * This offers a tradeoff between sometimes requiring extra
- * traversal steps to locate the first and/or last unmatched
- * nodes, versus the reduced overhead and contention of fewer
- * updates to queue pointers. For example, a possible snapshot of
- * a queue is:
- *
- * head tail
- * | |
- * v v
- * M -> M -> U -> U -> U -> U
- *
- * The best value for this "slack" (the targeted maximum distance
- * between the value of "head" and the first unmatched node, and
- * similarly for "tail") is an empirical matter. We have found
- * that using very small constants in the range of 1-3 work best
- * over a range of platforms. Larger values introduce increasing
- * costs of cache misses and risks of long traversal chains, while
- * smaller values increase CAS contention and overhead.
- *
- * Dual queues with slack differ from plain M&S dual queues by
- * virtue of only sometimes updating head or tail pointers when
- * matching, appending, or even traversing nodes; in order to
- * maintain a targeted slack. The idea of "sometimes" may be
- * operationalized in several ways. The simplest is to use a
- * per-operation counter incremented on each traversal step, and
- * to try (via CAS) to update the associated queue pointer
- * whenever the count exceeds a threshold. Another, that requires
- * more overhead, is to use random number generators to update
- * with a given probability per traversal step.
- *
- * In any strategy along these lines, because CASes updating
- * fields may fail, the actual slack may exceed targeted
- * slack. However, they may be retried at any time to maintain
- * targets. Even when using very small slack values, this
- * approach works well for dual queues because it allows all
- * operations up to the point of matching or appending an item
- * (hence potentially allowing progress by another thread) to be
- * read-only, thus not introducing any further contention. As
- * described below, we implement this by performing slack
- * maintenance retries only after these points.
- *
- * As an accompaniment to such techniques, traversal overhead can
- * be further reduced without increasing contention of head
- * pointer updates: Threads may sometimes shortcut the "next" link
- * path from the current "head" node to be closer to the currently
- * known first unmatched node, and similarly for tail. Again, this
- * may be triggered with using thresholds or randomization.
- *
- * These ideas must be further extended to avoid unbounded amounts
- * of costly-to-reclaim garbage caused by the sequential "next"
- * links of nodes starting at old forgotten head nodes: As first
- * described in detail by Boehm
- * (http://portal.acm.org/citation.cfm?doid=503272.503282) if a GC
- * delays noticing that any arbitrarily old node has become
- * garbage, all newer dead nodes will also be unreclaimed.
- * (Similar issues arise in non-GC environments.) To cope with
- * this in our implementation, upon CASing to advance the head
- * pointer, we set the "next" link of the previous head to point
- * only to itself; thus limiting the length of connected dead lists.
- * (We also take similar care to wipe out possibly garbage
- * retaining values held in other Node fields.) However, doing so
- * adds some further complexity to traversal: If any "next"
- * pointer links to itself, it indicates that the current thread
- * has lagged behind a head-update, and so the traversal must
- * continue from the "head". Traversals trying to find the
- * current tail starting from "tail" may also encounter
- * self-links, in which case they also continue at "head".
- *
- * It is tempting in slack-based scheme to not even use CAS for
- * updates (similarly to Ladan-Mozes & Shavit). However, this
- * cannot be done for head updates under the above link-forgetting
- * mechanics because an update may leave head at a detached node.
- * And while direct writes are possible for tail updates, they
- * increase the risk of long retraversals, and hence long garbage
- * chains, which can be much more costly than is worthwhile
- * considering that the cost difference of performing a CAS vs
- * write is smaller when they are not triggered on each operation
- * (especially considering that writes and CASes equally require
- * additional GC bookkeeping ("write barriers") that are sometimes
- * more costly than the writes themselves because of contention).
- *
- * *** Overview of implementation ***
- *
- * We use a threshold-based approach to updates, with a slack
- * threshold of two -- that is, we update head/tail when the
- * current pointer appears to be two or more steps away from the
- * first/last node. The slack value is hard-wired: a path greater
- * than one is naturally implemented by checking equality of
- * traversal pointers except when the list has only one element,
- * in which case we keep slack threshold at one. Avoiding tracking
- * explicit counts across method calls slightly simplifies an
- * already-messy implementation. Using randomization would
- * probably work better if there were a low-quality dirt-cheap
- * per-thread one available, but even ThreadLocalRandom is too
- * heavy for these purposes.
- *
- * With such a small slack threshold value, it is not worthwhile
- * to augment this with path short-circuiting (i.e., unsplicing
- * interior nodes) except in the case of cancellation/removal (see
- * below).
- *
- * We allow both the head and tail fields to be null before any
- * nodes are enqueued; initializing upon first append. This
- * simplifies some other logic, as well as providing more
- * efficient explicit control paths instead of letting JVMs insert
- * implicit NullPointerExceptions when they are null. While not
- * currently fully implemented, we also leave open the possibility
- * of re-nulling these fields when empty (which is complicated to
- * arrange, for little benefit.)
- *
- * All enqueue/dequeue operations are handled by the single method
- * "xfer" with parameters indicating whether to act as some form
- * of offer, put, poll, take, or transfer (each possibly with
- * timeout). The relative complexity of using one monolithic
- * method outweighs the code bulk and maintenance problems of
- * using separate methods for each case.
- *
- * Operation consists of up to three phases. The first is
- * implemented within method xfer, the second in tryAppend, and
- * the third in method awaitMatch.
- *
- * 1. Try to match an existing node
- *
- * Starting at head, skip already-matched nodes until finding
- * an unmatched node of opposite mode, if one exists, in which
- * case matching it and returning, also if necessary updating
- * head to one past the matched node (or the node itself if the
- * list has no other unmatched nodes). If the CAS misses, then
- * a loop retries advancing head by two steps until either
- * success or the slack is at most two. By requiring that each
- * attempt advances head by two (if applicable), we ensure that
- * the slack does not grow without bound. Traversals also check
- * if the initial head is now off-list, in which case they
- * start at the new head.
- *
- * If no candidates are found and the call was untimed
- * poll/offer, (argument "how" is NOW) return.
- *
- * 2. Try to append a new node (method tryAppend)
- *
- * Starting at current tail pointer, find the actual last node
- * and try to append a new node (or if head was null, establish
- * the first node). Nodes can be appended only if their
- * predecessors are either already matched or are of the same
- * mode. If we detect otherwise, then a new node with opposite
- * mode must have been appended during traversal, so we must
- * restart at phase 1. The traversal and update steps are
- * otherwise similar to phase 1: Retrying upon CAS misses and
- * checking for staleness. In particular, if a self-link is
- * encountered, then we can safely jump to a node on the list
- * by continuing the traversal at current head.
- *
- * On successful append, if the call was ASYNC, return.
- *
- * 3. Await match or cancellation (method awaitMatch)
- *
- * Wait for another thread to match node; instead cancelling if
- * the current thread was interrupted or the wait timed out. On
- * multiprocessors, we use front-of-queue spinning: If a node
- * appears to be the first unmatched node in the queue, it
- * spins a bit before blocking. In either case, before blocking
- * it tries to unsplice any nodes between the current "head"
- * and the first unmatched node.
- *
- * Front-of-queue spinning vastly improves performance of
- * heavily contended queues. And so long as it is relatively
- * brief and "quiet", spinning does not much impact performance
- * of less-contended queues. During spins threads check their
- * interrupt status and generate a thread-local random number
- * to decide to occasionally perform a Thread.yield. While
- * yield has underdefined specs, we assume that it might help,
- * and will not hurt, in limiting impact of spinning on busy
- * systems. We also use smaller (1/2) spins for nodes that are
- * not known to be front but whose predecessors have not
- * blocked -- these "chained" spins avoid artifacts of
- * front-of-queue rules which otherwise lead to alternating
- * nodes spinning vs blocking. Further, front threads that
- * represent phase changes (from data to request node or vice
- * versa) compared to their predecessors receive additional
- * chained spins, reflecting longer paths typically required to
- * unblock threads during phase changes.
- *
- *
- * ** Unlinking removed interior nodes **
- *
- * In addition to minimizing garbage retention via self-linking
- * described above, we also unlink removed interior nodes. These
- * may arise due to timed out or interrupted waits, or calls to
- * remove(x) or Iterator.remove. Normally, given a node that was
- * at one time known to be the predecessor of some node s that is
- * to be removed, we can unsplice s by CASing the next field of
- * its predecessor if it still points to s (otherwise s must
- * already have been removed or is now offlist). But there are two
- * situations in which we cannot guarantee to make node s
- * unreachable in this way: (1) If s is the trailing node of list
- * (i.e., with null next), then it is pinned as the target node
- * for appends, so can only be removed later after other nodes are
- * appended. (2) We cannot necessarily unlink s given a
- * predecessor node that is matched (including the case of being
- * cancelled): the predecessor may already be unspliced, in which
- * case some previous reachable node may still point to s.
- * (For further explanation see Herlihy & Shavit "The Art of
- * Multiprocessor Programming" chapter 9). Although, in both
- * cases, we can rule out the need for further action if either s
- * or its predecessor are (or can be made to be) at, or fall off
- * from, the head of list.
- *
- * Without taking these into account, it would be possible for an
- * unbounded number of supposedly removed nodes to remain
- * reachable. Situations leading to such buildup are uncommon but
- * can occur in practice; for example when a series of short timed
- * calls to poll repeatedly time out but never otherwise fall off
- * the list because of an untimed call to take at the front of the
- * queue.
- *
- * When these cases arise, rather than always retraversing the
- * entire list to find an actual predecessor to unlink (which
- * won't help for case (1) anyway), we record a conservative
- * estimate of possible unsplice failures (in "sweepVotes").
- * We trigger a full sweep when the estimate exceeds a threshold
- * ("SWEEP_THRESHOLD") indicating the maximum number of estimated
- * removal failures to tolerate before sweeping through, unlinking
- * cancelled nodes that were not unlinked upon initial removal.
- * We perform sweeps by the thread hitting threshold (rather than
- * background threads or by spreading work to other threads)
- * because in the main contexts in which removal occurs, the
- * caller is already timed-out, cancelled, or performing a
- * potentially O(n) operation (e.g. remove(x)), none of which are
- * time-critical enough to warrant the overhead that alternatives
- * would impose on other threads.
- *
- * Because the sweepVotes estimate is conservative, and because
- * nodes become unlinked "naturally" as they fall off the head of
- * the queue, and because we allow votes to accumulate even while
- * sweeps are in progress, there are typically significantly fewer
- * such nodes than estimated. Choice of a threshold value
- * balances the likelihood of wasted effort and contention, versus
- * providing a worst-case bound on retention of interior nodes in
- * quiescent queues. The value defined below was chosen
- * empirically to balance these under various timeout scenarios.
- *
- * Note that we cannot self-link unlinked interior nodes during
- * sweeps. However, the associated garbage chains terminate when
- * some successor ultimately falls off the head of the list and is
- * self-linked.
- */
-
- /** True if on multiprocessor */
- private static final boolean MP =
- Runtime.getRuntime().availableProcessors() > 1;
-
- /**
- * The number of times to spin (with randomly interspersed calls
- * to Thread.yield) on multiprocessor before blocking when a node
- * is apparently the first waiter in the queue. See above for
- * explanation. Must be a power of two. The value is empirically
- * derived -- it works pretty well across a variety of processors,
- * numbers of CPUs, and OSes.
- */
- private static final int FRONT_SPINS = 1 << 7;
-
- /**
- * The number of times to spin before blocking when a node is
- * preceded by another node that is apparently spinning. Also
- * serves as an increment to FRONT_SPINS on phase changes, and as
- * base average frequency for yielding during spins. Must be a
- * power of two.
- */
- private static final int CHAINED_SPINS = FRONT_SPINS >>> 1;
-
- /**
- * The maximum number of estimated removal failures (sweepVotes)
- * to tolerate before sweeping through the queue unlinking
- * cancelled nodes that were not unlinked upon initial
- * removal. See above for explanation. The value must be at least
- * two to avoid useless sweeps when removing trailing nodes.
- */
- static final int SWEEP_THRESHOLD = 32;
-
- /**
- * Queue nodes. Uses Object, not E, for items to allow forgetting
- * them after use. Relies heavily on Unsafe mechanics to minimize
- * unnecessary ordering constraints: Writes that are intrinsically
- * ordered wrt other accesses or CASes use simple relaxed forms.
- */
- static final class Node {
- final boolean isData; // false if this is a request node
- volatile Object item; // initially non-null if isData; CASed to match
- volatile Node next;
- volatile Thread waiter; // null until waiting
-
- // CAS methods for fields
- final boolean casNext(Node cmp, Node val) {
- return UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val);
- }
-
- final boolean casItem(Object cmp, Object val) {
- // assert cmp == null || cmp.getClass() != Node.class;
- return UNSAFE.compareAndSwapObject(this, itemOffset, cmp, val);
- }
-
- /**
- * Constructs a new node. Uses relaxed write because item can
- * only be seen after publication via casNext.
- */
- Node(Object item, boolean isData) {
- UNSAFE.putObject(this, itemOffset, item); // relaxed write
- this.isData = isData;
- }
-
- /**
- * Links node to itself to avoid garbage retention. Called
- * only after CASing head field, so uses relaxed write.
- */
- final void forgetNext() {
- UNSAFE.putObject(this, nextOffset, this);
- }
-
- /**
- * Sets item to self and waiter to null, to avoid garbage
- * retention after matching or cancelling. Uses relaxed writes
- * because order is already constrained in the only calling
- * contexts: item is forgotten only after volatile/atomic
- * mechanics that extract items. Similarly, clearing waiter
- * follows either CAS or return from park (if ever parked;
- * else we don't care).
- */
- final void forgetContents() {
- UNSAFE.putObject(this, itemOffset, this);
- UNSAFE.putObject(this, waiterOffset, null);
- }
-
- /**
- * Returns true if this node has been matched, including the
- * case of artificial matches due to cancellation.
- */
- final boolean isMatched() {
- Object x = item;
- return (x == this) || ((x == null) == isData);
- }
-
- /**
- * Returns true if this is an unmatched request node.
- */
- final boolean isUnmatchedRequest() {
- return !isData && item == null;
- }
-
- /**
- * Returns true if a node with the given mode cannot be
- * appended to this node because this node is unmatched and
- * has opposite data mode.
- */
- final boolean cannotPrecede(boolean haveData) {
- boolean d = isData;
- Object x;
- return d != haveData && (x = item) != this && (x != null) == d;
- }
-
- /**
- * Tries to artificially match a data node -- used by remove.
- */
- final boolean tryMatchData() {
- // assert isData;
- Object x = item;
- if (x != null && x != this && casItem(x, null)) {
- LockSupport.unpark(waiter);
- return true;
- }
- return false;
- }
-
- private static final long serialVersionUID = -3375979862319811754L;
-
- // Unsafe mechanics
- private static final sun.misc.Unsafe UNSAFE;
- private static final long itemOffset;
- private static final long nextOffset;
- private static final long waiterOffset;
- static {
- try {
- UNSAFE = getUnsafe();
- Class<?> k = Node.class;
- itemOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("item"));
- nextOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("next"));
- waiterOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("waiter"));
- } catch (Exception e) {
- throw new Error(e);
- }
- }
- }
-
- /** head of the queue; null until first enqueue */
- transient volatile Node head;
-
- /** tail of the queue; null until first append */
- private transient volatile Node tail;
-
- /** The number of apparent failures to unsplice removed nodes */
- private transient volatile int sweepVotes;
-
- // CAS methods for fields
- private boolean casTail(Node cmp, Node val) {
- return UNSAFE.compareAndSwapObject(this, tailOffset, cmp, val);
- }
-
- private boolean casHead(Node cmp, Node val) {
- return UNSAFE.compareAndSwapObject(this, headOffset, cmp, val);
- }
-
- private boolean casSweepVotes(int cmp, int val) {
- return UNSAFE.compareAndSwapInt(this, sweepVotesOffset, cmp, val);
- }
-
- /*
- * Possible values for "how" argument in xfer method.
- */
- private static final int NOW = 0; // for untimed poll, tryTransfer
- private static final int ASYNC = 1; // for offer, put, add
- private static final int SYNC = 2; // for transfer, take
- private static final int TIMED = 3; // for timed poll, tryTransfer
-
- @SuppressWarnings("unchecked")
- static <E> E cast(Object item) {
- // assert item == null || item.getClass() != Node.class;
- return (E) item;
- }
-
- /**
- * Implements all queuing methods. See above for explanation.
- *
- * @param e the item or null for take
- * @param haveData true if this is a put, else a take
- * @param how NOW, ASYNC, SYNC, or TIMED
- * @param nanos timeout in nanosecs, used only if mode is TIMED
- * @return an item if matched, else e
- * @throws NullPointerException if haveData mode but e is null
- */
- private E xfer(E e, boolean haveData, int how, long nanos) {
- if (haveData && (e == null))
- throw new NullPointerException();
- Node s = null; // the node to append, if needed
-
- retry:
- for (;;) { // restart on append race
-
- for (Node h = head, p = h; p != null;) { // find & match first node
- boolean isData = p.isData;
- Object item = p.item;
- if (item != p && (item != null) == isData) { // unmatched
- if (isData == haveData) // can't match
- break;
- if (p.casItem(item, e)) { // match
- for (Node q = p; q != h;) {
- Node n = q.next; // update by 2 unless singleton
- if (head == h && casHead(h, n == null ? q : n)) {
- h.forgetNext();
- break;
- } // advance and retry
- if ((h = head) == null ||
- (q = h.next) == null || !q.isMatched())
- break; // unless slack < 2
- }
- LockSupport.unpark(p.waiter);
- return LinkedTransferQueue.<E>cast(item);
- }
- }
- Node n = p.next;
- p = (p != n) ? n : (h = head); // Use head if p offlist
- }
-
- if (how != NOW) { // No matches available
- if (s == null)
- s = new Node(e, haveData);
- Node pred = tryAppend(s, haveData);
- if (pred == null)
- continue retry; // lost race vs opposite mode
- if (how != ASYNC)
- return awaitMatch(s, pred, e, (how == TIMED), nanos);
- }
- return e; // not waiting
- }
- }
-
- /**
- * Tries to append node s as tail.
- *
- * @param s the node to append
- * @param haveData true if appending in data mode
- * @return null on failure due to losing race with append in
- * different mode, else s's predecessor, or s itself if no
- * predecessor
- */
- private Node tryAppend(Node s, boolean haveData) {
- for (Node t = tail, p = t;;) { // move p to last node and append
- Node n, u; // temps for reads of next & tail
- if (p == null && (p = head) == null) {
- if (casHead(null, s))
- return s; // initialize
- }
- else if (p.cannotPrecede(haveData))
- return null; // lost race vs opposite mode
- else if ((n = p.next) != null) // not last; keep traversing
- p = p != t && t != (u = tail) ? (t = u) : // stale tail
- (p != n) ? n : null; // restart if off list
- else if (!p.casNext(null, s))
- p = p.next; // re-read on CAS failure
- else {
- if (p != t) { // update if slack now >= 2
- while ((tail != t || !casTail(t, s)) &&
- (t = tail) != null &&
- (s = t.next) != null && // advance and retry
- (s = s.next) != null && s != t);
- }
- return p;
- }
- }
- }
-
- /**
- * Spins/yields/blocks until node s is matched or caller gives up.
- *
- * @param s the waiting node
- * @param pred the predecessor of s, or s itself if it has no
- * predecessor, or null if unknown (the null case does not occur
- * in any current calls but may in possible future extensions)
- * @param e the comparison value for checking match
- * @param timed if true, wait only until timeout elapses
- * @param nanos timeout in nanosecs, used only if timed is true
- * @return matched item, or e if unmatched on interrupt or timeout
- */
- private E awaitMatch(Node s, Node pred, E e, boolean timed, long nanos) {
- long lastTime = timed ? System.nanoTime() : 0L;
- Thread w = Thread.currentThread();
- int spins = -1; // initialized after first item and cancel checks
- ThreadLocalRandom randomYields = null; // bound if needed
-
- for (;;) {
- Object item = s.item;
- if (item != e) { // matched
- // assert item != s;
- s.forgetContents(); // avoid garbage
- return LinkedTransferQueue.<E>cast(item);
- }
- if ((w.isInterrupted() || (timed && nanos <= 0)) &&
- s.casItem(e, s)) { // cancel
- unsplice(pred, s);
- return e;
- }
-
- if (spins < 0) { // establish spins at/near front
- if ((spins = spinsFor(pred, s.isData)) > 0)
- randomYields = ThreadLocalRandom.current();
- }
- else if (spins > 0) { // spin
- --spins;
- if (randomYields.nextInt(CHAINED_SPINS) == 0)
- Thread.yield(); // occasionally yield
- }
- else if (s.waiter == null) {
- s.waiter = w; // request unpark then recheck
- }
- else if (timed) {
- long now = System.nanoTime();
- if ((nanos -= now - lastTime) > 0)
- LockSupport.parkNanos(this, nanos);
- lastTime = now;
- }
- else {
- LockSupport.park(this);
- }
- }
- }
-
- /**
- * Returns spin/yield value for a node with given predecessor and
- * data mode. See above for explanation.
- */
- private static int spinsFor(Node pred, boolean haveData) {
- if (MP && pred != null) {
- if (pred.isData != haveData) // phase change
- return FRONT_SPINS + CHAINED_SPINS;
- if (pred.isMatched()) // probably at front
- return FRONT_SPINS;
- if (pred.waiter == null) // pred apparently spinning
- return CHAINED_SPINS;
- }
- return 0;
- }
-
- /* -------------- Traversal methods -------------- */
-
- /**
- * Returns the successor of p, or the head node if p.next has been
- * linked to self, which will only be true if traversing with a
- * stale pointer that is now off the list.
- */
- final Node succ(Node p) {
- Node next = p.next;
- return (p == next) ? head : next;
- }
-
- /**
- * Returns the first unmatched node of the given mode, or null if
- * none. Used by methods isEmpty, hasWaitingConsumer.
- */
- private Node firstOfMode(boolean isData) {
- for (Node p = head; p != null; p = succ(p)) {
- if (!p.isMatched())
- return (p.isData == isData) ? p : null;
- }
- return null;
- }
-
- /**
- * Returns the item in the first unmatched node with isData; or
- * null if none. Used by peek.
- */
- private E firstDataItem() {
- for (Node p = head; p != null; p = succ(p)) {
- Object item = p.item;
- if (p.isData) {
- if (item != null && item != p)
- return LinkedTransferQueue.<E>cast(item);
- }
- else if (item == null)
- return null;
- }
- return null;
- }
-
- /**
- * Traverses and counts unmatched nodes of the given mode.
- * Used by methods size and getWaitingConsumerCount.
- */
- private int countOfMode(boolean data) {
- int count = 0;
- for (Node p = head; p != null; ) {
- if (!p.isMatched()) {
- if (p.isData != data)
- return 0;
- if (++count == Integer.MAX_VALUE) // saturated
- break;
- }
- Node n = p.next;
- if (n != p)
- p = n;
- else {
- count = 0;
- p = head;
- }
- }
- return count;
- }
-
- final class Itr implements Iterator<E> {
- private Node nextNode; // next node to return item for
- private E nextItem; // the corresponding item
- private Node lastRet; // last returned node, to support remove
- private Node lastPred; // predecessor to unlink lastRet
-
- /**
- * Moves to next node after prev, or first node if prev null.
- */
- private void advance(Node prev) {
- /*
- * To track and avoid buildup of deleted nodes in the face
- * of calls to both Queue.remove and Itr.remove, we must
- * include variants of unsplice and sweep upon each
- * advance: Upon Itr.remove, we may need to catch up links
- * from lastPred, and upon other removes, we might need to
- * skip ahead from stale nodes and unsplice deleted ones
- * found while advancing.
- */
-
- Node r, b; // reset lastPred upon possible deletion of lastRet
- if ((r = lastRet) != null && !r.isMatched())
- lastPred = r; // next lastPred is old lastRet
- else if ((b = lastPred) == null || b.isMatched())
- lastPred = null; // at start of list
- else {
- Node s, n; // help with removal of lastPred.next
- while ((s = b.next) != null &&
- s != b && s.isMatched() &&
- (n = s.next) != null && n != s)
- b.casNext(s, n);
- }
-
- this.lastRet = prev;
-
- for (Node p = prev, s, n;;) {
- s = (p == null) ? head : p.next;
- if (s == null)
- break;
- else if (s == p) {
- p = null;
- continue;
- }
- Object item = s.item;
- if (s.isData) {
- if (item != null && item != s) {
- nextItem = LinkedTransferQueue.<E>cast(item);
- nextNode = s;
- return;
- }
- }
- else if (item == null)
- break;
- // assert s.isMatched();
- if (p == null)
- p = s;
- else if ((n = s.next) == null)
- break;
- else if (s == n)
- p = null;
- else
- p.casNext(s, n);
- }
- nextNode = null;
- nextItem = null;
- }
-
- Itr() {
- advance(null);
- }
-
- public final boolean hasNext() {
- return nextNode != null;
- }
-
- public final E next() {
- Node p = nextNode;
- if (p == null) throw new NoSuchElementException();
- E e = nextItem;
- advance(p);
- return e;
- }
-
- public final void remove() {
- final Node lastRet = this.lastRet;
- if (lastRet == null)
- throw new IllegalStateException();
- this.lastRet = null;
- if (lastRet.tryMatchData())
- unsplice(lastPred, lastRet);
- }
- }
-
- /* -------------- Removal methods -------------- */
-
- /**
- * Unsplices (now or later) the given deleted/cancelled node with
- * the given predecessor.
- *
- * @param pred a node that was at one time known to be the
- * predecessor of s, or null or s itself if s is/was at head
- * @param s the node to be unspliced
- */
- final void unsplice(Node pred, Node s) {
- s.forgetContents(); // forget unneeded fields
- /*
- * See above for rationale. Briefly: if pred still points to
- * s, try to unlink s. If s cannot be unlinked, because it is
- * trailing node or pred might be unlinked, and neither pred
- * nor s are head or offlist, add to sweepVotes, and if enough
- * votes have accumulated, sweep.
- */
- if (pred != null && pred != s && pred.next == s) {
- Node n = s.next;
- if (n == null ||
- (n != s && pred.casNext(s, n) && pred.isMatched())) {
- for (;;) { // check if at, or could be, head
- Node h = head;
- if (h == pred || h == s || h == null)
- return; // at head or list empty
- if (!h.isMatched())
- break;
- Node hn = h.next;
- if (hn == null)
- return; // now empty
- if (hn != h && casHead(h, hn))
- h.forgetNext(); // advance head
- }
- if (pred.next != pred && s.next != s) { // recheck if offlist
- for (;;) { // sweep now if enough votes
- int v = sweepVotes;
- if (v < SWEEP_THRESHOLD) {
- if (casSweepVotes(v, v + 1))
- break;
- }
- else if (casSweepVotes(v, 0)) {
- sweep();
- break;
- }
- }
- }
- }
- }
- }
-
- /**
- * Unlinks matched (typically cancelled) nodes encountered in a
- * traversal from head.
- */
- private void sweep() {
- for (Node p = head, s, n; p != null && (s = p.next) != null; ) {
- if (!s.isMatched())
- // Unmatched nodes are never self-linked
- p = s;
- else if ((n = s.next) == null) // trailing node is pinned
- break;
- else if (s == n) // stale
- // No need to also check for p == s, since that implies s == n
- p = head;
- else
- p.casNext(s, n);
- }
- }
-
- /**
- * Main implementation of remove(Object)
- */
- private boolean findAndRemove(Object e) {
- if (e != null) {
- for (Node pred = null, p = head; p != null; ) {
- Object item = p.item;
- if (p.isData) {
- if (item != null && item != p && e.equals(item) &&
- p.tryMatchData()) {
- unsplice(pred, p);
- return true;
- }
- }
- else if (item == null)
- break;
- pred = p;
- if ((p = p.next) == pred) { // stale
- pred = null;
- p = head;
- }
- }
- }
- return false;
- }
-
-
- /**
- * Creates an initially empty {@code LinkedTransferQueue}.
- */
- public LinkedTransferQueue() {
- }
-
- /**
- * Creates a {@code LinkedTransferQueue}
- * initially containing the elements of the given collection,
- * added in traversal order of the collection's iterator.
- *
- * @param c the collection of elements to initially contain
- * @throws NullPointerException if the specified collection or any
- * of its elements are null
- */
- public LinkedTransferQueue(Collection<? extends E> c) {
- this();
- addAll(c);
- }
-
- /**
- * Inserts the specified element at the tail of this queue.
- * As the queue is unbounded, this method will never block.
- *
- * @throws NullPointerException if the specified element is null
- */
- public void put(E e) {
- xfer(e, true, ASYNC, 0);
- }
-
- /**
- * Inserts the specified element at the tail of this queue.
- * As the queue is unbounded, this method will never block or
- * return {@code false}.
- *
- * @return {@code true} (as specified by
- * {@link java.util.concurrent.BlockingQueue#offer(Object,long,TimeUnit)
- * BlockingQueue.offer})
- * @throws NullPointerException if the specified element is null
- */
- public boolean offer(E e, long timeout, TimeUnit unit) {
- xfer(e, true, ASYNC, 0);
- return true;
- }
-
- /**
- * Inserts the specified element at the tail of this queue.
- * As the queue is unbounded, this method will never return {@code false}.
- *
- * @return {@code true} (as specified by {@link Queue#offer})
- * @throws NullPointerException if the specified element is null
- */
- public boolean offer(E e) {
- xfer(e, true, ASYNC, 0);
- return true;
- }
-
- /**
- * Inserts the specified element at the tail of this queue.
- * As the queue is unbounded, this method will never throw
- * {@link IllegalStateException} or return {@code false}.
- *
- * @return {@code true} (as specified by {@link Collection#add})
- * @throws NullPointerException if the specified element is null
- */
- public boolean add(E e) {
- xfer(e, true, ASYNC, 0);
- return true;
- }
-
- /**
- * Transfers the element to a waiting consumer immediately, if possible.
- *
- * <p>More precisely, transfers the specified element immediately
- * if there exists a consumer already waiting to receive it (in
- * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
- * otherwise returning {@code false} without enqueuing the element.
- *
- * @throws NullPointerException if the specified element is null
- */
- public boolean tryTransfer(E e) {
- return xfer(e, true, NOW, 0) == null;
- }
-
- /**
- * Transfers the element to a consumer, waiting if necessary to do so.
- *
- * <p>More precisely, transfers the specified element immediately
- * if there exists a consumer already waiting to receive it (in
- * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
- * else inserts the specified element at the tail of this queue
- * and waits until the element is received by a consumer.
- *
- * @throws NullPointerException if the specified element is null
- */
- public void transfer(E e) throws InterruptedException {
- if (xfer(e, true, SYNC, 0) != null) {
- Thread.interrupted(); // failure possible only due to interrupt
- throw new InterruptedException();
- }
- }
-
- /**
- * Transfers the element to a consumer if it is possible to do so
- * before the timeout elapses.
- *
- * <p>More precisely, transfers the specified element immediately
- * if there exists a consumer already waiting to receive it (in
- * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
- * else inserts the specified element at the tail of this queue
- * and waits until the element is received by a consumer,
- * returning {@code false} if the specified wait time elapses
- * before the element can be transferred.
- *
- * @throws NullPointerException if the specified element is null
- */
- public boolean tryTransfer(E e, long timeout, TimeUnit unit)
- throws InterruptedException {
- if (xfer(e, true, TIMED, unit.toNanos(timeout)) == null)
- return true;
- if (!Thread.interrupted())
- return false;
- throw new InterruptedException();
- }
-
- public E take() throws InterruptedException {
- E e = xfer(null, false, SYNC, 0);
- if (e != null)
- return e;
- Thread.interrupted();
- throw new InterruptedException();
- }
-
- public E poll(long timeout, TimeUnit unit) throws InterruptedException {
- E e = xfer(null, false, TIMED, unit.toNanos(timeout));
- if (e != null || !Thread.interrupted())
- return e;
- throw new InterruptedException();
- }
-
- public E poll() {
- return xfer(null, false, NOW, 0);
- }
-
- /**
- * @throws NullPointerException {@inheritDoc}
- * @throws IllegalArgumentException {@inheritDoc}
- */
- public int drainTo(Collection<? super E> c) {
- if (c == null)
- throw new NullPointerException();
- if (c == this)
- throw new IllegalArgumentException();
- int n = 0;
- for (E e; (e = poll()) != null;) {
- c.add(e);
- ++n;
- }
- return n;
- }
-
- /**
- * @throws NullPointerException {@inheritDoc}
- * @throws IllegalArgumentException {@inheritDoc}
- */
- public int drainTo(Collection<? super E> c, int maxElements) {
- if (c == null)
- throw new NullPointerException();
- if (c == this)
- throw new IllegalArgumentException();
- int n = 0;
- for (E e; n < maxElements && (e = poll()) != null;) {
- c.add(e);
- ++n;
- }
- return n;
- }
-
- /**
- * Returns an iterator over the elements in this queue in proper sequence.
- * The elements will be returned in order from first (head) to last (tail).
- *
- * <p>The returned iterator is a "weakly consistent" iterator that
- * will never throw {@link java.util.ConcurrentModificationException
- * ConcurrentModificationException}, and guarantees to traverse
- * elements as they existed upon construction of the iterator, and
- * may (but is not guaranteed to) reflect any modifications
- * subsequent to construction.
- *
- * @return an iterator over the elements in this queue in proper sequence
- */
- public Iterator<E> iterator() {
- return new Itr();
- }
-
- public E peek() {
- return firstDataItem();
- }
-
- /**
- * Returns {@code true} if this queue contains no elements.
- *
- * @return {@code true} if this queue contains no elements
- */
- public boolean isEmpty() {
- for (Node p = head; p != null; p = succ(p)) {
- if (!p.isMatched())
- return !p.isData;
- }
- return true;
- }
-
- public boolean hasWaitingConsumer() {
- return firstOfMode(false) != null;
- }
-
- /**
- * Returns the number of elements in this queue. If this queue
- * contains more than {@code Integer.MAX_VALUE} elements, returns
- * {@code Integer.MAX_VALUE}.
- *
- * <p>Beware that, unlike in most collections, this method is
- * <em>NOT</em> a constant-time operation. Because of the
- * asynchronous nature of these queues, determining the current
- * number of elements requires an O(n) traversal.
- *
- * @return the number of elements in this queue
- */
- public int size() {
- return countOfMode(true);
- }
-
- public int getWaitingConsumerCount() {
- return countOfMode(false);
- }
-
- /**
- * Removes a single instance of the specified element from this queue,
- * if it is present. More formally, removes an element {@code e} such
- * that {@code o.equals(e)}, if this queue contains one or more such
- * elements.
- * Returns {@code true} if this queue contained the specified element
- * (or equivalently, if this queue changed as a result of the call).
- *
- * @param o element to be removed from this queue, if present
- * @return {@code true} if this queue changed as a result of the call
- */
- public boolean remove(Object o) {
- return findAndRemove(o);
- }
-
- /**
- * Returns {@code true} if this queue contains the specified element.
- * More formally, returns {@code true} if and only if this queue contains
- * at least one element {@code e} such that {@code o.equals(e)}.
- *
- * @param o object to be checked for containment in this queue
- * @return {@code true} if this queue contains the specified element
- */
- public boolean contains(Object o) {
- if (o == null) return false;
- for (Node p = head; p != null; p = succ(p)) {
- Object item = p.item;
- if (p.isData) {
- if (item != null && item != p && o.equals(item))
- return true;
- }
- else if (item == null)
- break;
- }
- return false;
- }
-
- /**
- * Always returns {@code Integer.MAX_VALUE} because a
- * {@code LinkedTransferQueue} is not capacity constrained.
- *
- * @return {@code Integer.MAX_VALUE} (as specified by
- * {@link java.util.concurrent.BlockingQueue#remainingCapacity()
- * BlockingQueue.remainingCapacity})
- */
- public int remainingCapacity() {
- return Integer.MAX_VALUE;
- }
-
- /**
- * Saves the state to a stream (that is, serializes it).
- *
- * @serialData All of the elements (each an {@code E}) in
- * the proper order, followed by a null
- * @param s the stream
- */
- private void writeObject(java.io.ObjectOutputStream s)
- throws java.io.IOException {
- s.defaultWriteObject();
- for (E e : this)
- s.writeObject(e);
- // Use trailing null as sentinel
- s.writeObject(null);
- }
-
- /**
- * Reconstitutes the Queue instance from a stream (that is,
- * deserializes it).
- *
- * @param s the stream
- */
- private void readObject(java.io.ObjectInputStream s)
- throws java.io.IOException, ClassNotFoundException {
- s.defaultReadObject();
- for (;;) {
- @SuppressWarnings("unchecked")
- E item = (E) s.readObject();
- if (item == null)
- break;
- else
- offer(item);
- }
- }
-
- // Unsafe mechanics
-
- private static final sun.misc.Unsafe UNSAFE;
- private static final long headOffset;
- private static final long tailOffset;
- private static final long sweepVotesOffset;
- static {
- try {
- UNSAFE = getUnsafe();
- Class<?> k = LinkedTransferQueue.class;
- headOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("head"));
- tailOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("tail"));
- sweepVotesOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("sweepVotes"));
- } catch (Exception e) {
- throw new Error(e);
- }
- }
-
- /**
- * Returns a sun.misc.Unsafe. Suitable for use in a 3rd party package.
- * Replace with a simple call to Unsafe.getUnsafe when integrating
- * into a jdk.
- *
- * @return a sun.misc.Unsafe
- */
- static sun.misc.Unsafe getUnsafe() {
- return scala.concurrent.util.Unsafe.instance;
- }
-
-}
diff --git a/src/forkjoin/scala/concurrent/forkjoin/RecursiveAction.java b/src/forkjoin/scala/concurrent/forkjoin/RecursiveAction.java
deleted file mode 100644
index 1e7cdd952d..0000000000
--- a/src/forkjoin/scala/concurrent/forkjoin/RecursiveAction.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-package scala.concurrent.forkjoin;
-
-/**
- * A recursive resultless {@link ForkJoinTask}. This class
- * establishes conventions to parameterize resultless actions as
- * {@code Void} {@code ForkJoinTask}s. Because {@code null} is the
- * only valid value of type {@code Void}, methods such as {@code join}
- * always return {@code null} upon completion.
- *
- * <p><b>Sample Usages.</b> Here is a simple but complete ForkJoin
- * sort that sorts a given {@code long[]} array:
- *
- * <pre> {@code
- * static class SortTask extends RecursiveAction {
- * final long[] array; final int lo, hi;
- * SortTask(long[] array, int lo, int hi) {
- * this.array = array; this.lo = lo; this.hi = hi;
- * }
- * SortTask(long[] array) { this(array, 0, array.length); }
- * protected void compute() {
- * if (hi - lo < THRESHOLD)
- * sortSequentially(lo, hi);
- * else {
- * int mid = (lo + hi) >>> 1;
- * invokeAll(new SortTask(array, lo, mid),
- * new SortTask(array, mid, hi));
- * merge(lo, mid, hi);
- * }
- * }
- * // implementation details follow:
- * final static int THRESHOLD = 1000;
- * void sortSequentially(int lo, int hi) {
- * Arrays.sort(array, lo, hi);
- * }
- * void merge(int lo, int mid, int hi) {
- * long[] buf = Arrays.copyOfRange(array, lo, mid);
- * for (int i = 0, j = lo, k = mid; i < buf.length; j++)
- * array[j] = (k == hi || buf[i] < array[k]) ?
- * buf[i++] : array[k++];
- * }
- * }}</pre>
- *
- * You could then sort {@code anArray} by creating {@code new
- * SortTask(anArray)} and invoking it in a ForkJoinPool. As a more
- * concrete simple example, the following task increments each element
- * of an array:
- * <pre> {@code
- * class IncrementTask extends RecursiveAction {
- * final long[] array; final int lo, hi;
- * IncrementTask(long[] array, int lo, int hi) {
- * this.array = array; this.lo = lo; this.hi = hi;
- * }
- * protected void compute() {
- * if (hi - lo < THRESHOLD) {
- * for (int i = lo; i < hi; ++i)
- * array[i]++;
- * }
- * else {
- * int mid = (lo + hi) >>> 1;
- * invokeAll(new IncrementTask(array, lo, mid),
- * new IncrementTask(array, mid, hi));
- * }
- * }
- * }}</pre>
- *
- * <p>The following example illustrates some refinements and idioms
- * that may lead to better performance: RecursiveActions need not be
- * fully recursive, so long as they maintain the basic
- * divide-and-conquer approach. Here is a class that sums the squares
- * of each element of a double array, by subdividing out only the
- * right-hand-sides of repeated divisions by two, and keeping track of
- * them with a chain of {@code next} references. It uses a dynamic
- * threshold based on method {@code getSurplusQueuedTaskCount}, but
- * counterbalances potential excess partitioning by directly
- * performing leaf actions on unstolen tasks rather than further
- * subdividing.
- *
- * <pre> {@code
- * double sumOfSquares(ForkJoinPool pool, double[] array) {
- * int n = array.length;
- * Applyer a = new Applyer(array, 0, n, null);
- * pool.invoke(a);
- * return a.result;
- * }
- *
- * class Applyer extends RecursiveAction {
- * final double[] array;
- * final int lo, hi;
- * double result;
- * Applyer next; // keeps track of right-hand-side tasks
- * Applyer(double[] array, int lo, int hi, Applyer next) {
- * this.array = array; this.lo = lo; this.hi = hi;
- * this.next = next;
- * }
- *
- * double atLeaf(int l, int h) {
- * double sum = 0;
- * for (int i = l; i < h; ++i) // perform leftmost base step
- * sum += array[i] * array[i];
- * return sum;
- * }
- *
- * protected void compute() {
- * int l = lo;
- * int h = hi;
- * Applyer right = null;
- * while (h - l > 1 && getSurplusQueuedTaskCount() <= 3) {
- * int mid = (l + h) >>> 1;
- * right = new Applyer(array, mid, h, right);
- * right.fork();
- * h = mid;
- * }
- * double sum = atLeaf(l, h);
- * while (right != null) {
- * if (right.tryUnfork()) // directly calculate if not stolen
- * sum += right.atLeaf(right.lo, right.hi);
- * else {
- * right.join();
- * sum += right.result;
- * }
- * right = right.next;
- * }
- * result = sum;
- * }
- * }}</pre>
- *
- * @since 1.7
- * @author Doug Lea
- */
-public abstract class RecursiveAction extends ForkJoinTask<Void> {
- private static final long serialVersionUID = 5232453952276485070L;
-
- /**
- * The main computation performed by this task.
- */
- protected abstract void compute();
-
- /**
- * Always returns {@code null}.
- *
- * @return {@code null} always
- */
- public final Void getRawResult() { return null; }
-
- /**
- * Requires null completion value.
- */
- protected final void setRawResult(Void mustBeNull) { }
-
- /**
- * Implements execution conventions for RecursiveActions.
- */
- protected final boolean exec() {
- compute();
- return true;
- }
-
-}
diff --git a/src/forkjoin/scala/concurrent/forkjoin/RecursiveTask.java b/src/forkjoin/scala/concurrent/forkjoin/RecursiveTask.java
deleted file mode 100644
index d1e1547143..0000000000
--- a/src/forkjoin/scala/concurrent/forkjoin/RecursiveTask.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-package scala.concurrent.forkjoin;
-
-/**
- * A recursive result-bearing {@link ForkJoinTask}.
- *
- * <p>For a classic example, here is a task computing Fibonacci numbers:
- *
- * <pre> {@code
- * class Fibonacci extends RecursiveTask<Integer> {
- * final int n;
- * Fibonacci(int n) { this.n = n; }
- * Integer compute() {
- * if (n <= 1)
- * return n;
- * Fibonacci f1 = new Fibonacci(n - 1);
- * f1.fork();
- * Fibonacci f2 = new Fibonacci(n - 2);
- * return f2.compute() + f1.join();
- * }
- * }}</pre>
- *
- * However, besides being a dumb way to compute Fibonacci functions
- * (there is a simple fast linear algorithm that you'd use in
- * practice), this is likely to perform poorly because the smallest
- * subtasks are too small to be worthwhile splitting up. Instead, as
- * is the case for nearly all fork/join applications, you'd pick some
- * minimum granularity size (for example 10 here) for which you always
- * sequentially solve rather than subdividing.
- *
- * @since 1.7
- * @author Doug Lea
- */
-public abstract class RecursiveTask<V> extends ForkJoinTask<V> {
- private static final long serialVersionUID = 5232453952276485270L;
-
- /**
- * The result of the computation.
- */
- V result;
-
- /**
- * The main computation performed by this task.
- */
- protected abstract V compute();
-
- public final V getRawResult() {
- return result;
- }
-
- protected final void setRawResult(V value) {
- result = value;
- }
-
- /**
- * Implements execution conventions for RecursiveTask.
- */
- protected final boolean exec() {
- result = compute();
- return true;
- }
-
-}
diff --git a/src/forkjoin/scala/concurrent/forkjoin/ThreadLocalRandom.java b/src/forkjoin/scala/concurrent/forkjoin/ThreadLocalRandom.java
deleted file mode 100644
index 19237c9092..0000000000
--- a/src/forkjoin/scala/concurrent/forkjoin/ThreadLocalRandom.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-package scala.concurrent.forkjoin;
-
-import java.util.Random;
-
-/**
- * A random number generator isolated to the current thread. Like the
- * global {@link java.util.Random} generator used by the {@link
- * java.lang.Math} class, a {@code ThreadLocalRandom} is initialized
- * with an internally generated seed that may not otherwise be
- * modified. When applicable, use of {@code ThreadLocalRandom} rather
- * than shared {@code Random} objects in concurrent programs will
- * typically encounter much less overhead and contention. Use of
- * {@code ThreadLocalRandom} is particularly appropriate when multiple
- * tasks (for example, each a {@link ForkJoinTask}) use random numbers
- * in parallel in thread pools.
- *
- * <p>Usages of this class should typically be of the form:
- * {@code ThreadLocalRandom.current().nextX(...)} (where
- * {@code X} is {@code Int}, {@code Long}, etc).
- * When all usages are of this form, it is never possible to
- * accidently share a {@code ThreadLocalRandom} across multiple threads.
- *
- * <p>This class also provides additional commonly used bounded random
- * generation methods.
- *
- * @since 1.7
- * @author Doug Lea
- */
-public class ThreadLocalRandom extends Random {
- // same constants as Random, but must be redeclared because private
- private static final long multiplier = 0x5DEECE66DL;
- private static final long addend = 0xBL;
- private static final long mask = (1L << 48) - 1;
-
- /**
- * The random seed. We can't use super.seed.
- */
- private long rnd;
-
- /**
- * Initialization flag to permit calls to setSeed to succeed only
- * while executing the Random constructor. We can't allow others
- * since it would cause setting seed in one part of a program to
- * unintentionally impact other usages by the thread.
- */
- boolean initialized;
-
- // Padding to help avoid memory contention among seed updates in
- // different TLRs in the common case that they are located near
- // each other.
- private long pad0, pad1, pad2, pad3, pad4, pad5, pad6, pad7;
-
- /**
- * The actual ThreadLocal
- */
- private static final ThreadLocal<ThreadLocalRandom> localRandom =
- new ThreadLocal<ThreadLocalRandom>() {
- protected ThreadLocalRandom initialValue() {
- return new ThreadLocalRandom();
- }
- };
-
-
- /**
- * Constructor called only by localRandom.initialValue.
- */
- ThreadLocalRandom() {
- super();
- initialized = true;
- }
-
- /**
- * Returns the current thread's {@code ThreadLocalRandom}.
- *
- * @return the current thread's {@code ThreadLocalRandom}
- */
- public static ThreadLocalRandom current() {
- return localRandom.get();
- }
-
- /**
- * Throws {@code UnsupportedOperationException}. Setting seeds in
- * this generator is not supported.
- *
- * @throws UnsupportedOperationException always
- */
- public void setSeed(long seed) {
- if (initialized)
- throw new UnsupportedOperationException();
- rnd = (seed ^ multiplier) & mask;
- }
-
- protected int next(int bits) {
- rnd = (rnd * multiplier + addend) & mask;
- return (int) (rnd >>> (48-bits));
- }
-
- /**
- * Returns a pseudorandom, uniformly distributed value between the
- * given least value (inclusive) and bound (exclusive).
- *
- * @param least the least value returned
- * @param bound the upper bound (exclusive)
- * @throws IllegalArgumentException if least greater than or equal
- * to bound
- * @return the next value
- */
- public int nextInt(int least, int bound) {
- if (least >= bound)
- throw new IllegalArgumentException();
- return nextInt(bound - least) + least;
- }
-
- /**
- * Returns a pseudorandom, uniformly distributed value
- * between 0 (inclusive) and the specified value (exclusive).
- *
- * @param n the bound on the random number to be returned. Must be
- * positive.
- * @return the next value
- * @throws IllegalArgumentException if n is not positive
- */
- public long nextLong(long n) {
- if (n <= 0)
- throw new IllegalArgumentException("n must be positive");
- // Divide n by two until small enough for nextInt. On each
- // iteration (at most 31 of them but usually much less),
- // randomly choose both whether to include high bit in result
- // (offset) and whether to continue with the lower vs upper
- // half (which makes a difference only if odd).
- long offset = 0;
- while (n >= Integer.MAX_VALUE) {
- int bits = next(2);
- long half = n >>> 1;
- long nextn = ((bits & 2) == 0) ? half : n - half;
- if ((bits & 1) == 0)
- offset += n - nextn;
- n = nextn;
- }
- return offset + nextInt((int) n);
- }
-
- /**
- * Returns a pseudorandom, uniformly distributed value between the
- * given least value (inclusive) and bound (exclusive).
- *
- * @param least the least value returned
- * @param bound the upper bound (exclusive)
- * @return the next value
- * @throws IllegalArgumentException if least greater than or equal
- * to bound
- */
- public long nextLong(long least, long bound) {
- if (least >= bound)
- throw new IllegalArgumentException();
- return nextLong(bound - least) + least;
- }
-
- /**
- * Returns a pseudorandom, uniformly distributed {@code double} value
- * between 0 (inclusive) and the specified value (exclusive).
- *
- * @param n the bound on the random number to be returned. Must be
- * positive.
- * @return the next value
- * @throws IllegalArgumentException if n is not positive
- */
- public double nextDouble(double n) {
- if (n <= 0)
- throw new IllegalArgumentException("n must be positive");
- return nextDouble() * n;
- }
-
- /**
- * Returns a pseudorandom, uniformly distributed value between the
- * given least value (inclusive) and bound (exclusive).
- *
- * @param least the least value returned
- * @param bound the upper bound (exclusive)
- * @return the next value
- * @throws IllegalArgumentException if least greater than or equal
- * to bound
- */
- public double nextDouble(double least, double bound) {
- if (least >= bound)
- throw new IllegalArgumentException();
- return nextDouble() * (bound - least) + least;
- }
-
- private static final long serialVersionUID = -5851777807851030925L;
-}
diff --git a/src/forkjoin/scala/concurrent/forkjoin/TransferQueue.java b/src/forkjoin/scala/concurrent/forkjoin/TransferQueue.java
deleted file mode 100644
index 7d149c7ae5..0000000000
--- a/src/forkjoin/scala/concurrent/forkjoin/TransferQueue.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-package scala.concurrent.forkjoin;
-import java.util.concurrent.*;
-
-/**
- * A {@link BlockingQueue} in which producers may wait for consumers
- * to receive elements. A {@code TransferQueue} may be useful for
- * example in message passing applications in which producers
- * sometimes (using method {@link #transfer}) await receipt of
- * elements by consumers invoking {@code take} or {@code poll}, while
- * at other times enqueue elements (via method {@code put}) without
- * waiting for receipt.
- * {@linkplain #tryTransfer(Object) Non-blocking} and
- * {@linkplain #tryTransfer(Object,long,TimeUnit) time-out} versions of
- * {@code tryTransfer} are also available.
- * A {@code TransferQueue} may also be queried, via {@link
- * #hasWaitingConsumer}, whether there are any threads waiting for
- * items, which is a converse analogy to a {@code peek} operation.
- *
- * <p>Like other blocking queues, a {@code TransferQueue} may be
- * capacity bounded. If so, an attempted transfer operation may
- * initially block waiting for available space, and/or subsequently
- * block waiting for reception by a consumer. Note that in a queue
- * with zero capacity, such as {@link SynchronousQueue}, {@code put}
- * and {@code transfer} are effectively synonymous.
- *
- * <p>This interface is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
- * Java Collections Framework</a>.
- *
- * @since 1.7
- * @author Doug Lea
- * @param <E> the type of elements held in this collection
- */
-public interface TransferQueue<E> extends BlockingQueue<E> {
- /**
- * Transfers the element to a waiting consumer immediately, if possible.
- *
- * <p>More precisely, transfers the specified element immediately
- * if there exists a consumer already waiting to receive it (in
- * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
- * otherwise returning {@code false} without enqueuing the element.
- *
- * @param e the element to transfer
- * @return {@code true} if the element was transferred, else
- * {@code false}
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this queue
- */
- boolean tryTransfer(E e);
-
- /**
- * Transfers the element to a consumer, waiting if necessary to do so.
- *
- * <p>More precisely, transfers the specified element immediately
- * if there exists a consumer already waiting to receive it (in
- * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
- * else waits until the element is received by a consumer.
- *
- * @param e the element to transfer
- * @throws InterruptedException if interrupted while waiting,
- * in which case the element is not left enqueued
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this queue
- */
- void transfer(E e) throws InterruptedException;
-
- /**
- * Transfers the element to a consumer if it is possible to do so
- * before the timeout elapses.
- *
- * <p>More precisely, transfers the specified element immediately
- * if there exists a consumer already waiting to receive it (in
- * {@link #take} or timed {@link #poll(long,TimeUnit) poll}),
- * else waits until the element is received by a consumer,
- * returning {@code false} if the specified wait time elapses
- * before the element can be transferred.
- *
- * @param e the element to transfer
- * @param timeout how long to wait before giving up, in units of
- * {@code unit}
- * @param unit a {@code TimeUnit} determining how to interpret the
- * {@code timeout} parameter
- * @return {@code true} if successful, or {@code false} if
- * the specified waiting time elapses before completion,
- * in which case the element is not left enqueued
- * @throws InterruptedException if interrupted while waiting,
- * in which case the element is not left enqueued
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this queue
- */
- boolean tryTransfer(E e, long timeout, TimeUnit unit)
- throws InterruptedException;
-
- /**
- * Returns {@code true} if there is at least one consumer waiting
- * to receive an element via {@link #take} or
- * timed {@link #poll(long,TimeUnit) poll}.
- * The return value represents a momentary state of affairs.
- *
- * @return {@code true} if there is at least one waiting consumer
- */
- boolean hasWaitingConsumer();
-
- /**
- * Returns an estimate of the number of consumers waiting to
- * receive elements via {@link #take} or timed
- * {@link #poll(long,TimeUnit) poll}. The return value is an
- * approximation of a momentary state of affairs, that may be
- * inaccurate if consumers have completed or given up waiting.
- * The value may be useful for monitoring and heuristics, but
- * not for synchronization control. Implementations of this
- * method are likely to be noticeably slower than those for
- * {@link #hasWaitingConsumer}.
- *
- * @return the number of consumers waiting to receive elements
- */
- int getWaitingConsumerCount();
-}
diff --git a/src/forkjoin/scala/concurrent/forkjoin/package-info.java b/src/forkjoin/scala/concurrent/forkjoin/package-info.java
deleted file mode 100644
index 3561b9b44a..0000000000
--- a/src/forkjoin/scala/concurrent/forkjoin/package-info.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-
-/**
- * Preview versions of classes targeted for Java 7. Includes a
- * fine-grained parallel computation framework: ForkJoinTasks and
- * their related support classes provide a very efficient basis for
- * obtaining platform-independent parallel speed-ups of
- * computation-intensive operations. They are not a full substitute
- * for the kinds of arbitrary processing supported by Executors or
- * Threads. However, when applicable, they typically provide
- * significantly greater performance on multiprocessor platforms.
- *
- * <p>Candidates for fork/join processing mainly include those that
- * can be expressed using parallel divide-and-conquer techniques: To
- * solve a problem, break it in two (or more) parts, and then solve
- * those parts in parallel, continuing on in this way until the
- * problem is too small to be broken up, so is solved directly. The
- * underlying <em>work-stealing</em> framework makes subtasks
- * available to other threads (normally one per CPU), that help
- * complete the tasks. In general, the most efficient ForkJoinTasks
- * are those that directly implement this algorithmic design pattern.
- */
-package scala.concurrent.forkjoin;
diff --git a/src/forkjoin/scala/concurrent/util/Unsafe.java b/src/forkjoin/scala/concurrent/util/Unsafe.java
deleted file mode 100644
index ef893c94d9..0000000000
--- a/src/forkjoin/scala/concurrent/util/Unsafe.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.concurrent.util;
-
-
-
-import java.lang.reflect.Field;
-
-
-
-public final class Unsafe {
- public final static sun.misc.Unsafe instance;
- static {
- try {
- sun.misc.Unsafe found = null;
- for(Field field : sun.misc.Unsafe.class.getDeclaredFields()) {
- if (field.getType() == sun.misc.Unsafe.class) {
- field.setAccessible(true);
- found = (sun.misc.Unsafe) field.get(null);
- break;
- }
- }
- if (found == null) throw new IllegalStateException("Can't find instance of sun.misc.Unsafe");
- else instance = found;
- } catch(Throwable t) {
- throw new ExceptionInInitializerError(t);
- }
- }
-}
diff --git a/src/intellij/actors.iml.SAMPLE b/src/intellij/actors.iml.SAMPLE
deleted file mode 100644
index dfdf396c46..0000000000
--- a/src/intellij/actors.iml.SAMPLE
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" inherit-compiler-output="true">
- <exclude-output />
- <content url="file://$MODULE_DIR$/../actors">
- <sourceFolder url="file://$MODULE_DIR$/../actors" isTestSource="false" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="library" />
- <orderEntry type="module" module-name="forkjoin" />
- <orderEntry type="library" name="starr" level="project" />
- </component>
-</module> \ No newline at end of file
diff --git a/src/intellij/forkjoin.iml.SAMPLE b/src/intellij/forkjoin.iml.SAMPLE
deleted file mode 100644
index 42507b2911..0000000000
--- a/src/intellij/forkjoin.iml.SAMPLE
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" inherit-compiler-output="true">
- <exclude-output />
- <content url="file://$MODULE_DIR$/../forkjoin">
- <sourceFolder url="file://$MODULE_DIR$/../forkjoin" isTestSource="false" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- </component>
-</module> \ No newline at end of file
diff --git a/src/intellij/library.iml.SAMPLE b/src/intellij/library.iml.SAMPLE
index b03fef9414..8ceb9dd3f1 100644
--- a/src/intellij/library.iml.SAMPLE
+++ b/src/intellij/library.iml.SAMPLE
@@ -8,7 +8,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="forkjoin" />
<orderEntry type="library" name="starr" level="project" />
</component>
</module> \ No newline at end of file
diff --git a/src/intellij/scala.ipr.SAMPLE b/src/intellij/scala.ipr.SAMPLE
index 47ac2be188..3e6e074717 100644
--- a/src/intellij/scala.ipr.SAMPLE
+++ b/src/intellij/scala.ipr.SAMPLE
@@ -35,9 +35,7 @@
</component>
<component name="ProjectModuleManager">
<modules>
- <module fileurl="file://$PROJECT_DIR$/actors.iml" filepath="$PROJECT_DIR$/actors.iml" />
<module fileurl="file://$PROJECT_DIR$/compiler.iml" filepath="$PROJECT_DIR$/compiler.iml" />
- <module fileurl="file://$PROJECT_DIR$/forkjoin.iml" filepath="$PROJECT_DIR$/forkjoin.iml" />
<module fileurl="file://$PROJECT_DIR$/interactive.iml" filepath="$PROJECT_DIR$/interactive.iml" />
<module fileurl="file://$PROJECT_DIR$/library.iml" filepath="$PROJECT_DIR$/library.iml" />
<module fileurl="file://$PROJECT_DIR$/manual.iml" filepath="$PROJECT_DIR$/manual.iml" />
diff --git a/src/intellij/test-junit.iml.SAMPLE b/src/intellij/test-junit.iml.SAMPLE
index 86dc39c175..326c9813aa 100644
--- a/src/intellij/test-junit.iml.SAMPLE
+++ b/src/intellij/test-junit.iml.SAMPLE
@@ -7,9 +7,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="actors" />
<orderEntry type="module" module-name="compiler" />
- <orderEntry type="module" module-name="forkjoin" />
<orderEntry type="module" module-name="library" />
<orderEntry type="module" module-name="partest-extras" />
<orderEntry type="module" module-name="reflect" />
diff --git a/src/intellij/test.iml.SAMPLE b/src/intellij/test.iml.SAMPLE
index 5047967721..d1f2975fbf 100644
--- a/src/intellij/test.iml.SAMPLE
+++ b/src/intellij/test.iml.SAMPLE
@@ -7,9 +7,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="actors" />
<orderEntry type="module" module-name="compiler" />
- <orderEntry type="module" module-name="forkjoin" />
<orderEntry type="module" module-name="interactive" />
<orderEntry type="module" module-name="library" />
<orderEntry type="module" module-name="partest-extras" />
diff --git a/src/interactive/scala/tools/nsc/interactive/Global.scala b/src/interactive/scala/tools/nsc/interactive/Global.scala
index 727bfdd510..e79c1a01ab 100644
--- a/src/interactive/scala/tools/nsc/interactive/Global.scala
+++ b/src/interactive/scala/tools/nsc/interactive/Global.scala
@@ -19,6 +19,8 @@ import scala.annotation.{ elidable, tailrec }
import scala.language.implicitConversions
import scala.tools.nsc.typechecker.Typers
import scala.util.control.Breaks._
+import java.util.concurrent.ConcurrentHashMap
+import scala.collection.JavaConverters.mapAsScalaMapConverter
/**
* This trait allows the IDE to have an instance of the PC that
@@ -157,33 +159,20 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
override def forInteractive = true
override protected def synchronizeNames = true
- override def newAsSeenFromMap(pre: Type, clazz: Symbol): AsSeenFromMap =
- new InteractiveAsSeenFromMap(pre, clazz)
-
- class InteractiveAsSeenFromMap(pre: Type, clazz: Symbol) extends AsSeenFromMap(pre, clazz) {
- /** The method formerly known as 'instParamsRelaxed' goes here if it's still necessary,
- * which it is currently supposed it is not.
- *
- * If it is, change AsSeenFromMap method correspondingTypeArgument to call an overridable
- * method rather than aborting in the failure case.
- */
- }
-
/** A map of all loaded files to the rich compilation units that correspond to them.
*/
- val unitOfFile = new LinkedHashMap[AbstractFile, RichCompilationUnit] with
- SynchronizedMap[AbstractFile, RichCompilationUnit] {
+ val unitOfFile = mapAsScalaMapConverter(new ConcurrentHashMap[AbstractFile, RichCompilationUnit] {
override def put(key: AbstractFile, value: RichCompilationUnit) = {
val r = super.put(key, value)
- if (r.isEmpty) debugLog("added unit for "+key)
+ if (r == null) debugLog("added unit for "+key)
r
}
- override def remove(key: AbstractFile) = {
+ override def remove(key: Any) = {
val r = super.remove(key)
- if (r.nonEmpty) debugLog("removed unit for "+key)
+ if (r != null) debugLog("removed unit for "+key)
r
}
- }
+ }).asScala
/** A set containing all those files that need to be removed
* Units are removed by getUnit, typically once a unit is finished compiled.
@@ -1101,7 +1090,7 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
val implicitlyAdded = viaView != NoSymbol
members.add(sym, pre, implicitlyAdded) { (s, st) =>
new TypeMember(s, st,
- context.isAccessible(if (s.hasGetter) s.getter(s.owner) else s, pre, superAccess && !implicitlyAdded),
+ context.isAccessible(if (s.hasGetter) s.getterIn(s.owner) else s, pre, superAccess && !implicitlyAdded),
inherited,
viaView)
}
diff --git a/src/library/rootdoc.txt b/src/library/rootdoc.txt
index e84942b8c4..95f9836cc9 100644
--- a/src/library/rootdoc.txt
+++ b/src/library/rootdoc.txt
@@ -44,12 +44,8 @@ Additional parts of the standard library are shipped as separate libraries. Thes
- [[scala.reflect `scala.reflect`]] - Scala's reflection API (scala-reflect.jar)
- [[scala.xml `scala.xml`]] - XML parsing, manipulation, and serialization (scala-xml.jar)
- [[scala.swing `scala.swing`]] - A convenient wrapper around Java's GUI framework called Swing (scala-swing.jar)
- - [[scala.util.continuations `scala.util.continuations`]] - Delimited continuations using continuation-passing-style
- (scala-continuations-library.jar, scala-continuations-plugin.jar)
- [[scala.util.parsing `scala.util.parsing`]] - [[scala.util.parsing.combinator Parser combinators]], including an
example implementation of a [[scala.util.parsing.json JSON parser]] (scala-parser-combinators.jar)
- - [[scala.actors `scala.actors`]] - Actor-based concurrency (deprecated and replaced by Akka actors,
- scala-actors.jar)
== Automatic imports ==
diff --git a/src/library/scala/PartialFunction.scala b/src/library/scala/PartialFunction.scala
index fba759eb32..98dd35d306 100644
--- a/src/library/scala/PartialFunction.scala
+++ b/src/library/scala/PartialFunction.scala
@@ -161,10 +161,10 @@ trait PartialFunction[-A, +B] extends (A => B) { self =>
object PartialFunction {
/** Composite function produced by `PartialFunction#orElse` method
*/
- private class OrElse[-A, +B] (f1: PartialFunction[A, B], f2: PartialFunction[A, B]) extends PartialFunction[A, B] {
+ private class OrElse[-A, +B] (f1: PartialFunction[A, B], f2: PartialFunction[A, B]) extends scala.runtime.AbstractPartialFunction[A, B] {
def isDefinedAt(x: A) = f1.isDefinedAt(x) || f2.isDefinedAt(x)
- def apply(x: A): B = f1.applyOrElse(x, f2)
+ override def apply(x: A): B = f1.applyOrElse(x, f2)
override def applyOrElse[A1 <: A, B1 >: B](x: A1, default: A1 => B1): B1 = {
val z = f1.applyOrElse(x, checkFallback[B])
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala
index cef62922ac..fa58015a84 100644
--- a/src/library/scala/Predef.scala
+++ b/src/library/scala/Predef.scala
@@ -131,7 +131,7 @@ object Predef extends LowPriorityImplicits with DeprecatedPredef {
def optManifest[T](implicit m: OptManifest[T]) = m
// Minor variations on identity functions
- def identity[A](x: A): A = x // @see `conforms` for the implicit version
+ @inline def identity[A](x: A): A = x // @see `conforms` for the implicit version
@inline def implicitly[T](implicit e: T) = e // for summoning implicit values from the nether world -- TODO: when dependent method types are on by default, give this result type `e.type`, so that inliner has better chance of knowing which method to inline in calls like `implicitly[MatchingStrategy[Option]].zero`
@inline def locally[T](x: T): T = x // to communicate intent and avoid unmoored statements
@@ -269,13 +269,6 @@ object Predef extends LowPriorityImplicits with DeprecatedPredef {
@inline def formatted(fmtstr: String): String = fmtstr format self
}
- // TODO: remove, only needed for binary compatibility of 2.11.0-RC1 with 2.11.0-M8
- // note that `private[scala]` becomes `public` in bytecode
- private[scala] final class StringAdd[A](private val self: A) extends AnyVal {
- def +(other: String): String = String.valueOf(self) + other
- }
- private[scala] def StringAdd(x: Any): Any = new StringAdd(x)
-
// SI-8229 retaining the pre 2.11 name for source compatibility in shadowing this implicit
implicit final class any2stringadd[A](private val self: A) extends AnyVal {
def +(other: String): String = String.valueOf(self) + other
@@ -334,16 +327,28 @@ object Predef extends LowPriorityImplicits with DeprecatedPredef {
case null => null
}).asInstanceOf[ArrayOps[T]]
- implicit def booleanArrayOps(xs: Array[Boolean]): ArrayOps[Boolean] = new ArrayOps.ofBoolean(xs)
- implicit def byteArrayOps(xs: Array[Byte]): ArrayOps[Byte] = new ArrayOps.ofByte(xs)
- implicit def charArrayOps(xs: Array[Char]): ArrayOps[Char] = new ArrayOps.ofChar(xs)
- implicit def doubleArrayOps(xs: Array[Double]): ArrayOps[Double] = new ArrayOps.ofDouble(xs)
- implicit def floatArrayOps(xs: Array[Float]): ArrayOps[Float] = new ArrayOps.ofFloat(xs)
- implicit def intArrayOps(xs: Array[Int]): ArrayOps[Int] = new ArrayOps.ofInt(xs)
- implicit def longArrayOps(xs: Array[Long]): ArrayOps[Long] = new ArrayOps.ofLong(xs)
- implicit def refArrayOps[T <: AnyRef](xs: Array[T]): ArrayOps[T] = new ArrayOps.ofRef[T](xs)
- implicit def shortArrayOps(xs: Array[Short]): ArrayOps[Short] = new ArrayOps.ofShort(xs)
- implicit def unitArrayOps(xs: Array[Unit]): ArrayOps[Unit] = new ArrayOps.ofUnit(xs)
+ // TODO: when we remove, these should we drop the underscores from the new generation below? (For source compatibility in case someone was shadowing these.)
+ @deprecated("For binary compatibility only. Release new partest and remove in M3.", "2.12.0-M2") def booleanArrayOps(xs: Array[Boolean]): ArrayOps[Boolean] = new ArrayOps.ofBoolean(xs)
+ @deprecated("For binary compatibility only. Release new partest and remove in M3.", "2.12.0-M2") def byteArrayOps(xs: Array[Byte]): ArrayOps[Byte] = new ArrayOps.ofByte(xs)
+ @deprecated("For binary compatibility only. Release new partest and remove in M3.", "2.12.0-M2") def charArrayOps(xs: Array[Char]): ArrayOps[Char] = new ArrayOps.ofChar(xs)
+ @deprecated("For binary compatibility only. Release new partest and remove in M3.", "2.12.0-M2") def doubleArrayOps(xs: Array[Double]): ArrayOps[Double] = new ArrayOps.ofDouble(xs)
+ @deprecated("For binary compatibility only. Release new partest and remove in M3.", "2.12.0-M2") def floatArrayOps(xs: Array[Float]): ArrayOps[Float] = new ArrayOps.ofFloat(xs)
+ @deprecated("For binary compatibility only. Release new partest and remove in M3.", "2.12.0-M2") def intArrayOps(xs: Array[Int]): ArrayOps[Int] = new ArrayOps.ofInt(xs)
+ @deprecated("For binary compatibility only. Release new partest and remove in M3.", "2.12.0-M2") def longArrayOps(xs: Array[Long]): ArrayOps[Long] = new ArrayOps.ofLong(xs)
+ @deprecated("For binary compatibility only. Release new partest and remove in M3.", "2.12.0-M2") def refArrayOps[T <: AnyRef](xs: Array[T]): ArrayOps[T] = new ArrayOps.ofRef[T](xs)
+ @deprecated("For binary compatibility only. Release new partest and remove in M3.", "2.12.0-M2") def shortArrayOps(xs: Array[Short]): ArrayOps[Short] = new ArrayOps.ofShort(xs)
+ @deprecated("For binary compatibility only. Release new partest and remove in M3.", "2.12.0-M2") def unitArrayOps(xs: Array[Unit]): ArrayOps[Unit] = new ArrayOps.ofUnit(xs)
+
+ implicit def _booleanArrayOps(xs: Array[Boolean]): ArrayOps.ofBoolean = new ArrayOps.ofBoolean(xs)
+ implicit def _byteArrayOps(xs: Array[Byte]): ArrayOps.ofByte = new ArrayOps.ofByte(xs)
+ implicit def _charArrayOps(xs: Array[Char]): ArrayOps.ofChar = new ArrayOps.ofChar(xs)
+ implicit def _doubleArrayOps(xs: Array[Double]): ArrayOps.ofDouble = new ArrayOps.ofDouble(xs)
+ implicit def _floatArrayOps(xs: Array[Float]): ArrayOps.ofFloat = new ArrayOps.ofFloat(xs)
+ implicit def _intArrayOps(xs: Array[Int]): ArrayOps.ofInt = new ArrayOps.ofInt(xs)
+ implicit def _longArrayOps(xs: Array[Long]): ArrayOps.ofLong = new ArrayOps.ofLong(xs)
+ implicit def _refArrayOps[T <: AnyRef](xs: Array[T]): ArrayOps.ofRef[T] = new ArrayOps.ofRef[T](xs)
+ implicit def _shortArrayOps(xs: Array[Short]): ArrayOps.ofShort = new ArrayOps.ofShort(xs)
+ implicit def _unitArrayOps(xs: Array[Unit]): ArrayOps.ofUnit = new ArrayOps.ofUnit(xs)
// "Autoboxing" and "Autounboxing" ---------------------------------------------------
diff --git a/src/library/scala/beans/BeanInfo.scala b/src/library/scala/beans/BeanInfo.scala
index 799e93e71a..d7f0a1618b 100644
--- a/src/library/scala/beans/BeanInfo.scala
+++ b/src/library/scala/beans/BeanInfo.scala
@@ -17,4 +17,5 @@ package scala.beans
*
* @author Ross Judson (rjudson@managedobjects.com)
*/
+@deprecated(message = "the generation of BeanInfo classes is no longer supported", since = "2.12.0")
class BeanInfo extends scala.annotation.Annotation
diff --git a/src/library/scala/collection/IterableViewLike.scala b/src/library/scala/collection/IterableViewLike.scala
index b84d90c51b..c254ed7480 100644
--- a/src/library/scala/collection/IterableViewLike.scala
+++ b/src/library/scala/collection/IterableViewLike.scala
@@ -69,6 +69,10 @@ trait IterableViewLike[+A,
trait Appended[B >: A] extends super.Appended[B] with Transformed[B] {
def iterator = self.iterator ++ rest
}
+
+ trait Prepended[B >: A] extends super.Prepended[B] with Transformed[B] {
+ def iterator = fst.toIterator ++ self
+ }
trait Filtered extends super.Filtered with Transformed[A] {
def iterator = self.iterator filter pred
@@ -110,6 +114,7 @@ trait IterableViewLike[+A,
} with AbstractTransformed[(A1, B)] with ZippedAll[A1, B]
protected override def newForced[B](xs: => GenSeq[B]): Transformed[B] = new { val forced = xs } with AbstractTransformed[B] with Forced[B]
protected override def newAppended[B >: A](that: GenTraversable[B]): Transformed[B] = new { val rest = that } with AbstractTransformed[B] with Appended[B]
+ protected override def newPrepended[B >: A](that: GenTraversable[B]): Transformed[B] = new { val fst = that } with AbstractTransformed[B] with Prepended[B]
protected override def newMapped[B](f: A => B): Transformed[B] = new { val mapping = f } with AbstractTransformed[B] with Mapped[B]
protected override def newFlatMapped[B](f: A => GenTraversableOnce[B]): Transformed[B] = new { val mapping = f } with AbstractTransformed[B] with FlatMapped[B]
protected override def newFiltered(p: A => Boolean): Transformed[A] = new { val pred = p } with AbstractTransformed[A] with Filtered
diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala
index c9037eb3e3..e2c271145d 100644
--- a/src/library/scala/collection/Iterator.scala
+++ b/src/library/scala/collection/Iterator.scala
@@ -182,7 +182,7 @@ object Iterator {
}
}
def hasNext = (current ne null) && (current.hasNext || advance())
- def next() = if (hasNext) current.next else Iterator.empty.next
+ def next() = if (hasNext) current.next() else Iterator.empty.next()
override def ++[B >: A](that: => GenTraversableOnce[B]): Iterator[B] =
new ConcatIterator(current, queue :+ (() => that.toIterator))
@@ -191,11 +191,55 @@ object Iterator {
private[scala] final class JoinIterator[+A](lhs: Iterator[A], that: => GenTraversableOnce[A]) extends Iterator[A] {
private[this] lazy val rhs: Iterator[A] = that.toIterator
def hasNext = lhs.hasNext || rhs.hasNext
- def next = if (lhs.hasNext) lhs.next else rhs.next
+ def next() = if (lhs.hasNext) lhs.next() else rhs.next()
override def ++[B >: A](that: => GenTraversableOnce[B]) =
new ConcatIterator(this, Vector(() => that.toIterator))
}
+
+ /** Creates a delegating iterator capped by a limit count. Negative limit means unbounded.
+ * Lazily skip to start on first evaluation. Avoids daisy-chained iterators due to slicing.
+ */
+ private[scala] final class SliceIterator[A](val underlying: Iterator[A], start: Int, limit: Int) extends AbstractIterator[A] {
+ private var remaining = limit
+ private var dropping = start
+ @inline private def unbounded = remaining < 0
+ private def skip(): Unit =
+ while (dropping > 0) {
+ if (underlying.hasNext) {
+ underlying.next()
+ dropping -= 1
+ } else
+ dropping = 0
+ }
+ def hasNext = { skip(); remaining != 0 && underlying.hasNext }
+ def next() = {
+ skip()
+ if (remaining > 0) {
+ remaining -= 1
+ underlying.next()
+ }
+ else if (unbounded) underlying.next()
+ else empty.next()
+ }
+ override protected def sliceIterator(from: Int, until: Int): Iterator[A] = {
+ val lo = from max 0
+ def adjustedBound =
+ if (unbounded) -1
+ else 0 max (remaining - lo)
+ val rest =
+ if (until < 0) adjustedBound // respect current bound, if any
+ else if (until <= lo) 0 // empty
+ else if (unbounded) until - lo // now finite
+ else adjustedBound min (until - lo) // keep lesser bound
+ if (rest == 0) empty
+ else {
+ dropping += lo
+ remaining = rest
+ this
+ }
+ }
+ }
}
import Iterator.empty
@@ -307,11 +351,11 @@ trait Iterator[+A] extends TraversableOnce[A] {
/** Selects first ''n'' values of this iterator.
*
* @param n the number of values to take
- * @return an iterator producing only of the first `n` values of this iterator, or else the
+ * @return an iterator producing only the first `n` values of this iterator, or else the
* whole iterator, if it produces fewer than `n` values.
* @note Reuse: $consumesAndProducesIterator
*/
- def take(n: Int): Iterator[A] = slice(0, n)
+ def take(n: Int): Iterator[A] = sliceIterator(0, n max 0)
/** Advances this iterator past the first ''n'' elements, or the length of the iterator, whichever is smaller.
*
@@ -332,29 +376,24 @@ trait Iterator[+A] extends TraversableOnce[A] {
/** Creates an iterator returning an interval of the values produced by this iterator.
*
* @param from the index of the first element in this iterator which forms part of the slice.
- * @param until the index of the first element following the slice.
+ * If negative, the slice starts at zero.
+ * @param until the index of the first element following the slice. If negative, the slice is empty.
* @return an iterator which advances this iterator past the first `from` elements using `drop`,
* and then takes `until - from` elements, using `take`.
* @note Reuse: $consumesAndProducesIterator
*/
- def slice(from: Int, until: Int): Iterator[A] = {
+ def slice(from: Int, until: Int): Iterator[A] = sliceIterator(from, until max 0)
+
+ /** Creates an optionally bounded slice, unbounded if `until` is negative. */
+ protected def sliceIterator(from: Int, until: Int): Iterator[A] = {
val lo = from max 0
- var toDrop = lo
- while (toDrop > 0 && self.hasNext) {
- self.next()
- toDrop -= 1
- }
+ val rest =
+ if (until < 0) -1 // unbounded
+ else if (until <= lo) 0 // empty
+ else until - lo // finite
- new AbstractIterator[A] {
- private var remaining = until - lo
- def hasNext = remaining > 0 && self.hasNext
- def next(): A =
- if (remaining > 0) {
- remaining -= 1
- self.next()
- }
- else empty.next()
- }
+ if (rest == 0) empty
+ else new Iterator.SliceIterator(this, lo, rest)
}
/** Creates a new iterator that maps all produced values of this iterator
@@ -805,8 +844,25 @@ trait Iterator[+A] extends TraversableOnce[A] {
* or -1 if such an element does not exist until the end of the iterator is reached.
* @note Reuse: $consumesIterator
*/
- def indexWhere(p: A => Boolean): Int = {
+ def indexWhere(p: A => Boolean): Int = indexWhere(p, 0)
+
+ /** Returns the index of the first produced value satisfying a predicate, or -1, after or at
+ * some start index.
+ * $mayNotTerminateInf
+ *
+ * @param p the predicate to test values
+ * @param from the start index
+ * @return the index `>= from` of the first produced value satisfying `p`,
+ * or -1 if such an element does not exist until the end of the iterator is reached.
+ * @note Reuse: $consumesIterator
+ */
+ def indexWhere(p: A => Boolean, from: Int): Int = {
var i = 0
+ while (i < from && hasNext) {
+ next()
+ i += 1
+ }
+
var found = false
while (!found && hasNext) {
if (p(next())) {
@@ -827,8 +883,26 @@ trait Iterator[+A] extends TraversableOnce[A] {
* or -1 if such an element does not exist until the end of the iterator is reached.
* @note Reuse: $consumesIterator
*/
- def indexOf[B >: A](elem: B): Int = {
+ def indexOf[B >: A](elem: B): Int = indexOf(elem, 0)
+
+ /** Returns the index of the first occurrence of the specified object in this iterable object
+ * after or at some start index.
+ * $mayNotTerminateInf
+ *
+ * @param elem element to search for.
+ * @param from the start index
+ * @return the index `>= from` of the first occurrence of `elem` in the values produced by this
+ * iterator, or -1 if such an element does not exist until the end of the iterator is
+ * reached.
+ * @note Reuse: $consumesIterator
+ */
+ def indexOf[B >: A](elem: B, from: Int): Int = {
var i = 0
+ while (i < from && hasNext) {
+ next()
+ i += 1
+ }
+
var found = false
while (!found && hasNext) {
if (next() == elem) {
@@ -1147,9 +1221,8 @@ trait Iterator[+A] extends TraversableOnce[A] {
* $willNotTerminateInf
*/
def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Unit = {
- require(start >= 0 && (start < xs.length || xs.length == 0), s"start $start out of range ${xs.length}")
var i = start
- val end = start + math.min(len, xs.length - start)
+ val end = start + math.min(len, xs.length - start)
while (i < end && hasNext) {
xs(i) = next()
i += 1
diff --git a/src/library/scala/collection/MapLike.scala b/src/library/scala/collection/MapLike.scala
index d133400570..b474abc12a 100644
--- a/src/library/scala/collection/MapLike.scala
+++ b/src/library/scala/collection/MapLike.scala
@@ -230,11 +230,15 @@ self =>
protected class FilteredKeys(p: A => Boolean) extends AbstractMap[A, B] with DefaultMap[A, B] {
override def foreach[C](f: ((A, B)) => C): Unit = for (kv <- self) if (p(kv._1)) f(kv)
def iterator = self.iterator.filter(kv => p(kv._1))
- override def contains(key: A) = self.contains(key) && p(key)
+ override def contains(key: A) = p(key) && self.contains(key)
def get(key: A) = if (!p(key)) None else self.get(key)
}
/** Filters this map by retaining only keys satisfying a predicate.
+ *
+ * '''Note''': the predicate must accept any key of type `A`, not just those already
+ * present in the map, as the predicate is tested before the underlying map is queried.
+ *
* @param p the predicate used to test keys
* @return an immutable map consisting only of those key value pairs of this map where the key satisfies
* the predicate `p`. The resulting map wraps the original map without copying any elements.
@@ -319,11 +323,20 @@ self =>
res
}
- /* Overridden for efficiency. */
- override def toSeq: Seq[(A, B)] = toBuffer[(A, B)]
+ override def toSeq: Seq[(A, B)] = {
+ if (isEmpty) Vector.empty[(A, B)]
+ else {
+ // Default appropriate for immutable collections; mutable collections override this
+ val vb = Vector.newBuilder[(A, B)]
+ foreach(vb += _)
+ vb.result
+ }
+ }
+
override def toBuffer[C >: (A, B)]: mutable.Buffer[C] = {
val result = new mutable.ArrayBuffer[C](size)
- copyToBuffer(result)
+ // Faster to let the map iterate itself than to defer through copyToBuffer
+ foreach(result += _)
result
}
diff --git a/src/library/scala/collection/SeqViewLike.scala b/src/library/scala/collection/SeqViewLike.scala
index 3473c8aff1..1fbcb6531e 100644
--- a/src/library/scala/collection/SeqViewLike.scala
+++ b/src/library/scala/collection/SeqViewLike.scala
@@ -96,6 +96,14 @@ trait SeqViewLike[+A,
if (idx < self.length) self(idx) else restSeq(idx - self.length)
}
+ trait Prepended[B >: A] extends super.Prepended[B] with Transformed[B] {
+ protected[this] lazy val fstSeq = fst.toSeq
+ def length: Int = fstSeq.length + self.length
+ def apply(idx: Int): B =
+ if (idx < fstSeq.length) fstSeq(idx)
+ else self.apply(idx - fstSeq.length)
+ }
+
trait Filtered extends super.Filtered with Transformed[A] {
protected[this] lazy val index = {
var len = 0
@@ -179,21 +187,12 @@ trait SeqViewLike[+A,
final override protected[this] def viewIdentifier = "P"
}
- trait Prepended[B >: A] extends Transformed[B] {
- protected[this] val fst: B
- override def iterator: Iterator[B] = Iterator.single(fst) ++ self.iterator
- def length: Int = 1 + self.length
- def apply(idx: Int): B =
- if (idx == 0) fst
- else self.apply(idx - 1)
- final override protected[this] def viewIdentifier = "A"
- }
-
/** Boilerplate method, to override in each subclass
* This method could be eliminated if Scala had virtual classes
*/
protected override def newForced[B](xs: => GenSeq[B]): Transformed[B] = new { val forced = xs } with AbstractTransformed[B] with Forced[B]
protected override def newAppended[B >: A](that: GenTraversable[B]): Transformed[B] = new { val rest = that } with AbstractTransformed[B] with Appended[B]
+ protected override def newPrepended[B >: A](that: GenTraversable[B]): Transformed[B] = new { protected[this] val fst = that } with AbstractTransformed[B] with Prepended[B]
protected override def newMapped[B](f: A => B): Transformed[B] = new { val mapping = f } with AbstractTransformed[B] with Mapped[B]
protected override def newFlatMapped[B](f: A => GenTraversableOnce[B]): Transformed[B] = new { val mapping = f } with AbstractTransformed[B] with FlatMapped[B]
protected override def newFiltered(p: A => Boolean): Transformed[A] = new { val pred = p } with AbstractTransformed[A] with Filtered
@@ -212,7 +211,6 @@ trait SeqViewLike[+A,
val patch = _patch
val replaced = _replaced
} with AbstractTransformed[B] with Patched[B]
- protected def newPrepended[B >: A](elem: B): Transformed[B] = new { protected[this] val fst = elem } with AbstractTransformed[B] with Prepended[B]
// see comment in IterableViewLike.
protected override def newTaken(n: Int): Transformed[A] = newSliced(SliceInterval(0, n))
@@ -242,7 +240,7 @@ trait SeqViewLike[+A,
}
override def +:[B >: A, That](elem: B)(implicit bf: CanBuildFrom[This, B, That]): That =
- newPrepended(elem).asInstanceOf[That]
+ newPrepended(elem :: Nil).asInstanceOf[That]
override def :+[B >: A, That](elem: B)(implicit bf: CanBuildFrom[This, B, That]): That =
++(Iterator.single(elem))(bf)
diff --git a/src/library/scala/collection/SetLike.scala b/src/library/scala/collection/SetLike.scala
index f8ac1d754d..d03c808c2c 100644
--- a/src/library/scala/collection/SetLike.scala
+++ b/src/library/scala/collection/SetLike.scala
@@ -77,11 +77,20 @@ self =>
protected[this] override def parCombiner = ParSet.newCombiner[A]
- /* Overridden for efficiency. */
- override def toSeq: Seq[A] = toBuffer[A]
+ // Default collection type appropriate for immutable collections; mutable collections override this
+ override def toSeq: Seq[A] = {
+ if (isEmpty) Vector.empty[A]
+ else {
+ val vb = Vector.newBuilder[A]
+ foreach(vb += _)
+ vb.result
+ }
+ }
+
override def toBuffer[A1 >: A]: mutable.Buffer[A1] = {
val result = new mutable.ArrayBuffer[A1](size)
- copyToBuffer(result)
+ // Faster to let the map iterate itself than to defer through copyToBuffer
+ foreach(result += _)
result
}
diff --git a/src/library/scala/collection/TraversableLike.scala b/src/library/scala/collection/TraversableLike.scala
index 96374ef653..f187a7a655 100644
--- a/src/library/scala/collection/TraversableLike.scala
+++ b/src/library/scala/collection/TraversableLike.scala
@@ -253,7 +253,7 @@ trait TraversableLike[+A, +Repr] extends Any
b.result
}
- private def filterImpl(p: A => Boolean, isFlipped: Boolean): Repr = {
+ private[scala] def filterImpl(p: A => Boolean, isFlipped: Boolean): Repr = {
val b = newBuilder
for (x <- this)
if (p(x) != isFlipped) b += x
diff --git a/src/library/scala/collection/TraversableViewLike.scala b/src/library/scala/collection/TraversableViewLike.scala
index 5926c69ebf..0901d749c3 100644
--- a/src/library/scala/collection/TraversableViewLike.scala
+++ b/src/library/scala/collection/TraversableViewLike.scala
@@ -189,6 +189,15 @@ trait TraversableViewLike[+A,
}
final override protected[this] def viewIdentifier = "A"
}
+
+ trait Prepended[B >: A] extends Transformed[B] {
+ protected[this] val fst: GenTraversable[B]
+ def foreach[U](f: B => U) {
+ fst foreach f
+ self foreach f
+ }
+ final override protected[this] def viewIdentifier = "A"
+ }
trait Filtered extends Transformed[A] {
protected[this] val pred: A => Boolean
@@ -222,11 +231,15 @@ trait TraversableViewLike[+A,
final override protected[this] def viewIdentifier = "D"
}
- override def ++[B >: A, That](xs: GenTraversableOnce[B])(implicit bf: CanBuildFrom[This, B, That]): That = {
+ override def ++[B >: A, That](xs: GenTraversableOnce[B])(implicit bf: CanBuildFrom[This, B, That]): That =
newAppended(xs.seq.toTraversable).asInstanceOf[That]
-// was: if (bf.isInstanceOf[ByPassCanBuildFrom]) newAppended(that).asInstanceOf[That]
-// else super.++[B, That](that)(bf)
- }
+
+ override def ++:[B >: A, That](xs: TraversableOnce[B])(implicit bf: CanBuildFrom[This, B, That]): That =
+ newPrepended(xs.seq.toTraversable).asInstanceOf[That]
+
+ // Need second one because of optimization in TraversableLike
+ override def ++:[B >: A, That](xs: Traversable[B])(implicit bf: CanBuildFrom[This, B, That]): That =
+ newPrepended(xs).asInstanceOf[That]
override def map[B, That](f: A => B)(implicit bf: CanBuildFrom[This, B, That]): That = {
newMapped(f).asInstanceOf[That]
@@ -253,6 +266,7 @@ trait TraversableViewLike[+A,
*/
protected def newForced[B](xs: => GenSeq[B]): Transformed[B] = new { val forced = xs } with AbstractTransformed[B] with Forced[B]
protected def newAppended[B >: A](that: GenTraversable[B]): Transformed[B] = new { val rest = that } with AbstractTransformed[B] with Appended[B]
+ protected def newPrepended[B >: A](that: GenTraversable[B]): Transformed[B] = new { val fst = that } with AbstractTransformed[B] with Prepended[B]
protected def newMapped[B](f: A => B): Transformed[B] = new { val mapping = f } with AbstractTransformed[B] with Mapped[B]
protected def newFlatMapped[B](f: A => GenTraversableOnce[B]): Transformed[B] = new { val mapping = f } with AbstractTransformed[B] with FlatMapped[B]
protected def newFiltered(p: A => Boolean): Transformed[A] = new { val pred = p } with AbstractTransformed[A] with Filtered
diff --git a/src/library/scala/collection/concurrent/Map.scala b/src/library/scala/collection/concurrent/Map.scala
index cfb567abe9..f27dfd57fc 100644
--- a/src/library/scala/collection/concurrent/Map.scala
+++ b/src/library/scala/collection/concurrent/Map.scala
@@ -86,4 +86,15 @@ trait Map[A, B] extends scala.collection.mutable.Map[A, B] {
* @return `Some(v)` if the given key was previously mapped to some value `v`, or `None` otherwise
*/
def replace(k: A, v: B): Option[B]
+
+ override def getOrElseUpdate(key: A, op: =>B): B = get(key) match {
+ case Some(v) => v
+ case None =>
+ val v = op
+ putIfAbsent(key, v) match {
+ case Some(nv) => nv
+ case None => v
+ }
+ }
+
}
diff --git a/src/library/scala/collection/concurrent/TrieMap.scala b/src/library/scala/collection/concurrent/TrieMap.scala
index bcfea7a463..74e0e0f7d2 100644
--- a/src/library/scala/collection/concurrent/TrieMap.scala
+++ b/src/library/scala/collection/concurrent/TrieMap.scala
@@ -471,7 +471,7 @@ private[collection] final class CNode[K, V](val bitmap: Int, val array: Array[Ba
val offset =
if (array.length > 0)
//util.Random.nextInt(array.length) /* <-- benchmarks show that this causes observable contention */
- scala.concurrent.forkjoin.ThreadLocalRandom.current.nextInt(0, array.length)
+ java.util.concurrent.ThreadLocalRandom.current.nextInt(0, array.length)
else 0
while (i < array.length) {
val pos = (i + offset) % array.length
diff --git a/src/library/scala/collection/convert/WrapAsJava.scala b/src/library/scala/collection/convert/WrapAsJava.scala
index 9916fe9843..e97a2ff1fc 100644
--- a/src/library/scala/collection/convert/WrapAsJava.scala
+++ b/src/library/scala/collection/convert/WrapAsJava.scala
@@ -30,8 +30,9 @@ trait WrapAsJava {
* @return A Java Iterator view of the argument.
*/
implicit def asJavaIterator[A](it: Iterator[A]): ju.Iterator[A] = it match {
- case JIteratorWrapper(wrapped) => wrapped.asInstanceOf[ju.Iterator[A]]
- case _ => IteratorWrapper(it)
+ case null => null
+ case JIteratorWrapper(wrapped) => wrapped.asInstanceOf[ju.Iterator[A]]
+ case _ => IteratorWrapper(it)
}
/**
@@ -48,8 +49,9 @@ trait WrapAsJava {
* @return A Java Enumeration view of the argument.
*/
implicit def asJavaEnumeration[A](it: Iterator[A]): ju.Enumeration[A] = it match {
+ case null => null
case JEnumerationWrapper(wrapped) => wrapped.asInstanceOf[ju.Enumeration[A]]
- case _ => IteratorWrapper(it)
+ case _ => IteratorWrapper(it)
}
/**
@@ -66,8 +68,9 @@ trait WrapAsJava {
* @return A Java Iterable view of the argument.
*/
implicit def asJavaIterable[A](i: Iterable[A]): jl.Iterable[A] = i match {
- case JIterableWrapper(wrapped) => wrapped.asInstanceOf[jl.Iterable[A]]
- case _ => IterableWrapper(i)
+ case null => null
+ case JIterableWrapper(wrapped) => wrapped.asInstanceOf[jl.Iterable[A]]
+ case _ => IterableWrapper(i)
}
/**
@@ -82,8 +85,9 @@ trait WrapAsJava {
* @return A Java Collection view of the argument.
*/
implicit def asJavaCollection[A](it: Iterable[A]): ju.Collection[A] = it match {
- case JCollectionWrapper(wrapped) => wrapped.asInstanceOf[ju.Collection[A]]
- case _ => new IterableWrapper(it)
+ case null => null
+ case JCollectionWrapper(wrapped) => wrapped.asInstanceOf[ju.Collection[A]]
+ case _ => new IterableWrapper(it)
}
/**
@@ -100,8 +104,9 @@ trait WrapAsJava {
* @return A Java List view of the argument.
*/
implicit def bufferAsJavaList[A](b: mutable.Buffer[A]): ju.List[A] = b match {
- case JListWrapper(wrapped) => wrapped
- case _ => new MutableBufferWrapper(b)
+ case null => null
+ case JListWrapper(wrapped) => wrapped
+ case _ => new MutableBufferWrapper(b)
}
/**
@@ -118,8 +123,9 @@ trait WrapAsJava {
* @return A Java List view of the argument.
*/
implicit def mutableSeqAsJavaList[A](seq: mutable.Seq[A]): ju.List[A] = seq match {
- case JListWrapper(wrapped) => wrapped
- case _ => new MutableSeqWrapper(seq)
+ case null => null
+ case JListWrapper(wrapped) => wrapped
+ case _ => new MutableSeqWrapper(seq)
}
/**
@@ -136,8 +142,9 @@ trait WrapAsJava {
* @return A Java List view of the argument.
*/
implicit def seqAsJavaList[A](seq: Seq[A]): ju.List[A] = seq match {
- case JListWrapper(wrapped) => wrapped.asInstanceOf[ju.List[A]]
- case _ => new SeqWrapper(seq)
+ case null => null
+ case JListWrapper(wrapped) => wrapped.asInstanceOf[ju.List[A]]
+ case _ => new SeqWrapper(seq)
}
/**
@@ -154,8 +161,9 @@ trait WrapAsJava {
* @return A Java Set view of the argument.
*/
implicit def mutableSetAsJavaSet[A](s: mutable.Set[A]): ju.Set[A] = s match {
+ case null => null
case JSetWrapper(wrapped) => wrapped
- case _ => new MutableSetWrapper(s)
+ case _ => new MutableSetWrapper(s)
}
/**
@@ -172,8 +180,9 @@ trait WrapAsJava {
* @return A Java Set view of the argument.
*/
implicit def setAsJavaSet[A](s: Set[A]): ju.Set[A] = s match {
+ case null => null
case JSetWrapper(wrapped) => wrapped
- case _ => new SetWrapper(s)
+ case _ => new SetWrapper(s)
}
/**
@@ -190,9 +199,9 @@ trait WrapAsJava {
* @return A Java Map view of the argument.
*/
implicit def mutableMapAsJavaMap[A, B](m: mutable.Map[A, B]): ju.Map[A, B] = m match {
- //case JConcurrentMapWrapper(wrapped) => wrapped
+ case null => null
case JMapWrapper(wrapped) => wrapped
- case _ => new MutableMapWrapper(m)
+ case _ => new MutableMapWrapper(m)
}
/**
@@ -210,9 +219,9 @@ trait WrapAsJava {
* @return A Java `Dictionary` view of the argument.
*/
implicit def asJavaDictionary[A, B](m: mutable.Map[A, B]): ju.Dictionary[A, B] = m match {
- //case JConcurrentMapWrapper(wrapped) => wrapped
- case JDictionaryWrapper(wrapped) => wrapped
- case _ => new DictionaryWrapper(m)
+ case null => null
+ case JDictionaryWrapper(wrapped) => wrapped
+ case _ => new DictionaryWrapper(m)
}
/**
@@ -230,9 +239,9 @@ trait WrapAsJava {
* @return A Java `Map` view of the argument.
*/
implicit def mapAsJavaMap[A, B](m: Map[A, B]): ju.Map[A, B] = m match {
- //case JConcurrentMapWrapper(wrapped) => wrapped
+ case null => null
case JMapWrapper(wrapped) => wrapped.asInstanceOf[ju.Map[A, B]]
- case _ => new MapWrapper(m)
+ case _ => new MapWrapper(m)
}
/**
@@ -251,8 +260,9 @@ trait WrapAsJava {
* @return A Java `ConcurrentMap` view of the argument.
*/
implicit def mapAsJavaConcurrentMap[A, B](m: concurrent.Map[A, B]): juc.ConcurrentMap[A, B] = m match {
+ case null => null
case JConcurrentMapWrapper(wrapped) => wrapped
- case _ => new ConcurrentMapWrapper(m)
+ case _ => new ConcurrentMapWrapper(m)
}
}
diff --git a/src/library/scala/collection/convert/WrapAsScala.scala b/src/library/scala/collection/convert/WrapAsScala.scala
index ab151a6778..7332b71af1 100644
--- a/src/library/scala/collection/convert/WrapAsScala.scala
+++ b/src/library/scala/collection/convert/WrapAsScala.scala
@@ -30,8 +30,9 @@ trait WrapAsScala {
* @return A Scala `Iterator` view of the argument.
*/
implicit def asScalaIterator[A](it: ju.Iterator[A]): Iterator[A] = it match {
+ case null => null
case IteratorWrapper(wrapped) => wrapped
- case _ => JIteratorWrapper(it)
+ case _ => JIteratorWrapper(it)
}
/**
@@ -48,8 +49,9 @@ trait WrapAsScala {
* @return A Scala Iterator view of the argument.
*/
implicit def enumerationAsScalaIterator[A](i: ju.Enumeration[A]): Iterator[A] = i match {
+ case null => null
case IteratorWrapper(wrapped) => wrapped
- case _ => JEnumerationWrapper(i)
+ case _ => JEnumerationWrapper(i)
}
/**
@@ -67,8 +69,9 @@ trait WrapAsScala {
* @return A Scala Iterable view of the argument.
*/
implicit def iterableAsScalaIterable[A](i: jl.Iterable[A]): Iterable[A] = i match {
+ case null => null
case IterableWrapper(wrapped) => wrapped
- case _ => JIterableWrapper(i)
+ case _ => JIterableWrapper(i)
}
/**
@@ -82,8 +85,9 @@ trait WrapAsScala {
* @return A Scala Iterable view of the argument.
*/
implicit def collectionAsScalaIterable[A](i: ju.Collection[A]): Iterable[A] = i match {
+ case null => null
case IterableWrapper(wrapped) => wrapped
- case _ => JCollectionWrapper(i)
+ case _ => JCollectionWrapper(i)
}
/**
@@ -101,8 +105,9 @@ trait WrapAsScala {
* @return A Scala mutable `Buffer` view of the argument.
*/
implicit def asScalaBuffer[A](l: ju.List[A]): mutable.Buffer[A] = l match {
- case MutableBufferWrapper(wrapped) => wrapped
- case _ =>new JListWrapper(l)
+ case null => null
+ case MutableBufferWrapper(wrapped) => wrapped
+ case _ => new JListWrapper(l)
}
/**
@@ -119,8 +124,9 @@ trait WrapAsScala {
* @return A Scala mutable Set view of the argument.
*/
implicit def asScalaSet[A](s: ju.Set[A]): mutable.Set[A] = s match {
+ case null => null
case MutableSetWrapper(wrapped) => wrapped
- case _ =>new JSetWrapper(s)
+ case _ => new JSetWrapper(s)
}
/**
@@ -144,9 +150,9 @@ trait WrapAsScala {
* @return A Scala mutable Map view of the argument.
*/
implicit def mapAsScalaMap[A, B](m: ju.Map[A, B]): mutable.Map[A, B] = m match {
- //case ConcurrentMapWrapper(wrapped) => wrapped
+ case null => null
case MutableMapWrapper(wrapped) => wrapped
- case _ => new JMapWrapper(m)
+ case _ => new JMapWrapper(m)
}
/**
@@ -163,8 +169,9 @@ trait WrapAsScala {
* @return A Scala mutable ConcurrentMap view of the argument.
*/
implicit def mapAsScalaConcurrentMap[A, B](m: juc.ConcurrentMap[A, B]): concurrent.Map[A, B] = m match {
- case cmw: ConcurrentMapWrapper[a, b] => cmw.underlying
- case _ => new JConcurrentMapWrapper(m)
+ case null => null
+ case cmw: ConcurrentMapWrapper[A, B] => cmw.underlying
+ case _ => new JConcurrentMapWrapper(m)
}
/**
@@ -179,8 +186,9 @@ trait WrapAsScala {
* @return A Scala mutable Map[String, String] view of the argument.
*/
implicit def dictionaryAsScalaMap[A, B](p: ju.Dictionary[A, B]): mutable.Map[A, B] = p match {
+ case null => null
case DictionaryWrapper(wrapped) => wrapped
- case _ => new JDictionaryWrapper(p)
+ case _ => new JDictionaryWrapper(p)
}
/**
@@ -194,7 +202,8 @@ trait WrapAsScala {
* @return A Scala mutable Map[String, String] view of the argument.
*/
implicit def propertiesAsScalaMap(p: ju.Properties): mutable.Map[String, String] = p match {
- case _ => new JPropertiesWrapper(p)
+ case null => null
+ case _ => new JPropertiesWrapper(p)
}
}
diff --git a/src/library/scala/collection/convert/Wrappers.scala b/src/library/scala/collection/convert/Wrappers.scala
index 9f9732c62f..c2da66a9bf 100644
--- a/src/library/scala/collection/convert/Wrappers.scala
+++ b/src/library/scala/collection/convert/Wrappers.scala
@@ -102,9 +102,9 @@ private[collection] trait Wrappers {
override def clone(): JListWrapper[A] = JListWrapper(new ju.ArrayList[A](underlying))
}
- // Note various overrides to avoid performance gotchas.
- class SetWrapper[A](underlying: Set[A]) extends ju.AbstractSet[A] {
- self =>
+ @SerialVersionUID(1L)
+ class SetWrapper[A](underlying: Set[A]) extends ju.AbstractSet[A] with Serializable { self =>
+ // Note various overrides to avoid performance gotchas.
override def contains(o: Object): Boolean = {
try { underlying.contains(o.asInstanceOf[A]) }
catch { case cce: ClassCastException => false }
@@ -165,7 +165,8 @@ private[collection] trait Wrappers {
new JSetWrapper[A](new ju.LinkedHashSet[A](underlying))
}
- class MapWrapper[A, B](underlying: Map[A, B]) extends ju.AbstractMap[A, B] { self =>
+ @SerialVersionUID(1L)
+ class MapWrapper[A, B](underlying: Map[A, B]) extends ju.AbstractMap[A, B] with Serializable { self =>
override def size = underlying.size
override def get(key: AnyRef): B = try {
diff --git a/src/library/scala/collection/generic/MutableSortedMapFactory.scala b/src/library/scala/collection/generic/MutableSortedMapFactory.scala
new file mode 100644
index 0000000000..b6fa933ca8
--- /dev/null
+++ b/src/library/scala/collection/generic/MutableSortedMapFactory.scala
@@ -0,0 +1,24 @@
+package scala
+package collection
+package generic
+
+import scala.language.higherKinds
+
+/**
+ * A template for companion objects of `SortedMap` and subclasses thereof.
+ *
+ * @tparam CC the type of the collection.
+ *
+ * @author Rui Gonçalves
+ * @since 2.12
+ * @version 2.12
+ *
+ * @define Coll `mutable.SortedMap`
+ * @define coll mutable sorted map
+ * @define factoryInfo
+ * This object provides a set of operations needed to create sorted maps of type `$Coll`.
+ * @define sortedMapCanBuildFromInfo
+ * The standard `CanBuildFrom` instance for sorted maps
+ */
+abstract class MutableSortedMapFactory[CC[A, B] <: mutable.SortedMap[A, B] with SortedMapLike[A, B, CC[A, B]]]
+ extends SortedMapFactory[CC]
diff --git a/src/library/scala/collection/immutable/HashSet.scala b/src/library/scala/collection/immutable/HashSet.scala
index f548eac88d..49b4397cf2 100644
--- a/src/library/scala/collection/immutable/HashSet.scala
+++ b/src/library/scala/collection/immutable/HashSet.scala
@@ -194,7 +194,7 @@ class HashSet[A] extends AbstractSet[A]
protected def get0(key: A, hash: Int, level: Int): Boolean = false
- def updated0(key: A, hash: Int, level: Int): HashSet[A] =
+ private[collection] def updated0(key: A, hash: Int, level: Int): HashSet[A] =
new HashSet.HashSet1(key, hash)
protected def removed0(key: A, hash: Int, level: Int): HashSet[A] = this
@@ -256,10 +256,10 @@ object HashSet extends ImmutableSetFactory[HashSet] {
class HashSet1[A](private[HashSet] val key: A, private[HashSet] val hash: Int) extends LeafHashSet[A] {
override def size = 1
- override def get0(key: A, hash: Int, level: Int): Boolean =
+ override protected def get0(key: A, hash: Int, level: Int): Boolean =
(hash == this.hash && key == this.key)
- override def subsetOf0(that: HashSet[A], level: Int) = {
+ override protected def subsetOf0(that: HashSet[A], level: Int) = {
// check if that contains this.key
// we use get0 with our key and hash at the correct level instead of calling contains,
// which would not work since that might not be a top-level HashSet
@@ -267,7 +267,7 @@ object HashSet extends ImmutableSetFactory[HashSet] {
that.get0(key, hash, level)
}
- override def updated0(key: A, hash: Int, level: Int): HashSet[A] =
+ override private[collection] def updated0(key: A, hash: Int, level: Int): HashSet[A] =
if (hash == this.hash && key == this.key) this
else {
if (hash != this.hash) {
@@ -312,7 +312,7 @@ object HashSet extends ImmutableSetFactory[HashSet] {
override private[immutable] def diff0(that: HashSet[A], level: Int, buffer: Array[HashSet[A]], offset0: Int): HashSet[A] =
if (that.get0(key, hash, level)) null else this
- override def removed0(key: A, hash: Int, level: Int): HashSet[A] =
+ override protected def removed0(key: A, hash: Int, level: Int): HashSet[A] =
if (hash == this.hash && key == this.key) null else this
override protected def filter0(p: A => Boolean, negate: Boolean, level: Int, buffer: Array[HashSet[A]], offset0: Int): HashSet[A] =
@@ -326,10 +326,10 @@ object HashSet extends ImmutableSetFactory[HashSet] {
override def size = ks.size
- override def get0(key: A, hash: Int, level: Int): Boolean =
+ override protected def get0(key: A, hash: Int, level: Int): Boolean =
if (hash == this.hash) ks.contains(key) else false
- override def subsetOf0(that: HashSet[A], level: Int) = {
+ override protected def subsetOf0(that: HashSet[A], level: Int) = {
// we have to check each element
// we use get0 with our hash at the correct level instead of calling contains,
// which would not work since that might not be a top-level HashSet
@@ -337,11 +337,11 @@ object HashSet extends ImmutableSetFactory[HashSet] {
ks.forall(key => that.get0(key, hash, level))
}
- override def updated0(key: A, hash: Int, level: Int): HashSet[A] =
+ override private[collection] def updated0(key: A, hash: Int, level: Int): HashSet[A] =
if (hash == this.hash) new HashSetCollision1(hash, ks + key)
else makeHashTrieSet(this.hash, this, hash, new HashSet1(key, hash), level)
- override def union0(that: LeafHashSet[A], level: Int): HashSet[A] = that match {
+ override private[immutable] def union0(that: LeafHashSet[A], level: Int): HashSet[A] = that match {
case that if that.hash != this.hash =>
// different hash code, so there is no need to investigate further.
// Just create a branch node containing the two.
@@ -374,7 +374,7 @@ object HashSet extends ImmutableSetFactory[HashSet] {
}
}
- override def union0(that: HashSet[A], level: Int, buffer: Array[HashSet[A]], offset0: Int): HashSet[A] = that match {
+ override private[immutable] def union0(that: HashSet[A], level: Int, buffer: Array[HashSet[A]], offset0: Int): HashSet[A] = that match {
case that: LeafHashSet[A] =>
// switch to the simpler Tree/Leaf implementation
this.union0(that, level)
@@ -431,7 +431,7 @@ object HashSet extends ImmutableSetFactory[HashSet] {
}
}
- override def removed0(key: A, hash: Int, level: Int): HashSet[A] =
+ override protected def removed0(key: A, hash: Int, level: Int): HashSet[A] =
if (hash == this.hash) {
val ks1 = ks - key
ks1.size match {
@@ -528,7 +528,7 @@ object HashSet extends ImmutableSetFactory[HashSet] {
override def size = size0
- override def get0(key: A, hash: Int, level: Int): Boolean = {
+ override protected def get0(key: A, hash: Int, level: Int): Boolean = {
val index = (hash >>> level) & 0x1f
val mask = (1 << index)
if (bitmap == - 1) {
@@ -540,7 +540,7 @@ object HashSet extends ImmutableSetFactory[HashSet] {
false
}
- override def updated0(key: A, hash: Int, level: Int): HashSet[A] = {
+ override private[collection] def updated0(key: A, hash: Int, level: Int): HashSet[A] = {
val index = (hash >>> level) & 0x1f
val mask = (1 << index)
val offset = Integer.bitCount(bitmap & (mask-1))
@@ -842,7 +842,7 @@ object HashSet extends ImmutableSetFactory[HashSet] {
case _ => this
}
- override def removed0(key: A, hash: Int, level: Int): HashSet[A] = {
+ override protected def removed0(key: A, hash: Int, level: Int): HashSet[A] = {
val index = (hash >>> level) & 0x1f
val mask = (1 << index)
val offset = Integer.bitCount(bitmap & (mask-1))
@@ -879,7 +879,7 @@ object HashSet extends ImmutableSetFactory[HashSet] {
}
}
- override def subsetOf0(that: HashSet[A], level: Int): Boolean = if (that eq this) true else that match {
+ override protected def subsetOf0(that: HashSet[A], level: Int): Boolean = if (that eq this) true else that match {
case that: HashTrieSet[A] if this.size0 <= that.size0 =>
// create local mutable copies of members
var abm = this.bitmap
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala
index 82e38d3549..7b1997252d 100644
--- a/src/library/scala/collection/immutable/List.scala
+++ b/src/library/scala/collection/immutable/List.scala
@@ -13,7 +13,7 @@ package immutable
import generic._
import mutable.{Builder, ListBuffer}
import scala.annotation.tailrec
-import java.io._
+import java.io.{ObjectOutputStream, ObjectInputStream}
/** A class for immutable linked lists representing ordered collections
* of elements of type.
@@ -86,7 +86,7 @@ sealed abstract class List[+A] extends AbstractSeq[A]
with Product
with GenericTraversableTemplate[A, List]
with LinearSeqOptimized[A, List[A]]
- with Serializable {
+ with scala.Serializable {
override def companion: GenericCompanion[List] = List
import scala.collection.{Iterable, Traversable, Seq, IndexedSeq}
diff --git a/src/library/scala/collection/immutable/ListMap.scala b/src/library/scala/collection/immutable/ListMap.scala
index 7c40e84280..c5773338f5 100644
--- a/src/library/scala/collection/immutable/ListMap.scala
+++ b/src/library/scala/collection/immutable/ListMap.scala
@@ -29,7 +29,11 @@ object ListMap extends ImmutableMapFactory[ListMap] {
new MapCanBuildFrom[A, B]
def empty[A, B]: ListMap[A, B] = EmptyListMap.asInstanceOf[ListMap[A, B]]
- private object EmptyListMap extends ListMap[Any, Nothing] { }
+ @SerialVersionUID(-8256686706655863282L)
+ private object EmptyListMap extends ListMap[Any, Nothing] {
+ override def apply(key: Any) = throw new NoSuchElementException("key not found: " + key)
+ override def contains(key: Any) = false
+ }
}
/** This class implements immutable maps using a list-based data structure.
@@ -159,7 +163,6 @@ extends AbstractMap[A, B]
*/
override def apply(k: A): B1 = apply0(this, k)
-
@tailrec private def apply0(cur: ListMap[A, B1], k: A): B1 =
if (cur.isEmpty) throw new NoSuchElementException("key not found: "+k)
else if (k == cur.key) cur.value
@@ -176,7 +179,16 @@ extends AbstractMap[A, B]
@tailrec private def get0(cur: ListMap[A, B1], k: A): Option[B1] =
if (k == cur.key) Some(cur.value)
else if (cur.next.nonEmpty) get0(cur.next, k) else None
-
+
+
+ override def contains(key: A): Boolean = contains0(this, key)
+
+ @tailrec private def contains0(cur: ListMap[A, B1], k: A): Boolean =
+ if (k == cur.key) true
+ else if (cur.next.nonEmpty) contains0(cur.next, k)
+ else false
+
+
/** This method allows one to create a new map with an additional mapping
* from `key` to `value`. If the map contains already a mapping for `key`,
* it will be overridden by this function.
@@ -186,6 +198,7 @@ extends AbstractMap[A, B]
new m.Node[B2](k, v)
}
+
/** Creates a new mapping without the given `key`.
* If the map does not contain a mapping for the given key, the
* method returns the same map.
diff --git a/src/library/scala/collection/immutable/Map.scala b/src/library/scala/collection/immutable/Map.scala
index 5178d5a862..63ddcb18cf 100644
--- a/src/library/scala/collection/immutable/Map.scala
+++ b/src/library/scala/collection/immutable/Map.scala
@@ -94,6 +94,8 @@ object Map extends ImmutableMapFactory[Map] {
private object EmptyMap extends AbstractMap[Any, Nothing] with Map[Any, Nothing] with Serializable {
override def size: Int = 0
+ override def apply(key: Any) = throw new NoSuchElementException("key not found: " + key)
+ override def contains(key: Any) = false
def get(key: Any): Option[Nothing] = None
def iterator: Iterator[(Any, Nothing)] = Iterator.empty
override def updated [B1] (key: Any, value: B1): Map[Any, B1] = new Map1(key, value)
@@ -103,6 +105,8 @@ object Map extends ImmutableMapFactory[Map] {
class Map1[A, +B](key1: A, value1: B) extends AbstractMap[A, B] with Map[A, B] with Serializable {
override def size = 1
+ override def apply(key: A) = if (key == key1) value1 else throw new NoSuchElementException("key not found: " + key)
+ override def contains(key: A) = key == key1
def get(key: A): Option[B] =
if (key == key1) Some(value1) else None
def iterator = Iterator((key1, value1))
@@ -119,6 +123,11 @@ object Map extends ImmutableMapFactory[Map] {
class Map2[A, +B](key1: A, value1: B, key2: A, value2: B) extends AbstractMap[A, B] with Map[A, B] with Serializable {
override def size = 2
+ override def apply(key: A) =
+ if (key == key1) value1
+ else if (key == key2) value2
+ else throw new NoSuchElementException("key not found: " + key)
+ override def contains(key: A) = (key == key1) || (key == key2)
def get(key: A): Option[B] =
if (key == key1) Some(value1)
else if (key == key2) Some(value2)
@@ -140,6 +149,12 @@ object Map extends ImmutableMapFactory[Map] {
class Map3[A, +B](key1: A, value1: B, key2: A, value2: B, key3: A, value3: B) extends AbstractMap[A, B] with Map[A, B] with Serializable {
override def size = 3
+ override def apply(key: A) =
+ if (key == key1) value1
+ else if (key == key2) value2
+ else if (key == key3) value3
+ else throw new NoSuchElementException("key not found: " + key)
+ override def contains(key: A) = (key == key1) || (key == key2) || (key == key3)
def get(key: A): Option[B] =
if (key == key1) Some(value1)
else if (key == key2) Some(value2)
@@ -164,6 +179,13 @@ object Map extends ImmutableMapFactory[Map] {
class Map4[A, +B](key1: A, value1: B, key2: A, value2: B, key3: A, value3: B, key4: A, value4: B) extends AbstractMap[A, B] with Map[A, B] with Serializable {
override def size = 4
+ override def apply(key: A) =
+ if (key == key1) value1
+ else if (key == key2) value2
+ else if (key == key3) value3
+ else if (key == key4) value4
+ else throw new NoSuchElementException("key not found: " + key)
+ override def contains(key: A) = (key == key1) || (key == key2) || (key == key3) || (key == key4)
def get(key: A): Option[B] =
if (key == key1) Some(value1)
else if (key == key2) Some(value2)
diff --git a/src/library/scala/collection/immutable/PagedSeq.scala b/src/library/scala/collection/immutable/PagedSeq.scala
index f11217d26a..8910ee16b9 100644
--- a/src/library/scala/collection/immutable/PagedSeq.scala
+++ b/src/library/scala/collection/immutable/PagedSeq.scala
@@ -12,7 +12,7 @@ package scala
package collection
package immutable
-import java.io._
+import java.io.{File, FileReader, Reader}
import scala.util.matching.Regex
import scala.reflect.ClassTag
diff --git a/src/library/scala/collection/immutable/Range.scala b/src/library/scala/collection/immutable/Range.scala
index 79cd673932..984ea7ba50 100644
--- a/src/library/scala/collection/immutable/Range.scala
+++ b/src/library/scala/collection/immutable/Range.scala
@@ -202,7 +202,24 @@ extends scala.collection.AbstractSeq[Int]
copy(locationAfterN(n), end, step)
}
)
-
+
+ /** Creates a new range containing the elements starting at `from` up to but not including `until`.
+ *
+ * $doesNotUseBuilders
+ *
+ * @param from the element at which to start
+ * @param until the element at which to end (not included in the range)
+ * @return a new range consisting of a contiguous interval of values in the old range
+ */
+ override def slice(from: Int, until: Int): Range =
+ if (from <= 0) take(until)
+ else if (until >= numRangeElements && numRangeElements >= 0) drop(from)
+ else {
+ val fromValue = locationAfterN(from)
+ if (from >= until) newEmptyRange(fromValue)
+ else new Range.Inclusive(fromValue, locationAfterN(until-1), step)
+ }
+
/** Creates a new range containing all the elements of this range except the last one.
*
* $doesNotUseBuilders
diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala
index 17cf02cce6..1d0d40a1d8 100644
--- a/src/library/scala/collection/immutable/Stream.scala
+++ b/src/library/scala/collection/immutable/Stream.scala
@@ -499,80 +499,19 @@ self =>
)
else super.flatMap(f)(bf)
- /** Returns all the elements of this `Stream` that satisfy the predicate `p`
- * in a new `Stream` - i.e., it is still a lazy data structure. The order of
- * the elements is preserved
- *
- * @param p the predicate used to filter the stream.
- * @return the elements of this stream satisfying `p`.
- *
- * @example {{{
- * $naturalsEx
- * naturalsFrom(1) 10 } filter { _ % 5 == 0 } take 10 mkString(", ")
- * // produces
- * }}}
- */
- override def filter(p: A => Boolean): Stream[A] = {
+ override private[scala] def filterImpl(p: A => Boolean, isFlipped: Boolean): Stream[A] = {
// optimization: drop leading prefix of elems for which f returns false
// var rest = this dropWhile (!p(_)) - forget DRY principle - GC can't collect otherwise
var rest = this
- while (!rest.isEmpty && !p(rest.head)) rest = rest.tail
+ while (!rest.isEmpty && p(rest.head) == isFlipped) rest = rest.tail
// private utility func to avoid `this` on stack (would be needed for the lazy arg)
- if (rest.nonEmpty) Stream.filteredTail(rest, p)
+ if (rest.nonEmpty) Stream.filteredTail(rest, p, isFlipped)
else Stream.Empty
}
- override final def withFilter(p: A => Boolean): StreamWithFilter = new StreamWithFilter(p)
-
- /** A lazier implementation of WithFilter than TraversableLike's.
- */
- final class StreamWithFilter(p: A => Boolean) extends WithFilter(p) {
-
- override def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Stream[A], B, That]): That = {
- def tailMap(coll: Stream[A]): Stream[B] = {
- var head: A = null.asInstanceOf[A]
- var tail: Stream[A] = coll
- while (true) {
- if (tail.isEmpty)
- return Stream.Empty
- head = tail.head
- tail = tail.tail
- if (p(head))
- return cons(f(head), tailMap(tail))
- }
- throw new RuntimeException()
- }
-
- if (isStreamBuilder(bf)) asThat(tailMap(Stream.this))
- else super.map(f)(bf)
- }
-
- override def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Stream[A], B, That]): That = {
- def tailFlatMap(coll: Stream[A]): Stream[B] = {
- var head: A = null.asInstanceOf[A]
- var tail: Stream[A] = coll
- while (true) {
- if (tail.isEmpty)
- return Stream.Empty
- head = tail.head
- tail = tail.tail
- if (p(head))
- return f(head).toStream append tailFlatMap(tail)
- }
- throw new RuntimeException()
- }
-
- if (isStreamBuilder(bf)) asThat(tailFlatMap(Stream.this))
- else super.flatMap(f)(bf)
- }
-
- override def foreach[B](f: A => B) =
- for (x <- self)
- if (p(x)) f(x)
-
- override def withFilter(q: A => Boolean): StreamWithFilter =
- new StreamWithFilter(x => p(x) && q(x))
- }
+ /** A FilterMonadic which allows GC of the head of stream during processing */
+ @noinline // Workaround SI-9137, see https://github.com/scala/scala/pull/4284#issuecomment-73180791
+ override final def withFilter(p: A => Boolean): FilterMonadic[A, Stream[A]] = new Stream.StreamWithFilter(this, p)
/** A lazier Iterator than LinearSeqLike's. */
override def iterator: Iterator[A] = new StreamIterator(self)
@@ -1295,13 +1234,36 @@ object Stream extends SeqFactory[Stream] {
else cons(start, range(start + step, end, step))
}
- private[immutable] def filteredTail[A](stream: Stream[A], p: A => Boolean) = {
- cons(stream.head, stream.tail filter p)
+ private[immutable] def filteredTail[A](stream: Stream[A], p: A => Boolean, isFlipped: Boolean) = {
+ cons(stream.head, stream.tail.filterImpl(p, isFlipped))
}
private[immutable] def collectedTail[A, B, That](head: B, stream: Stream[A], pf: PartialFunction[A, B], bf: CanBuildFrom[Stream[A], B, That]) = {
cons(head, stream.tail.collect(pf)(bf).asInstanceOf[Stream[B]])
}
-}
+ /** An implementation of `FilterMonadic` allowing GC of the filtered-out elements of
+ * the `Stream` as it is processed.
+ *
+ * Because this is not an inner class of `Stream` with a reference to the original
+ * head, it is now possible for GC to collect any leading and filtered-out elements
+ * which do not satisfy the filter, while the tail is still processing (see SI-8990).
+ */
+ private[immutable] final class StreamWithFilter[A](sl: => Stream[A], p: A => Boolean) extends FilterMonadic[A, Stream[A]] {
+ private var s = sl // set to null to allow GC after filtered
+ private lazy val filtered = { val f = s filter p; s = null; f } // don't set to null if throw during filter
+ def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Stream[A], B, That]): That =
+ filtered map f
+
+ def flatMap[B, That](f: A => scala.collection.GenTraversableOnce[B])(implicit bf: CanBuildFrom[Stream[A], B, That]): That =
+ filtered flatMap f
+
+ def foreach[U](f: A => U): Unit =
+ filtered foreach f
+
+ def withFilter(q: A => Boolean): FilterMonadic[A, Stream[A]] =
+ new StreamWithFilter[A](filtered, q)
+ }
+
+}
diff --git a/src/library/scala/collection/immutable/StreamViewLike.scala b/src/library/scala/collection/immutable/StreamViewLike.scala
index c2eb85815d..4d7eaeff2a 100644
--- a/src/library/scala/collection/immutable/StreamViewLike.scala
+++ b/src/library/scala/collection/immutable/StreamViewLike.scala
@@ -53,6 +53,7 @@ extends SeqView[A, Coll]
/** boilerplate */
protected override def newForced[B](xs: => scala.collection.GenSeq[B]): Transformed[B] = new { val forced = xs } with AbstractTransformed[B] with Forced[B]
protected override def newAppended[B >: A](that: scala.collection.GenTraversable[B]): Transformed[B] = new { val rest = that } with AbstractTransformed[B] with Appended[B]
+ protected override def newPrepended[B >: A](that: scala.collection.GenTraversable[B]): Transformed[B] = new { protected[this] val fst = that } with AbstractTransformed[B] with Prepended[B]
protected override def newMapped[B](f: A => B): Transformed[B] = new { val mapping = f } with AbstractTransformed[B] with Mapped[B]
protected override def newFlatMapped[B](f: A => scala.collection.GenTraversableOnce[B]): Transformed[B] = new { val mapping = f } with AbstractTransformed[B] with FlatMapped[B]
protected override def newFiltered(p: A => Boolean): Transformed[A] = new { val pred = p } with AbstractTransformed[A] with Filtered
@@ -67,7 +68,6 @@ extends SeqView[A, Coll]
protected override def newPatched[B >: A](_from: Int, _patch: scala.collection.GenSeq[B], _replaced: Int): Transformed[B] = {
new { val from = _from; val patch = _patch; val replaced = _replaced } with AbstractTransformed[B] with Patched[B]
}
- protected override def newPrepended[B >: A](elem: B): Transformed[B] = new { protected[this] val fst = elem } with AbstractTransformed[B] with Prepended[B]
override def stringPrefix = "StreamView"
}
diff --git a/src/library/scala/collection/immutable/StringLike.scala b/src/library/scala/collection/immutable/StringLike.scala
index 1ead894faf..7b3da1e2ea 100644
--- a/src/library/scala/collection/immutable/StringLike.scala
+++ b/src/library/scala/collection/immutable/StringLike.scala
@@ -201,35 +201,64 @@ self =>
*/
def stripMargin: String = stripMargin('|')
- private def escape(ch: Char): String = "\\Q" + ch + "\\E"
-
- def split(separator: Char): Array[String] = {
- val thisString = toString
- var pos = thisString.indexOf(separator)
-
- if (pos != -1) {
- val res = new ArrayBuilder.ofRef[String]
-
- var prev = 0
- do {
- res += thisString.substring(prev, pos)
- prev = pos + 1
- pos = thisString.indexOf(separator, prev)
- } while (pos != -1)
-
- if (prev != thisString.size)
- res += thisString.substring(prev, thisString.size)
-
- val initialResult = res.result()
- pos = initialResult.length
- while (pos > 0 && initialResult(pos - 1).isEmpty) pos = pos - 1
- if (pos != initialResult.length) {
- val trimmed = new Array[String](pos)
- Array.copy(initialResult, 0, trimmed, 0, pos)
- trimmed
- } else initialResult
- } else Array[String](thisString)
- }
+ private def escape(ch: Char): String = if (
+ (ch >= 'a') && (ch <= 'z') ||
+ (ch >= 'A') && (ch <= 'Z') ||
+ (ch >= '0' && ch <= '9')) ch.toString
+ else "\\" + ch
+
+ /** Split this string around the separator character
+ *
+ * If this string is the empty string, returns an array of strings
+ * that contains a single empty string.
+ *
+ * If this string is not the empty string, returns an array containing
+ * the substrings terminated by the start of the string, the end of the
+ * string or the separator character, excluding empty trailing substrings
+ *
+ * If the separator character is a surrogate character, only split on
+ * matching surrogate characters if they are not part of a surrogate pair
+ *
+ * The behaviour follows, and is implemented in terms of <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split%28java.lang.String%29">String.split(re: String)</a>
+ *
+ *
+ * @example {{{
+ * "a.b".split('.') //returns Array("a", "b")
+ *
+ * //splitting the empty string always returns the array with a single
+ * //empty string
+ * "".split('.') //returns Array("")
+ *
+ * //only trailing empty substrings are removed
+ * "a.".split('.') //returns Array("a")
+ * ".a.".split('.') //returns Array("", "a")
+ * "..a..".split('.') //returns Array("", "", "a")
+ *
+ * //all parts are empty and trailing
+ * ".".split('.') //returns Array()
+ * "..".split('.') //returns Array()
+ *
+ * //surrogate pairs
+ * val high = 0xD852.toChar
+ * val low = 0xDF62.toChar
+ * val highstring = high.toString
+ * val lowstring = low.toString
+ *
+ * //well-formed surrogate pairs are not split
+ * val highlow = highstring + lowstring
+ * highlow.split(high) //returns Array(highlow)
+ *
+ * //bare surrogate characters are split
+ * val bare = "_" + highstring + "_"
+ * bare.split(high) //returns Array("_", "_")
+ *
+ * }}}
+ *
+ * @param separator the character used as a delimiter
+ */
+ def split(separator: Char): Array[String] =
+ toString.split(escape(separator))
+
@throws(classOf[java.util.regex.PatternSyntaxException])
def split(separators: Array[Char]): Array[String] = {
diff --git a/src/library/scala/collection/mutable/AnyRefMap.scala b/src/library/scala/collection/mutable/AnyRefMap.scala
index fccc9d83e6..ed6ca1939d 100644
--- a/src/library/scala/collection/mutable/AnyRefMap.scala
+++ b/src/library/scala/collection/mutable/AnyRefMap.scala
@@ -335,6 +335,24 @@ extends AbstractMap[K, V]
arm
}
+ override def +[V1 >: V](kv: (K, V1)): AnyRefMap[K, V1] = {
+ val arm = clone().asInstanceOf[AnyRefMap[K, V1]]
+ arm += kv
+ arm
+ }
+
+ override def ++[V1 >: V](xs: GenTraversableOnce[(K, V1)]): AnyRefMap[K, V1] = {
+ val arm = clone().asInstanceOf[AnyRefMap[K, V1]]
+ xs.foreach(kv => arm += kv)
+ arm
+ }
+
+ override def updated[V1 >: V](key: K, value: V1): AnyRefMap[K, V1] = {
+ val arm = clone().asInstanceOf[AnyRefMap[K, V1]]
+ arm += (key, value)
+ arm
+ }
+
private[this] def foreachElement[A,B](elems: Array[AnyRef], f: A => B) {
var i,j = 0
while (i < _hashes.length & j < _size) {
diff --git a/src/library/scala/collection/mutable/ArrayOps.scala b/src/library/scala/collection/mutable/ArrayOps.scala
index 00491ef20e..2bc41b5802 100644
--- a/src/library/scala/collection/mutable/ArrayOps.scala
+++ b/src/library/scala/collection/mutable/ArrayOps.scala
@@ -40,9 +40,8 @@ trait ArrayOps[T] extends Any with ArrayLike[T, Array[T]] with CustomParalleliza
arrayElementClass(repr.getClass)
override def copyToArray[U >: T](xs: Array[U], start: Int, len: Int) {
- var l = math.min(len, repr.length)
- if (xs.length - start < l) l = xs.length - start max 0
- Array.copy(repr, 0, xs, start, l)
+ val l = len min repr.length min (xs.length - start)
+ if (l > 0) Array.copy(repr, 0, xs, start, l)
}
override def toArray[U >: T : ClassTag]: Array[U] = {
diff --git a/src/library/scala/collection/mutable/ArraySeq.scala b/src/library/scala/collection/mutable/ArraySeq.scala
index 577a838315..5a50f4fb27 100644
--- a/src/library/scala/collection/mutable/ArraySeq.scala
+++ b/src/library/scala/collection/mutable/ArraySeq.scala
@@ -87,7 +87,7 @@ extends AbstractSeq[A]
*/
override def copyToArray[B >: A](xs: Array[B], start: Int, len: Int) {
val len1 = len min (xs.length - start) min length
- Array.copy(array, 0, xs, start, len1)
+ if (len1 > 0) Array.copy(array, 0, xs, start, len1)
}
override def clone(): ArraySeq[A] = {
diff --git a/src/library/scala/collection/mutable/BufferLike.scala b/src/library/scala/collection/mutable/BufferLike.scala
index 3c57387c03..8d24538620 100644
--- a/src/library/scala/collection/mutable/BufferLike.scala
+++ b/src/library/scala/collection/mutable/BufferLike.scala
@@ -211,13 +211,6 @@ trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]]
*/
override def stringPrefix: String = "Buffer"
- /** Returns the current evolving(!) state of this buffer as a read-only sequence.
- *
- * @return A sequence that forwards to this buffer for all its operations.
- */
- @deprecated("The returned sequence changes as this buffer is mutated. For an immutable copy, use, e.g., toList.", "2.11.0")
- def readOnly: scala.collection.Seq[A] = toSeq
-
/** Creates a new collection containing both the elements of this collection and the provided
* traversable object.
*
diff --git a/src/library/scala/collection/mutable/BufferProxy.scala b/src/library/scala/collection/mutable/BufferProxy.scala
index d9632cce91..2d52831d37 100644
--- a/src/library/scala/collection/mutable/BufferProxy.scala
+++ b/src/library/scala/collection/mutable/BufferProxy.scala
@@ -43,8 +43,6 @@ trait BufferProxy[A] extends Buffer[A] with Proxy {
*/
def +=(elem: A): this.type = { self.+=(elem); this }
- override def readOnly = self.readOnly
-
/** Appends a number of elements provided by a traversable object.
*
* @param xs the traversable object.
diff --git a/src/library/scala/collection/mutable/ListBuffer.scala b/src/library/scala/collection/mutable/ListBuffer.scala
index f9bab40a1e..2bc6738e53 100644
--- a/src/library/scala/collection/mutable/ListBuffer.scala
+++ b/src/library/scala/collection/mutable/ListBuffer.scala
@@ -12,7 +12,7 @@ package mutable
import generic._
import immutable.{List, Nil, ::}
-import java.io._
+import java.io.{ObjectOutputStream, ObjectInputStream}
import scala.annotation.migration
/** A `Buffer` implementation backed by a list. It provides constant time
@@ -408,9 +408,6 @@ final class ListBuffer[A]
}
}
- @deprecated("The result of this method will change along with this buffer, which is often not what's expected.", "2.11.0")
- override def readOnly: List[A] = start
-
// Private methods
/** Copy contents of this buffer */
@@ -426,7 +423,7 @@ final class ListBuffer[A]
}
override def equals(that: Any): Boolean = that match {
- case that: ListBuffer[_] => this.readOnly equals that.readOnly
+ case that: ListBuffer[_] => this.start equals that.start
case _ => super.equals(that)
}
diff --git a/src/library/scala/collection/mutable/LongMap.scala b/src/library/scala/collection/mutable/LongMap.scala
index c124f35cd7..1eb12d817c 100644
--- a/src/library/scala/collection/mutable/LongMap.scala
+++ b/src/library/scala/collection/mutable/LongMap.scala
@@ -415,6 +415,24 @@ extends AbstractMap[Long, V]
lm
}
+ override def +[V1 >: V](kv: (Long, V1)): LongMap[V1] = {
+ val lm = clone().asInstanceOf[LongMap[V1]]
+ lm += kv
+ lm
+ }
+
+ override def ++[V1 >: V](xs: GenTraversableOnce[(Long, V1)]): LongMap[V1] = {
+ val lm = clone().asInstanceOf[LongMap[V1]]
+ xs.foreach(kv => lm += kv)
+ lm
+ }
+
+ override def updated[V1 >: V](key: Long, value: V1): LongMap[V1] = {
+ val lm = clone().asInstanceOf[LongMap[V1]]
+ lm += (key, value)
+ lm
+ }
+
/** Applies a function to all keys of this map. */
def foreachKey[A](f: Long => A) {
if ((extraKeys & 1) == 1) f(0L)
@@ -541,7 +559,7 @@ object LongMap {
/** Creates a new `LongMap` from keys and values.
* Equivalent to but more efficient than `LongMap((keys zip values): _*)`.
*/
- def fromZip[V](keys: Iterable[Long], values: Iterable[V]): LongMap[V] = {
+ def fromZip[V](keys: collection.Iterable[Long], values: collection.Iterable[V]): LongMap[V] = {
val sz = math.min(keys.size, values.size)
val lm = new LongMap[V](sz * 2)
val ki = keys.iterator
diff --git a/src/library/scala/collection/mutable/MapLike.scala b/src/library/scala/collection/mutable/MapLike.scala
index 44af886cf5..949e5e3536 100644
--- a/src/library/scala/collection/mutable/MapLike.scala
+++ b/src/library/scala/collection/mutable/MapLike.scala
@@ -61,6 +61,18 @@ trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]]
override protected[this] def newBuilder: Builder[(A, B), This] = empty
protected[this] override def parCombiner = ParMap.newCombiner[A, B]
+
+ /** Converts this $coll to a sequence.
+ *
+ * ```Note```: assumes a fast `size` method. Subclasses should override if this is not true.
+ */
+ override def toSeq: collection.Seq[(A, B)] = {
+ // ArrayBuffer for efficiency, preallocated to the right size.
+ val result = new ArrayBuffer[(A, B)](size)
+ foreach(result += _)
+ result
+ }
+
/** Adds a new key/value pair to this map and optionally returns previously bound value.
* If the map already contains a
diff --git a/src/library/scala/collection/mutable/PriorityQueue.scala b/src/library/scala/collection/mutable/PriorityQueue.scala
index d3c4161e3b..619beeb1d6 100644
--- a/src/library/scala/collection/mutable/PriorityQueue.scala
+++ b/src/library/scala/collection/mutable/PriorityQueue.scala
@@ -16,7 +16,7 @@ import generic._
* To prioritize elements of type A there must be an implicit
* Ordering[A] available at creation.
*
- * Only the `dequeue` and `dequeueAll` methods will return methods in priority
+ * Only the `dequeue` and `dequeueAll` methods will return elements in priority
* order (while removing elements from the heap). Standard collection methods
* including `drop` and `iterator` will remove or traverse the heap in whichever
* order seems most convenient.
diff --git a/src/library/scala/collection/mutable/RedBlackTree.scala b/src/library/scala/collection/mutable/RedBlackTree.scala
new file mode 100644
index 0000000000..a3be011ae2
--- /dev/null
+++ b/src/library/scala/collection/mutable/RedBlackTree.scala
@@ -0,0 +1,547 @@
+package scala.collection.mutable
+
+import scala.annotation.tailrec
+import scala.collection.Iterator
+
+/**
+ * An object containing the red-black tree implementation used by mutable `TreeMaps`.
+ *
+ * The trees implemented in this object are *not* thread safe.
+ *
+ * @author Rui Gonçalves
+ * @version 2.12
+ * @since 2.12
+ */
+private[collection] object RedBlackTree {
+
+ // ---- class structure ----
+
+ // For performance reasons, this implementation uses `null` references to represent leaves instead of a sentinel node.
+ // Currently, the internal nodes do not store their subtree size - only the tree object keeps track of their size.
+ // Therefore, while obtaining the size of the whole tree is O(1), knowing the number of entries inside a range is O(n)
+ // on the size of the range.
+
+ @SerialVersionUID(21575944040195605L)
+ final class Tree[A, B](var root: Node[A, B], var size: Int) extends Serializable
+
+ @SerialVersionUID(1950599696441054720L)
+ final class Node[A, B](var key: A, var value: B, var red: Boolean,
+ var left: Node[A, B], var right: Node[A, B], var parent: Node[A, B]) extends Serializable {
+
+ override def toString: String = "Node(" + key + ", " + value + ", " + red + ", " + left + ", " + right + ")"
+ }
+
+ object Tree {
+ def empty[A, B]: Tree[A, B] = new Tree(null, 0)
+ }
+
+ object Node {
+
+ @inline def apply[A, B](key: A, value: B, red: Boolean,
+ left: Node[A, B], right: Node[A, B], parent: Node[A, B]): Node[A, B] =
+ new Node(key, value, red, left, right, parent)
+
+ @inline def leaf[A, B](key: A, value: B, red: Boolean, parent: Node[A, B]): Node[A, B] =
+ new Node(key, value, red, null, null, parent)
+
+ def unapply[A, B](t: Node[A, B]) = Some((t.key, t.value, t.left, t.right, t.parent))
+ }
+
+ // ---- getters ----
+
+ def isRed(node: Node[_, _]) = (node ne null) && node.red
+ def isBlack(node: Node[_, _]) = (node eq null) || !node.red
+
+ // ---- size ----
+
+ def size(node: Node[_, _]): Int = if (node eq null) 0 else 1 + size(node.left) + size(node.right)
+ def size(tree: Tree[_, _]): Int = tree.size
+ def isEmpty(tree: Tree[_, _]) = tree.root eq null
+ def clear(tree: Tree[_, _]): Unit = { tree.root = null; tree.size = 0 }
+
+ // ---- search ----
+
+ def get[A: Ordering, B](tree: Tree[A, B], key: A): Option[B] = getNode(tree.root, key) match {
+ case null => None
+ case node => Some(node.value)
+ }
+
+ @tailrec private[this] def getNode[A, B](node: Node[A, B], key: A)(implicit ord: Ordering[A]): Node[A, B] =
+ if (node eq null) null
+ else {
+ val cmp = ord.compare(key, node.key)
+ if (cmp < 0) getNode(node.left, key)
+ else if (cmp > 0) getNode(node.right, key)
+ else node
+ }
+
+ def contains[A: Ordering](tree: Tree[A, _], key: A) = getNode(tree.root, key) ne null
+
+ def min[A, B](tree: Tree[A, B]): Option[(A, B)] = minNode(tree.root) match {
+ case null => None
+ case node => Some((node.key, node.value))
+ }
+
+ private def minNode[A, B](node: Node[A, B]): Node[A, B] =
+ if (node eq null) null else minNodeNonNull(node)
+
+ @tailrec def minNodeNonNull[A, B](node: Node[A, B]): Node[A, B] =
+ if (node.left eq null) node else minNodeNonNull(node.left)
+
+ def max[A, B](tree: Tree[A, B]): Option[(A, B)] = maxNode(tree.root) match {
+ case null => None
+ case node => Some((node.key, node.value))
+ }
+
+ private def maxNode[A, B](node: Node[A, B]): Node[A, B] =
+ if (node eq null) null else maxNodeNonNull(node)
+
+ @tailrec def maxNodeNonNull[A, B](node: Node[A, B]): Node[A, B] =
+ if (node.right eq null) node else maxNodeNonNull(node.right)
+
+ /**
+ * Returns the first (lowest) map entry with a key equal or greater than `key`. Returns `None` if there is no such
+ * node.
+ */
+ def minAfter[A, B](tree: Tree[A, B], key: A)(implicit ord: Ordering[A]): Option[(A, B)] =
+ minNodeAfter(tree.root, key) match {
+ case null => None
+ case node => Some((node.key, node.value))
+ }
+
+ private[this] def minNodeAfter[A, B](node: Node[A, B], key: A)(implicit ord: Ordering[A]): Node[A, B] = {
+ if (node eq null) null
+ else {
+ var y: Node[A, B] = null
+ var x = node
+ var cmp = 1
+ while ((x ne null) && cmp != 0) {
+ y = x
+ cmp = ord.compare(key, x.key)
+ x = if (cmp < 0) x.left else x.right
+ }
+ if (cmp <= 0) y else successor(y)
+ }
+ }
+
+ /**
+ * Returns the last (highest) map entry with a key smaller than `key`. Returns `None` if there is no such node.
+ */
+ def maxBefore[A, B](tree: Tree[A, B], key: A)(implicit ord: Ordering[A]): Option[(A, B)] =
+ maxNodeBefore(tree.root, key) match {
+ case null => None
+ case node => Some((node.key, node.value))
+ }
+
+ private[this] def maxNodeBefore[A, B](node: Node[A, B], key: A)(implicit ord: Ordering[A]): Node[A, B] = {
+ if (node eq null) null
+ else {
+ var y: Node[A, B] = null
+ var x = node
+ var cmp = 1
+ while ((x ne null) && cmp != 0) {
+ y = x
+ cmp = ord.compare(key, x.key)
+ x = if (cmp < 0) x.left else x.right
+ }
+ if (cmp > 0) y else predecessor(y)
+ }
+ }
+
+ // ---- insertion ----
+
+ def insert[A, B](tree: Tree[A, B], key: A, value: B)(implicit ord: Ordering[A]): Unit = {
+ var y: Node[A, B] = null
+ var x = tree.root
+ var cmp = 1
+ while ((x ne null) && cmp != 0) {
+ y = x
+ cmp = ord.compare(key, x.key)
+ x = if (cmp < 0) x.left else x.right
+ }
+
+ if (cmp == 0) y.value = value
+ else {
+ val z = Node.leaf(key, value, red = true, y)
+
+ if (y eq null) tree.root = z
+ else if (cmp < 0) y.left = z
+ else y.right = z
+
+ fixAfterInsert(tree, z)
+ tree.size += 1
+ }
+ }
+
+ private[this] def fixAfterInsert[A, B](tree: Tree[A, B], node: Node[A, B]): Unit = {
+ var z = node
+ while (isRed(z.parent)) {
+ if (z.parent eq z.parent.parent.left) {
+ val y = z.parent.parent.right
+ if (isRed(y)) {
+ z.parent.red = false
+ y.red = false
+ z.parent.parent.red = true
+ z = z.parent.parent
+ } else {
+ if (z eq z.parent.right) {
+ z = z.parent
+ rotateLeft(tree, z)
+ }
+ z.parent.red = false
+ z.parent.parent.red = true
+ rotateRight(tree, z.parent.parent)
+ }
+ } else { // symmetric cases
+ val y = z.parent.parent.left
+ if (isRed(y)) {
+ z.parent.red = false
+ y.red = false
+ z.parent.parent.red = true
+ z = z.parent.parent
+ } else {
+ if (z eq z.parent.left) {
+ z = z.parent
+ rotateRight(tree, z)
+ }
+ z.parent.red = false
+ z.parent.parent.red = true
+ rotateLeft(tree, z.parent.parent)
+ }
+ }
+ }
+ tree.root.red = false
+ }
+
+ // ---- deletion ----
+
+ def delete[A, B](tree: Tree[A, B], key: A)(implicit ord: Ordering[A]): Unit = {
+ val z = getNode(tree.root, key)
+ if (z ne null) {
+ var y = z
+ var yIsRed = y.red
+ var x: Node[A, B] = null
+ var xParent: Node[A, B] = null
+
+ if (z.left eq null) {
+ x = z.right
+ transplant(tree, z, z.right)
+ xParent = z.parent
+ }
+ else if (z.right eq null) {
+ x = z.left
+ transplant(tree, z, z.left)
+ xParent = z.parent
+ }
+ else {
+ y = minNodeNonNull(z.right)
+ yIsRed = y.red
+ x = y.right
+
+ if (y.parent eq z) xParent = y
+ else {
+ xParent = y.parent
+ transplant(tree, y, y.right)
+ y.right = z.right
+ y.right.parent = y
+ }
+ transplant(tree, z, y)
+ y.left = z.left
+ y.left.parent = y
+ y.red = z.red
+ }
+
+ if (!yIsRed) fixAfterDelete(tree, x, xParent)
+ tree.size -= 1
+ }
+ }
+
+ private[this] def fixAfterDelete[A, B](tree: Tree[A, B], node: Node[A, B], parent: Node[A, B]): Unit = {
+ var x = node
+ var xParent = parent
+ while ((x ne tree.root) && isBlack(x)) {
+ if (x eq xParent.left) {
+ var w = xParent.right
+ // assert(w ne null)
+
+ if (w.red) {
+ w.red = false
+ xParent.red = true
+ rotateLeft(tree, xParent)
+ w = xParent.right
+ }
+ if (isBlack(w.left) && isBlack(w.right)) {
+ w.red = true
+ x = xParent
+ } else {
+ if (isBlack(w.right)) {
+ w.left.red = false
+ w.red = true
+ rotateRight(tree, w)
+ w = xParent.right
+ }
+ w.red = xParent.red
+ xParent.red = false
+ w.right.red = false
+ rotateLeft(tree, xParent)
+ x = tree.root
+ }
+ } else { // symmetric cases
+ var w = xParent.left
+ // assert(w ne null)
+
+ if (w.red) {
+ w.red = false
+ xParent.red = true
+ rotateRight(tree, xParent)
+ w = xParent.left
+ }
+ if (isBlack(w.right) && isBlack(w.left)) {
+ w.red = true
+ x = xParent
+ } else {
+ if (isBlack(w.left)) {
+ w.right.red = false
+ w.red = true
+ rotateLeft(tree, w)
+ w = xParent.left
+ }
+ w.red = xParent.red
+ xParent.red = false
+ w.left.red = false
+ rotateRight(tree, xParent)
+ x = tree.root
+ }
+ }
+ xParent = x.parent
+ }
+ if (x ne null) x.red = false
+ }
+
+ // ---- helpers ----
+
+ /**
+ * Returns the node that follows `node` in an in-order tree traversal. If `node` has the maximum key (and is,
+ * therefore, the last node), this method returns `null`.
+ */
+ private[this] def successor[A, B](node: Node[A, B]): Node[A, B] = {
+ if (node.right ne null) minNodeNonNull(node.right)
+ else {
+ var x = node
+ var y = x.parent
+ while ((y ne null) && (x eq y.right)) {
+ x = y
+ y = y.parent
+ }
+ y
+ }
+ }
+
+ /**
+ * Returns the node that precedes `node` in an in-order tree traversal. If `node` has the minimum key (and is,
+ * therefore, the first node), this method returns `null`.
+ */
+ private[this] def predecessor[A, B](node: Node[A, B]): Node[A, B] = {
+ if (node.left ne null) maxNodeNonNull(node.left)
+ else {
+ var x = node
+ var y = x.parent
+ while ((y ne null) && (x eq y.left)) {
+ x = y
+ y = y.parent
+ }
+ y
+ }
+ }
+
+ private[this] def rotateLeft[A, B](tree: Tree[A, B], x: Node[A, B]): Unit = if (x ne null) {
+ // assert(x.right ne null)
+ val y = x.right
+ x.right = y.left
+
+ if (y.left ne null) y.left.parent = x
+ y.parent = x.parent
+
+ if (x.parent eq null) tree.root = y
+ else if (x eq x.parent.left) x.parent.left = y
+ else x.parent.right = y
+
+ y.left = x
+ x.parent = y
+ }
+
+ private[this] def rotateRight[A, B](tree: Tree[A, B], x: Node[A, B]): Unit = if (x ne null) {
+ // assert(x.left ne null)
+ val y = x.left
+ x.left = y.right
+
+ if (y.right ne null) y.right.parent = x
+ y.parent = x.parent
+
+ if (x.parent eq null) tree.root = y
+ else if (x eq x.parent.right) x.parent.right = y
+ else x.parent.left = y
+
+ y.right = x
+ x.parent = y
+ }
+
+ /**
+ * Transplant the node `from` to the place of node `to`. This is done by setting `from` as a child of `to`'s previous
+ * parent and setting `from`'s parent to the `to`'s previous parent. The children of `from` are left unchanged.
+ */
+ private[this] def transplant[A, B](tree: Tree[A, B], to: Node[A, B], from: Node[A, B]): Unit = {
+ if (to.parent eq null) tree.root = from
+ else if (to eq to.parent.left) to.parent.left = from
+ else to.parent.right = from
+
+ if (from ne null) from.parent = to.parent
+ }
+
+ // ---- tree traversal ----
+
+ def foreach[A, B, U](tree: Tree[A, B], f: ((A, B)) => U): Unit = foreachNode(tree.root, f)
+
+ private[this] def foreachNode[A, B, U](node: Node[A, B], f: ((A, B)) => U): Unit =
+ if (node ne null) foreachNodeNonNull(node, f)
+
+ private[this] def foreachNodeNonNull[A, B, U](node: Node[A, B], f: ((A, B)) => U): Unit = {
+ if (node.left ne null) foreachNodeNonNull(node.left, f)
+ f((node.key, node.value))
+ if (node.right ne null) foreachNodeNonNull(node.right, f)
+ }
+
+ def transform[A, B](tree: Tree[A, B], f: (A, B) => B): Unit = transformNode(tree.root, f)
+
+ private[this] def transformNode[A, B, U](node: Node[A, B], f: (A, B) => B): Unit =
+ if (node ne null) transformNodeNonNull(node, f)
+
+ private[this] def transformNodeNonNull[A, B, U](node: Node[A, B], f: (A, B) => B): Unit = {
+ if (node.left ne null) transformNodeNonNull(node.left, f)
+ node.value = f(node.key, node.value)
+ if (node.right ne null) transformNodeNonNull(node.right, f)
+ }
+
+ def iterator[A: Ordering, B](tree: Tree[A, B], start: Option[A] = None, end: Option[A] = None): Iterator[(A, B)] =
+ new EntriesIterator(tree, start, end)
+
+ def keysIterator[A: Ordering](tree: Tree[A, _], start: Option[A] = None, end: Option[A] = None): Iterator[A] =
+ new KeysIterator(tree, start, end)
+
+ def valuesIterator[A: Ordering, B](tree: Tree[A, B], start: Option[A] = None, end: Option[A] = None): Iterator[B] =
+ new ValuesIterator(tree, start, end)
+
+ private[this] abstract class TreeIterator[A, B, R](tree: Tree[A, B], start: Option[A], end: Option[A])
+ (implicit ord: Ordering[A]) extends Iterator[R] {
+
+ protected[this] def nextResult(node: Node[A, B]): R
+
+ def hasNext: Boolean = nextNode ne null
+
+ def next(): R = nextNode match {
+ case null => throw new NoSuchElementException("next on empty iterator")
+ case node =>
+ nextNode = successor(node)
+ setNullIfAfterEnd()
+ nextResult(node)
+ }
+
+ private[this] var nextNode: Node[A, B] = start match {
+ case None => minNode(tree.root)
+ case Some(from) => minNodeAfter(tree.root, from)
+ }
+
+ private[this] def setNullIfAfterEnd(): Unit =
+ if (end.isDefined && (nextNode ne null) && ord.compare(nextNode.key, end.get) >= 0)
+ nextNode = null
+
+ setNullIfAfterEnd()
+ }
+
+ private[this] final class EntriesIterator[A: Ordering, B](tree: Tree[A, B], start: Option[A], end: Option[A])
+ extends TreeIterator[A, B, (A, B)](tree, start, end) {
+
+ def nextResult(node: Node[A, B]) = (node.key, node.value)
+ }
+
+ private[this] final class KeysIterator[A: Ordering, B](tree: Tree[A, B], start: Option[A], end: Option[A])
+ extends TreeIterator[A, B, A](tree, start, end) {
+
+ def nextResult(node: Node[A, B]) = node.key
+ }
+
+ private[this] final class ValuesIterator[A: Ordering, B](tree: Tree[A, B], start: Option[A], end: Option[A])
+ extends TreeIterator[A, B, B](tree, start, end) {
+
+ def nextResult(node: Node[A, B]) = node.value
+ }
+
+ // ---- debugging ----
+
+ /**
+ * Checks if the tree is in a valid state. That happens if:
+ * - It is a valid binary search tree;
+ * - All red-black properties are satisfied;
+ * - All non-null nodes have their `parent` reference correct;
+ * - The size variable in `tree` corresponds to the actual size of the tree.
+ */
+ def isValid[A: Ordering, B](tree: Tree[A, B]): Boolean =
+ isValidBST(tree.root) && hasProperParentRefs(tree) && isValidRedBlackTree(tree) && size(tree.root) == tree.size
+
+ /**
+ * Returns true if all non-null nodes have their `parent` reference correct.
+ */
+ private[this] def hasProperParentRefs[A, B](tree: Tree[A, B]): Boolean = {
+
+ def hasProperParentRefs(node: Node[A, B]): Boolean = {
+ if (node eq null) true
+ else {
+ if ((node.left ne null) && (node.left.parent ne node) ||
+ (node.right ne null) && (node.right.parent ne node)) false
+ else hasProperParentRefs(node.left) && hasProperParentRefs(node.right)
+ }
+ }
+
+ if(tree.root eq null) true
+ else (tree.root.parent eq null) && hasProperParentRefs(tree.root)
+ }
+
+ /**
+ * Returns true if this node follows the properties of a binary search tree.
+ */
+ private[this] def isValidBST[A, B](node: Node[A, B])(implicit ord: Ordering[A]): Boolean = {
+ if (node eq null) true
+ else {
+ if ((node.left ne null) && (ord.compare(node.key, node.left.key) <= 0) ||
+ (node.right ne null) && (ord.compare(node.key, node.right.key) >= 0)) false
+ else isValidBST(node.left) && isValidBST(node.right)
+ }
+ }
+
+ /**
+ * Returns true if the tree has all the red-black tree properties: if the root node is black, if all children of red
+ * nodes are black and if the path from any node to any of its null children has the same number of black nodes.
+ */
+ private[this] def isValidRedBlackTree[A, B](tree: Tree[A, B]): Boolean = {
+
+ def noRedAfterRed(node: Node[A, B]): Boolean = {
+ if (node eq null) true
+ else if (node.red && (isRed(node.left) || isRed(node.right))) false
+ else noRedAfterRed(node.left) && noRedAfterRed(node.right)
+ }
+
+ def blackHeight(node: Node[A, B]): Int = {
+ if (node eq null) 1
+ else {
+ val lh = blackHeight(node.left)
+ val rh = blackHeight(node.right)
+
+ if (lh == -1 || lh != rh) -1
+ else if (isRed(node)) lh
+ else lh + 1
+ }
+ }
+
+ isBlack(tree.root) && noRedAfterRed(tree.root) && blackHeight(tree.root) >= 0
+ }
+}
diff --git a/src/library/scala/collection/mutable/ResizableArray.scala b/src/library/scala/collection/mutable/ResizableArray.scala
index c3047522e2..85a299216e 100644
--- a/src/library/scala/collection/mutable/ResizableArray.scala
+++ b/src/library/scala/collection/mutable/ResizableArray.scala
@@ -74,7 +74,7 @@ trait ResizableArray[A] extends IndexedSeq[A]
*/
override def copyToArray[B >: A](xs: Array[B], start: Int, len: Int) {
val len1 = len min (xs.length - start) min length
- Array.copy(array, 0, xs, start, len1)
+ if (len1 > 0) Array.copy(array, 0, xs, start, len1)
}
//##########################################################################
diff --git a/src/library/scala/collection/mutable/SetLike.scala b/src/library/scala/collection/mutable/SetLike.scala
index 81a71adc91..40a5c93064 100644
--- a/src/library/scala/collection/mutable/SetLike.scala
+++ b/src/library/scala/collection/mutable/SetLike.scala
@@ -72,6 +72,17 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]]
protected[this] override def parCombiner = ParSet.newCombiner[A]
+ /** Converts this $coll to a sequence.
+ *
+ * ```Note```: assumes a fast `size` method. Subclasses should override if this is not true.
+ */
+ override def toSeq: collection.Seq[A] = {
+ // ArrayBuffer for efficiency, preallocated to the right size.
+ val result = new ArrayBuffer[A](size)
+ foreach(result += _)
+ result
+ }
+
/** Adds an element to this $coll.
*
* @param elem the element to be added
diff --git a/src/library/scala/collection/mutable/SortedMap.scala b/src/library/scala/collection/mutable/SortedMap.scala
new file mode 100644
index 0000000000..806b30e79a
--- /dev/null
+++ b/src/library/scala/collection/mutable/SortedMap.scala
@@ -0,0 +1,57 @@
+package scala
+package collection
+package mutable
+
+import generic._
+
+/**
+ * A mutable map whose keys are sorted.
+ *
+ * @tparam A the type of the keys contained in this sorted map.
+ * @tparam B the type of the values associated with the keys.
+ *
+ * @author Rui Gonçalves
+ * @version 2.12
+ * @since 2.12
+ *
+ * @define Coll mutable.SortedMap
+ * @define coll mutable sorted map
+ */
+trait SortedMap[A, B]
+ extends Map[A, B]
+ with collection.SortedMap[A, B]
+ with MapLike[A, B, SortedMap[A, B]]
+ with SortedMapLike[A, B, SortedMap[A, B]] {
+
+ override protected[this] def newBuilder: Builder[(A, B), SortedMap[A, B]] = SortedMap.newBuilder[A, B]
+
+ override def empty: SortedMap[A, B] = SortedMap.empty
+
+ override def updated[B1 >: B](key: A, value: B1): SortedMap[A, B1] = this + ((key, value))
+
+ override def +[B1 >: B](kv: (A, B1)): SortedMap[A, B1] = clone().asInstanceOf[SortedMap[A, B1]] += kv
+
+ override def +[B1 >: B](elem1: (A, B1), elem2: (A, B1), elems: (A, B1)*): SortedMap[A, B1] =
+ clone().asInstanceOf[SortedMap[A, B1]] += elem1 += elem2 ++= elems
+
+ override def ++[B1 >: B](xs: GenTraversableOnce[(A, B1)]): SortedMap[A, B1] =
+ clone().asInstanceOf[SortedMap[A, B1]] ++= xs.seq
+}
+
+/**
+ * $factoryInfo
+ *
+ * @define Coll mutable.SortedMap
+ * @define coll mutable sorted map
+ */
+object SortedMap extends MutableSortedMapFactory[SortedMap] {
+
+ def empty[A, B](implicit ord: Ordering[A]): SortedMap[A, B] = TreeMap.empty[A, B]
+
+ /** $sortedMapCanBuildFromInfo */
+ implicit def canBuildFrom[A, B](implicit ord: Ordering[A]): CanBuildFrom[Coll, (A, B), SortedMap[A, B]] =
+ new SortedMapCanBuildFrom[A, B]
+}
+
+/** Explicit instantiation of the `SortedMap` trait to reduce class file size in subclasses. */
+abstract class AbstractSortedMap[A, B] extends scala.collection.mutable.AbstractMap[A, B] with SortedMap[A, B]
diff --git a/src/library/scala/collection/mutable/TreeMap.scala b/src/library/scala/collection/mutable/TreeMap.scala
new file mode 100644
index 0000000000..b96cef5bee
--- /dev/null
+++ b/src/library/scala/collection/mutable/TreeMap.scala
@@ -0,0 +1,166 @@
+package scala
+package collection
+package mutable
+
+import scala.collection.generic._
+import scala.collection.mutable.{RedBlackTree => RB}
+
+/**
+ * $factoryInfo
+ *
+ * @define Coll mutable.TreeMap
+ * @define coll mutable tree map
+ */
+object TreeMap extends MutableSortedMapFactory[TreeMap] {
+
+ def empty[A, B](implicit ord: Ordering[A]) = new TreeMap[A, B]()(ord)
+
+ /** $sortedMapCanBuildFromInfo */
+ implicit def canBuildFrom[A, B](implicit ord: Ordering[A]): CanBuildFrom[Coll, (A, B), TreeMap[A, B]] =
+ new SortedMapCanBuildFrom[A, B]
+}
+
+/**
+ * A mutable sorted map implemented using a mutable red-black tree as underlying data structure.
+ *
+ * @param ordering the implicit ordering used to compare objects of type `A`.
+ * @tparam A the type of the keys contained in this tree map.
+ * @tparam B the type of the values associated with the keys.
+ *
+ * @author Rui Gonçalves
+ * @version 2.12
+ * @since 2.12
+ *
+ * @define Coll mutable.TreeMap
+ * @define coll mutable tree map
+ */
+@SerialVersionUID(-2558985573956740112L)
+sealed class TreeMap[A, B] private (tree: RB.Tree[A, B])(implicit val ordering: Ordering[A])
+ extends AbstractSortedMap[A, B]
+ with SortedMap[A, B]
+ with MapLike[A, B, TreeMap[A, B]]
+ with SortedMapLike[A, B, TreeMap[A, B]]
+ with Serializable {
+
+ /**
+ * Creates an empty `TreeMap`.
+ * @param ord the implicit ordering used to compare objects of type `A`.
+ * @return an empty `TreeMap`.
+ */
+ def this()(implicit ord: Ordering[A]) = this(RB.Tree.empty)(ord)
+
+ override def empty = TreeMap.empty
+ override protected[this] def newBuilder = TreeMap.newBuilder[A, B]
+
+ def rangeImpl(from: Option[A], until: Option[A]): TreeMap[A, B] = new TreeMapView(from, until)
+
+ def -=(key: A): this.type = { RB.delete(tree, key); this }
+ def +=(kv: (A, B)): this.type = { RB.insert(tree, kv._1, kv._2); this }
+
+ def get(key: A) = RB.get(tree, key)
+
+ def iterator = RB.iterator(tree)
+ def iteratorFrom(start: A) = RB.iterator(tree, Some(start))
+ def keysIteratorFrom(start: A) = RB.keysIterator(tree, Some(start))
+ def valuesIteratorFrom(start: A) = RB.valuesIterator(tree, Some(start))
+
+ override def size = RB.size(tree)
+ override def isEmpty = RB.isEmpty(tree)
+ override def contains(key: A) = RB.contains(tree, key)
+
+ override def head = RB.min(tree).get
+ override def headOption = RB.min(tree)
+ override def last = RB.max(tree).get
+ override def lastOption = RB.max(tree)
+
+ override def keysIterator = RB.keysIterator(tree)
+ override def valuesIterator = RB.valuesIterator(tree)
+
+ override def foreach[U](f: ((A, B)) => U): Unit = RB.foreach(tree, f)
+ override def transform(f: (A, B) => B) = { RB.transform(tree, f); this }
+ override def clear(): Unit = RB.clear(tree)
+
+ override def stringPrefix = "TreeMap"
+
+ /**
+ * A ranged projection of a [[TreeMap]]. Mutations on this map affect the original map and vice versa.
+ *
+ * Only entries with keys between this projection's key range will ever appear as elements of this map, independently
+ * of whether the entries are added through the original map or through this view. That means that if one inserts a
+ * key-value in a view whose key is outside the view's bounds, calls to `get` or `contains` will _not_ consider the
+ * newly added entry. Mutations are always reflected in the original map, though.
+ *
+ * @param from the lower bound (inclusive) of this projection wrapped in a `Some`, or `None` if there is no lower
+ * bound.
+ * @param until the upper bound (exclusive) of this projection wrapped in a `Some`, or `None` if there is no upper
+ * bound.
+ */
+ @SerialVersionUID(2219159283273389116L)
+ private[this] final class TreeMapView(from: Option[A], until: Option[A]) extends TreeMap[A, B](tree) {
+
+ /**
+ * Given a possible new lower bound, chooses and returns the most constraining one (the maximum).
+ */
+ private[this] def pickLowerBound(newFrom: Option[A]): Option[A] = (from, newFrom) match {
+ case (Some(fr), Some(newFr)) => Some(ordering.max(fr, newFr))
+ case (None, _) => newFrom
+ case _ => from
+ }
+
+ /**
+ * Given a possible new upper bound, chooses and returns the most constraining one (the minimum).
+ */
+ private[this] def pickUpperBound(newUntil: Option[A]): Option[A] = (until, newUntil) match {
+ case (Some(unt), Some(newUnt)) => Some(ordering.min(unt, newUnt))
+ case (None, _) => newUntil
+ case _ => until
+ }
+
+ /**
+ * Returns true if the argument is inside the view bounds (between `from` and `until`).
+ */
+ private[this] def isInsideViewBounds(key: A): Boolean = {
+ val afterFrom = from.isEmpty || ordering.compare(from.get, key) <= 0
+ val beforeUntil = until.isEmpty || ordering.compare(key, until.get) < 0
+ afterFrom && beforeUntil
+ }
+
+ override def rangeImpl(from: Option[A], until: Option[A]): TreeMap[A, B] =
+ new TreeMapView(pickLowerBound(from), pickUpperBound(until))
+
+ override def get(key: A) = if (isInsideViewBounds(key)) RB.get(tree, key) else None
+
+ override def iterator = RB.iterator(tree, from, until)
+ override def iteratorFrom(start: A) = RB.iterator(tree, pickLowerBound(Some(start)), until)
+ override def keysIteratorFrom(start: A) = RB.keysIterator(tree, pickLowerBound(Some(start)), until)
+ override def valuesIteratorFrom(start: A) = RB.valuesIterator(tree, pickLowerBound(Some(start)), until)
+
+ override def size = iterator.length
+ override def isEmpty = !iterator.hasNext
+ override def contains(key: A) = isInsideViewBounds(key) && RB.contains(tree, key)
+
+ override def head = headOption.get
+ override def headOption = {
+ val entry = if (from.isDefined) RB.minAfter(tree, from.get) else RB.min(tree)
+ (entry, until) match {
+ case (Some(e), Some(unt)) if ordering.compare(e._1, unt) >= 0 => None
+ case _ => entry
+ }
+ }
+
+ override def last = lastOption.get
+ override def lastOption = {
+ val entry = if (until.isDefined) RB.maxBefore(tree, until.get) else RB.max(tree)
+ (entry, from) match {
+ case (Some(e), Some(fr)) if ordering.compare(e._1, fr) < 0 => None
+ case _ => entry
+ }
+ }
+
+ override def foreach[U](f: ((A, B)) => U): Unit = iterator.foreach(f)
+ override def transform(f: (A, B) => B) = {
+ iterator.foreach { case (key, value) => update(key, f(key, value)) }
+ this
+ }
+ }
+}
diff --git a/src/library/scala/collection/parallel/ParIterableLike.scala b/src/library/scala/collection/parallel/ParIterableLike.scala
index 016255dca4..53f9a7b87a 100644
--- a/src/library/scala/collection/parallel/ParIterableLike.scala
+++ b/src/library/scala/collection/parallel/ParIterableLike.scala
@@ -195,7 +195,7 @@ self: ParIterableLike[T, Repr, Sequential] =>
* import scala.collection.parallel._
* val pc = mutable.ParArray(1, 2, 3)
* pc.tasksupport = new ForkJoinTaskSupport(
- * new scala.concurrent.forkjoin.ForkJoinPool(2))
+ * new java.util.concurrent.ForkJoinPool(2))
* }}}
*
* @see [[scala.collection.parallel.TaskSupport]]
diff --git a/src/library/scala/collection/parallel/RemainsIterator.scala b/src/library/scala/collection/parallel/RemainsIterator.scala
index 5f2ceac0e0..7bb278b038 100644
--- a/src/library/scala/collection/parallel/RemainsIterator.scala
+++ b/src/library/scala/collection/parallel/RemainsIterator.scala
@@ -456,6 +456,15 @@ self =>
}
it
}
+ /** Drop implemented as simple eager consumption. */
+ override def drop(n: Int): IterableSplitter[T] = {
+ var i = 0
+ while (i < n && hasNext) {
+ next()
+ i += 1
+ }
+ this
+ }
override def take(n: Int): IterableSplitter[T] = newTaken(n)
override def slice(from1: Int, until1: Int): IterableSplitter[T] = newSliceInternal(newTaken(until1), from1)
diff --git a/src/library/scala/collection/parallel/TaskSupport.scala b/src/library/scala/collection/parallel/TaskSupport.scala
index 9064018d46..6ab694de04 100644
--- a/src/library/scala/collection/parallel/TaskSupport.scala
+++ b/src/library/scala/collection/parallel/TaskSupport.scala
@@ -10,7 +10,7 @@ package scala
package collection.parallel
import java.util.concurrent.ThreadPoolExecutor
-import scala.concurrent.forkjoin.ForkJoinPool
+import java.util.concurrent.ForkJoinPool
import scala.concurrent.ExecutionContext
/** A trait implementing the scheduling of a parallel collection operation.
@@ -41,7 +41,7 @@ import scala.concurrent.ExecutionContext
* import scala.collection.parallel._
* val pc = mutable.ParArray(1, 2, 3)
* pc.tasksupport = new ForkJoinTaskSupport(
- * new scala.concurrent.forkjoin.ForkJoinPool(2))
+ * new java.util.concurrent.ForkJoinPool(2))
* }}}
*
* @see [[http://docs.scala-lang.org/overviews/parallel-collections/configuration.html Configuring Parallel Collections]] section
diff --git a/src/library/scala/collection/parallel/Tasks.scala b/src/library/scala/collection/parallel/Tasks.scala
index fcf0dff846..c9a75752df 100644
--- a/src/library/scala/collection/parallel/Tasks.scala
+++ b/src/library/scala/collection/parallel/Tasks.scala
@@ -10,7 +10,7 @@ package scala
package collection.parallel
import java.util.concurrent.ThreadPoolExecutor
-import scala.concurrent.forkjoin._
+import java.util.concurrent.{ForkJoinPool, RecursiveAction, ForkJoinWorkerThread}
import scala.concurrent.ExecutionContext
import scala.util.control.Breaks._
import scala.annotation.unchecked.uncheckedVariance
diff --git a/src/library/scala/collection/parallel/immutable/ParHashSet.scala b/src/library/scala/collection/parallel/immutable/ParHashSet.scala
index 65a632470e..3a1ec7fff8 100644
--- a/src/library/scala/collection/parallel/immutable/ParHashSet.scala
+++ b/src/library/scala/collection/parallel/immutable/ParHashSet.scala
@@ -197,7 +197,7 @@ extends scala.collection.parallel.BucketCombiner[T, ParHashSet[T], Any, HashSetC
while (i < chunksz) {
val v = chunkarr(i).asInstanceOf[T]
val hc = trie.computeHash(v)
- trie = trie.updated0(v, hc, rootbits)
+ trie = trie.updated0(v, hc, rootbits) // internal API, private[collection]
i += 1
}
i = 0
diff --git a/src/library/scala/concurrent/BlockContext.scala b/src/library/scala/concurrent/BlockContext.scala
index 747cc393c3..2b8ed4c7ca 100644
--- a/src/library/scala/concurrent/BlockContext.scala
+++ b/src/library/scala/concurrent/BlockContext.scala
@@ -41,7 +41,7 @@ package scala.concurrent
trait BlockContext {
/** Used internally by the framework;
- * Designates (and eventually executes) a thunk which potentially blocks the calling `Thread`.
+ * Designates (and eventually executes) a thunk which potentially blocks the calling `java.lang.Thread`.
*
* Clients must use `scala.concurrent.blocking` or `scala.concurrent.Await` instead.
*/
@@ -53,9 +53,16 @@ object BlockContext {
override def blockOn[T](thunk: =>T)(implicit permission: CanAwait): T = thunk
}
+ /**
+ * @return the `BlockContext` that will be used if no other is found.
+ **/
+ def defaultBlockContext: BlockContext = DefaultBlockContext
+
private val contextLocal = new ThreadLocal[BlockContext]()
- /** Obtain the current thread's current `BlockContext`. */
+ /**
+ @return the `BlockContext` that would be used for the current `java.lang.Thread` at this point
+ **/
def current: BlockContext = contextLocal.get match {
case null => Thread.currentThread match {
case ctx: BlockContext => ctx
@@ -64,7 +71,9 @@ object BlockContext {
case some => some
}
- /** Pushes a current `BlockContext` while executing `body`. */
+ /**
+ * Installs a current `BlockContext` around executing `body`.
+ **/
def withBlockContext[T](blockContext: BlockContext)(body: => T): T = {
val old = contextLocal.get // can be null
try {
diff --git a/src/library/scala/concurrent/ExecutionContext.scala b/src/library/scala/concurrent/ExecutionContext.scala
index e380c55880..df2d68c9c6 100644
--- a/src/library/scala/concurrent/ExecutionContext.scala
+++ b/src/library/scala/concurrent/ExecutionContext.scala
@@ -72,22 +72,24 @@ trait ExecutionContext {
*/
def reportFailure(@deprecatedName('t) cause: Throwable): Unit
- /** Prepares for the execution of a task. Returns the prepared execution context.
- *
- * `prepare` should be called at the site where an `ExecutionContext` is received (for
- * example, through an implicit method parameter). The returned execution context may
- * then be used to execute tasks. The role of `prepare` is to save any context relevant
- * to an execution's ''call site'', so that this context may be restored at the
- * ''execution site''. (These are often different: for example, execution may be
- * suspended through a `Promise`'s future until the `Promise` is completed, which may
- * be done in another thread, on another stack.)
- *
- * Note: a valid implementation of `prepare` is one that simply returns `this`.
- *
- * @return the prepared execution context
- */
+ /** Prepares for the execution of a task. Returns the prepared
+ * execution context. The recommended implementation of
+ * `prepare` is to return `this`.
+ *
+ * This method should no longer be overridden or called. It was
+ * originally expected that `prepare` would be called by
+ * all libraries that consume ExecutionContexts, in order to
+ * capture thread local context. However, this usage has proven
+ * difficult to implement in practice and instead it is
+ * now better to avoid using `prepare` entirely.
+ *
+ * Instead, if an `ExecutionContext` needs to capture thread
+ * local context, it should capture that context when it is
+ * constructed, so that it doesn't need any additional
+ * preparation later.
+ */
+ @deprecated("Preparation of ExecutionContexts will be removed.", "2.12")
def prepare(): ExecutionContext = this
-
}
/**
@@ -116,7 +118,7 @@ object ExecutionContext {
*
* @return the global `ExecutionContext`
*/
- def global: ExecutionContextExecutor = Implicits.global
+ def global: ExecutionContextExecutor = Implicits.global.asInstanceOf[ExecutionContextExecutor]
object Implicits {
/**
@@ -127,7 +129,7 @@ object ExecutionContext {
* the thread pool uses a target number of worker threads equal to the number of
* [[https://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#availableProcessors-- available processors]].
*/
- implicit lazy val global: ExecutionContextExecutor = impl.ExecutionContextImpl.fromExecutor(null: Executor)
+ implicit lazy val global: ExecutionContext = impl.ExecutionContextImpl.fromExecutor(null: Executor)
}
/** Creates an `ExecutionContext` from the given `ExecutorService`.
diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala
index 914646320c..6304f35da9 100644
--- a/src/library/scala/concurrent/Future.scala
+++ b/src/library/scala/concurrent/Future.scala
@@ -10,26 +10,22 @@ package scala.concurrent
import scala.language.higherKinds
-import java.util.concurrent.{ ConcurrentLinkedQueue, TimeUnit, Callable }
+import java.util.concurrent.{ CountDownLatch, TimeUnit, Callable }
import java.util.concurrent.TimeUnit.{ NANOSECONDS => NANOS, MILLISECONDS ⇒ MILLIS }
-import java.lang.{ Iterable => JIterable }
-import java.util.{ LinkedList => JLinkedList }
-import java.util.concurrent.atomic.{ AtomicReferenceFieldUpdater, AtomicInteger, AtomicLong, AtomicBoolean }
+import java.util.concurrent.atomic.AtomicInteger
import scala.util.control.NonFatal
-import scala.Option
import scala.util.{Try, Success, Failure}
-
+import scala.concurrent.duration._
import scala.annotation.tailrec
import scala.collection.mutable.Builder
import scala.collection.generic.CanBuildFrom
import scala.reflect.ClassTag
-
/** The trait that represents futures.
*
- * Asynchronous computations that yield futures are created with the `Future` call:
+ * Asynchronous computations that yield futures are created with the `Future.apply` call:
*
* {{{
* val s = "Hello"
@@ -60,6 +56,10 @@ import scala.reflect.ClassTag
* If a future is failed with a `scala.runtime.NonLocalReturnControl`,
* it is completed with a value from that throwable instead.
*
+ * @define swallowsExceptions
+ * Since this method executes asynchronously and does not produce a return value,
+ * any non-fatal exceptions thrown will be reported to the `ExecutionContext`.
+ *
* @define nonDeterministic
* Note: using this method yields nondeterministic dataflow programs.
*
@@ -91,14 +91,7 @@ import scala.reflect.ClassTag
* `execute()` either immediately or asynchronously.
*/
trait Future[+T] extends Awaitable[T] {
-
- // The executor within the lexical scope
- // of the Future trait. Note that this will
- // (modulo bugs) _never_ execute a callback
- // other than those below in this same file.
- //
- // See the documentation on `InternalCallbackExecutor` for more details.
- private def internalExecutor = Future.InternalCallbackExecutor
+ import Future.{ InternalCallbackExecutor => internalExecutor }
/* Callbacks */
@@ -109,9 +102,11 @@ trait Future[+T] extends Awaitable[T] {
* If the future has already been completed with a value,
* this will either be applied immediately or be scheduled asynchronously.
*
+ * $swallowsExceptions
* $multipleCallbacks
* $callbackInContext
*/
+ @deprecated("use `foreach` or `onComplete` instead (keep in mind that they take total rather than partial functions)", "2.12")
def onSuccess[U](pf: PartialFunction[T, U])(implicit executor: ExecutionContext): Unit = onComplete {
case Success(v) =>
pf.applyOrElse[T, Any](v, Predef.conforms[T]) // Exploiting the cached function to avoid MatchError
@@ -128,9 +123,11 @@ trait Future[+T] extends Awaitable[T] {
*
* Will not be called in case that the future is completed with a value.
*
+ * $swallowsExceptions
* $multipleCallbacks
* $callbackInContext
*/
+ @deprecated("use `onComplete` or `failed.foreach` instead (keep in mind that they take total rather than partial functions)", "2.12")
def onFailure[U](@deprecatedName('callback) pf: PartialFunction[Throwable, U])(implicit executor: ExecutionContext): Unit = onComplete {
case Failure(t) =>
pf.applyOrElse[Throwable, Any](t, Predef.conforms[Throwable]) // Exploiting the cached function to avoid MatchError
@@ -143,8 +140,12 @@ trait Future[+T] extends Awaitable[T] {
* If the future has already been completed,
* this will either be applied immediately or be scheduled asynchronously.
*
+ * $swallowsExceptions
* $multipleCallbacks
* $callbackInContext
+ *
+ * @tparam U only used to accept any return type of the given callback function
+ * @param f the function to be executed when this `Future` completes
*/
def onComplete[U](@deprecatedName('func) f: Try[T] => U)(implicit executor: ExecutionContext): Unit
@@ -160,46 +161,47 @@ trait Future[+T] extends Awaitable[T] {
*/
def isCompleted: Boolean
- /** The value of this `Future`.
+ /** The current value of this `Future`.
+ *
+ * $nonDeterministic
*
* If the future is not completed the returned value will be `None`.
* If the future is completed the value will be `Some(Success(t))`
* if it contains a valid result, or `Some(Failure(error))` if it contains
* an exception.
+ *
+ * @return `None` if the `Future` wasn't completed, `Some` if it was.
*/
def value: Option[Try[T]]
/* Projections */
- /** Returns a failed projection of this future.
- *
- * The failed projection is a future holding a value of type `Throwable`.
+ /** The returned `Future` will be successfully completed with the `Throwable` of the original `Future`
+ * if the original `Future` fails.
*
- * It is completed with a value which is the throwable of the original future
- * in case the original future is failed.
+ * If the original `Future` is successful, the returned `Future` is failed with a `NoSuchElementException`.
*
- * It is failed with a `NoSuchElementException` if the original future is completed successfully.
- *
- * Blocking on this future returns a value if the original future is completed with an exception
- * and throws a corresponding exception if the original future fails.
+ * @return a failed projection of this `Future`.
*/
- def failed: Future[Throwable] = {
- implicit val ec = internalExecutor
- val p = Promise[Throwable]()
- onComplete {
- case Failure(t) => p success t
- case Success(v) => p failure (new NoSuchElementException("Future.failed not completed with a throwable."))
- }
- p.future
- }
+ def failed: Future[Throwable] =
+ transform({
+ case Failure(t) => Success(t)
+ case Success(v) => Failure(new NoSuchElementException("Future.failed not completed with a throwable."))
+ })(internalExecutor)
/* Monadic operations */
/** Asynchronously processes the value in the future once the value becomes available.
*
- * Will not be called if the future fails.
+ * WARNING: Will not be called if this future is never completed or if it is completed with a failure.
+ *
+ * $swallowsExceptions
+ *
+ * @tparam U only used to accept any return type of the given callback function
+ * @param f the function which will be executed if this `Future` completes with a result,
+ * the return value of `f` will be discarded.
*/
def foreach[U](f: T => U)(implicit executor: ExecutionContext): Unit = onComplete { _ foreach f }
@@ -208,33 +210,49 @@ trait Future[+T] extends Awaitable[T] {
* exception thrown when 's' or 'f' is applied, that exception will be propagated
* to the resulting future.
*
- * @param s function that transforms a successful result of the receiver into a
- * successful result of the returned future
- * @param f function that transforms a failure of the receiver into a failure of
- * the returned future
- * @return a future that will be completed with the transformed value
- */
- def transform[S](s: T => S, f: Throwable => Throwable)(implicit executor: ExecutionContext): Future[S] = {
- val p = Promise[S]()
- // transform on Try has the wrong shape for us here
- onComplete {
- case Success(r) => p complete Try(s(r))
- case Failure(t) => p complete Try(throw f(t)) // will throw fatal errors!
+ * @tparam S the type of the returned `Future`
+ * @param s function that transforms a successful result of the receiver into a successful result of the returned future
+ * @param f function that transforms a failure of the receiver into a failure of the returned future
+ * @return a `Future` that will be completed with the transformed value
+ */
+ def transform[S](s: T => S, f: Throwable => Throwable)(implicit executor: ExecutionContext): Future[S] =
+ transform {
+ case Success(r) => Try(s(r))
+ case Failure(t) => Try(throw f(t)) // will throw fatal errors!
}
- p.future
- }
+
+ /** Creates a new Future by applying the specified function to the result
+ * of this Future. If there is any non-fatal exception thrown when 'f'
+ * is applied then that exception will be propagated to the resulting future.
+ *
+ * @tparam S the type of the returned `Future`
+ * @param f function that transforms the result of this future
+ * @return a `Future` that will be completed with the transformed value
+ */
+ def transform[S](f: Try[T] => Try[S])(implicit executor: ExecutionContext): Future[S]
+
+ /** Creates a new Future by applying the specified function, which produces a Future, to the result
+ * of this Future. If there is any non-fatal exception thrown when 'f'
+ * is applied then that exception will be propagated to the resulting future.
+ *
+ * @tparam S the type of the returned `Future`
+ * @param f function that transforms the result of this future
+ * @return a `Future` that will be completed with the transformed value
+ */
+ def transformWith[S](f: Try[T] => Future[S])(implicit executor: ExecutionContext): Future[S]
+
/** Creates a new future by applying a function to the successful result of
* this future. If this future is completed with an exception then the new
* future will also contain this exception.
*
* $forComprehensionExamples
+ *
+ * @tparam S the type of the returned `Future`
+ * @param f the function which will be applied to the successful result of this `Future`
+ * @return a `Future` which will be completed with the result of the application of the function
*/
- def map[S](f: T => S)(implicit executor: ExecutionContext): Future[S] = { // transform(f, identity)
- val p = Promise[S]()
- onComplete { v => p complete (v map f) }
- p.future
- }
+ def map[S](f: T => S)(implicit executor: ExecutionContext): Future[S] = transform(_.map(f))
/** Creates a new future by applying a function to the successful result of
* this future, and returns the result of the function as the new future.
@@ -242,21 +260,23 @@ trait Future[+T] extends Awaitable[T] {
* also contain this exception.
*
* $forComprehensionExamples
+ *
+ * @tparam S the type of the returned `Future`
+ * @param f the function which will be applied to the successful result of this `Future`
+ * @return a `Future` which will be completed with the result of the application of the function
*/
- def flatMap[S](f: T => Future[S])(implicit executor: ExecutionContext): Future[S] = {
- import impl.Promise.DefaultPromise
- val p = new DefaultPromise[S]()
- onComplete {
- case f: Failure[_] => p complete f.asInstanceOf[Failure[S]]
- case Success(v) => try f(v) match {
- // If possible, link DefaultPromises to avoid space leaks
- case dp: DefaultPromise[_] => dp.asInstanceOf[DefaultPromise[S]].linkRootOf(p)
- case fut => fut.onComplete(p.complete)(internalExecutor)
- } catch { case NonFatal(t) => p failure t }
- }
- p.future
+ def flatMap[S](f: T => Future[S])(implicit executor: ExecutionContext): Future[S] = transformWith {
+ case Success(s) => f(s)
+ case Failure(_) => this.asInstanceOf[Future[S]]
}
+ /** Creates a new future with one level of nesting flattened, this method is equivalent
+ * to `flatMap(identity)`.
+ *
+ * @tparam S the type of the returned `Future`
+ */
+ def flatten[S](implicit ev: T <:< Future[S]): Future[S] = flatMap(ev)(internalExecutor)
+
/** Creates a new future by filtering the value of the current future with a predicate.
*
* If the current future contains a value which satisfies the predicate, the new future will also hold that value.
@@ -269,14 +289,15 @@ trait Future[+T] extends Awaitable[T] {
* val f = Future { 5 }
* val g = f filter { _ % 2 == 1 }
* val h = f filter { _ % 2 == 0 }
- * Await.result(g, Duration.Zero) // evaluates to 5
+ * g foreach println // Eventually prints 5
* Await.result(h, Duration.Zero) // throw a NoSuchElementException
* }}}
+ *
+ * @param p the predicate to apply to the successful result of this `Future`
+ * @return a `Future` which will hold the successful result of this `Future` if it matches the predicate or a `NoSuchElementException`
*/
def filter(@deprecatedName('pred) p: T => Boolean)(implicit executor: ExecutionContext): Future[T] =
- map {
- r => if (p(r)) r else throw new NoSuchElementException("Future.filter predicate is not satisfied")
- }
+ map { r => if (p(r)) r else throw new NoSuchElementException("Future.filter predicate is not satisfied") }
/** Used by for-comprehensions.
*/
@@ -298,9 +319,13 @@ trait Future[+T] extends Awaitable[T] {
* val h = f collect {
* case x if x > 0 => x * 2
* }
- * Await.result(g, Duration.Zero) // evaluates to 5
+ * g foreach println // Eventually prints 5
* Await.result(h, Duration.Zero) // throw a NoSuchElementException
* }}}
+ *
+ * @tparam S the type of the returned `Future`
+ *  @param pf the `PartialFunction` to apply to the successful result of this `Future`
+ * @return a `Future` holding the result of application of the `PartialFunction` or a `NoSuchElementException`
*/
def collect[S](pf: PartialFunction[T, S])(implicit executor: ExecutionContext): Future[S] =
map {
@@ -318,12 +343,13 @@ trait Future[+T] extends Awaitable[T] {
* Future (6 / 0) recover { case e: NotFoundException => 0 } // result: exception
* Future (6 / 2) recover { case e: ArithmeticException => 0 } // result: 3
* }}}
+ *
+ * @tparam U the type of the returned `Future`
+ * @param pf the `PartialFunction` to apply if this `Future` fails
+ * @return a `Future` with the successful value of this `Future` or the result of the `PartialFunction`
*/
- def recover[U >: T](pf: PartialFunction[Throwable, U])(implicit executor: ExecutionContext): Future[U] = {
- val p = Promise[U]()
- onComplete { v => p complete (v recover pf) }
- p.future
- }
+ def recover[U >: T](pf: PartialFunction[Throwable, U])(implicit executor: ExecutionContext): Future[U] =
+ transform { _ recover pf }
/** Creates a new future that will handle any matching throwable that this
* future might contain by assigning it a value of another future.
@@ -337,15 +363,16 @@ trait Future[+T] extends Awaitable[T] {
* val f = Future { Int.MaxValue }
* Future (6 / 0) recoverWith { case e: ArithmeticException => f } // result: Int.MaxValue
* }}}
+ *
+ * @tparam U the type of the returned `Future`
+ * @param pf the `PartialFunction` to apply if this `Future` fails
+ * @return a `Future` with the successful value of this `Future` or the outcome of the `Future` returned by the `PartialFunction`
*/
- def recoverWith[U >: T](pf: PartialFunction[Throwable, Future[U]])(implicit executor: ExecutionContext): Future[U] = {
- val p = Promise[U]()
- onComplete {
- case Failure(t) => try pf.applyOrElse(t, (_: Throwable) => this).onComplete(p.complete)(internalExecutor) catch { case NonFatal(t) => p failure t }
- case other => p complete other
+ def recoverWith[U >: T](pf: PartialFunction[Throwable, Future[U]])(implicit executor: ExecutionContext): Future[U] =
+ transformWith {
+ case Failure(t) => pf.applyOrElse(t, (_: Throwable) => this)
+ case Success(_) => this
}
- p.future
- }
/** Zips the values of `this` and `that` future, and creates
* a new future holding the tuple of their results.
@@ -354,17 +381,35 @@ trait Future[+T] extends Awaitable[T] {
* with the throwable stored in `this`.
* Otherwise, if `that` future fails, the resulting future is failed
* with the throwable stored in `that`.
+ *
+ * @tparam U the type of the other `Future`
+ * @param that the other `Future`
+ * @return a `Future` with the results of both futures or the failure of the first of them that failed
*/
def zip[U](that: Future[U]): Future[(T, U)] = {
implicit val ec = internalExecutor
- val p = Promise[(T, U)]()
- onComplete {
- case f: Failure[_] => p complete f.asInstanceOf[Failure[(T, U)]]
- case Success(s) => that onComplete { c => p.complete(c map { s2 => (s, s2) }) }
- }
- p.future
+ flatMap { r1 => that.map(r2 => (r1, r2)) }
}
+ /** Zips the values of `this` and `that` future using a function `f`,
+ * and creates a new future holding the result.
+ *
+ * If `this` future fails, the resulting future is failed
+ * with the throwable stored in `this`.
+ * Otherwise, if `that` future fails, the resulting future is failed
+ * with the throwable stored in `that`.
+ * If the application of `f` throws a throwable, the resulting future
+ * is failed with that throwable if it is non-fatal.
+ *
+ * @tparam U the type of the other `Future`
+ * @tparam R the type of the resulting `Future`
+ * @param that the other `Future`
+ * @param f the function to apply to the results of `this` and `that`
+ * @return a `Future` with the result of the application of `f` to the results of `this` and `that`
+ */
+ def zipWith[U, R](that: Future[U])(f: (T, U) => R)(implicit executor: ExecutionContext): Future[R] =
+ flatMap(r1 => that.map(r2 => f(r1, r2)))(internalExecutor)
+
/** Creates a new future which holds the result of this future if it was completed successfully, or, if not,
* the result of the `that` future if `that` is completed successfully.
* If both futures are failed, the resulting future holds the throwable object of the first future.
@@ -376,24 +421,26 @@ trait Future[+T] extends Awaitable[T] {
* val f = Future { sys.error("failed") }
* val g = Future { 5 }
* val h = f fallbackTo g
- * Await.result(h, Duration.Zero) // evaluates to 5
+ * h foreach println // Eventually prints 5
* }}}
+ *
+ * @tparam U the type of the other `Future` and the resulting `Future`
+ * @param that the `Future` whose result we want to use if this `Future` fails.
+ * @return a `Future` with the successful result of this or that `Future` or the failure of this `Future` if both fail
*/
- def fallbackTo[U >: T](that: Future[U]): Future[U] = {
- implicit val ec = internalExecutor
- val p = Promise[U]()
- onComplete {
- case s @ Success(_) => p complete s
- case f @ Failure(_) => that onComplete {
- case s2 @ Success(_) => p complete s2
- case _ => p complete f // Use the first failure as the failure
- }
+ def fallbackTo[U >: T](that: Future[U]): Future[U] =
+ if (this eq that) this
+ else {
+ implicit val ec = internalExecutor
+ recoverWith { case _ => that } recoverWith { case _ => this }
}
- p.future
- }
/** Creates a new `Future[S]` which is completed with this `Future`'s result if
* that conforms to `S`'s erased type or a `ClassCastException` otherwise.
+ *
+ * @tparam S the type of the returned `Future`
+ * @param tag the `ClassTag` which will be used to cast the result of this `Future`
+ * @return a `Future` holding the casted result of this `Future` or a `ClassCastException` otherwise
*/
def mapTo[S](implicit tag: ClassTag[S]): Future[S] = {
implicit val ec = internalExecutor
@@ -427,15 +474,19 @@ trait Future[+T] extends Awaitable[T] {
* case Success(v) => println(v)
* }
* }}}
+ *
+ * @tparam U only used to accept any return type of the given `PartialFunction`
+ * @param pf a `PartialFunction` which will be conditionally applied to the outcome of this `Future`
+ * @return a `Future` which will be completed with the exact same outcome as this `Future` but after the `PartialFunction` has been executed.
*/
- def andThen[U](pf: PartialFunction[Try[T], U])(implicit executor: ExecutionContext): Future[T] = {
- val p = Promise[T]()
- onComplete {
- case r => try pf.applyOrElse[Try[T], Any](r, Predef.conforms[Try[T]]) finally p complete r
- }
- p.future
- }
+ def andThen[U](pf: PartialFunction[Try[T], U])(implicit executor: ExecutionContext): Future[T] =
+ transform {
+ result =>
+ try pf.applyOrElse[Try[T], Any](result, Predef.conforms[Try[T]])
+ catch { case NonFatal(t) => executor reportFailure t }
+ result
+ }
}
@@ -459,40 +510,102 @@ object Future {
classOf[Unit] -> classOf[scala.runtime.BoxedUnit]
)
+ /** A Future which is never completed.
+ */
+ final object never extends Future[Nothing] {
+
+ @throws(classOf[TimeoutException])
+ @throws(classOf[InterruptedException])
+ override def ready(atMost: Duration)(implicit permit: CanAwait): this.type = {
+ atMost match {
+ case e if e eq Duration.Undefined => throw new IllegalArgumentException("cannot wait for Undefined period")
+ case Duration.Inf => new CountDownLatch(1).await()
+ case Duration.MinusInf => // Drop out
+ case f: FiniteDuration =>
+ if (f > Duration.Zero) new CountDownLatch(1).await(f.toNanos, TimeUnit.NANOSECONDS)
+ }
+ throw new TimeoutException(s"Future timed out after [$atMost]")
+ }
+
+ @throws(classOf[Exception])
+ override def result(atMost: Duration)(implicit permit: CanAwait): Nothing = {
+ ready(atMost)
+ throw new TimeoutException(s"Future timed out after [$atMost]")
+ }
+
+ override def onSuccess[U](pf: PartialFunction[Nothing, U])(implicit executor: ExecutionContext): Unit = ()
+ override def onFailure[U](pf: PartialFunction[Throwable, U])(implicit executor: ExecutionContext): Unit = ()
+ override def onComplete[U](f: Try[Nothing] => U)(implicit executor: ExecutionContext): Unit = ()
+ override def isCompleted: Boolean = false
+ override def value: Option[Try[Nothing]] = None
+ override def failed: Future[Throwable] = this
+ override def foreach[U](f: Nothing => U)(implicit executor: ExecutionContext): Unit = ()
+ override def transform[S](s: Nothing => S, f: Throwable => Throwable)(implicit executor: ExecutionContext): Future[S] = this
+ override def transform[S](f: Try[Nothing] => Try[S])(implicit executor: ExecutionContext): Future[S] = this
+ override def transformWith[S](f: Try[Nothing] => Future[S])(implicit executor: ExecutionContext): Future[S] = this
+ override def map[S](f: Nothing => S)(implicit executor: ExecutionContext): Future[S] = this
+ override def flatMap[S](f: Nothing => Future[S])(implicit executor: ExecutionContext): Future[S] = this
+ override def flatten[S](implicit ev: Nothing <:< Future[S]): Future[S] = this
+ override def filter(p: Nothing => Boolean)(implicit executor: ExecutionContext): Future[Nothing] = this
+ override def collect[S](pf: PartialFunction[Nothing, S])(implicit executor: ExecutionContext): Future[S] = this
+ override def recover[U >: Nothing](pf: PartialFunction[Throwable, U])(implicit executor: ExecutionContext): Future[U] = this
+ override def recoverWith[U >: Nothing](pf: PartialFunction[Throwable, Future[U]])(implicit executor: ExecutionContext): Future[U] = this
+ override def zip[U](that: Future[U]): Future[(Nothing, U)] = this
+ override def zipWith[U, R](that: Future[U])(f: (Nothing, U) => R)(implicit executor: ExecutionContext): Future[R] = this
+ override def fallbackTo[U >: Nothing](that: Future[U]): Future[U] = this
+ override def mapTo[S](implicit tag: ClassTag[S]): Future[S] = this
+ override def andThen[U](pf: PartialFunction[Try[Nothing], U])(implicit executor: ExecutionContext): Future[Nothing] = this
+
+ override def toString: String = "Future(<never>)"
+ }
+
+ /** A Future which is always completed with the Unit value.
+ */
+ val unit: Future[Unit] = successful(())
+
/** Creates an already completed Future with the specified exception.
*
- * @tparam T the type of the value in the future
- * @return the newly created `Future` object
+ * @tparam T the type of the value in the future
+ * @param exception the non-null instance of `Throwable`
+ * @return the newly created `Future` instance
*/
def failed[T](exception: Throwable): Future[T] = Promise.failed(exception).future
/** Creates an already completed Future with the specified result.
*
* @tparam T the type of the value in the future
- * @return the newly created `Future` object
+ * @param result the given successful value
+ * @return the newly created `Future` instance
*/
def successful[T](result: T): Future[T] = Promise.successful(result).future
/** Creates an already completed Future with the specified result or exception.
*
- * @tparam T the type of the value in the promise
- * @return the newly created `Future` object
+ * @tparam T the type of the value in the `Future`
+ * @param result the result of the returned `Future` instance
+ * @return the newly created `Future` instance
*/
def fromTry[T](result: Try[T]): Future[T] = Promise.fromTry(result).future
- /** Starts an asynchronous computation and returns a `Future` object with the result of that computation.
+ /** Starts an asynchronous computation and returns a `Future` instance with the result of that computation.
*
* The result becomes available once the asynchronous computation is completed.
*
- * @tparam T the type of the result
- * @param body the asynchronous computation
+ * @tparam T the type of the result
+ * @param body the asynchronous computation
* @param executor the execution context on which the future is run
- * @return the `Future` holding the result of the computation
+ * @return the `Future` holding the result of the computation
*/
- def apply[T](body: =>T)(implicit @deprecatedName('execctx) executor: ExecutionContext): Future[T] = impl.Future(body)
+ def apply[T](body: =>T)(implicit @deprecatedName('execctx) executor: ExecutionContext): Future[T] =
+ unit.map(_ => body)
- /** Simple version of `Future.traverse`. Transforms a `TraversableOnce[Future[A]]` into a `Future[TraversableOnce[A]]`.
- * Useful for reducing many `Future`s into a single `Future`.
+ /** Simple version of `Future.traverse`. Asynchronously and non-blockingly transforms a `TraversableOnce[Future[A]]`
+ * into a `Future[TraversableOnce[A]]`. Useful for reducing many `Future`s into a single `Future`.
+ *
+ * @tparam A the type of the value inside the Futures
+ * @tparam M the type of the `TraversableOnce` of Futures
+ * @param in the `TraversableOnce` of Futures which will be sequenced
+ * @return the `Future` of the `TraversableOnce` of results
*/
def sequence[A, M[X] <: TraversableOnce[X]](in: M[Future[A]])(implicit cbf: CanBuildFrom[M[Future[A]], A, M[A]], executor: ExecutionContext): Future[M[A]] = {
in.foldLeft(successful(cbf(in))) {
@@ -500,7 +613,12 @@ object Future {
} map (_.result())
}
- /** Returns a new `Future` to the result of the first future in the list that is completed.
+ /** Asynchronously and non-blockingly returns a new `Future` to the result of the first future
+ * in the list that is completed. This means no matter if it is completed as a success or as a failure.
+ *
+ * @tparam T the type of the value in the future
+ * @param futures the `TraversableOnce` of Futures in which to find the first completed
+ * @return the `Future` holding the result of the future that is first to be completed
*/
def firstCompletedOf[T](futures: TraversableOnce[Future[T]])(implicit executor: ExecutionContext): Future[T] = {
val p = Promise[T]()
@@ -509,8 +627,15 @@ object Future {
p.future
}
- /** Returns a `Future` that will hold the optional result of the first `Future` with a result that matches the predicate.
+ /** Asynchronously and non-blockingly returns a `Future` that will hold the optional result
+ * of the first `Future` with a result that matches the predicate.
+ *
+ * @tparam T the type of the value in the future
+ * @param futures the `TraversableOnce` of Futures to search
+ * @param p the predicate which indicates if it's a match
+ * @return the `Future` holding the optional result of the search
*/
+ @deprecated("Use the overloaded version of this method that takes a scala.collection.immutable.Iterable instead", "2.12")
def find[T](@deprecatedName('futurestravonce) futures: TraversableOnce[Future[T]])(@deprecatedName('predicate) p: T => Boolean)(implicit executor: ExecutionContext): Future[Option[T]] = {
val futuresBuffer = futures.toBuffer
if (futuresBuffer.isEmpty) successful[Option[T]](None)
@@ -534,40 +659,127 @@ object Future {
}
}
- /** A non-blocking fold over the specified futures, with the start value of the given zero.
+
+ /** Asynchronously and non-blockingly returns a `Future` that will hold the optional result
+ * of the first `Future` with a result that matches the predicate, failed `Future`s will be ignored.
+ *
+ * @tparam T the type of the value in the future
+ * @param futures the `scala.collection.immutable.Iterable` of Futures to search
+ * @param p the predicate which indicates if it's a match
+ * @return the `Future` holding the optional result of the search
+ */
+ def find[T](futures: scala.collection.immutable.Iterable[Future[T]])(p: T => Boolean)(implicit executor: ExecutionContext): Future[Option[T]] = {
+ def searchNext(i: Iterator[Future[T]]): Future[Option[T]] =
+ if (!i.hasNext) successful[Option[T]](None)
+ else {
+ i.next().transformWith {
+ case Success(r) if p(r) => successful(Some(r))
+ case other => searchNext(i)
+ }
+ }
+ searchNext(futures.iterator)
+ }
+
+ /** A non-blocking, asynchronous left fold over the specified futures,
+ * with the start value of the given zero.
+ * The fold is performed asynchronously in left-to-right order as the futures become completed.
+ * The result will be the first failure of any of the futures, or any failure in the actual fold,
+ * or the result of the fold.
+ *
+ * Example:
+ * {{{
+ * val futureSum = Future.foldLeft(futures)(0)(_ + _)
+ * }}}
+ *
+ * @tparam T the type of the value of the input Futures
+ * @tparam R the type of the value of the returned `Future`
+ * @param futures the `scala.collection.immutable.Iterable` of Futures to be folded
+ * @param zero the start value of the fold
+ * @param op the fold operation to be applied to the zero and futures
+ * @return the `Future` holding the result of the fold
+ */
+ def foldLeft[T, R](futures: scala.collection.immutable.Iterable[Future[T]])(zero: R)(op: (R, T) => R)(implicit executor: ExecutionContext): Future[R] =
+ foldNext(futures.iterator, zero, op)
+
+ private[this] def foldNext[T, R](i: Iterator[Future[T]], prevValue: R, op: (R, T) => R)(implicit executor: ExecutionContext): Future[R] =
+ if (!i.hasNext) successful(prevValue)
+ else i.next().flatMap { value => foldNext(i, op(prevValue, value), op) }
+
+ /** A non-blocking, asynchronous fold over the specified futures, with the start value of the given zero.
* The fold is performed on the thread where the last future is completed,
* the result will be the first failure of any of the futures, or any failure in the actual fold,
* or the result of the fold.
*
* Example:
* {{{
- * val result = Await.result(Future.fold(futures)(0)(_ + _), 5 seconds)
+ * val futureSum = Future.fold(futures)(0)(_ + _)
* }}}
+ *
+ * @tparam T the type of the value of the input Futures
+ * @tparam R the type of the value of the returned `Future`
+ * @param futures the `TraversableOnce` of Futures to be folded
+ * @param zero the start value of the fold
+ * @param op the fold operation to be applied to the zero and futures
+ * @return the `Future` holding the result of the fold
*/
+ @deprecated("Use Future.foldLeft instead", "2.12")
def fold[T, R](futures: TraversableOnce[Future[T]])(zero: R)(@deprecatedName('foldFun) op: (R, T) => R)(implicit executor: ExecutionContext): Future[R] = {
if (futures.isEmpty) successful(zero)
else sequence(futures).map(_.foldLeft(zero)(op))
}
- /** Initiates a fold over the supplied futures where the fold-zero is the result value of the `Future` that's completed first.
+ /** Initiates a non-blocking, asynchronous, fold over the supplied futures
+ * where the fold-zero is the result value of the `Future` that's completed first.
*
* Example:
* {{{
- * val result = Await.result(Future.reduce(futures)(_ + _), 5 seconds)
+ * val futureSum = Future.reduce(futures)(_ + _)
* }}}
+ * @tparam T the type of the value of the input Futures
+ * @tparam R the type of the value of the returned `Future`
+ * @param futures the `TraversableOnce` of Futures to be reduced
+ * @param op the reduce operation which is applied to the results of the futures
+ * @return the `Future` holding the result of the reduce
*/
+ @deprecated("Use Future.reduceLeft instead", "2.12")
def reduce[T, R >: T](futures: TraversableOnce[Future[T]])(op: (R, T) => R)(implicit executor: ExecutionContext): Future[R] = {
if (futures.isEmpty) failed(new NoSuchElementException("reduce attempted on empty collection"))
else sequence(futures).map(_ reduceLeft op)
}
- /** Transforms a `TraversableOnce[A]` into a `Future[TraversableOnce[B]]` using the provided function `A => Future[B]`.
+ /** Initiates a non-blocking, asynchronous, left reduction over the supplied futures
+ * where the zero is the result value of the first `Future`.
+ *
+ * Example:
+ * {{{
+ * val futureSum = Future.reduceLeft(futures)(_ + _)
+ * }}}
+ * @tparam T the type of the value of the input Futures
+ * @tparam R the type of the value of the returned `Future`
+ * @param futures the `scala.collection.immutable.Iterable` of Futures to be reduced
+ * @param op the reduce operation which is applied to the results of the futures
+ * @return the `Future` holding the result of the reduce
+ */
+ def reduceLeft[T, R >: T](futures: scala.collection.immutable.Iterable[Future[T]])(op: (R, T) => R)(implicit executor: ExecutionContext): Future[R] = {
+ val i = futures.iterator
+ if (!i.hasNext) failed(new NoSuchElementException("reduceLeft attempted on empty collection"))
+ else i.next() flatMap { v => foldNext(i, v, op) }
+ }
+
+ /** Asynchronously and non-blockingly transforms a `TraversableOnce[A]` into a `Future[TraversableOnce[B]]`
+ * using the provided function `A => Future[B]`.
* This is useful for performing a parallel map. For example, to apply a function to all items of a list
* in parallel:
*
* {{{
* val myFutureList = Future.traverse(myList)(x => Future(myFunc(x)))
* }}}
+ * @tparam A the type of the value inside the Futures in the `TraversableOnce`
+ * @tparam B the type of the value of the returned `Future`
+ * @tparam M the type of the `TraversableOnce` of Futures
+ * @param in the `TraversableOnce` of Futures which will be sequenced
+ * @param fn the function to apply to the `TraversableOnce` of Futures to produce the results
+ * @return the `Future` of the `TraversableOnce` of results
*/
def traverse[A, B, M[X] <: TraversableOnce[X]](in: M[A])(fn: A => Future[B])(implicit cbf: CanBuildFrom[M[A], B, M[B]], executor: ExecutionContext): Future[M[B]] =
in.foldLeft(successful(cbf(in))) { (fr, a) =>
@@ -575,6 +787,7 @@ object Future {
for (r <- fr; b <- fb) yield (r += b)
}.map(_.result())
+
// This is used to run callbacks which are internal
// to scala.concurrent; our own callbacks are only
// ever used to eventually run another callback,
diff --git a/src/library/scala/concurrent/Promise.scala b/src/library/scala/concurrent/Promise.scala
index 0f4e98db57..894b134e83 100644
--- a/src/library/scala/concurrent/Promise.scala
+++ b/src/library/scala/concurrent/Promise.scala
@@ -26,12 +26,6 @@ import scala.util.{ Try, Success, Failure }
* Note: Using this method may result in non-deterministic concurrent programs.
*/
trait Promise[T] {
-
- // used for internal callbacks defined in
- // the lexical scope of this trait;
- // _never_ for application callbacks.
- private implicit def internalExecutor: ExecutionContext = Future.InternalCallbackExecutor
-
/** Future containing the value of this promise.
*/
def future: Future[T]
@@ -73,7 +67,9 @@ trait Promise[T] {
* @return This promise
*/
final def tryCompleteWith(other: Future[T]): this.type = {
- other onComplete { this tryComplete _ }
+ if (other ne this.future) { // this tryCompleteWith this doesn't make much sense
+ other.onComplete(this tryComplete _)(Future.InternalCallbackExecutor)
+ }
this
}
@@ -139,5 +135,5 @@ object Promise {
* @tparam T the type of the value in the promise
* @return the newly created `Promise` object
*/
- def fromTry[T](result: Try[T]): Promise[T] = new impl.Promise.KeptPromise[T](result)
+ def fromTry[T](result: Try[T]): Promise[T] = impl.Promise.KeptPromise[T](result)
}
diff --git a/src/library/scala/concurrent/duration/Duration.scala b/src/library/scala/concurrent/duration/Duration.scala
index 182c2d172a..8b7d81d1c4 100644
--- a/src/library/scala/concurrent/duration/Duration.scala
+++ b/src/library/scala/concurrent/duration/Duration.scala
@@ -708,7 +708,7 @@ final class FiniteDuration(val length: Long, val unit: TimeUnit) extends Duratio
final def isFinite() = true
- final def toCoarsest: Duration = {
+ final override def toCoarsest: FiniteDuration = {
def loop(length: Long, unit: TimeUnit): FiniteDuration = {
def coarserOrThis(coarser: TimeUnit, divider: Int) =
if (length % divider == 0) loop(length / divider, coarser)
diff --git a/src/library/scala/concurrent/forkjoin/package.scala b/src/library/scala/concurrent/forkjoin/package.scala
new file mode 100644
index 0000000000..7f4524fccf
--- /dev/null
+++ b/src/library/scala/concurrent/forkjoin/package.scala
@@ -0,0 +1,60 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2015, LAMP/EPFL and Typesafe, Inc. **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+package scala.concurrent
+import java.util.{concurrent => juc}
+import java.util.Collection
+
+package object forkjoin {
+ @deprecated("Use java.util.concurrent.ForkJoinPool directly, instead of this alias.", "2.12.0")
+ type ForkJoinPool = juc.ForkJoinPool
+ @deprecated("Use java.util.concurrent.ForkJoinPool directly, instead of this alias.", "2.12.0")
+ object ForkJoinPool {
+ type ForkJoinWorkerThreadFactory = juc.ForkJoinPool.ForkJoinWorkerThreadFactory
+ type ManagedBlocker = juc.ForkJoinPool.ManagedBlocker
+
+ val defaultForkJoinWorkerThreadFactory: ForkJoinWorkerThreadFactory = juc.ForkJoinPool.defaultForkJoinWorkerThreadFactory
+ def managedBlock(blocker: ManagedBlocker): Unit = juc.ForkJoinPool.managedBlock(blocker)
+ }
+
+ @deprecated("Use java.util.concurrent.ForkJoinTask directly, instead of this alias.", "2.12.0")
+ type ForkJoinTask[T] = juc.ForkJoinTask[T]
+ @deprecated("Use java.util.concurrent.ForkJoinTask directly, instead of this alias.", "2.12.0")
+ object ForkJoinTask {
+ def adapt(runnable: Runnable): ForkJoinTask[_] = juc.ForkJoinTask.adapt(runnable)
+ def adapt[T](callable: juc.Callable[_ <: T]): ForkJoinTask[T] = juc.ForkJoinTask.adapt(callable)
+ def adapt[T](runnable: Runnable, result: T): ForkJoinTask[T] = juc.ForkJoinTask.adapt(runnable, result)
+ def getPool(): ForkJoinPool = juc.ForkJoinTask.getPool
+ def getQueuedTaskCount(): Int = juc.ForkJoinTask.getQueuedTaskCount
+ def getSurplusQueuedTaskCount(): Int = juc.ForkJoinTask.getSurplusQueuedTaskCount
+ def helpQuiesce(): Unit = juc.ForkJoinTask.helpQuiesce
+ def inForkJoinPool(): Boolean = juc.ForkJoinTask.inForkJoinPool
+ def invokeAll[T <: ForkJoinTask[_]](tasks: Collection[T]): Collection[T] = juc.ForkJoinTask.invokeAll(tasks)
+ def invokeAll[T](t1: ForkJoinTask[T]): Unit = juc.ForkJoinTask.invokeAll(t1)
+ def invokeAll[T](tasks: ForkJoinTask[T]*): Unit = juc.ForkJoinTask.invokeAll(tasks: _*)
+ }
+
+ @deprecated("Use java.util.concurrent.ForkJoinWorkerThread directly, instead of this alias.", "2.12.0")
+ type ForkJoinWorkerThread = juc.ForkJoinWorkerThread
+ @deprecated("Use java.util.concurrent.LinkedTransferQueue directly, instead of this alias.", "2.12.0")
+ type LinkedTransferQueue[T] = juc.LinkedTransferQueue[T]
+ @deprecated("Use java.util.concurrent.RecursiveAction directly, instead of this alias.", "2.12.0")
+ type RecursiveAction = juc.RecursiveAction
+ @deprecated("Use java.util.concurrent.RecursiveTask directly, instead of this alias.", "2.12.0")
+ type RecursiveTask[T] = juc.RecursiveTask[T]
+
+ @deprecated("Use java.util.concurrent.ThreadLocalRandom directly, instead of this alias.", "2.12.0")
+ type ThreadLocalRandom = juc.ThreadLocalRandom
+ @deprecated("Use java.util.concurrent.ThreadLocalRandom directly, instead of this alias.", "2.12.0")
+ object ThreadLocalRandom {
+ // For source compatibility, current must declare the empty argument list.
+ // Having no argument list makes more sense since it doesn't have any side effects,
+ // but existing callers will break if they invoked it as `current()`.
+ def current() = juc.ThreadLocalRandom.current
+ }
+}
diff --git a/src/library/scala/concurrent/impl/AbstractPromise.java b/src/library/scala/concurrent/impl/AbstractPromise.java
deleted file mode 100644
index b8165b6cde..0000000000
--- a/src/library/scala/concurrent/impl/AbstractPromise.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.concurrent.impl;
-
-
-import scala.concurrent.util.Unsafe;
-import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
-
-
-
-abstract class AbstractPromise {
- private volatile Object _ref;
-
- final static long _refoffset;
-
- static {
- try {
- _refoffset = Unsafe.instance.objectFieldOffset(AbstractPromise.class.getDeclaredField("_ref"));
- } catch (Throwable t) {
- throw new ExceptionInInitializerError(t);
- }
- }
-
- protected final boolean updateState(Object oldState, Object newState) {
- return Unsafe.instance.compareAndSwapObject(this, _refoffset, oldState, newState);
- }
-
- protected final Object getState() {
- return _ref;
- }
-
- protected final static AtomicReferenceFieldUpdater<AbstractPromise, Object> updater =
- AtomicReferenceFieldUpdater.newUpdater(AbstractPromise.class, Object.class, "_ref");
-} \ No newline at end of file
diff --git a/src/library/scala/concurrent/impl/ExecutionContextImpl.scala b/src/library/scala/concurrent/impl/ExecutionContextImpl.scala
index 479720287c..c98746a98d 100644
--- a/src/library/scala/concurrent/impl/ExecutionContextImpl.scala
+++ b/src/library/scala/concurrent/impl/ExecutionContextImpl.scala
@@ -10,53 +10,88 @@ package scala.concurrent.impl
-import java.util.concurrent.{ LinkedBlockingQueue, Callable, Executor, ExecutorService, Executors, ThreadFactory, TimeUnit, ThreadPoolExecutor }
+import java.util.concurrent.{ ForkJoinPool, ForkJoinWorkerThread, ForkJoinTask, LinkedBlockingQueue, Callable, Executor, ExecutorService, Executors, ThreadFactory, TimeUnit, ThreadPoolExecutor }
+import java.util.concurrent.atomic.AtomicInteger
import java.util.Collection
-import scala.concurrent.forkjoin._
import scala.concurrent.{ BlockContext, ExecutionContext, Awaitable, CanAwait, ExecutionContextExecutor, ExecutionContextExecutorService }
import scala.util.control.NonFatal
+import scala.annotation.tailrec
+private[scala] class ExecutionContextImpl private[impl] (val executor: Executor, val reporter: Throwable => Unit) extends ExecutionContextExecutor {
+ require(executor ne null, "Executor must not be null")
+ override def execute(runnable: Runnable) = executor execute runnable
+ override def reportFailure(t: Throwable) = reporter(t)
+}
-private[scala] class ExecutionContextImpl private[impl] (es: Executor, reporter: Throwable => Unit) extends ExecutionContextExecutor {
- // Placed here since the creation of the executor needs to read this val
- private[this] val uncaughtExceptionHandler: Thread.UncaughtExceptionHandler = new Thread.UncaughtExceptionHandler {
- def uncaughtException(thread: Thread, cause: Throwable): Unit = reporter(cause)
- }
- val executor: Executor = es match {
- case null => createExecutorService
- case some => some
- }
+private[concurrent] object ExecutionContextImpl {
// Implement BlockContext on FJP threads
- class DefaultThreadFactory(daemonic: Boolean) extends ThreadFactory with ForkJoinPool.ForkJoinWorkerThreadFactory {
+ final class DefaultThreadFactory(
+ daemonic: Boolean,
+ maxThreads: Int,
+ prefix: String,
+ uncaught: Thread.UncaughtExceptionHandler) extends ThreadFactory with ForkJoinPool.ForkJoinWorkerThreadFactory {
+
+ require(prefix ne null, "DefaultThreadFactory.prefix must be non null")
+ require(maxThreads > 0, "DefaultThreadFactory.maxThreads must be greater than 0")
+
+ private final val currentNumberOfThreads = new AtomicInteger(0)
+
+ @tailrec private final def reserveThread(): Boolean = currentNumberOfThreads.get() match {
+ case `maxThreads` | Int.`MaxValue` => false
+ case other => currentNumberOfThreads.compareAndSet(other, other + 1) || reserveThread()
+ }
+
+ @tailrec private final def deregisterThread(): Boolean = currentNumberOfThreads.get() match {
+ case 0 => false
+ case other => currentNumberOfThreads.compareAndSet(other, other - 1) || deregisterThread()
+ }
+
def wire[T <: Thread](thread: T): T = {
thread.setDaemon(daemonic)
- thread.setUncaughtExceptionHandler(uncaughtExceptionHandler)
+ thread.setUncaughtExceptionHandler(uncaught)
+ thread.setName(prefix + "-" + thread.getId())
thread
}
- def newThread(runnable: Runnable): Thread = wire(new Thread(runnable))
-
- def newThread(fjp: ForkJoinPool): ForkJoinWorkerThread = wire(new ForkJoinWorkerThread(fjp) with BlockContext {
- override def blockOn[T](thunk: =>T)(implicit permission: CanAwait): T = {
- var result: T = null.asInstanceOf[T]
- ForkJoinPool.managedBlock(new ForkJoinPool.ManagedBlocker {
- @volatile var isdone = false
- override def block(): Boolean = {
- result = try thunk finally { isdone = true }
- true
+ // As per ThreadFactory contract newThread should return `null` if cannot create new thread.
+ def newThread(runnable: Runnable): Thread =
+ if (reserveThread())
+ wire(new Thread(new Runnable {
+ // We have to decrement the current thread count when the thread exits
+ override def run() = try runnable.run() finally deregisterThread()
+ })) else null
+
+ def newThread(fjp: ForkJoinPool): ForkJoinWorkerThread =
+ if (reserveThread()) {
+ wire(new ForkJoinWorkerThread(fjp) with BlockContext {
+ // We have to decrement the current thread count when the thread exits
+ final override def onTermination(exception: Throwable): Unit = deregisterThread()
+ final override def blockOn[T](thunk: =>T)(implicit permission: CanAwait): T = {
+ var result: T = null.asInstanceOf[T]
+ ForkJoinPool.managedBlock(new ForkJoinPool.ManagedBlocker {
+ @volatile var isdone = false
+ override def block(): Boolean = {
+ result = try {
+ // When we block, switch out the BlockContext temporarily so that nested blocking does not created N new Threads
+ BlockContext.withBlockContext(BlockContext.defaultBlockContext) { thunk }
+ } finally {
+ isdone = true
+ }
+
+ true
+ }
+ override def isReleasable = isdone
+ })
+ result
}
- override def isReleasable = isdone
})
- result
- }
- })
+ } else null
}
- def createExecutorService: ExecutorService = {
-
+ def createDefaultExecutorService(reporter: Throwable => Unit): ExecutorService = {
def getInt(name: String, default: String) = (try System.getProperty(name, default) catch {
case e: SecurityException => default
}) match {
@@ -65,20 +100,42 @@ private[scala] class ExecutionContextImpl private[impl] (es: Executor, reporter:
}
def range(floor: Int, desired: Int, ceiling: Int) = scala.math.min(scala.math.max(floor, desired), ceiling)
+ val numThreads = getInt("scala.concurrent.context.numThreads", "x1")
+ // The hard limit on the number of active threads that the thread factory will produce
+ // SI-8955 Deadlocks can happen if maxNoOfThreads is too low, although we're currently not sure
+ // about what the exact threshhold is. numThreads + 256 is conservatively high.
+ val maxNoOfThreads = getInt("scala.concurrent.context.maxThreads", "x1")
val desiredParallelism = range(
getInt("scala.concurrent.context.minThreads", "1"),
- getInt("scala.concurrent.context.numThreads", "x1"),
- getInt("scala.concurrent.context.maxThreads", "x1"))
+ numThreads,
+ maxNoOfThreads)
+
+ // The thread factory must provide additional threads to support managed blocking.
+ val maxExtraThreads = getInt("scala.concurrent.context.maxExtraThreads", "256")
+
+ val uncaughtExceptionHandler: Thread.UncaughtExceptionHandler = new Thread.UncaughtExceptionHandler {
+ override def uncaughtException(thread: Thread, cause: Throwable): Unit = reporter(cause)
+ }
- val threadFactory = new DefaultThreadFactory(daemonic = true)
+ val threadFactory = new ExecutionContextImpl.DefaultThreadFactory(daemonic = true,
+ maxThreads = maxNoOfThreads + maxExtraThreads,
+ prefix = "scala-execution-context-global",
+ uncaught = uncaughtExceptionHandler)
try {
- new ForkJoinPool(
- desiredParallelism,
- threadFactory,
- uncaughtExceptionHandler,
- true) // Async all the way baby
+ new ForkJoinPool(desiredParallelism, threadFactory, uncaughtExceptionHandler, true) {
+ override def execute(runnable: Runnable): Unit = {
+ val fjt: ForkJoinTask[_] = runnable match {
+ case t: ForkJoinTask[_] => t
+ case r => new ExecutionContextImpl.AdaptedForkJoinTask(r)
+ }
+ Thread.currentThread match {
+ case fjw: ForkJoinWorkerThread if fjw.getPool eq this => fjt.fork()
+ case _ => super.execute(fjt)
+ }
+ }
+ }
} catch {
case NonFatal(t) =>
System.err.println("Failed to create ForkJoinPool for the default ExecutionContext, falling back to ThreadPoolExecutor")
@@ -96,56 +153,42 @@ private[scala] class ExecutionContextImpl private[impl] (es: Executor, reporter:
}
}
- def execute(runnable: Runnable): Unit = executor match {
- case fj: ForkJoinPool =>
- val fjt: ForkJoinTask[_] = runnable match {
- case t: ForkJoinTask[_] => t
- case r => new ExecutionContextImpl.AdaptedForkJoinTask(r)
- }
- Thread.currentThread match {
- case fjw: ForkJoinWorkerThread if fjw.getPool eq fj => fjt.fork()
- case _ => fj execute fjt
- }
- case generic => generic execute runnable
- }
-
- def reportFailure(t: Throwable) = reporter(t)
-}
-
-
-private[concurrent] object ExecutionContextImpl {
-
final class AdaptedForkJoinTask(runnable: Runnable) extends ForkJoinTask[Unit] {
- final override def setRawResult(u: Unit): Unit = ()
- final override def getRawResult(): Unit = ()
- final override def exec(): Boolean = try { runnable.run(); true } catch {
- case anything: Throwable ⇒
- val t = Thread.currentThread
- t.getUncaughtExceptionHandler match {
- case null ⇒
- case some ⇒ some.uncaughtException(t, anything)
- }
- throw anything
- }
+ final override def setRawResult(u: Unit): Unit = ()
+ final override def getRawResult(): Unit = ()
+ final override def exec(): Boolean = try { runnable.run(); true } catch {
+ case anything: Throwable =>
+ val t = Thread.currentThread
+ t.getUncaughtExceptionHandler match {
+ case null =>
+ case some => some.uncaughtException(t, anything)
}
+ throw anything
+ }
+ }
- def fromExecutor(e: Executor, reporter: Throwable => Unit = ExecutionContext.defaultReporter): ExecutionContextImpl = new ExecutionContextImpl(e, reporter)
- def fromExecutorService(es: ExecutorService, reporter: Throwable => Unit = ExecutionContext.defaultReporter): ExecutionContextImpl with ExecutionContextExecutorService =
- new ExecutionContextImpl(es, reporter) with ExecutionContextExecutorService {
- final def asExecutorService: ExecutorService = executor.asInstanceOf[ExecutorService]
- override def execute(command: Runnable) = executor.execute(command)
- override def shutdown() { asExecutorService.shutdown() }
- override def shutdownNow() = asExecutorService.shutdownNow()
- override def isShutdown = asExecutorService.isShutdown
- override def isTerminated = asExecutorService.isTerminated
- override def awaitTermination(l: Long, timeUnit: TimeUnit) = asExecutorService.awaitTermination(l, timeUnit)
- override def submit[T](callable: Callable[T]) = asExecutorService.submit(callable)
- override def submit[T](runnable: Runnable, t: T) = asExecutorService.submit(runnable, t)
- override def submit(runnable: Runnable) = asExecutorService.submit(runnable)
- override def invokeAll[T](callables: Collection[_ <: Callable[T]]) = asExecutorService.invokeAll(callables)
- override def invokeAll[T](callables: Collection[_ <: Callable[T]], l: Long, timeUnit: TimeUnit) = asExecutorService.invokeAll(callables, l, timeUnit)
- override def invokeAny[T](callables: Collection[_ <: Callable[T]]) = asExecutorService.invokeAny(callables)
- override def invokeAny[T](callables: Collection[_ <: Callable[T]], l: Long, timeUnit: TimeUnit) = asExecutorService.invokeAny(callables, l, timeUnit)
+ def fromExecutor(e: Executor, reporter: Throwable => Unit = ExecutionContext.defaultReporter): ExecutionContextImpl =
+ new ExecutionContextImpl(Option(e).getOrElse(createDefaultExecutorService(reporter)), reporter)
+
+ def fromExecutorService(es: ExecutorService, reporter: Throwable => Unit = ExecutionContext.defaultReporter):
+ ExecutionContextImpl with ExecutionContextExecutorService = {
+ new ExecutionContextImpl(Option(es).getOrElse(createDefaultExecutorService(reporter)), reporter)
+ with ExecutionContextExecutorService {
+ final def asExecutorService: ExecutorService = executor.asInstanceOf[ExecutorService]
+ override def execute(command: Runnable) = executor.execute(command)
+ override def shutdown() { asExecutorService.shutdown() }
+ override def shutdownNow() = asExecutorService.shutdownNow()
+ override def isShutdown = asExecutorService.isShutdown
+ override def isTerminated = asExecutorService.isTerminated
+ override def awaitTermination(l: Long, timeUnit: TimeUnit) = asExecutorService.awaitTermination(l, timeUnit)
+ override def submit[T](callable: Callable[T]) = asExecutorService.submit(callable)
+ override def submit[T](runnable: Runnable, t: T) = asExecutorService.submit(runnable, t)
+ override def submit(runnable: Runnable) = asExecutorService.submit(runnable)
+ override def invokeAll[T](callables: Collection[_ <: Callable[T]]) = asExecutorService.invokeAll(callables)
+ override def invokeAll[T](callables: Collection[_ <: Callable[T]], l: Long, timeUnit: TimeUnit) = asExecutorService.invokeAll(callables, l, timeUnit)
+ override def invokeAny[T](callables: Collection[_ <: Callable[T]]) = asExecutorService.invokeAny(callables)
+ override def invokeAny[T](callables: Collection[_ <: Callable[T]], l: Long, timeUnit: TimeUnit) = asExecutorService.invokeAny(callables, l, timeUnit)
+ }
}
}
diff --git a/src/library/scala/concurrent/impl/Future.scala b/src/library/scala/concurrent/impl/Future.scala
deleted file mode 100644
index 042d32c234..0000000000
--- a/src/library/scala/concurrent/impl/Future.scala
+++ /dev/null
@@ -1,34 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-package scala.concurrent.impl
-
-
-
-import scala.concurrent.ExecutionContext
-import scala.util.control.NonFatal
-import scala.util.{ Success, Failure }
-
-
-private[concurrent] object Future {
- class PromiseCompletingRunnable[T](body: => T) extends Runnable {
- val promise = new Promise.DefaultPromise[T]()
-
- override def run() = {
- promise complete {
- try Success(body) catch { case NonFatal(e) => Failure(e) }
- }
- }
- }
-
- def apply[T](body: =>T)(implicit executor: ExecutionContext): scala.concurrent.Future[T] = {
- val runnable = new PromiseCompletingRunnable(body)
- executor.prepare.execute(runnable)
- runnable.promise.future
- }
-}
diff --git a/src/library/scala/concurrent/impl/Promise.scala b/src/library/scala/concurrent/impl/Promise.scala
index b15601058e..078ad45be9 100644
--- a/src/library/scala/concurrent/impl/Promise.scala
+++ b/src/library/scala/concurrent/impl/Promise.scala
@@ -16,14 +16,42 @@ import scala.util.control.NonFatal
import scala.util.{ Try, Success, Failure }
import java.io.ObjectInputStream
import java.util.concurrent.locks.AbstractQueuedSynchronizer
+import java.util.concurrent.atomic.AtomicReference
private[concurrent] trait Promise[T] extends scala.concurrent.Promise[T] with scala.concurrent.Future[T] {
def future: this.type = this
+
+ import scala.concurrent.Future
+ import scala.concurrent.impl.Promise.DefaultPromise
+
+ override def transform[S](f: Try[T] => Try[S])(implicit executor: ExecutionContext): Future[S] = {
+ val p = new DefaultPromise[S]()
+ onComplete { result => p.complete(try f(result) catch { case NonFatal(t) => Failure(t) }) }
+ p.future
+ }
+
+ // If possible, link DefaultPromises to avoid space leaks
+ override def transformWith[S](f: Try[T] => Future[S])(implicit executor: ExecutionContext): Future[S] = {
+ val p = new DefaultPromise[S]()
+ onComplete {
+ v => try f(v) match {
+ case fut if fut eq this => p complete v.asInstanceOf[Try[S]]
+ case dp: DefaultPromise[_] => dp.asInstanceOf[DefaultPromise[S]].linkRootOf(p)
+ case fut => p completeWith fut
+ } catch { case NonFatal(t) => p failure t }
+ }
+ p.future
+ }
+
+ override def toString: String = value match {
+ case Some(result) => "Future("+result+")"
+ case None => "Future(<not completed>)"
+ }
}
/* Precondition: `executor` is prepared, i.e., `executor` has been returned from invocation of `prepare` on some other `ExecutionContext`.
*/
-private class CallbackRunnable[T](val executor: ExecutionContext, val onComplete: Try[T] => Any) extends Runnable with OnCompleteRunnable {
+private final class CallbackRunnable[T](val executor: ExecutionContext, val onComplete: Try[T] => Any) extends Runnable with OnCompleteRunnable {
// must be filled in before running it
var value: Try[T] = null
@@ -89,7 +117,7 @@ private[concurrent] object Promise {
* incomplete, or as complete with the same result value.
*
* A DefaultPromise stores its state entirely in the AnyRef cell exposed by
- * AbstractPromise. The type of object stored in the cell fully describes the
+ * AtomicReference. The type of object stored in the cell fully describes the
* current state of the promise.
*
* 1. List[CallbackRunnable] - The promise is incomplete and has zero or more callbacks
@@ -150,8 +178,7 @@ private[concurrent] object Promise {
* DefaultPromises, and `linkedRootOf` is currently only designed to be called
* by Future.flatMap.
*/
- class DefaultPromise[T] extends AbstractPromise with Promise[T] { self =>
- updateState(null, Nil) // The promise is incomplete and has no callbacks
+ final class DefaultPromise[T] extends AtomicReference[AnyRef](Nil) with Promise[T] {
/** Get the root promise for this promise, compressing the link chain to that
* promise if necessary.
@@ -167,14 +194,23 @@ private[concurrent] object Promise {
* be garbage collected. Also, subsequent calls to this method should be
* faster as the link chain will be shorter.
*/
- @tailrec
- private def compressedRoot(): DefaultPromise[T] = {
- getState match {
- case linked: DefaultPromise[_] =>
- val target = linked.asInstanceOf[DefaultPromise[T]].root
- if (linked eq target) target else if (updateState(linked, target)) target else compressedRoot()
+ private def compressedRoot(): DefaultPromise[T] =
+ get() match {
+ case linked: DefaultPromise[_] => compressedRoot(linked)
case _ => this
}
+
+ @tailrec
+ private[this] final def compressedRoot(linked: DefaultPromise[_]): DefaultPromise[T] = {
+ val target = linked.asInstanceOf[DefaultPromise[T]].root
+ if (linked eq target) target
+ else if (compareAndSet(linked, target)) target
+ else {
+ get() match {
+ case newLinked: DefaultPromise[_] => compressedRoot(newLinked)
+ case _ => this
+ }
+ }
}
/** Get the promise at the root of the chain of linked promises. Used by `compressedRoot()`.
@@ -182,18 +218,16 @@ private[concurrent] object Promise {
* to compress the link chain whenever possible.
*/
@tailrec
- private def root: DefaultPromise[T] = {
- getState match {
+ private def root: DefaultPromise[T] =
+ get() match {
case linked: DefaultPromise[_] => linked.asInstanceOf[DefaultPromise[T]].root
case _ => this
}
- }
/** Try waiting for this promise to be completed.
*/
protected final def tryAwait(atMost: Duration): Boolean = if (!isCompleted) {
import Duration.Undefined
- import scala.concurrent.Future.InternalCallbackExecutor
atMost match {
case e if e eq Undefined => throw new IllegalArgumentException("cannot wait for Undefined period")
case Duration.Inf =>
@@ -225,18 +259,18 @@ private[concurrent] object Promise {
def value: Option[Try[T]] = value0
@tailrec
- private def value0: Option[Try[T]] = getState match {
+ private def value0: Option[Try[T]] = get() match {
case c: Try[_] => Some(c.asInstanceOf[Try[T]])
- case _: DefaultPromise[_] => compressedRoot().value0
+ case dp: DefaultPromise[_] => compressedRoot(dp).value0
case _ => None
}
override def isCompleted: Boolean = isCompleted0
@tailrec
- private def isCompleted0: Boolean = getState match {
+ private def isCompleted0: Boolean = get() match {
case _: Try[_] => true
- case _: DefaultPromise[_] => compressedRoot().isCompleted0
+ case dp: DefaultPromise[_] => compressedRoot(dp).isCompleted0
case _ => false
}
@@ -254,21 +288,17 @@ private[concurrent] object Promise {
*/
@tailrec
private def tryCompleteAndGetListeners(v: Try[T]): List[CallbackRunnable[T]] = {
- getState match {
+ get() match {
case raw: List[_] =>
val cur = raw.asInstanceOf[List[CallbackRunnable[T]]]
- if (updateState(cur, v)) cur else tryCompleteAndGetListeners(v)
- case _: DefaultPromise[_] =>
- compressedRoot().tryCompleteAndGetListeners(v)
+ if (compareAndSet(cur, v)) cur else tryCompleteAndGetListeners(v)
+ case dp: DefaultPromise[_] => compressedRoot(dp).tryCompleteAndGetListeners(v)
case _ => null
}
}
- def onComplete[U](func: Try[T] => U)(implicit executor: ExecutionContext): Unit = {
- val preparedEC = executor.prepare()
- val runnable = new CallbackRunnable[T](preparedEC, func)
- dispatchOrAddCallback(runnable)
- }
+ def onComplete[U](func: Try[T] => U)(implicit executor: ExecutionContext): Unit =
+ dispatchOrAddCallback(new CallbackRunnable[T](executor.prepare(), func))
/** Tries to add the callback, if already completed, it dispatches the callback to be executed.
* Used by `onComplete()` to add callbacks to a promise and by `link()` to transfer callbacks
@@ -276,15 +306,16 @@ private[concurrent] object Promise {
*/
@tailrec
private def dispatchOrAddCallback(runnable: CallbackRunnable[T]): Unit = {
- getState match {
+ get() match {
case r: Try[_] => runnable.executeWithValue(r.asInstanceOf[Try[T]])
- case _: DefaultPromise[_] => compressedRoot().dispatchOrAddCallback(runnable)
- case listeners: List[_] => if (updateState(listeners, runnable :: listeners)) () else dispatchOrAddCallback(runnable)
+ case dp: DefaultPromise[_] => compressedRoot(dp).dispatchOrAddCallback(runnable)
+ case listeners: List[_] => if (compareAndSet(listeners, runnable :: listeners)) ()
+ else dispatchOrAddCallback(runnable)
}
}
/** Link this promise to the root of another promise using `link()`. Should only be
- * be called by Future.flatMap.
+ * be called by transformWith.
*/
protected[concurrent] final def linkRootOf(target: DefaultPromise[T]): Unit = link(target.compressedRoot())
@@ -299,18 +330,17 @@ private[concurrent] object Promise {
*/
@tailrec
private def link(target: DefaultPromise[T]): Unit = if (this ne target) {
- getState match {
+ get() match {
case r: Try[_] =>
- if (!target.tryComplete(r.asInstanceOf[Try[T]])) {
- // Currently linking is done from Future.flatMap, which should ensure only
- // one promise can be completed. Therefore this situation is unexpected.
+ if (!target.tryComplete(r.asInstanceOf[Try[T]]))
throw new IllegalStateException("Cannot link completed promises together")
- }
- case _: DefaultPromise[_] =>
- compressedRoot().link(target)
- case listeners: List[_] => if (updateState(listeners, target)) {
- if (!listeners.isEmpty) listeners.asInstanceOf[List[CallbackRunnable[T]]].foreach(target.dispatchOrAddCallback(_))
- } else link(target)
+ case dp: DefaultPromise[_] =>
+ compressedRoot(dp).link(target)
+ case listeners: List[_] if compareAndSet(listeners, target) =>
+ if (listeners.nonEmpty)
+ listeners.asInstanceOf[List[CallbackRunnable[T]]].foreach(target.dispatchOrAddCallback(_))
+ case _ =>
+ link(target)
}
}
}
@@ -319,23 +349,58 @@ private[concurrent] object Promise {
*
* Useful in Future-composition when a value to contribute is already available.
*/
- final class KeptPromise[T](suppliedValue: Try[T]) extends Promise[T] {
+ object KeptPromise {
+ import scala.concurrent.Future
+ import scala.reflect.ClassTag
+
+ private[this] sealed trait Kept[T] extends Promise[T] {
+ def result: Try[T]
+
+ override def value: Option[Try[T]] = Some(result)
- val value = Some(resolveTry(suppliedValue))
+ override def isCompleted: Boolean = true
- override def isCompleted: Boolean = true
+ override def tryComplete(value: Try[T]): Boolean = false
- def tryComplete(value: Try[T]): Boolean = false
+ override def onComplete[U](func: Try[T] => U)(implicit executor: ExecutionContext): Unit =
+ (new CallbackRunnable(executor.prepare(), func)).executeWithValue(result)
- def onComplete[U](func: Try[T] => U)(implicit executor: ExecutionContext): Unit = {
- val completedAs = value.get
- val preparedEC = executor.prepare()
- (new CallbackRunnable(preparedEC, func)).executeWithValue(completedAs)
+ override def ready(atMost: Duration)(implicit permit: CanAwait): this.type = this
+
+ override def result(atMost: Duration)(implicit permit: CanAwait): T = result.get
}
- def ready(atMost: Duration)(implicit permit: CanAwait): this.type = this
+ private[this] final class Successful[T](val result: Success[T]) extends Kept[T] {
+ override def onFailure[U](pf: PartialFunction[Throwable, U])(implicit executor: ExecutionContext): Unit = ()
+ override def failed: Future[Throwable] = KeptPromise(Failure(new NoSuchElementException("Future.failed not completed with a throwable."))).future
+ override def recover[U >: T](pf: PartialFunction[Throwable, U])(implicit executor: ExecutionContext): Future[U] = this
+ override def recoverWith[U >: T](pf: PartialFunction[Throwable, Future[U]])(implicit executor: ExecutionContext): Future[U] = this
+ override def fallbackTo[U >: T](that: Future[U]): Future[U] = this
+ }
- def result(atMost: Duration)(implicit permit: CanAwait): T = value.get.get
+ private[this] final class Failed[T](val result: Failure[T]) extends Kept[T] {
+ private[this] final def thisAs[S]: Future[S] = future.asInstanceOf[Future[S]]
+
+ override def onSuccess[U](pf: PartialFunction[T, U])(implicit executor: ExecutionContext): Unit = ()
+ override def failed: Future[Throwable] = thisAs[Throwable]
+ override def foreach[U](f: T => U)(implicit executor: ExecutionContext): Unit = ()
+ override def map[S](f: T => S)(implicit executor: ExecutionContext): Future[S] = thisAs[S]
+ override def flatMap[S](f: T => Future[S])(implicit executor: ExecutionContext): Future[S] = thisAs[S]
+ override def flatten[S](implicit ev: T <:< Future[S]): Future[S] = thisAs[S]
+ override def filter(p: T => Boolean)(implicit executor: ExecutionContext): Future[T] = this
+ override def collect[S](pf: PartialFunction[T, S])(implicit executor: ExecutionContext): Future[S] = thisAs[S]
+ override def zip[U](that: Future[U]): Future[(T, U)] = thisAs[(T,U)]
+ override def zipWith[U, R](that: Future[U])(f: (T, U) => R)(implicit executor: ExecutionContext): Future[R] = thisAs[R]
+ override def fallbackTo[U >: T](that: Future[U]): Future[U] =
+ if (this eq that) this else that.recoverWith({ case _ => this })(InternalCallbackExecutor)
+ override def mapTo[S](implicit tag: ClassTag[S]): Future[S] = thisAs[S]
+ }
+
+ def apply[T](result: Try[T]): scala.concurrent.Promise[T] =
+ resolveTry(result) match {
+ case s @ Success(_) => new Successful(s)
+ case f @ Failure(_) => new Failed(f)
+ }
}
}
diff --git a/src/library/scala/concurrent/util/Unsafe.java b/src/library/scala/concurrent/util/Unsafe.java
new file mode 100644
index 0000000000..73739e377d
--- /dev/null
+++ b/src/library/scala/concurrent/util/Unsafe.java
@@ -0,0 +1,38 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+package scala.concurrent.util;
+import java.lang.reflect.Field;
+
+// TODO: remove once akka no longer needs it, hopefully by 2.12.0-M3!
+@Deprecated
+public final class Unsafe {
+ @Deprecated
+ public final static sun.misc.Unsafe instance;
+ static {
+ try {
+ sun.misc.Unsafe found = null;
+ for(Field field : sun.misc.Unsafe.class.getDeclaredFields()) {
+ if (field.getType() == sun.misc.Unsafe.class) {
+ field.setAccessible(true);
+ found = (sun.misc.Unsafe) field.get(null);
+ break;
+ }
+ }
+ if (found == null) throw new IllegalStateException("Can't find instance of sun.misc.Unsafe");
+ else instance = found;
+ } catch(Throwable t) {
+ throw new ExceptionInInitializerError(t);
+ }
+ }
+}
+
+// Scala version:
+// classOf[sun.misc.Unsafe].getDeclaredFields.filter(_.getType == classOf[sun.misc.Unsafe]).headOption.map { field =>
+// field.setAccessible(true); field.get(null).asInstanceOf[sun.misc.Unsafe]
+// } getOrElse (throw new IllegalStateException("Can't find instance of sun.misc.Unsafe"))
diff --git a/src/library/scala/deprecatedName.scala b/src/library/scala/deprecatedName.scala
index 07c5c8925c..a0d3aa829b 100644
--- a/src/library/scala/deprecatedName.scala
+++ b/src/library/scala/deprecatedName.scala
@@ -29,4 +29,6 @@ import scala.annotation.meta._
* @since 2.8.1
*/
@param
-class deprecatedName(name: Symbol) extends scala.annotation.StaticAnnotation
+class deprecatedName(name: Symbol) extends scala.annotation.StaticAnnotation {
+ def this() = this(Symbol("<none>"))
+}
diff --git a/src/library/scala/io/Source.scala b/src/library/scala/io/Source.scala
index 9f0b56b4fe..c0ee5f6a75 100644
--- a/src/library/scala/io/Source.scala
+++ b/src/library/scala/io/Source.scala
@@ -10,7 +10,7 @@ package scala
package io
import scala.collection.AbstractIterator
-import java.io.{ FileInputStream, InputStream, PrintStream, File => JFile }
+import java.io.{ FileInputStream, InputStream, PrintStream, File => JFile, Closeable }
import java.net.{ URI, URL }
/** This object provides convenience methods to create an iterable
@@ -167,6 +167,16 @@ object Source {
def fromInputStream(is: InputStream)(implicit codec: Codec): BufferedSource =
createBufferedSource(is, reset = () => fromInputStream(is)(codec), close = () => is.close())(codec)
+
+ /** Reads data from a classpath resource, using either a context classloader (default) or a passed one.
+ *
+ * @param resource name of the resource to load from the classpath
+ * @param classLoader classloader to be used, or context classloader if not specified
+ * @return the buffered source
+ */
+ def fromResource(resource: String, classLoader: ClassLoader = Thread.currentThread().getContextClassLoader())(implicit codec: Codec): BufferedSource =
+ fromInputStream(classLoader.getResourceAsStream(resource))
+
}
/** An iterable representation of source data.
@@ -187,7 +197,7 @@ object Source {
* @author Burak Emir
* @version 1.0
*/
-abstract class Source extends Iterator[Char] {
+abstract class Source extends Iterator[Char] with Closeable {
/** the actual iterator */
protected val iter: Iterator[Char]
diff --git a/src/library/scala/math/package.scala b/src/library/scala/math/package.scala
index 58ece8a05b..b6593d6661 100644
--- a/src/library/scala/math/package.scala
+++ b/src/library/scala/math/package.scala
@@ -26,7 +26,7 @@ package object math {
/** Returns a `double` value with a positive sign, greater than or equal
* to `0.0` and less than `1.0`.
*/
- def random: Double = java.lang.Math.random()
+ def random(): Double = java.lang.Math.random()
def sin(x: Double): Double = java.lang.Math.sin(x)
def cos(x: Double): Double = java.lang.Math.cos(x)
diff --git a/src/library/scala/runtime/BoxesRunTime.java b/src/library/scala/runtime/BoxesRunTime.java
index 9cb1dee41c..96e0f23f3d 100644
--- a/src/library/scala/runtime/BoxesRunTime.java
+++ b/src/library/scala/runtime/BoxesRunTime.java
@@ -179,7 +179,7 @@ public final class BoxesRunTime
return xc.equals(y);
}
- private static boolean equalsNumChar(java.lang.Number xn, java.lang.Character yc) {
+ public static boolean equalsNumChar(java.lang.Number xn, java.lang.Character yc) {
if (yc == null)
return xn == null;
diff --git a/src/library/scala/runtime/LambdaDeserializer.scala b/src/library/scala/runtime/LambdaDeserializer.scala
new file mode 100644
index 0000000000..ad7d12ba5d
--- /dev/null
+++ b/src/library/scala/runtime/LambdaDeserializer.scala
@@ -0,0 +1,132 @@
+package scala.runtime
+
+import java.lang.invoke._
+
+/**
+ * This class is only intended to be called by synthetic `$deserializeLambda$` method that the Scala 2.12
+ * compiler will add to classes hosting lambdas.
+ *
+ * It is not intended to be consumed directly.
+ */
+object LambdaDeserializer {
+ /**
+ * Deserialize a lambda by calling `LambdaMetafactory.altMetafactory` to spin up a lambda class
+ * and instantiating this class with the captured arguments.
+ *
+ * A cache may be provided to ensure that subsequent deserialization of the same lambda expression
+ * is cheap, it amounts to a reflective call to the constructor of the previously created class.
+ * However, deserialization of the same lambda expression is not guaranteed to use the same class,
+ * concurrent deserialization of the same lambda expression may spin up more than one class.
+ *
+ * Assumptions:
+ * - No additional marker interfaces are required beyond `{java.io,scala.}Serializable`. These are
+ * not stored in `SerializedLambda`, so we can't reconstitute them.
+ * - No additional bridge methods are passed to `altMetafactory`. Again, these are not stored.
+ *
+ * @param lookup The factory for method handles. Must have access to the implementation method, the
+ * functional interface class, and `java.io.Serializable` or `scala.Serializable` as
+ * required.
+ * @param cache A cache used to avoid spinning up a class for each deserialization of a given lambda. May be `null`
+ * @param serialized The lambda to deserialize. Note that this is typically created by the `readResolve`
+ * member of the anonymous class created by `LambdaMetaFactory`.
+ * @return An instance of the functional interface
+ */
+ def deserializeLambda(lookup: MethodHandles.Lookup, cache: java.util.Map[String, MethodHandle], serialized: SerializedLambda): AnyRef = {
+ def slashDot(name: String) = name.replaceAll("/", ".")
+ val loader = lookup.lookupClass().getClassLoader
+ val implClass = loader.loadClass(slashDot(serialized.getImplClass))
+
+ def makeCallSite: CallSite = {
+ import serialized._
+ def parseDescriptor(s: String) =
+ MethodType.fromMethodDescriptorString(s, loader)
+
+ val funcInterfaceSignature = parseDescriptor(getFunctionalInterfaceMethodSignature)
+ val instantiated = parseDescriptor(getInstantiatedMethodType)
+ val functionalInterfaceClass = loader.loadClass(slashDot(getFunctionalInterfaceClass))
+
+ val implMethodSig = parseDescriptor(getImplMethodSignature)
+ // Construct the invoked type from the impl method type. This is the type of a factory
+ // that will be generated by the meta-factory. It is a method type, with param types
+ // coming form the types of the captures, and return type being the functional interface.
+ val invokedType: MethodType = {
+ // 1. Add receiver for non-static impl methods
+ val withReceiver = getImplMethodKind match {
+ case MethodHandleInfo.REF_invokeStatic | MethodHandleInfo.REF_newInvokeSpecial =>
+ implMethodSig
+ case _ =>
+ implMethodSig.insertParameterTypes(0, implClass)
+ }
+ // 2. Remove lambda parameters, leaving only captures. Note: the receiver may be a lambda parameter,
+ // such as in `Function<Object, String> s = Object::toString`
+ val lambdaArity = funcInterfaceSignature.parameterCount()
+ val from = withReceiver.parameterCount() - lambdaArity
+ val to = withReceiver.parameterCount()
+
+ // 3. Drop the lambda return type and replace with the functional interface.
+ withReceiver.dropParameterTypes(from, to).changeReturnType(functionalInterfaceClass)
+ }
+
+ // Lookup the implementation method
+ val implMethod: MethodHandle = try {
+ findMember(lookup, getImplMethodKind, implClass, getImplMethodName, implMethodSig)
+ } catch {
+ case e: ReflectiveOperationException => throw new IllegalArgumentException("Illegal lambda deserialization", e)
+ }
+
+ val flags: Int = LambdaMetafactory.FLAG_SERIALIZABLE | LambdaMetafactory.FLAG_MARKERS
+ val isScalaFunction = functionalInterfaceClass.getName.startsWith("scala.Function")
+ val markerInterface: Class[_] = loader.loadClass(if (isScalaFunction) ScalaSerializable else JavaIOSerializable)
+
+ LambdaMetafactory.altMetafactory(
+ lookup, getFunctionalInterfaceMethodName, invokedType,
+
+ /* samMethodType = */ funcInterfaceSignature,
+ /* implMethod = */ implMethod,
+ /* instantiatedMethodType = */ instantiated,
+ /* flags = */ flags.asInstanceOf[AnyRef],
+ /* markerInterfaceCount = */ 1.asInstanceOf[AnyRef],
+ /* markerInterfaces[0] = */ markerInterface,
+ /* bridgeCount = */ 0.asInstanceOf[AnyRef]
+ )
+ }
+
+ val key = serialized.getImplMethodName + " : " + serialized.getImplMethodSignature
+ val factory: MethodHandle = if (cache == null) {
+ makeCallSite.getTarget
+ } else cache.get(key) match {
+ case null =>
+ val callSite = makeCallSite
+ val temp = callSite.getTarget
+ cache.put(key, temp)
+ temp
+ case target => target
+ }
+
+ val captures = Array.tabulate(serialized.getCapturedArgCount)(n => serialized.getCapturedArg(n))
+ factory.invokeWithArguments(captures: _*)
+ }
+
+ private val ScalaSerializable = "scala.Serializable"
+
+ private val JavaIOSerializable = {
+ // We could actually omit this marker interface as LambdaMetaFactory will add it if
+ // the FLAG_SERIALIZABLE is set and of the provided markers extend it. But the code
+ // is cleaner if we uniformly add a single marker, so I'm leaving it in place.
+ "java.io.Serializable"
+ }
+
+ private def findMember(lookup: MethodHandles.Lookup, kind: Int, owner: Class[_],
+ name: String, signature: MethodType): MethodHandle = {
+ kind match {
+ case MethodHandleInfo.REF_invokeStatic =>
+ lookup.findStatic(owner, name, signature)
+ case MethodHandleInfo.REF_newInvokeSpecial =>
+ lookup.findConstructor(owner, signature)
+ case MethodHandleInfo.REF_invokeVirtual | MethodHandleInfo.REF_invokeInterface =>
+ lookup.findVirtual(owner, name, signature)
+ case MethodHandleInfo.REF_invokeSpecial =>
+ lookup.findSpecial(owner, name, signature, owner)
+ }
+ }
+}
diff --git a/src/library/scala/runtime/ScalaRunTime.scala b/src/library/scala/runtime/ScalaRunTime.scala
index 18fcbf8276..a0d89fc0e1 100644
--- a/src/library/scala/runtime/ScalaRunTime.scala
+++ b/src/library/scala/runtime/ScalaRunTime.scala
@@ -13,6 +13,7 @@ import scala.collection.{ Seq, IndexedSeq, TraversableView, AbstractIterator }
import scala.collection.mutable.WrappedArray
import scala.collection.immutable.{ StringLike, NumericRange, List, Stream, Nil, :: }
import scala.collection.generic.{ Sorted, IsTraversableLike }
+import scala.collection.parallel.ParIterable
import scala.reflect.{ ClassTag, classTag }
import scala.util.control.ControlThrowable
import java.lang.{ Class => jClass }
@@ -326,6 +327,7 @@ object ScalaRunTime {
case x: AnyRef if isArray(x) => arrayToString(x)
case x: scala.collection.Map[_, _] => x.iterator take maxElements map mapInner mkString (x.stringPrefix + "(", ", ", ")")
case x: Iterable[_] => x.iterator take maxElements map inner mkString (x.stringPrefix + "(", ", ", ")")
+ case x: ParIterable[_] => x.iterator take maxElements map inner mkString (x.stringPrefix + "(", ", ", ")")
case x: Traversable[_] => x take maxElements map inner mkString (x.stringPrefix + "(", ", ", ")")
case x: Product1[_] if isTuple(x) => "(" + inner(x._1) + ",)" // that special trailing comma
case x: Product if isTuple(x) => x.productIterator map inner mkString ("(", ",", ")")
diff --git a/src/library/scala/runtime/java8/JFunction.java b/src/library/scala/runtime/java8/JFunction.java
new file mode 100644
index 0000000000..326aad3fec
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction.java
@@ -0,0 +1,146 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+public final class JFunction {
+ private JFunction() {}
+ public static <R> scala.Function0<R> func(JFunction0<R> f) { return f; }
+ public static scala.Function0<BoxedUnit> proc(JProcedure0 p) { return p; }
+ public static scala.Function0<BoxedUnit> procSpecialized(JFunction0$mcV$sp f) { return f; }
+ public static scala.Function0<Byte> funcSpecialized(JFunction0$mcB$sp f) { return f; }
+ public static scala.Function0<Short> funcSpecialized(JFunction0$mcS$sp f) { return f; }
+ public static scala.Function0<Integer> funcSpecialized(JFunction0$mcI$sp f) { return f; }
+ public static scala.Function0<Long> funcSpecialized(JFunction0$mcJ$sp f) { return f; }
+ public static scala.Function0<Character> funcSpecialized(JFunction0$mcC$sp f) { return f; }
+ public static scala.Function0<Float> funcSpecialized(JFunction0$mcF$sp f) { return f; }
+ public static scala.Function0<Double> funcSpecialized(JFunction0$mcD$sp f) { return f; }
+ public static scala.Function0<Boolean> funcSpecialized(JFunction0$mcZ$sp f) { return f; }
+ public static <T1, R> scala.Function1<T1, R> func(JFunction1<T1, R> f) { return f; }
+ public static <T1> scala.Function1<T1, BoxedUnit> proc(JProcedure1<T1> p) { return p; }
+ public static scala.Function1<Integer, BoxedUnit> procSpecialized(JFunction1$mcVI$sp f) { return f; }
+ public static scala.Function1<Integer, Boolean> funcSpecialized(JFunction1$mcZI$sp f) { return f; }
+ public static scala.Function1<Integer, Integer> funcSpecialized(JFunction1$mcII$sp f) { return f; }
+ public static scala.Function1<Integer, Float> funcSpecialized(JFunction1$mcFI$sp f) { return f; }
+ public static scala.Function1<Integer, Long> funcSpecialized(JFunction1$mcJI$sp f) { return f; }
+ public static scala.Function1<Integer, Double> funcSpecialized(JFunction1$mcDI$sp f) { return f; }
+ public static scala.Function1<Long, BoxedUnit> procSpecialized(JFunction1$mcVJ$sp f) { return f; }
+ public static scala.Function1<Long, Boolean> funcSpecialized(JFunction1$mcZJ$sp f) { return f; }
+ public static scala.Function1<Long, Integer> funcSpecialized(JFunction1$mcIJ$sp f) { return f; }
+ public static scala.Function1<Long, Float> funcSpecialized(JFunction1$mcFJ$sp f) { return f; }
+ public static scala.Function1<Long, Long> funcSpecialized(JFunction1$mcJJ$sp f) { return f; }
+ public static scala.Function1<Long, Double> funcSpecialized(JFunction1$mcDJ$sp f) { return f; }
+ public static scala.Function1<Float, BoxedUnit> procSpecialized(JFunction1$mcVF$sp f) { return f; }
+ public static scala.Function1<Float, Boolean> funcSpecialized(JFunction1$mcZF$sp f) { return f; }
+ public static scala.Function1<Float, Integer> funcSpecialized(JFunction1$mcIF$sp f) { return f; }
+ public static scala.Function1<Float, Float> funcSpecialized(JFunction1$mcFF$sp f) { return f; }
+ public static scala.Function1<Float, Long> funcSpecialized(JFunction1$mcJF$sp f) { return f; }
+ public static scala.Function1<Float, Double> funcSpecialized(JFunction1$mcDF$sp f) { return f; }
+ public static scala.Function1<Double, BoxedUnit> procSpecialized(JFunction1$mcVD$sp f) { return f; }
+ public static scala.Function1<Double, Boolean> funcSpecialized(JFunction1$mcZD$sp f) { return f; }
+ public static scala.Function1<Double, Integer> funcSpecialized(JFunction1$mcID$sp f) { return f; }
+ public static scala.Function1<Double, Float> funcSpecialized(JFunction1$mcFD$sp f) { return f; }
+ public static scala.Function1<Double, Long> funcSpecialized(JFunction1$mcJD$sp f) { return f; }
+ public static scala.Function1<Double, Double> funcSpecialized(JFunction1$mcDD$sp f) { return f; }
+ public static <T1, T2, R> scala.Function2<T1, T2, R> func(JFunction2<T1, T2, R> f) { return f; }
+ public static <T1, T2> scala.Function2<T1, T2, BoxedUnit> proc(JProcedure2<T1, T2> p) { return p; }
+ public static scala.Function2<Integer, Integer, BoxedUnit> procSpecialized(JFunction2$mcVII$sp f) { return f; }
+ public static scala.Function2<Integer, Integer, Boolean> funcSpecialized(JFunction2$mcZII$sp f) { return f; }
+ public static scala.Function2<Integer, Integer, Integer> funcSpecialized(JFunction2$mcIII$sp f) { return f; }
+ public static scala.Function2<Integer, Integer, Float> funcSpecialized(JFunction2$mcFII$sp f) { return f; }
+ public static scala.Function2<Integer, Integer, Long> funcSpecialized(JFunction2$mcJII$sp f) { return f; }
+ public static scala.Function2<Integer, Integer, Double> funcSpecialized(JFunction2$mcDII$sp f) { return f; }
+ public static scala.Function2<Integer, Long, BoxedUnit> procSpecialized(JFunction2$mcVIJ$sp f) { return f; }
+ public static scala.Function2<Integer, Long, Boolean> funcSpecialized(JFunction2$mcZIJ$sp f) { return f; }
+ public static scala.Function2<Integer, Long, Integer> funcSpecialized(JFunction2$mcIIJ$sp f) { return f; }
+ public static scala.Function2<Integer, Long, Float> funcSpecialized(JFunction2$mcFIJ$sp f) { return f; }
+ public static scala.Function2<Integer, Long, Long> funcSpecialized(JFunction2$mcJIJ$sp f) { return f; }
+ public static scala.Function2<Integer, Long, Double> funcSpecialized(JFunction2$mcDIJ$sp f) { return f; }
+ public static scala.Function2<Integer, Double, BoxedUnit> procSpecialized(JFunction2$mcVID$sp f) { return f; }
+ public static scala.Function2<Integer, Double, Boolean> funcSpecialized(JFunction2$mcZID$sp f) { return f; }
+ public static scala.Function2<Integer, Double, Integer> funcSpecialized(JFunction2$mcIID$sp f) { return f; }
+ public static scala.Function2<Integer, Double, Float> funcSpecialized(JFunction2$mcFID$sp f) { return f; }
+ public static scala.Function2<Integer, Double, Long> funcSpecialized(JFunction2$mcJID$sp f) { return f; }
+ public static scala.Function2<Integer, Double, Double> funcSpecialized(JFunction2$mcDID$sp f) { return f; }
+ public static scala.Function2<Long, Integer, BoxedUnit> procSpecialized(JFunction2$mcVJI$sp f) { return f; }
+ public static scala.Function2<Long, Integer, Boolean> funcSpecialized(JFunction2$mcZJI$sp f) { return f; }
+ public static scala.Function2<Long, Integer, Integer> funcSpecialized(JFunction2$mcIJI$sp f) { return f; }
+ public static scala.Function2<Long, Integer, Float> funcSpecialized(JFunction2$mcFJI$sp f) { return f; }
+ public static scala.Function2<Long, Integer, Long> funcSpecialized(JFunction2$mcJJI$sp f) { return f; }
+ public static scala.Function2<Long, Integer, Double> funcSpecialized(JFunction2$mcDJI$sp f) { return f; }
+ public static scala.Function2<Long, Long, BoxedUnit> procSpecialized(JFunction2$mcVJJ$sp f) { return f; }
+ public static scala.Function2<Long, Long, Boolean> funcSpecialized(JFunction2$mcZJJ$sp f) { return f; }
+ public static scala.Function2<Long, Long, Integer> funcSpecialized(JFunction2$mcIJJ$sp f) { return f; }
+ public static scala.Function2<Long, Long, Float> funcSpecialized(JFunction2$mcFJJ$sp f) { return f; }
+ public static scala.Function2<Long, Long, Long> funcSpecialized(JFunction2$mcJJJ$sp f) { return f; }
+ public static scala.Function2<Long, Long, Double> funcSpecialized(JFunction2$mcDJJ$sp f) { return f; }
+ public static scala.Function2<Long, Double, BoxedUnit> procSpecialized(JFunction2$mcVJD$sp f) { return f; }
+ public static scala.Function2<Long, Double, Boolean> funcSpecialized(JFunction2$mcZJD$sp f) { return f; }
+ public static scala.Function2<Long, Double, Integer> funcSpecialized(JFunction2$mcIJD$sp f) { return f; }
+ public static scala.Function2<Long, Double, Float> funcSpecialized(JFunction2$mcFJD$sp f) { return f; }
+ public static scala.Function2<Long, Double, Long> funcSpecialized(JFunction2$mcJJD$sp f) { return f; }
+ public static scala.Function2<Long, Double, Double> funcSpecialized(JFunction2$mcDJD$sp f) { return f; }
+ public static scala.Function2<Double, Integer, BoxedUnit> procSpecialized(JFunction2$mcVDI$sp f) { return f; }
+ public static scala.Function2<Double, Integer, Boolean> funcSpecialized(JFunction2$mcZDI$sp f) { return f; }
+ public static scala.Function2<Double, Integer, Integer> funcSpecialized(JFunction2$mcIDI$sp f) { return f; }
+ public static scala.Function2<Double, Integer, Float> funcSpecialized(JFunction2$mcFDI$sp f) { return f; }
+ public static scala.Function2<Double, Integer, Long> funcSpecialized(JFunction2$mcJDI$sp f) { return f; }
+ public static scala.Function2<Double, Integer, Double> funcSpecialized(JFunction2$mcDDI$sp f) { return f; }
+ public static scala.Function2<Double, Long, BoxedUnit> procSpecialized(JFunction2$mcVDJ$sp f) { return f; }
+ public static scala.Function2<Double, Long, Boolean> funcSpecialized(JFunction2$mcZDJ$sp f) { return f; }
+ public static scala.Function2<Double, Long, Integer> funcSpecialized(JFunction2$mcIDJ$sp f) { return f; }
+ public static scala.Function2<Double, Long, Float> funcSpecialized(JFunction2$mcFDJ$sp f) { return f; }
+ public static scala.Function2<Double, Long, Long> funcSpecialized(JFunction2$mcJDJ$sp f) { return f; }
+ public static scala.Function2<Double, Long, Double> funcSpecialized(JFunction2$mcDDJ$sp f) { return f; }
+ public static scala.Function2<Double, Double, BoxedUnit> procSpecialized(JFunction2$mcVDD$sp f) { return f; }
+ public static scala.Function2<Double, Double, Boolean> funcSpecialized(JFunction2$mcZDD$sp f) { return f; }
+ public static scala.Function2<Double, Double, Integer> funcSpecialized(JFunction2$mcIDD$sp f) { return f; }
+ public static scala.Function2<Double, Double, Float> funcSpecialized(JFunction2$mcFDD$sp f) { return f; }
+ public static scala.Function2<Double, Double, Long> funcSpecialized(JFunction2$mcJDD$sp f) { return f; }
+ public static scala.Function2<Double, Double, Double> funcSpecialized(JFunction2$mcDDD$sp f) { return f; }
+ public static <T1, T2, T3, R> scala.Function3<T1, T2, T3, R> func(JFunction3<T1, T2, T3, R> f) { return f; }
+ public static <T1, T2, T3> scala.Function3<T1, T2, T3, BoxedUnit> proc(JProcedure3<T1, T2, T3> p) { return p; }
+ public static <T1, T2, T3, T4, R> scala.Function4<T1, T2, T3, T4, R> func(JFunction4<T1, T2, T3, T4, R> f) { return f; }
+ public static <T1, T2, T3, T4> scala.Function4<T1, T2, T3, T4, BoxedUnit> proc(JProcedure4<T1, T2, T3, T4> p) { return p; }
+ public static <T1, T2, T3, T4, T5, R> scala.Function5<T1, T2, T3, T4, T5, R> func(JFunction5<T1, T2, T3, T4, T5, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5> scala.Function5<T1, T2, T3, T4, T5, BoxedUnit> proc(JProcedure5<T1, T2, T3, T4, T5> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, R> scala.Function6<T1, T2, T3, T4, T5, T6, R> func(JFunction6<T1, T2, T3, T4, T5, T6, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6> scala.Function6<T1, T2, T3, T4, T5, T6, BoxedUnit> proc(JProcedure6<T1, T2, T3, T4, T5, T6> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, R> scala.Function7<T1, T2, T3, T4, T5, T6, T7, R> func(JFunction7<T1, T2, T3, T4, T5, T6, T7, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7> scala.Function7<T1, T2, T3, T4, T5, T6, T7, BoxedUnit> proc(JProcedure7<T1, T2, T3, T4, T5, T6, T7> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, R> scala.Function8<T1, T2, T3, T4, T5, T6, T7, T8, R> func(JFunction8<T1, T2, T3, T4, T5, T6, T7, T8, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8> scala.Function8<T1, T2, T3, T4, T5, T6, T7, T8, BoxedUnit> proc(JProcedure8<T1, T2, T3, T4, T5, T6, T7, T8> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, R> scala.Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> func(JFunction9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9> scala.Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, BoxedUnit> proc(JProcedure9<T1, T2, T3, T4, T5, T6, T7, T8, T9> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> scala.Function10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> func(JFunction10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> scala.Function10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, BoxedUnit> proc(JProcedure10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R> scala.Function11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R> func(JFunction11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> scala.Function11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, BoxedUnit> proc(JProcedure11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R> scala.Function12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R> func(JFunction12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> scala.Function12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, BoxedUnit> proc(JProcedure12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R> scala.Function13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R> func(JFunction13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> scala.Function13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, BoxedUnit> proc(JProcedure13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R> scala.Function14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R> func(JFunction14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> scala.Function14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, BoxedUnit> proc(JProcedure14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R> scala.Function15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R> func(JFunction15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> scala.Function15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, BoxedUnit> proc(JProcedure15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R> scala.Function16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R> func(JFunction16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> scala.Function16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, BoxedUnit> proc(JProcedure16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R> scala.Function17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R> func(JFunction17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> scala.Function17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, BoxedUnit> proc(JProcedure17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R> scala.Function18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R> func(JFunction18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> scala.Function18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, BoxedUnit> proc(JProcedure18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R> scala.Function19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R> func(JFunction19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> scala.Function19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, BoxedUnit> proc(JProcedure19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R> scala.Function20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R> func(JFunction20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> scala.Function20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, BoxedUnit> proc(JProcedure20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R> scala.Function21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R> func(JFunction21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> scala.Function21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, BoxedUnit> proc(JProcedure21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> p) { return p; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R> scala.Function22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R> func(JFunction22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R> f) { return f; }
+ public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> scala.Function22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, BoxedUnit> proc(JProcedure22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> p) { return p; }
+}
+
diff --git a/src/library/scala/runtime/java8/JFunction0$mcB$sp.java b/src/library/scala/runtime/java8/JFunction0$mcB$sp.java
new file mode 100644
index 0000000000..c882757630
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction0$mcB$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction0$mcB$sp extends JFunction0 {
+ byte apply$mcB$sp();
+
+ default Object apply() { return scala.runtime.BoxesRunTime.boxToByte(apply$mcB$sp()); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction0$mcC$sp.java b/src/library/scala/runtime/java8/JFunction0$mcC$sp.java
new file mode 100644
index 0000000000..c804529f71
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction0$mcC$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction0$mcC$sp extends JFunction0 {
+ char apply$mcC$sp();
+
+ default Object apply() { return scala.runtime.BoxesRunTime.boxToCharacter(apply$mcC$sp()); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction0$mcD$sp.java b/src/library/scala/runtime/java8/JFunction0$mcD$sp.java
new file mode 100644
index 0000000000..dacf50237c
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction0$mcD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction0$mcD$sp extends JFunction0 {
+ double apply$mcD$sp();
+
+ default Object apply() { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcD$sp()); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction0$mcF$sp.java b/src/library/scala/runtime/java8/JFunction0$mcF$sp.java
new file mode 100644
index 0000000000..2a9f824924
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction0$mcF$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction0$mcF$sp extends JFunction0 {
+ float apply$mcF$sp();
+
+ default Object apply() { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcF$sp()); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction0$mcI$sp.java b/src/library/scala/runtime/java8/JFunction0$mcI$sp.java
new file mode 100644
index 0000000000..75c612f916
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction0$mcI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction0$mcI$sp extends JFunction0 {
+ int apply$mcI$sp();
+
+ default Object apply() { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcI$sp()); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction0$mcJ$sp.java b/src/library/scala/runtime/java8/JFunction0$mcJ$sp.java
new file mode 100644
index 0000000000..d08984c794
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction0$mcJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction0$mcJ$sp extends JFunction0 {
+ long apply$mcJ$sp();
+
+ default Object apply() { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJ$sp()); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction0$mcS$sp.java b/src/library/scala/runtime/java8/JFunction0$mcS$sp.java
new file mode 100644
index 0000000000..d9e36a39f0
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction0$mcS$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction0$mcS$sp extends JFunction0 {
+ short apply$mcS$sp();
+
+ default Object apply() { return scala.runtime.BoxesRunTime.boxToShort(apply$mcS$sp()); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction0$mcV$sp.java b/src/library/scala/runtime/java8/JFunction0$mcV$sp.java
new file mode 100644
index 0000000000..abd5e6ebbe
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction0$mcV$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction0$mcV$sp extends JFunction0 {
+ void apply$mcV$sp();
+
+ default Object apply() { apply$mcV$sp(); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction0$mcZ$sp.java b/src/library/scala/runtime/java8/JFunction0$mcZ$sp.java
new file mode 100644
index 0000000000..e1cd62a913
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction0$mcZ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction0$mcZ$sp extends JFunction0 {
+ boolean apply$mcZ$sp();
+
+ default Object apply() { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZ$sp()); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction0.java b/src/library/scala/runtime/java8/JFunction0.java
new file mode 100644
index 0000000000..bdeb7d5f8e
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction0.java
@@ -0,0 +1,39 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction0<R> extends scala.Function0<R> {
+ default void $init$() {
+ };
+ default void apply$mcV$sp() {
+ apply();
+ }
+ default byte apply$mcB$sp() {
+ return scala.runtime.BoxesRunTime.unboxToByte(apply());
+ }
+ default short apply$mcS$sp() {
+ return scala.runtime.BoxesRunTime.unboxToShort(apply());
+ }
+ default int apply$mcI$sp() {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply());
+ }
+ default long apply$mcJ$sp() {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply());
+ }
+ default char apply$mcC$sp() {
+ return scala.runtime.BoxesRunTime.unboxToChar(apply());
+ }
+ default float apply$mcF$sp() {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply());
+ }
+ default double apply$mcD$sp() {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply());
+ }
+ default boolean apply$mcZ$sp() {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply());
+ }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcDD$sp.java b/src/library/scala/runtime/java8/JFunction1$mcDD$sp.java
new file mode 100644
index 0000000000..4fbb370b8b
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcDD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcDD$sp extends JFunction1 {
+ double apply$mcDD$sp(double v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDD$sp(scala.runtime.BoxesRunTime.unboxToDouble(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcDF$sp.java b/src/library/scala/runtime/java8/JFunction1$mcDF$sp.java
new file mode 100644
index 0000000000..ce45666dd1
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcDF$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcDF$sp extends JFunction1 {
+ double apply$mcDF$sp(float v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDF$sp(scala.runtime.BoxesRunTime.unboxToFloat(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcDI$sp.java b/src/library/scala/runtime/java8/JFunction1$mcDI$sp.java
new file mode 100644
index 0000000000..09cac947c9
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcDI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcDI$sp extends JFunction1 {
+ double apply$mcDI$sp(int v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDI$sp(scala.runtime.BoxesRunTime.unboxToInt(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcDJ$sp.java b/src/library/scala/runtime/java8/JFunction1$mcDJ$sp.java
new file mode 100644
index 0000000000..f5154c3854
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcDJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcDJ$sp extends JFunction1 {
+ double apply$mcDJ$sp(long v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDJ$sp(scala.runtime.BoxesRunTime.unboxToLong(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcFD$sp.java b/src/library/scala/runtime/java8/JFunction1$mcFD$sp.java
new file mode 100644
index 0000000000..758b432d99
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcFD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcFD$sp extends JFunction1 {
+ float apply$mcFD$sp(double v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFD$sp(scala.runtime.BoxesRunTime.unboxToDouble(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcFF$sp.java b/src/library/scala/runtime/java8/JFunction1$mcFF$sp.java
new file mode 100644
index 0000000000..7e13e287a5
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcFF$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcFF$sp extends JFunction1 {
+ float apply$mcFF$sp(float v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFF$sp(scala.runtime.BoxesRunTime.unboxToFloat(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcFI$sp.java b/src/library/scala/runtime/java8/JFunction1$mcFI$sp.java
new file mode 100644
index 0000000000..e3c4a203c7
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcFI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcFI$sp extends JFunction1 {
+ float apply$mcFI$sp(int v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFI$sp(scala.runtime.BoxesRunTime.unboxToInt(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcFJ$sp.java b/src/library/scala/runtime/java8/JFunction1$mcFJ$sp.java
new file mode 100644
index 0000000000..d989fa1ea8
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcFJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcFJ$sp extends JFunction1 {
+ float apply$mcFJ$sp(long v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFJ$sp(scala.runtime.BoxesRunTime.unboxToLong(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcID$sp.java b/src/library/scala/runtime/java8/JFunction1$mcID$sp.java
new file mode 100644
index 0000000000..bde5d88d46
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcID$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcID$sp extends JFunction1 {
+ int apply$mcID$sp(double v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcID$sp(scala.runtime.BoxesRunTime.unboxToDouble(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcIF$sp.java b/src/library/scala/runtime/java8/JFunction1$mcIF$sp.java
new file mode 100644
index 0000000000..d1d235aef1
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcIF$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcIF$sp extends JFunction1 {
+ int apply$mcIF$sp(float v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcIF$sp(scala.runtime.BoxesRunTime.unboxToFloat(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcII$sp.java b/src/library/scala/runtime/java8/JFunction1$mcII$sp.java
new file mode 100644
index 0000000000..ef44b3830c
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcII$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcII$sp extends JFunction1 {
+ int apply$mcII$sp(int v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcII$sp(scala.runtime.BoxesRunTime.unboxToInt(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcIJ$sp.java b/src/library/scala/runtime/java8/JFunction1$mcIJ$sp.java
new file mode 100644
index 0000000000..373d13cd46
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcIJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcIJ$sp extends JFunction1 {
+ int apply$mcIJ$sp(long v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcIJ$sp(scala.runtime.BoxesRunTime.unboxToLong(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcJD$sp.java b/src/library/scala/runtime/java8/JFunction1$mcJD$sp.java
new file mode 100644
index 0000000000..86fd7b7779
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcJD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcJD$sp extends JFunction1 {
+ long apply$mcJD$sp(double v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJD$sp(scala.runtime.BoxesRunTime.unboxToDouble(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcJF$sp.java b/src/library/scala/runtime/java8/JFunction1$mcJF$sp.java
new file mode 100644
index 0000000000..3bcf264034
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcJF$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcJF$sp extends JFunction1 {
+ long apply$mcJF$sp(float v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJF$sp(scala.runtime.BoxesRunTime.unboxToFloat(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcJI$sp.java b/src/library/scala/runtime/java8/JFunction1$mcJI$sp.java
new file mode 100644
index 0000000000..11bc15ef6e
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcJI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcJI$sp extends JFunction1 {
+ long apply$mcJI$sp(int v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJI$sp(scala.runtime.BoxesRunTime.unboxToInt(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcJJ$sp.java b/src/library/scala/runtime/java8/JFunction1$mcJJ$sp.java
new file mode 100644
index 0000000000..2e1ad7878f
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcJJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcJJ$sp extends JFunction1 {
+ long apply$mcJJ$sp(long v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJJ$sp(scala.runtime.BoxesRunTime.unboxToLong(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcVD$sp.java b/src/library/scala/runtime/java8/JFunction1$mcVD$sp.java
new file mode 100644
index 0000000000..c8077e1268
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcVD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcVD$sp extends JFunction1 {
+ void apply$mcVD$sp(double v1);
+
+ default Object apply(Object t) { apply$mcVD$sp(scala.runtime.BoxesRunTime.unboxToDouble(t)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcVF$sp.java b/src/library/scala/runtime/java8/JFunction1$mcVF$sp.java
new file mode 100644
index 0000000000..e7be77f8e3
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcVF$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcVF$sp extends JFunction1 {
+ void apply$mcVF$sp(float v1);
+
+ default Object apply(Object t) { apply$mcVF$sp(scala.runtime.BoxesRunTime.unboxToFloat(t)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcVI$sp.java b/src/library/scala/runtime/java8/JFunction1$mcVI$sp.java
new file mode 100644
index 0000000000..7597ca5294
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcVI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcVI$sp extends JFunction1 {
+ void apply$mcVI$sp(int v1);
+
+ default Object apply(Object t) { apply$mcVI$sp(scala.runtime.BoxesRunTime.unboxToInt(t)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcVJ$sp.java b/src/library/scala/runtime/java8/JFunction1$mcVJ$sp.java
new file mode 100644
index 0000000000..55c6c3997f
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcVJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcVJ$sp extends JFunction1 {
+ void apply$mcVJ$sp(long v1);
+
+ default Object apply(Object t) { apply$mcVJ$sp(scala.runtime.BoxesRunTime.unboxToLong(t)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcZD$sp.java b/src/library/scala/runtime/java8/JFunction1$mcZD$sp.java
new file mode 100644
index 0000000000..883a0e84fa
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcZD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcZD$sp extends JFunction1 {
+ boolean apply$mcZD$sp(double v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZD$sp(scala.runtime.BoxesRunTime.unboxToDouble(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcZF$sp.java b/src/library/scala/runtime/java8/JFunction1$mcZF$sp.java
new file mode 100644
index 0000000000..884832ca37
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcZF$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcZF$sp extends JFunction1 {
+ boolean apply$mcZF$sp(float v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZF$sp(scala.runtime.BoxesRunTime.unboxToFloat(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcZI$sp.java b/src/library/scala/runtime/java8/JFunction1$mcZI$sp.java
new file mode 100644
index 0000000000..8a51aa99a2
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcZI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcZI$sp extends JFunction1 {
+ boolean apply$mcZI$sp(int v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZI$sp(scala.runtime.BoxesRunTime.unboxToInt(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1$mcZJ$sp.java b/src/library/scala/runtime/java8/JFunction1$mcZJ$sp.java
new file mode 100644
index 0000000000..dc619666dc
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1$mcZJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1$mcZJ$sp extends JFunction1 {
+ boolean apply$mcZJ$sp(long v1);
+
+ default Object apply(Object t) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZJ$sp(scala.runtime.BoxesRunTime.unboxToLong(t))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction1.java b/src/library/scala/runtime/java8/JFunction1.java
new file mode 100644
index 0000000000..7c3974e94a
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction1.java
@@ -0,0 +1,240 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction1<T1, R> extends scala.Function1<T1, R> {
+ default void $init$() {
+ };
+
+ @Override
+ default <A> scala.Function1<T1, A> andThen(scala.Function1<R, A> g) {
+ return scala.Function1$class.andThen(this, g);
+ }
+
+ @Override
+ default <A> scala.Function1<A, R> compose(scala.Function1<A, T1> g) {
+ return scala.Function1$class.compose(this, g);
+ }
+ default void apply$mcVI$sp(int v1) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1));
+ }
+ default boolean apply$mcZI$sp(int v1) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1)));
+ }
+ default int apply$mcII$sp(int v1) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1)));
+ }
+ default float apply$mcFI$sp(int v1) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1)));
+ }
+ default long apply$mcJI$sp(int v1) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1)));
+ }
+ default double apply$mcDI$sp(int v1) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1)));
+ }
+ default void apply$mcVJ$sp(long v1) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1));
+ }
+ default boolean apply$mcZJ$sp(long v1) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1)));
+ }
+ default int apply$mcIJ$sp(long v1) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1)));
+ }
+ default float apply$mcFJ$sp(long v1) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1)));
+ }
+ default long apply$mcJJ$sp(long v1) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1)));
+ }
+ default double apply$mcDJ$sp(long v1) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1)));
+ }
+ default void apply$mcVF$sp(float v1) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToFloat(v1));
+ }
+ default boolean apply$mcZF$sp(float v1) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToFloat(v1)));
+ }
+ default int apply$mcIF$sp(float v1) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToFloat(v1)));
+ }
+ default float apply$mcFF$sp(float v1) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToFloat(v1)));
+ }
+ default long apply$mcJF$sp(float v1) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToFloat(v1)));
+ }
+ default double apply$mcDF$sp(float v1) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToFloat(v1)));
+ }
+ default void apply$mcVD$sp(double v1) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1));
+ }
+ default boolean apply$mcZD$sp(double v1) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1)));
+ }
+ default int apply$mcID$sp(double v1) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1)));
+ }
+ default float apply$mcFD$sp(double v1) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1)));
+ }
+ default long apply$mcJD$sp(double v1) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1)));
+ }
+ default double apply$mcDD$sp(double v1) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1)));
+ }
+
+ default scala.Function1 compose$mcVI$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcZI$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcII$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcFI$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcJI$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcDI$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcVJ$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcZJ$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcIJ$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcFJ$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcJJ$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcDJ$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcVF$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcZF$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcIF$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcFF$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcJF$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcDF$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcVD$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcZD$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcID$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcFD$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcJD$sp(scala.Function1 g) {
+ return compose(g);
+ }
+ default scala.Function1 compose$mcDD$sp(scala.Function1 g) {
+ return compose(g);
+ }
+
+ default scala.Function1 andThen$mcVI$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcZI$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcII$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcFI$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcJI$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcDI$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcVJ$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcZJ$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcIJ$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcFJ$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcJJ$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcDJ$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcVF$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcZF$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcIF$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcFF$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcJF$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcDF$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcVD$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcZD$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcID$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcFD$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcJD$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+ default scala.Function1 andThen$mcDD$sp(scala.Function1 g) {
+ return andThen(g);
+ }
+}
diff --git a/src/library/scala/runtime/java8/JFunction10.java b/src/library/scala/runtime/java8/JFunction10.java
new file mode 100644
index 0000000000..f9af616641
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction10.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> extends scala.Function10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, R>>>>>>>>>> curried() {
+ return scala.Function10$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, R> tupled() {
+ return scala.Function10$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction11.java b/src/library/scala/runtime/java8/JFunction11.java
new file mode 100644
index 0000000000..ba1235332b
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction11.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R> extends scala.Function11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, R>>>>>>>>>>> curried() {
+ return scala.Function11$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, R> tupled() {
+ return scala.Function11$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction12.java b/src/library/scala/runtime/java8/JFunction12.java
new file mode 100644
index 0000000000..141388e768
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction12.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R> extends scala.Function12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, scala.Function1<T12, R>>>>>>>>>>>> curried() {
+ return scala.Function12$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, R> tupled() {
+ return scala.Function12$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction13.java b/src/library/scala/runtime/java8/JFunction13.java
new file mode 100644
index 0000000000..8d0be96a74
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction13.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R> extends scala.Function13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, scala.Function1<T12, scala.Function1<T13, R>>>>>>>>>>>>> curried() {
+ return scala.Function13$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, R> tupled() {
+ return scala.Function13$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction14.java b/src/library/scala/runtime/java8/JFunction14.java
new file mode 100644
index 0000000000..58ab028716
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction14.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R> extends scala.Function14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, scala.Function1<T12, scala.Function1<T13, scala.Function1<T14, R>>>>>>>>>>>>>> curried() {
+ return scala.Function14$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, R> tupled() {
+ return scala.Function14$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction15.java b/src/library/scala/runtime/java8/JFunction15.java
new file mode 100644
index 0000000000..89a4a6cf61
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction15.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R> extends scala.Function15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, scala.Function1<T12, scala.Function1<T13, scala.Function1<T14, scala.Function1<T15, R>>>>>>>>>>>>>>> curried() {
+ return scala.Function15$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, R> tupled() {
+ return scala.Function15$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction16.java b/src/library/scala/runtime/java8/JFunction16.java
new file mode 100644
index 0000000000..e3287b42ac
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction16.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R> extends scala.Function16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, scala.Function1<T12, scala.Function1<T13, scala.Function1<T14, scala.Function1<T15, scala.Function1<T16, R>>>>>>>>>>>>>>>> curried() {
+ return scala.Function16$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, R> tupled() {
+ return scala.Function16$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction17.java b/src/library/scala/runtime/java8/JFunction17.java
new file mode 100644
index 0000000000..508614e8b4
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction17.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R> extends scala.Function17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, scala.Function1<T12, scala.Function1<T13, scala.Function1<T14, scala.Function1<T15, scala.Function1<T16, scala.Function1<T17, R>>>>>>>>>>>>>>>>> curried() {
+ return scala.Function17$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>, R> tupled() {
+ return scala.Function17$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction18.java b/src/library/scala/runtime/java8/JFunction18.java
new file mode 100644
index 0000000000..8aa9c5e2c3
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction18.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R> extends scala.Function18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, scala.Function1<T12, scala.Function1<T13, scala.Function1<T14, scala.Function1<T15, scala.Function1<T16, scala.Function1<T17, scala.Function1<T18, R>>>>>>>>>>>>>>>>>> curried() {
+ return scala.Function18$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>, R> tupled() {
+ return scala.Function18$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction19.java b/src/library/scala/runtime/java8/JFunction19.java
new file mode 100644
index 0000000000..89d739366e
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction19.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R> extends scala.Function19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, scala.Function1<T12, scala.Function1<T13, scala.Function1<T14, scala.Function1<T15, scala.Function1<T16, scala.Function1<T17, scala.Function1<T18, scala.Function1<T19, R>>>>>>>>>>>>>>>>>>> curried() {
+ return scala.Function19$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>, R> tupled() {
+ return scala.Function19$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcDDD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcDDD$sp.java
new file mode 100644
index 0000000000..1c11fb5252
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcDDD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcDDD$sp extends JFunction2 {
+ double apply$mcDDD$sp(double v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDDD$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcDDI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcDDI$sp.java
new file mode 100644
index 0000000000..e080bc87fa
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcDDI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcDDI$sp extends JFunction2 {
+ double apply$mcDDI$sp(double v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDDI$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcDDJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcDDJ$sp.java
new file mode 100644
index 0000000000..f96b19dff7
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcDDJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcDDJ$sp extends JFunction2 {
+ double apply$mcDDJ$sp(double v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDDJ$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcDID$sp.java b/src/library/scala/runtime/java8/JFunction2$mcDID$sp.java
new file mode 100644
index 0000000000..944f469a6d
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcDID$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcDID$sp extends JFunction2 {
+ double apply$mcDID$sp(int v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDID$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcDII$sp.java b/src/library/scala/runtime/java8/JFunction2$mcDII$sp.java
new file mode 100644
index 0000000000..a04f616b5a
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcDII$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcDII$sp extends JFunction2 {
+ double apply$mcDII$sp(int v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDII$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcDIJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcDIJ$sp.java
new file mode 100644
index 0000000000..3a7d33d4a5
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcDIJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcDIJ$sp extends JFunction2 {
+ double apply$mcDIJ$sp(int v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDIJ$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcDJD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcDJD$sp.java
new file mode 100644
index 0000000000..86b48486e6
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcDJD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcDJD$sp extends JFunction2 {
+ double apply$mcDJD$sp(long v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDJD$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcDJI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcDJI$sp.java
new file mode 100644
index 0000000000..b9375c7870
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcDJI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcDJI$sp extends JFunction2 {
+ double apply$mcDJI$sp(long v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDJI$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcDJJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcDJJ$sp.java
new file mode 100644
index 0000000000..4adbd17e14
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcDJJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcDJJ$sp extends JFunction2 {
+ double apply$mcDJJ$sp(long v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToDouble(apply$mcDJJ$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcFDD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcFDD$sp.java
new file mode 100644
index 0000000000..7e53d117c7
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcFDD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcFDD$sp extends JFunction2 {
+ float apply$mcFDD$sp(double v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFDD$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcFDI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcFDI$sp.java
new file mode 100644
index 0000000000..64c4b2f133
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcFDI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcFDI$sp extends JFunction2 {
+ float apply$mcFDI$sp(double v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFDI$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcFDJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcFDJ$sp.java
new file mode 100644
index 0000000000..c7ffcbc66a
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcFDJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcFDJ$sp extends JFunction2 {
+ float apply$mcFDJ$sp(double v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFDJ$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcFID$sp.java b/src/library/scala/runtime/java8/JFunction2$mcFID$sp.java
new file mode 100644
index 0000000000..43944751e6
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcFID$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcFID$sp extends JFunction2 {
+ float apply$mcFID$sp(int v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFID$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcFII$sp.java b/src/library/scala/runtime/java8/JFunction2$mcFII$sp.java
new file mode 100644
index 0000000000..a9a4540ca3
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcFII$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcFII$sp extends JFunction2 {
+ float apply$mcFII$sp(int v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFII$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcFIJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcFIJ$sp.java
new file mode 100644
index 0000000000..217615c7a3
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcFIJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcFIJ$sp extends JFunction2 {
+ float apply$mcFIJ$sp(int v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFIJ$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcFJD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcFJD$sp.java
new file mode 100644
index 0000000000..8400e47876
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcFJD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcFJD$sp extends JFunction2 {
+ float apply$mcFJD$sp(long v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFJD$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcFJI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcFJI$sp.java
new file mode 100644
index 0000000000..e6b6259f96
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcFJI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcFJI$sp extends JFunction2 {
+ float apply$mcFJI$sp(long v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFJI$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcFJJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcFJJ$sp.java
new file mode 100644
index 0000000000..68a4c8ecc0
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcFJJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcFJJ$sp extends JFunction2 {
+ float apply$mcFJJ$sp(long v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToFloat(apply$mcFJJ$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcIDD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcIDD$sp.java
new file mode 100644
index 0000000000..76fe0b6ead
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcIDD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcIDD$sp extends JFunction2 {
+ int apply$mcIDD$sp(double v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcIDD$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcIDI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcIDI$sp.java
new file mode 100644
index 0000000000..908078f735
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcIDI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcIDI$sp extends JFunction2 {
+ int apply$mcIDI$sp(double v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcIDI$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcIDJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcIDJ$sp.java
new file mode 100644
index 0000000000..35c943e324
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcIDJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcIDJ$sp extends JFunction2 {
+ int apply$mcIDJ$sp(double v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcIDJ$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcIID$sp.java b/src/library/scala/runtime/java8/JFunction2$mcIID$sp.java
new file mode 100644
index 0000000000..f245ec8788
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcIID$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcIID$sp extends JFunction2 {
+ int apply$mcIID$sp(int v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcIID$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcIII$sp.java b/src/library/scala/runtime/java8/JFunction2$mcIII$sp.java
new file mode 100644
index 0000000000..f3a7a56dff
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcIII$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcIII$sp extends JFunction2 {
+ int apply$mcIII$sp(int v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcIII$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcIIJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcIIJ$sp.java
new file mode 100644
index 0000000000..9736196b9e
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcIIJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcIIJ$sp extends JFunction2 {
+ int apply$mcIIJ$sp(int v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcIIJ$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcIJD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcIJD$sp.java
new file mode 100644
index 0000000000..3211432ccb
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcIJD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcIJD$sp extends JFunction2 {
+ int apply$mcIJD$sp(long v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcIJD$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcIJI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcIJI$sp.java
new file mode 100644
index 0000000000..74f76404e0
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcIJI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcIJI$sp extends JFunction2 {
+ int apply$mcIJI$sp(long v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcIJI$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcIJJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcIJJ$sp.java
new file mode 100644
index 0000000000..7b9060bcb8
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcIJJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcIJJ$sp extends JFunction2 {
+ int apply$mcIJJ$sp(long v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToInteger(apply$mcIJJ$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcJDD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcJDD$sp.java
new file mode 100644
index 0000000000..b4595cdf6a
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcJDD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcJDD$sp extends JFunction2 {
+ long apply$mcJDD$sp(double v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJDD$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcJDI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcJDI$sp.java
new file mode 100644
index 0000000000..59aad669e7
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcJDI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcJDI$sp extends JFunction2 {
+ long apply$mcJDI$sp(double v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJDI$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcJDJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcJDJ$sp.java
new file mode 100644
index 0000000000..8111e03617
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcJDJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcJDJ$sp extends JFunction2 {
+ long apply$mcJDJ$sp(double v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJDJ$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcJID$sp.java b/src/library/scala/runtime/java8/JFunction2$mcJID$sp.java
new file mode 100644
index 0000000000..8a06a40a4a
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcJID$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcJID$sp extends JFunction2 {
+ long apply$mcJID$sp(int v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJID$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcJII$sp.java b/src/library/scala/runtime/java8/JFunction2$mcJII$sp.java
new file mode 100644
index 0000000000..3d2e03ddbc
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcJII$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcJII$sp extends JFunction2 {
+ long apply$mcJII$sp(int v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJII$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcJIJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcJIJ$sp.java
new file mode 100644
index 0000000000..32408269c8
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcJIJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcJIJ$sp extends JFunction2 {
+ long apply$mcJIJ$sp(int v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJIJ$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcJJD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcJJD$sp.java
new file mode 100644
index 0000000000..cf75bc5c19
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcJJD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcJJD$sp extends JFunction2 {
+ long apply$mcJJD$sp(long v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJJD$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcJJI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcJJI$sp.java
new file mode 100644
index 0000000000..eddcea671d
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcJJI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcJJI$sp extends JFunction2 {
+ long apply$mcJJI$sp(long v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJJI$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcJJJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcJJJ$sp.java
new file mode 100644
index 0000000000..4f5626a3e6
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcJJJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcJJJ$sp extends JFunction2 {
+ long apply$mcJJJ$sp(long v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToLong(apply$mcJJJ$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcVDD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcVDD$sp.java
new file mode 100644
index 0000000000..45b9739c91
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcVDD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcVDD$sp extends JFunction2 {
+ void apply$mcVDD$sp(double v1, double v2);
+
+ default Object apply(Object v1, Object v2) { apply$mcVDD$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcVDI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcVDI$sp.java
new file mode 100644
index 0000000000..c344ea5017
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcVDI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcVDI$sp extends JFunction2 {
+ void apply$mcVDI$sp(double v1, int v2);
+
+ default Object apply(Object v1, Object v2) { apply$mcVDI$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToInt(v2)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcVDJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcVDJ$sp.java
new file mode 100644
index 0000000000..94b01d59d5
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcVDJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcVDJ$sp extends JFunction2 {
+ void apply$mcVDJ$sp(double v1, long v2);
+
+ default Object apply(Object v1, Object v2) { apply$mcVDJ$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToLong(v2)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcVID$sp.java b/src/library/scala/runtime/java8/JFunction2$mcVID$sp.java
new file mode 100644
index 0000000000..47c29525a7
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcVID$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcVID$sp extends JFunction2 {
+ void apply$mcVID$sp(int v1, double v2);
+
+ default Object apply(Object v1, Object v2) { apply$mcVID$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcVII$sp.java b/src/library/scala/runtime/java8/JFunction2$mcVII$sp.java
new file mode 100644
index 0000000000..546a994cb9
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcVII$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcVII$sp extends JFunction2 {
+ void apply$mcVII$sp(int v1, int v2);
+
+ default Object apply(Object v1, Object v2) { apply$mcVII$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToInt(v2)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcVIJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcVIJ$sp.java
new file mode 100644
index 0000000000..d9871efee3
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcVIJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcVIJ$sp extends JFunction2 {
+ void apply$mcVIJ$sp(int v1, long v2);
+
+ default Object apply(Object v1, Object v2) { apply$mcVIJ$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToLong(v2)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcVJD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcVJD$sp.java
new file mode 100644
index 0000000000..525c8ee059
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcVJD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcVJD$sp extends JFunction2 {
+ void apply$mcVJD$sp(long v1, double v2);
+
+ default Object apply(Object v1, Object v2) { apply$mcVJD$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcVJI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcVJI$sp.java
new file mode 100644
index 0000000000..98f33bf942
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcVJI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcVJI$sp extends JFunction2 {
+ void apply$mcVJI$sp(long v1, int v2);
+
+ default Object apply(Object v1, Object v2) { apply$mcVJI$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToInt(v2)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcVJJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcVJJ$sp.java
new file mode 100644
index 0000000000..adb8934b57
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcVJJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcVJJ$sp extends JFunction2 {
+ void apply$mcVJJ$sp(long v1, long v2);
+
+ default Object apply(Object v1, Object v2) { apply$mcVJJ$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToLong(v2)); return scala.runtime.BoxedUnit.UNIT; }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcZDD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcZDD$sp.java
new file mode 100644
index 0000000000..9272e025a6
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcZDD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcZDD$sp extends JFunction2 {
+ boolean apply$mcZDD$sp(double v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZDD$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcZDI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcZDI$sp.java
new file mode 100644
index 0000000000..4406e00abd
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcZDI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcZDI$sp extends JFunction2 {
+ boolean apply$mcZDI$sp(double v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZDI$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcZDJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcZDJ$sp.java
new file mode 100644
index 0000000000..1f92dddfaf
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcZDJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcZDJ$sp extends JFunction2 {
+ boolean apply$mcZDJ$sp(double v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZDJ$sp(scala.runtime.BoxesRunTime.unboxToDouble(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcZID$sp.java b/src/library/scala/runtime/java8/JFunction2$mcZID$sp.java
new file mode 100644
index 0000000000..06b73f9897
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcZID$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcZID$sp extends JFunction2 {
+ boolean apply$mcZID$sp(int v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZID$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcZII$sp.java b/src/library/scala/runtime/java8/JFunction2$mcZII$sp.java
new file mode 100644
index 0000000000..729f86063f
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcZII$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcZII$sp extends JFunction2 {
+ boolean apply$mcZII$sp(int v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZII$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcZIJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcZIJ$sp.java
new file mode 100644
index 0000000000..38da681cd1
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcZIJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcZIJ$sp extends JFunction2 {
+ boolean apply$mcZIJ$sp(int v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZIJ$sp(scala.runtime.BoxesRunTime.unboxToInt(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcZJD$sp.java b/src/library/scala/runtime/java8/JFunction2$mcZJD$sp.java
new file mode 100644
index 0000000000..6dc9534811
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcZJD$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcZJD$sp extends JFunction2 {
+ boolean apply$mcZJD$sp(long v1, double v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZJD$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToDouble(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcZJI$sp.java b/src/library/scala/runtime/java8/JFunction2$mcZJI$sp.java
new file mode 100644
index 0000000000..a86f63be36
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcZJI$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcZJI$sp extends JFunction2 {
+ boolean apply$mcZJI$sp(long v1, int v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZJI$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToInt(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2$mcZJJ$sp.java b/src/library/scala/runtime/java8/JFunction2$mcZJJ$sp.java
new file mode 100644
index 0000000000..728a781e8e
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2$mcZJJ$sp.java
@@ -0,0 +1,13 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2$mcZJJ$sp extends JFunction2 {
+ boolean apply$mcZJJ$sp(long v1, long v2);
+
+ default Object apply(Object v1, Object v2) { return scala.runtime.BoxesRunTime.boxToBoolean(apply$mcZJJ$sp(scala.runtime.BoxesRunTime.unboxToLong(v1), scala.runtime.BoxesRunTime.unboxToLong(v2))); }
+}
diff --git a/src/library/scala/runtime/java8/JFunction2.java b/src/library/scala/runtime/java8/JFunction2.java
new file mode 100644
index 0000000000..41f2adeae9
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction2.java
@@ -0,0 +1,509 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction2<T1, T2, R> extends scala.Function2<T1, T2, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, R>> curried() {
+ return scala.Function2$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple2<T1, T2>, R> tupled() {
+ return scala.Function2$class.tupled(this);
+ }
+
+ default void apply$mcVII$sp(int v1, int v2) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2));
+ }
+ default boolean apply$mcZII$sp(int v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default int apply$mcIII$sp(int v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default float apply$mcFII$sp(int v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default long apply$mcJII$sp(int v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default double apply$mcDII$sp(int v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default void apply$mcVIJ$sp(int v1, long v2) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2));
+ }
+ default boolean apply$mcZIJ$sp(int v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default int apply$mcIIJ$sp(int v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default float apply$mcFIJ$sp(int v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default long apply$mcJIJ$sp(int v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default double apply$mcDIJ$sp(int v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default void apply$mcVID$sp(int v1, double v2) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2));
+ }
+ default boolean apply$mcZID$sp(int v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default int apply$mcIID$sp(int v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default float apply$mcFID$sp(int v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default long apply$mcJID$sp(int v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default double apply$mcDID$sp(int v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToInteger(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default void apply$mcVJI$sp(long v1, int v2) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2));
+ }
+ default boolean apply$mcZJI$sp(long v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default int apply$mcIJI$sp(long v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default float apply$mcFJI$sp(long v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default long apply$mcJJI$sp(long v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default double apply$mcDJI$sp(long v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default void apply$mcVJJ$sp(long v1, long v2) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2));
+ }
+ default boolean apply$mcZJJ$sp(long v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default int apply$mcIJJ$sp(long v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default float apply$mcFJJ$sp(long v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default long apply$mcJJJ$sp(long v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default double apply$mcDJJ$sp(long v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default void apply$mcVJD$sp(long v1, double v2) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2));
+ }
+ default boolean apply$mcZJD$sp(long v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default int apply$mcIJD$sp(long v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default float apply$mcFJD$sp(long v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default long apply$mcJJD$sp(long v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default double apply$mcDJD$sp(long v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToLong(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default void apply$mcVDI$sp(double v1, int v2) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2));
+ }
+ default boolean apply$mcZDI$sp(double v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default int apply$mcIDI$sp(double v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default float apply$mcFDI$sp(double v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default long apply$mcJDI$sp(double v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default double apply$mcDDI$sp(double v1, int v2) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToInteger(v2)));
+ }
+ default void apply$mcVDJ$sp(double v1, long v2) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2));
+ }
+ default boolean apply$mcZDJ$sp(double v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default int apply$mcIDJ$sp(double v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default float apply$mcFDJ$sp(double v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default long apply$mcJDJ$sp(double v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default double apply$mcDDJ$sp(double v1, long v2) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToLong(v2)));
+ }
+ default void apply$mcVDD$sp(double v1, double v2) {
+ apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2));
+ }
+ default boolean apply$mcZDD$sp(double v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToBoolean(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default int apply$mcIDD$sp(double v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToInt(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default float apply$mcFDD$sp(double v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToFloat(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default long apply$mcJDD$sp(double v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToLong(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+ default double apply$mcDDD$sp(double v1, double v2) {
+ return scala.runtime.BoxesRunTime.unboxToDouble(apply((T1) scala.runtime.BoxesRunTime.boxToDouble(v1), (T2) scala.runtime.BoxesRunTime.boxToDouble(v2)));
+ }
+
+ default scala.Function1 curried$mcVII$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcZII$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcIII$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcFII$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcJII$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcDII$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcVIJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcZIJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcIIJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcFIJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcJIJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcDIJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcVID$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcZID$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcIID$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcFID$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcJID$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcDID$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcVJI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcZJI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcIJI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcFJI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcJJI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcDJI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcVJJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcZJJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcIJJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcFJJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcJJJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcDJJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcVJD$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcZJD$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcIJD$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcFJD$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcJJD$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcDJD$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcVDI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcZDI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcIDI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcFDI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcJDI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcDDI$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcVDJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcZDJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcIDJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcFDJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcJDJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcDDJ$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcVDD$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcZDD$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcIDD$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcFDD$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcJDD$sp() {
+ return curried();
+ }
+ default scala.Function1 curried$mcDDD$sp() {
+ return curried();
+ }
+
+ default scala.Function1 tupled$mcVII$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcZII$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcIII$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcFII$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcJII$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcDII$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcVIJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcZIJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcIIJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcFIJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcJIJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcDIJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcVID$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcZID$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcIID$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcFID$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcJID$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcDID$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcVJI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcZJI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcIJI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcFJI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcJJI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcDJI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcVJJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcZJJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcIJJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcFJJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcJJJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcDJJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcVJD$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcZJD$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcIJD$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcFJD$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcJJD$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcDJD$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcVDI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcZDI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcIDI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcFDI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcJDI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcDDI$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcVDJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcZDJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcIDJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcFDJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcJDJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcDDJ$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcVDD$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcZDD$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcIDD$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcFDD$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcJDD$sp() {
+ return tupled();
+ }
+ default scala.Function1 tupled$mcDDD$sp() {
+ return tupled();
+ }
+}
diff --git a/src/library/scala/runtime/java8/JFunction20.java b/src/library/scala/runtime/java8/JFunction20.java
new file mode 100644
index 0000000000..b8b4c11af7
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction20.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R> extends scala.Function20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, scala.Function1<T12, scala.Function1<T13, scala.Function1<T14, scala.Function1<T15, scala.Function1<T16, scala.Function1<T17, scala.Function1<T18, scala.Function1<T19, scala.Function1<T20, R>>>>>>>>>>>>>>>>>>>> curried() {
+ return scala.Function20$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>, R> tupled() {
+ return scala.Function20$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction21.java b/src/library/scala/runtime/java8/JFunction21.java
new file mode 100644
index 0000000000..dbae0a0479
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction21.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R> extends scala.Function21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, scala.Function1<T12, scala.Function1<T13, scala.Function1<T14, scala.Function1<T15, scala.Function1<T16, scala.Function1<T17, scala.Function1<T18, scala.Function1<T19, scala.Function1<T20, scala.Function1<T21, R>>>>>>>>>>>>>>>>>>>>> curried() {
+ return scala.Function21$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>, R> tupled() {
+ return scala.Function21$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction22.java b/src/library/scala/runtime/java8/JFunction22.java
new file mode 100644
index 0000000000..2926ae336d
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction22.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R> extends scala.Function22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, scala.Function1<T10, scala.Function1<T11, scala.Function1<T12, scala.Function1<T13, scala.Function1<T14, scala.Function1<T15, scala.Function1<T16, scala.Function1<T17, scala.Function1<T18, scala.Function1<T19, scala.Function1<T20, scala.Function1<T21, scala.Function1<T22, R>>>>>>>>>>>>>>>>>>>>>> curried() {
+ return scala.Function22$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>, R> tupled() {
+ return scala.Function22$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction3.java b/src/library/scala/runtime/java8/JFunction3.java
new file mode 100644
index 0000000000..b75da0669b
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction3.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction3<T1, T2, T3, R> extends scala.Function3<T1, T2, T3, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, R>>> curried() {
+ return scala.Function3$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple3<T1, T2, T3>, R> tupled() {
+ return scala.Function3$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction4.java b/src/library/scala/runtime/java8/JFunction4.java
new file mode 100644
index 0000000000..20f89141bd
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction4.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction4<T1, T2, T3, T4, R> extends scala.Function4<T1, T2, T3, T4, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, R>>>> curried() {
+ return scala.Function4$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple4<T1, T2, T3, T4>, R> tupled() {
+ return scala.Function4$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction5.java b/src/library/scala/runtime/java8/JFunction5.java
new file mode 100644
index 0000000000..ce15f14e22
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction5.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction5<T1, T2, T3, T4, T5, R> extends scala.Function5<T1, T2, T3, T4, T5, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, R>>>>> curried() {
+ return scala.Function5$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple5<T1, T2, T3, T4, T5>, R> tupled() {
+ return scala.Function5$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction6.java b/src/library/scala/runtime/java8/JFunction6.java
new file mode 100644
index 0000000000..07c0ca9665
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction6.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction6<T1, T2, T3, T4, T5, T6, R> extends scala.Function6<T1, T2, T3, T4, T5, T6, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, R>>>>>> curried() {
+ return scala.Function6$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple6<T1, T2, T3, T4, T5, T6>, R> tupled() {
+ return scala.Function6$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction7.java b/src/library/scala/runtime/java8/JFunction7.java
new file mode 100644
index 0000000000..f765ade092
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction7.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction7<T1, T2, T3, T4, T5, T6, T7, R> extends scala.Function7<T1, T2, T3, T4, T5, T6, T7, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, R>>>>>>> curried() {
+ return scala.Function7$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple7<T1, T2, T3, T4, T5, T6, T7>, R> tupled() {
+ return scala.Function7$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction8.java b/src/library/scala/runtime/java8/JFunction8.java
new file mode 100644
index 0000000000..ffd362b0af
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction8.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction8<T1, T2, T3, T4, T5, T6, T7, T8, R> extends scala.Function8<T1, T2, T3, T4, T5, T6, T7, T8, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, R>>>>>>>> curried() {
+ return scala.Function8$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>, R> tupled() {
+ return scala.Function8$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JFunction9.java b/src/library/scala/runtime/java8/JFunction9.java
new file mode 100644
index 0000000000..e3fca09be0
--- /dev/null
+++ b/src/library/scala/runtime/java8/JFunction9.java
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+@FunctionalInterface
+public interface JFunction9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> extends scala.Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> {
+ default void $init$() {
+ };
+
+ default scala.Function1<T1, scala.Function1<T2, scala.Function1<T3, scala.Function1<T4, scala.Function1<T5, scala.Function1<T6, scala.Function1<T7, scala.Function1<T8, scala.Function1<T9, R>>>>>>>>> curried() {
+ return scala.Function9$class.curried(this);
+ }
+
+ default scala.Function1<scala.Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9>, R> tupled() {
+ return scala.Function9$class.tupled(this);
+ }
+
+
+}
diff --git a/src/library/scala/runtime/java8/JProcedure0.java b/src/library/scala/runtime/java8/JProcedure0.java
new file mode 100644
index 0000000000..6004364d03
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure0.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure0 extends JFunction0<BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid();
+
+ default BoxedUnit apply() {
+ applyVoid();
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure1.java b/src/library/scala/runtime/java8/JProcedure1.java
new file mode 100644
index 0000000000..184d943042
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure1.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure1<T1> extends JFunction1<T1, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1);
+
+ default BoxedUnit apply(T1 t1) {
+ applyVoid(t1);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure10.java b/src/library/scala/runtime/java8/JProcedure10.java
new file mode 100644
index 0000000000..2aadd7d215
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure10.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> extends JFunction10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure11.java b/src/library/scala/runtime/java8/JProcedure11.java
new file mode 100644
index 0000000000..c29853be1f
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure11.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> extends JFunction11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure12.java b/src/library/scala/runtime/java8/JProcedure12.java
new file mode 100644
index 0000000000..0607600c33
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure12.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> extends JFunction12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure13.java b/src/library/scala/runtime/java8/JProcedure13.java
new file mode 100644
index 0000000000..c390fed2a5
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure13.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> extends JFunction13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure14.java b/src/library/scala/runtime/java8/JProcedure14.java
new file mode 100644
index 0000000000..d67cff1b5a
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure14.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> extends JFunction14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure15.java b/src/library/scala/runtime/java8/JProcedure15.java
new file mode 100644
index 0000000000..81e0f524f5
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure15.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> extends JFunction15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure16.java b/src/library/scala/runtime/java8/JProcedure16.java
new file mode 100644
index 0000000000..3d29ae25c5
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure16.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> extends JFunction16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure17.java b/src/library/scala/runtime/java8/JProcedure17.java
new file mode 100644
index 0000000000..85f40b2cd5
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure17.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> extends JFunction17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure18.java b/src/library/scala/runtime/java8/JProcedure18.java
new file mode 100644
index 0000000000..fe2ab6f22c
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure18.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> extends JFunction18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure19.java b/src/library/scala/runtime/java8/JProcedure19.java
new file mode 100644
index 0000000000..9289d639a5
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure19.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> extends JFunction19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure2.java b/src/library/scala/runtime/java8/JProcedure2.java
new file mode 100644
index 0000000000..273357a3b0
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure2.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure2<T1, T2> extends JFunction2<T1, T2, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2);
+
+ default BoxedUnit apply(T1 t1, T2 t2) {
+ applyVoid(t1, t2);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure20.java b/src/library/scala/runtime/java8/JProcedure20.java
new file mode 100644
index 0000000000..8701e9d422
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure20.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> extends JFunction20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure21.java b/src/library/scala/runtime/java8/JProcedure21.java
new file mode 100644
index 0000000000..f8e38f6c70
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure21.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> extends JFunction21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure22.java b/src/library/scala/runtime/java8/JProcedure22.java
new file mode 100644
index 0000000000..8bae4d7e0d
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure22.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> extends JFunction22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure3.java b/src/library/scala/runtime/java8/JProcedure3.java
new file mode 100644
index 0000000000..7c53187f31
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure3.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure3<T1, T2, T3> extends JFunction3<T1, T2, T3, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3) {
+ applyVoid(t1, t2, t3);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure4.java b/src/library/scala/runtime/java8/JProcedure4.java
new file mode 100644
index 0000000000..33161bc151
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure4.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure4<T1, T2, T3, T4> extends JFunction4<T1, T2, T3, T4, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4) {
+ applyVoid(t1, t2, t3, t4);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure5.java b/src/library/scala/runtime/java8/JProcedure5.java
new file mode 100644
index 0000000000..c834c48bf6
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure5.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure5<T1, T2, T3, T4, T5> extends JFunction5<T1, T2, T3, T4, T5, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) {
+ applyVoid(t1, t2, t3, t4, t5);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure6.java b/src/library/scala/runtime/java8/JProcedure6.java
new file mode 100644
index 0000000000..995bdd6734
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure6.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure6<T1, T2, T3, T4, T5, T6> extends JFunction6<T1, T2, T3, T4, T5, T6, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) {
+ applyVoid(t1, t2, t3, t4, t5, t6);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure7.java b/src/library/scala/runtime/java8/JProcedure7.java
new file mode 100644
index 0000000000..1821d8d406
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure7.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure7<T1, T2, T3, T4, T5, T6, T7> extends JFunction7<T1, T2, T3, T4, T5, T6, T7, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure8.java b/src/library/scala/runtime/java8/JProcedure8.java
new file mode 100644
index 0000000000..4b9dd0929a
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure8.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure8<T1, T2, T3, T4, T5, T6, T7, T8> extends JFunction8<T1, T2, T3, T4, T5, T6, T7, T8, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/runtime/java8/JProcedure9.java b/src/library/scala/runtime/java8/JProcedure9.java
new file mode 100644
index 0000000000..c4cbc65b6c
--- /dev/null
+++ b/src/library/scala/runtime/java8/JProcedure9.java
@@ -0,0 +1,21 @@
+
+/*
+ * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.runtime.java8;
+
+import scala.runtime.BoxedUnit;
+
+@FunctionalInterface
+public interface JProcedure9<T1, T2, T3, T4, T5, T6, T7, T8, T9> extends JFunction9<T1, T2, T3, T4, T5, T6, T7, T8, T9, BoxedUnit> {
+ default void $init$() {
+ }
+
+ void applyVoid(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9);
+
+ default BoxedUnit apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9) {
+ applyVoid(t1, t2, t3, t4, t5, t6, t7, t8, t9);
+ return BoxedUnit.UNIT;
+ }
+}
diff --git a/src/library/scala/sys/SystemProperties.scala b/src/library/scala/sys/SystemProperties.scala
index d2ebf8c044..3ee4f6c708 100644
--- a/src/library/scala/sys/SystemProperties.scala
+++ b/src/library/scala/sys/SystemProperties.scala
@@ -35,8 +35,15 @@ extends mutable.AbstractMap[String, String]
override def empty = new SystemProperties
override def default(key: String): String = null
- def iterator: Iterator[(String, String)] =
- wrapAccess(System.getProperties().asScala.iterator) getOrElse Iterator.empty
+ def iterator: Iterator[(String, String)] = wrapAccess {
+ val ps = System.getProperties()
+ names map (k => (k, ps getProperty k)) filter (_._2 ne null)
+ } getOrElse Iterator.empty
+
+ def names: Iterator[String] = wrapAccess (
+ System.getProperties().stringPropertyNames().asScala.iterator
+ ) getOrElse Iterator.empty
+
def get(key: String) =
wrapAccess(Option(System.getProperty(key))) flatMap (x => x)
override def contains(key: String) =
@@ -79,6 +86,8 @@ object SystemProperties {
lazy val headless = bool("java.awt.headless", "system should not utilize a display device")
lazy val preferIPv4Stack = bool("java.net.preferIPv4Stack", "system should prefer IPv4 sockets")
lazy val preferIPv6Addresses = bool("java.net.preferIPv6Addresses", "system should prefer IPv6 addresses")
- lazy val noTraceSupression = bool("scala.control.noTraceSuppression", "scala should not suppress any stack trace creation")
+ lazy val noTraceSuppression = bool("scala.control.noTraceSuppression", "scala should not suppress any stack trace creation")
+ @deprecated("Use noTraceSuppression", "2.12.0")
+ def noTraceSupression = noTraceSuppression
}
diff --git a/src/library/scala/sys/process/BasicIO.scala b/src/library/scala/sys/process/BasicIO.scala
index 066b2f5373..640f7e68c2 100644
--- a/src/library/scala/sys/process/BasicIO.scala
+++ b/src/library/scala/sys/process/BasicIO.scala
@@ -221,7 +221,7 @@ object BasicIO {
*/
def transferFully(in: InputStream, out: OutputStream): Unit =
try transferFullyImpl(in, out)
- catch onInterrupt(())
+ catch onIOInterrupt(())
private[this] def appendLine(buffer: Appendable): String => Unit = line => {
buffer append line
diff --git a/src/library/scala/sys/process/ProcessImpl.scala b/src/library/scala/sys/process/ProcessImpl.scala
index 2b7fcdeb73..d15f1a2b3d 100644
--- a/src/library/scala/sys/process/ProcessImpl.scala
+++ b/src/library/scala/sys/process/ProcessImpl.scala
@@ -109,45 +109,46 @@ private[process] trait ProcessImpl {
}
private[process] class PipedProcesses(a: ProcessBuilder, b: ProcessBuilder, defaultIO: ProcessIO, toError: Boolean) extends CompoundProcess {
- protected[this] override def runAndExitValue() = {
- val currentSource = new SyncVar[Option[InputStream]]
- val pipeOut = new PipedOutputStream
- val source = new PipeSource(currentSource, pipeOut, a.toString)
+ protected[this] override def runAndExitValue() = runAndExitValue(new PipeSource(a.toString), new PipeSink(b.toString))
+ protected[this] def runAndExitValue(source: PipeSource, sink: PipeSink): Option[Int] = {
+ source connectOut sink
source.start()
-
- val pipeIn = new PipedInputStream(pipeOut)
- val currentSink = new SyncVar[Option[OutputStream]]
- val sink = new PipeSink(pipeIn, currentSink, b.toString)
sink.start()
- def handleOutOrError(fromOutput: InputStream) = currentSource put Some(fromOutput)
+ /** Release PipeSource, PipeSink and Process in the correct order.
+ * If once connect Process with Source or Sink, then the order of releasing them
+ * must be Source -> Sink -> Process, otherwise IOException will be thrown. */
+ def releaseResources(so: PipeSource, sk: PipeSink, p: Process *) = {
+ so.release()
+ sk.release()
+ p foreach( _.destroy() )
+ }
val firstIO =
- if (toError)
- defaultIO.withError(handleOutOrError)
- else
- defaultIO.withOutput(handleOutOrError)
- val secondIO = defaultIO.withInput(toInput => currentSink put Some(toInput))
-
- val second = b.run(secondIO)
- val first = a.run(firstIO)
- try {
- runInterruptible {
- val exit1 = first.exitValue()
- currentSource put None
- currentSink put None
- val exit2 = second.exitValue()
- // Since file redirection (e.g. #>) is implemented as a piped process,
- // we ignore its exit value so cmd #> file doesn't always return 0.
- if (b.hasExitValue) exit2 else exit1
- } {
- first.destroy()
- second.destroy()
+ if (toError) defaultIO.withError(source.connectIn)
+ else defaultIO.withOutput(source.connectIn)
+ val secondIO = defaultIO.withInput(sink.connectOut)
+
+ val second =
+ try b.run(secondIO)
+ catch onError { err =>
+ releaseResources(source, sink)
+ throw err
}
- }
- finally {
- BasicIO close pipeIn
- BasicIO close pipeOut
+ val first =
+ try a.run(firstIO)
+ catch onError { err =>
+ releaseResources(source, sink, second)
+ throw err
+ }
+ runInterruptible {
+ val exit1 = first.exitValue()
+ val exit2 = second.exitValue()
+ // Since file redirection (e.g. #>) is implemented as a piped process,
+ // we ignore its exit value so cmd #> file doesn't always return 0.
+ if (b.hasExitValue) exit2 else exit1
+ } {
+ releaseResources(source, sink, first, second)
}
}
}
@@ -168,37 +169,46 @@ private[process] trait ProcessImpl {
}
}
- private[process] class PipeSource(
- currentSource: SyncVar[Option[InputStream]],
- pipe: PipedOutputStream,
- label: => String
- ) extends PipeThread(false, () => label) {
-
- final override def run(): Unit = currentSource.get match {
- case Some(source) =>
- try runloop(source, pipe)
- finally currentSource.unset()
-
- run()
- case None =>
- currentSource.unset()
- BasicIO close pipe
+ private[process] class PipeSource(label: => String) extends PipeThread(false, () => label) {
+ protected[this] val pipe = new PipedOutputStream
+ protected[this] val source = new LinkedBlockingQueue[Option[InputStream]]
+ override def run(): Unit = {
+ try {
+ source.take match {
+ case Some(in) => runloop(in, pipe)
+ case None =>
+ }
+ }
+ catch onInterrupt(())
+ finally BasicIO close pipe
+ }
+ def connectIn(in: InputStream): Unit = source add Some(in)
+ def connectOut(sink: PipeSink): Unit = sink connectIn pipe
+ def release(): Unit = {
+ interrupt()
+ source add None
+ join()
}
}
- private[process] class PipeSink(
- pipe: PipedInputStream,
- currentSink: SyncVar[Option[OutputStream]],
- label: => String
- ) extends PipeThread(true, () => label) {
-
- final override def run(): Unit = currentSink.get match {
- case Some(sink) =>
- try runloop(pipe, sink)
- finally currentSink.unset()
-
- run()
- case None =>
- currentSink.unset()
+ private[process] class PipeSink(label: => String) extends PipeThread(true, () => label) {
+ protected[this] val pipe = new PipedInputStream
+ protected[this] val sink = new LinkedBlockingQueue[Option[OutputStream]]
+ override def run(): Unit = {
+ try {
+ sink.take match {
+ case Some(out) => runloop(pipe, out)
+ case None =>
+ }
+ }
+ catch onInterrupt(())
+ finally BasicIO close pipe
+ }
+ def connectOut(out: OutputStream): Unit = sink add Some(out)
+ def connectIn(pipeOut: PipedOutputStream): Unit = pipe connect pipeOut
+ def release(): Unit = {
+ interrupt()
+ sink add None
+ join()
}
}
diff --git a/src/library/scala/sys/process/package.scala b/src/library/scala/sys/process/package.scala
index b1976ad4b6..5ec2e73cb9 100644
--- a/src/library/scala/sys/process/package.scala
+++ b/src/library/scala/sys/process/package.scala
@@ -224,16 +224,26 @@ package scala.sys {
final val processDebug = props contains "scala.process.debug"
dbg("Initializing process package.")
- type =?>[-A, +B] = PartialFunction[A, B]
- type Closeable = java.io.Closeable
- type File = java.io.File
- type IOException = java.io.IOException
- type InputStream = java.io.InputStream
- type JProcess = java.lang.Process
- type JProcessBuilder = java.lang.ProcessBuilder
- type OutputStream = java.io.OutputStream
- type SyncVar[T] = scala.concurrent.SyncVar[T]
- type URL = java.net.URL
+ type =?>[-A, +B] = PartialFunction[A, B]
+ type Closeable = java.io.Closeable
+ type File = java.io.File
+ type IOException = java.io.IOException
+ type InterruptedIOException = java.io.InterruptedIOException
+ type InputStream = java.io.InputStream
+ type JProcess = java.lang.Process
+ type JProcessBuilder = java.lang.ProcessBuilder
+ type LinkedBlockingQueue[T] = java.util.concurrent.LinkedBlockingQueue[T]
+ type OutputStream = java.io.OutputStream
+ type SyncVar[T] = scala.concurrent.SyncVar[T]
+ type URL = java.net.URL
+
+ def onError[T](handler: Throwable => T): Throwable =?> T = {
+ case e @ _ => handler(e)
+ }
+
+ def onIOInterrupt[T](handler: => T): Throwable =?> T = {
+ case _: InterruptedIOException => handler
+ }
def onInterrupt[T](handler: => T): Throwable =?> T = {
case _: InterruptedException => handler
diff --git a/src/library/scala/util/Either.scala b/src/library/scala/util/Either.scala
index e196d403c2..6ea9da64f2 100644
--- a/src/library/scala/util/Either.scala
+++ b/src/library/scala/util/Either.scala
@@ -68,7 +68,7 @@ import scala.language.implicitConversions
* @version 1.0, 11/10/2008
* @since 2.7
*/
-sealed abstract class Either[+A, +B] {
+sealed abstract class Either[+A, +B] extends Product with Serializable {
/**
* Projects this `Either` as a `Left`.
*/
diff --git a/src/library/scala/util/Try.scala b/src/library/scala/util/Try.scala
index b0eae74043..b1b9965614 100644
--- a/src/library/scala/util/Try.scala
+++ b/src/library/scala/util/Try.scala
@@ -61,7 +61,7 @@ import scala.language.implicitConversions
* @author based on Twitter's original implementation in com.twitter.util.
* @since 2.10
*/
-sealed abstract class Try[+T] {
+sealed abstract class Try[+T] extends Product with Serializable {
/** Returns `true` if the `Try` is a `Failure`, `false` otherwise.
*/
@@ -75,16 +75,11 @@ sealed abstract class Try[+T] {
*
* ''Note:'': This will throw an exception if it is not a success and default throws an exception.
*/
- def getOrElse[U >: T](default: => U): U =
- if (isSuccess) get else default
+ def getOrElse[U >: T](default: => U): U
/** Returns this `Try` if it's a `Success` or the given `default` argument if this is a `Failure`.
*/
- def orElse[U >: T](default: => Try[U]): Try[U] =
- try if (isSuccess) this else default
- catch {
- case NonFatal(e) => Failure(e)
- }
+ def orElse[U >: T](default: => Try[U]): Try[U]
/** Returns the value from this `Success` or throws the exception if this is a `Failure`.
*/
@@ -108,6 +103,11 @@ sealed abstract class Try[+T] {
def map[U](f: T => U): Try[U]
/**
+ * Applies the given partial function to the value from this `Success` or returns this if this is a `Failure`.
+ */
+ def collect[U](pf: PartialFunction[T, U]): Try[U]
+
+ /**
* Converts this to a `Failure` if the predicate is not satisfied.
*/
def filter(p: T => Boolean): Try[T]
@@ -134,6 +134,7 @@ sealed abstract class Try[+T] {
* collection" contract even though it seems unlikely to matter much in a
* collection with max size 1.
*/
+ @deprecatedInheritance("You were never supposed to be able to extend this class.", "2.12")
class WithFilter(p: T => Boolean) {
def map[U](f: T => U): Try[U] = Try.this filter p map f
def flatMap[U](f: T => Try[U]): Try[U] = Try.this filter p flatMap f
@@ -145,18 +146,18 @@ sealed abstract class Try[+T] {
* Applies the given function `f` if this is a `Failure`, otherwise returns this if this is a `Success`.
* This is like `flatMap` for the exception.
*/
- def recoverWith[U >: T](f: PartialFunction[Throwable, Try[U]]): Try[U]
+ def recoverWith[U >: T](@deprecatedName('f) pf: PartialFunction[Throwable, Try[U]]): Try[U]
/**
* Applies the given function `f` if this is a `Failure`, otherwise returns this if this is a `Success`.
* This is like map for the exception.
*/
- def recover[U >: T](f: PartialFunction[Throwable, U]): Try[U]
+ def recover[U >: T](@deprecatedName('f) pf: PartialFunction[Throwable, U]): Try[U]
/**
* Returns `None` if this is a `Failure` or a `Some` containing the value if this is a `Success`.
*/
- def toOption: Option[T] = if (isSuccess) Some(get) else None
+ def toOption: Option[T]
/**
* Transforms a nested `Try`, ie, a `Try` of type `Try[Try[T]]`,
@@ -173,13 +174,31 @@ sealed abstract class Try[+T] {
/** Completes this `Try` by applying the function `f` to this if this is of type `Failure`, or conversely, by applying
* `s` if this is a `Success`.
*/
- def transform[U](s: T => Try[U], f: Throwable => Try[U]): Try[U] =
- try this match {
- case Success(v) => s(v)
- case Failure(e) => f(e)
- } catch {
- case NonFatal(e) => Failure(e)
- }
+ def transform[U](s: T => Try[U], f: Throwable => Try[U]): Try[U]
+
+ /**
+ * Returns `Left` with `Throwable` if this is a `Failure`, otherwise returns `Right` with `Success` value.
+ */
+ def toEither: Either[Throwable, T]
+
+ /**
+ * Applies `fa` if this is a `Failure` or `fb` if this is a `Success`.
+ * If `fb` is initially applied and throws an exception,
+ * then `fa` is applied with this exception.
+ *
+ * @example {{{
+ * val result: Try[Throwable, Int] = Try { string.toInt }
+ * log(result.fold(
+ * ex => "Operation failed with " + ex,
+ * v => "Operation produced value: " + v
+ * ))
+ * }}}
+ *
+ * @param fa the function to apply if this is a `Failure`
+ * @param fb the function to apply if this is a `Success`
+ * @return the results of applying the function
+ */
+ def fold[U](fa: Throwable => U, fb: T => U): U
}
@@ -192,57 +211,60 @@ object Try {
try Success(r) catch {
case NonFatal(e) => Failure(e)
}
-
}
final case class Failure[+T](exception: Throwable) extends Try[T] {
- def isFailure: Boolean = true
- def isSuccess: Boolean = false
- def recoverWith[U >: T](f: PartialFunction[Throwable, Try[U]]): Try[U] =
- try {
- if (f isDefinedAt exception) f(exception) else this
- } catch {
- case NonFatal(e) => Failure(e)
- }
- def get: T = throw exception
- def flatMap[U](f: T => Try[U]): Try[U] = this.asInstanceOf[Try[U]]
- def flatten[U](implicit ev: T <:< Try[U]): Try[U] = this.asInstanceOf[Try[U]]
- def foreach[U](f: T => U): Unit = ()
- def map[U](f: T => U): Try[U] = this.asInstanceOf[Try[U]]
- def filter(p: T => Boolean): Try[T] = this
- def recover[U >: T](rescueException: PartialFunction[Throwable, U]): Try[U] =
- try {
- if (rescueException isDefinedAt exception) {
- Try(rescueException(exception))
- } else this
- } catch {
- case NonFatal(e) => Failure(e)
- }
- def failed: Try[Throwable] = Success(exception)
+ override def isFailure: Boolean = true
+ override def isSuccess: Boolean = false
+ override def get: T = throw exception
+ override def getOrElse[U >: T](default: => U): U = default
+ override def orElse[U >: T](default: => Try[U]): Try[U] =
+ try default catch { case NonFatal(e) => Failure(e) }
+ override def flatMap[U](f: T => Try[U]): Try[U] = this.asInstanceOf[Try[U]]
+ override def flatten[U](implicit ev: T <:< Try[U]): Try[U] = this.asInstanceOf[Try[U]]
+ override def foreach[U](f: T => U): Unit = ()
+ override def transform[U](s: T => Try[U], f: Throwable => Try[U]): Try[U] =
+ try f(exception) catch { case NonFatal(e) => Failure(e) }
+ override def map[U](f: T => U): Try[U] = this.asInstanceOf[Try[U]]
+ override def collect[U](pf: PartialFunction[T, U]): Try[U] = this.asInstanceOf[Try[U]]
+ override def filter(p: T => Boolean): Try[T] = this
+ override def recover[U >: T](@deprecatedName('rescueException) pf: PartialFunction[Throwable, U]): Try[U] =
+ try { if (pf isDefinedAt exception) Success(pf(exception)) else this } catch { case NonFatal(e) => Failure(e) }
+ override def recoverWith[U >: T](@deprecatedName('f) pf: PartialFunction[Throwable, Try[U]]): Try[U] =
+ try { if (pf isDefinedAt exception) pf(exception) else this } catch { case NonFatal(e) => Failure(e) }
+ override def failed: Try[Throwable] = Success(exception)
+ override def toOption: Option[T] = None
+ override def toEither: Either[Throwable, T] = Left(exception)
+ override def fold[U](fa: Throwable => U, fb: T => U): U = fa(exception)
}
final case class Success[+T](value: T) extends Try[T] {
- def isFailure: Boolean = false
- def isSuccess: Boolean = true
- def recoverWith[U >: T](f: PartialFunction[Throwable, Try[U]]): Try[U] = this
- def get = value
- def flatMap[U](f: T => Try[U]): Try[U] =
- try f(value)
- catch {
- case NonFatal(e) => Failure(e)
- }
- def flatten[U](implicit ev: T <:< Try[U]): Try[U] = value
- def foreach[U](f: T => U): Unit = f(value)
- def map[U](f: T => U): Try[U] = Try[U](f(value))
- def filter(p: T => Boolean): Try[T] = {
+ override def isFailure: Boolean = false
+ override def isSuccess: Boolean = true
+ override def get = value
+ override def getOrElse[U >: T](default: => U): U = get
+ override def orElse[U >: T](default: => Try[U]): Try[U] = this
+ override def flatMap[U](f: T => Try[U]): Try[U] =
+ try f(value) catch { case NonFatal(e) => Failure(e) }
+ override def flatten[U](implicit ev: T <:< Try[U]): Try[U] = value
+ override def foreach[U](f: T => U): Unit = f(value)
+ override def transform[U](s: T => Try[U], f: Throwable => Try[U]): Try[U] = this flatMap s
+ override def map[U](f: T => U): Try[U] = Try[U](f(value))
+ override def collect[U](pf: PartialFunction[T, U]): Try[U] =
try {
- if (p(value)) this
+ if (pf isDefinedAt value) Success(pf(value))
else Failure(new NoSuchElementException("Predicate does not hold for " + value))
- } catch {
- case NonFatal(e) => Failure(e)
- }
- }
- def recover[U >: T](rescueException: PartialFunction[Throwable, U]): Try[U] = this
- def failed: Try[Throwable] = Failure(new UnsupportedOperationException("Success.failed"))
+ } catch { case NonFatal(e) => Failure(e) }
+ override def filter(p: T => Boolean): Try[T] =
+ try {
+ if (p(value)) this else Failure(new NoSuchElementException("Predicate does not hold for " + value))
+ } catch { case NonFatal(e) => Failure(e) }
+ override def recover[U >: T](@deprecatedName('rescueException) pf: PartialFunction[Throwable, U]): Try[U] = this
+ override def recoverWith[U >: T](@deprecatedName('f) pf: PartialFunction[Throwable, Try[U]]): Try[U] = this
+ override def failed: Try[Throwable] = Failure(new UnsupportedOperationException("Success.failed"))
+ override def toOption: Option[T] = Some(value)
+ override def toEither: Either[Throwable, T] = Right(value)
+ override def fold[U](fa: Throwable => U, fb: T => U): U =
+ try { fb(value) } catch { case NonFatal(e) => fa(e) }
}
diff --git a/src/library/scala/util/control/NoStackTrace.scala b/src/library/scala/util/control/NoStackTrace.scala
index b33b6a18dd..3c42944af1 100644
--- a/src/library/scala/util/control/NoStackTrace.scala
+++ b/src/library/scala/util/control/NoStackTrace.scala
@@ -26,7 +26,7 @@ trait NoStackTrace extends Throwable {
object NoStackTrace {
final def noSuppression = _noSuppression
- // two-stage init to make checkinit happy, since sys.SystemProperties.noTraceSupression.value calls back into NoStackTrace.noSuppression
+ // two-stage init to make checkinit happy, since sys.SystemProperties.noTraceSuppression.value calls back into NoStackTrace.noSuppression
final private var _noSuppression = false
- _noSuppression = sys.SystemProperties.noTraceSupression.value
+ _noSuppression = sys.SystemProperties.noTraceSuppression.value
}
diff --git a/src/manual/scala/man1/scalac.scala b/src/manual/scala/man1/scalac.scala
index c658fe89f8..3219b10293 100644
--- a/src/manual/scala/man1/scalac.scala
+++ b/src/manual/scala/man1/scalac.scala
@@ -152,12 +152,9 @@ object scalac extends Command {
CmdOption("sourcepath", Argument("path")),
"Specify location(s) of source files."),
Definition(
- CmdOptionBound("target:", "{jvm-1.5,jvm-1.6,jvm-1.7,jvm-1.8}"),
+ CmdOptionBound("target:", "{jvm-1.8}"),
SeqPara(
- Mono("\"jvm-1.5\"") & " target JVM 1.5 (deprecated),",
- Mono("\"jvm-1.6\"") & " target JVM 1.6 (default),",
- Mono("\"jvm-1.7\"") & " target JVM 1.7,",
- Mono("\"jvm-1.8\"") & " target JVM 1.8,")),
+ Mono("\"jvm-1.8\"") & " target JVM 1.8 (default)")),
Definition(
CmdOption("toolcp", Argument("path")),
"Add to the runner classpath."),
diff --git a/src/partest-extras/scala/tools/partest/ASMConverters.scala b/src/partest-extras/scala/tools/partest/ASMConverters.scala
index 90f314428b..b4c686473b 100644
--- a/src/partest-extras/scala/tools/partest/ASMConverters.scala
+++ b/src/partest-extras/scala/tools/partest/ASMConverters.scala
@@ -58,21 +58,24 @@ object ASMConverters {
case class Method(instructions: List[Instruction], handlers: List[ExceptionHandler], localVars: List[LocalVariable])
- case class Field (opcode: Int, owner: String, name: String, desc: String) extends Instruction
- case class Incr (opcode: Int, `var`: Int, incr: Int) extends Instruction
- case class Op (opcode: Int) extends Instruction
- case class IntOp (opcode: Int, operand: Int) extends Instruction
- case class Jump (opcode: Int, label: Label) extends Instruction
- case class Ldc (opcode: Int, cst: Any) extends Instruction
- case class LookupSwitch(opcode: Int, dflt: Label, keys: List[Int], labels: List[Label]) extends Instruction
- case class TableSwitch (opcode: Int, min: Int, max: Int, dflt: Label, labels: List[Label]) extends Instruction
- case class Invoke (opcode: Int, owner: String, name: String, desc: String, itf: Boolean) extends Instruction
- case class NewArray (opcode: Int, desc: String, dims: Int) extends Instruction
- case class TypeOp (opcode: Int, desc: String) extends Instruction
- case class VarOp (opcode: Int, `var`: Int) extends Instruction
- case class Label (offset: Int) extends Instruction { def opcode: Int = -1 }
- case class FrameEntry (`type`: Int, local: List[Any], stack: List[Any]) extends Instruction { def opcode: Int = -1 }
- case class LineNumber (line: Int, start: Label) extends Instruction { def opcode: Int = -1 }
+ case class Field (opcode: Int, owner: String, name: String, desc: String) extends Instruction
+ case class Incr (opcode: Int, `var`: Int, incr: Int) extends Instruction
+ case class Op (opcode: Int) extends Instruction
+ case class IntOp (opcode: Int, operand: Int) extends Instruction
+ case class Jump (opcode: Int, label: Label) extends Instruction
+ case class Ldc (opcode: Int, cst: Any) extends Instruction
+ case class LookupSwitch (opcode: Int, dflt: Label, keys: List[Int], labels: List[Label]) extends Instruction
+ case class TableSwitch (opcode: Int, min: Int, max: Int, dflt: Label, labels: List[Label]) extends Instruction
+ case class Invoke (opcode: Int, owner: String, name: String, desc: String, itf: Boolean) extends Instruction
+ case class InvokeDynamic(opcode: Int, name: String, desc: String, bsm: MethodHandle, bsmArgs: List[AnyRef]) extends Instruction
+ case class NewArray (opcode: Int, desc: String, dims: Int) extends Instruction
+ case class TypeOp (opcode: Int, desc: String) extends Instruction
+ case class VarOp (opcode: Int, `var`: Int) extends Instruction
+ case class Label (offset: Int) extends Instruction { def opcode: Int = -1 }
+ case class FrameEntry (`type`: Int, local: List[Any], stack: List[Any]) extends Instruction { def opcode: Int = -1 }
+ case class LineNumber (line: Int, start: Label) extends Instruction { def opcode: Int = -1 }
+
+ case class MethodHandle(tag: Int, owner: String, name: String, desc: String)
case class ExceptionHandler(start: Label, end: Label, handler: Label, desc: Option[String])
case class LocalVariable(name: String, desc: String, signature: Option[String], start: Label, end: Label, index: Int)
@@ -111,6 +114,7 @@ object ASMConverters {
case i: t.LookupSwitchInsnNode => LookupSwitch (op(i), applyLabel(i.dflt), lst(i.keys) map (x => x: Int), lst(i.labels) map applyLabel)
case i: t.TableSwitchInsnNode => TableSwitch (op(i), i.min, i.max, applyLabel(i.dflt), lst(i.labels) map applyLabel)
case i: t.MethodInsnNode => Invoke (op(i), i.owner, i.name, i.desc, i.itf)
+ case i: t.InvokeDynamicInsnNode => InvokeDynamic(op(i), i.name, i.desc, convertMethodHandle(i.bsm), convertBsmArgs(i.bsmArgs))
case i: t.MultiANewArrayInsnNode => NewArray (op(i), i.desc, i.dims)
case i: t.TypeInsnNode => TypeOp (op(i), i.desc)
case i: t.VarInsnNode => VarOp (op(i), i.`var`)
@@ -119,6 +123,13 @@ object ASMConverters {
case i: t.LineNumberNode => LineNumber (i.line, applyLabel(i.start))
}
+ private def convertBsmArgs(a: Array[Object]): List[Object] = a.map({
+ case h: asm.Handle => convertMethodHandle(h)
+ case _ => a // can be: Class, method Type, primitive constant
+ })(collection.breakOut)
+
+ private def convertMethodHandle(h: asm.Handle): MethodHandle = MethodHandle(h.getTag, h.getOwner, h.getName, h.getDesc)
+
private def convertHandlers(method: t.MethodNode): List[ExceptionHandler] = {
method.tryCatchBlocks.asScala.map(h => ExceptionHandler(applyLabel(h.start), applyLabel(h.end), applyLabel(h.handler), Option(h.`type`)))(collection.breakOut)
}
@@ -197,21 +208,28 @@ object ASMConverters {
case x => x.asInstanceOf[Object]
}
+ def unconvertMethodHandle(h: MethodHandle): asm.Handle = new asm.Handle(h.tag, h.owner, h.name, h.desc)
+ def unconvertBsmArgs(a: List[Object]): Array[Object] = a.map({
+ case h: MethodHandle => unconvertMethodHandle(h)
+ case o => o
+ })(collection.breakOut)
+
private def visitMethod(method: t.MethodNode, instruction: Instruction, asmLabel: Map[Label, asm.Label]): Unit = instruction match {
- case Field(op, owner, name, desc) => method.visitFieldInsn(op, owner, name, desc)
- case Incr(op, vr, incr) => method.visitIincInsn(vr, incr)
- case Op(op) => method.visitInsn(op)
- case IntOp(op, operand) => method.visitIntInsn(op, operand)
- case Jump(op, label) => method.visitJumpInsn(op, asmLabel(label))
- case Ldc(op, cst) => method.visitLdcInsn(cst)
- case LookupSwitch(op, dflt, keys, labels) => method.visitLookupSwitchInsn(asmLabel(dflt), keys.toArray, (labels map asmLabel).toArray)
- case TableSwitch(op, min, max, dflt, labels) => method.visitTableSwitchInsn(min, max, asmLabel(dflt), (labels map asmLabel).toArray: _*)
- case Invoke(op, owner, name, desc, itf) => method.visitMethodInsn(op, owner, name, desc, itf)
- case NewArray(op, desc, dims) => method.visitMultiANewArrayInsn(desc, dims)
- case TypeOp(op, desc) => method.visitTypeInsn(op, desc)
- case VarOp(op, vr) => method.visitVarInsn(op, vr)
- case l: Label => method.visitLabel(asmLabel(l))
- case FrameEntry(tp, local, stack) => method.visitFrame(tp, local.length, frameTypesToAsm(local, asmLabel).toArray, stack.length, frameTypesToAsm(stack, asmLabel).toArray)
- case LineNumber(line, start) => method.visitLineNumber(line, asmLabel(start))
+ case Field(op, owner, name, desc) => method.visitFieldInsn(op, owner, name, desc)
+ case Incr(op, vr, incr) => method.visitIincInsn(vr, incr)
+ case Op(op) => method.visitInsn(op)
+ case IntOp(op, operand) => method.visitIntInsn(op, operand)
+ case Jump(op, label) => method.visitJumpInsn(op, asmLabel(label))
+ case Ldc(op, cst) => method.visitLdcInsn(cst)
+ case LookupSwitch(op, dflt, keys, labels) => method.visitLookupSwitchInsn(asmLabel(dflt), keys.toArray, (labels map asmLabel).toArray)
+ case TableSwitch(op, min, max, dflt, labels) => method.visitTableSwitchInsn(min, max, asmLabel(dflt), (labels map asmLabel).toArray: _*)
+ case Invoke(op, owner, name, desc, itf) => method.visitMethodInsn(op, owner, name, desc, itf)
+ case InvokeDynamic(op, name, desc, bsm, bsmArgs) => method.visitInvokeDynamicInsn(name, desc, unconvertMethodHandle(bsm), unconvertBsmArgs(bsmArgs))
+ case NewArray(op, desc, dims) => method.visitMultiANewArrayInsn(desc, dims)
+ case TypeOp(op, desc) => method.visitTypeInsn(op, desc)
+ case VarOp(op, vr) => method.visitVarInsn(op, vr)
+ case l: Label => method.visitLabel(asmLabel(l))
+ case FrameEntry(tp, local, stack) => method.visitFrame(tp, local.length, frameTypesToAsm(local, asmLabel).toArray, stack.length, frameTypesToAsm(stack, asmLabel).toArray)
+ case LineNumber(line, start) => method.visitLineNumber(line, asmLabel(start))
}
}
diff --git a/src/reflect/scala/reflect/api/FlagSets.scala b/src/reflect/scala/reflect/api/FlagSets.scala
index d3294dad9b..2d5d1d5d6b 100644
--- a/src/reflect/scala/reflect/api/FlagSets.scala
+++ b/src/reflect/scala/reflect/api/FlagSets.scala
@@ -173,6 +173,7 @@ trait FlagSets { self: Universe =>
* - the enum's class
* - enum constants
**/
+ @deprecated("Use `isJavaEnum` on the corresponding symbol instead.", since = "2.11.8")
val ENUM: FlagSet
/** Flag indicating that tree represents a parameter of the primary constructor of some class
diff --git a/src/reflect/scala/reflect/api/Symbols.scala b/src/reflect/scala/reflect/api/Symbols.scala
index c01029d067..9e9fe5d67b 100644
--- a/src/reflect/scala/reflect/api/Symbols.scala
+++ b/src/reflect/scala/reflect/api/Symbols.scala
@@ -228,7 +228,7 @@ trait Symbols { self: Universe =>
throw new ScalaReflectionException(s"$this $msg")
}
- /** Used to provide a better error message for `asMethod`
+ /** Used to provide a better error message for `asMethod`.
*
* @group Tests
*/
@@ -257,7 +257,7 @@ trait Symbols { self: Universe =>
def isClass: Boolean = false
/** Does this symbol represent the definition of a class implicitly associated
- * with an object definition (module class in scala compiler parlance).
+ * with an object definition (module class in scala compiler parlance)?
* If yes, `isType` is also guaranteed to be true.
*
* Note to compiler developers: During the "mixin" phase, trait implementation class symbols
@@ -294,7 +294,7 @@ trait Symbols { self: Universe =>
/** For a class: the module or case class factory with the same name in the same package.
* For a module: the class with the same name in the same package.
- * For all others: NoSymbol
+ * For all others: NoSymbol.
*
* This API may return unexpected results for module classes, packages and package classes.
* Use `companion` instead in order to get predictable results.
@@ -345,7 +345,7 @@ trait Symbols { self: Universe =>
*/
def overrides: List[Symbol]
- /** The overloaded alternatives of this symbol
+ /** The overloaded alternatives of this symbol.
*
* @group Basics
*/
@@ -370,7 +370,7 @@ trait Symbols { self: Universe =>
/** Does this symbol represent a declaration or definition written in a source file as `private[this]`
* or generated in tree/symbol form with the combination of flags LOCAL and PRIVATE?
- * If yes, `isPrivate` is guaranteed to be true,
+ * If yes, `isPrivate` is guaranteed to be true.
*
* @group Tests
*/
@@ -504,6 +504,18 @@ trait Symbols { self: Universe =>
*/
def isImplicit: Boolean
+ /** Does this symbol represent a java enum class or a java enum value?
+ *
+ * @group Tests
+ */
+ def isJavaEnum: Boolean
+
+ /** Does this symbol represent a java annotation interface?
+ *
+ * @group Tests
+ */
+ def isJavaAnnotation: Boolean
+
/******************* helpers *******************/
/** Provides an alternate if symbol is a NoSymbol.
@@ -678,7 +690,7 @@ trait Symbols { self: Universe =>
*/
def toTypeIn(site: Type): Type
- /** A type reference that refers to this type symbol
+ /** A type reference that refers to this type symbol.
* Note if symbol is a member of a class, one almost always is interested
* in `asTypeIn` with a site type instead.
*
@@ -727,7 +739,7 @@ trait Symbols { self: Universe =>
*/
def isExistential : Boolean
- /** For a polymorphic type, its type parameters, the empty list for all other types
+ /** For a polymorphic type, its type parameters, the empty list for all other types.
*
* @group Type
*/
@@ -756,12 +768,13 @@ trait Symbols { self: Universe =>
*/
def typeParams: List[Symbol]
- /** @see [[paramLists]] */
+ /** @see [[paramLists]]
+ *
+ * The name ending with "ss" indicates that the result type is a list of lists. */
@deprecated("Use `paramLists` instead", "2.11.0")
def paramss: List[List[Symbol]]
/** All parameter lists of the method.
- * The name ending with "ss" indicates that the result type is a list of lists.
*
* Can be used to distinguish nullary methods and methods with empty parameter lists.
* For a nullary method, returns the empty list (i.e. `List()`).
@@ -777,7 +790,7 @@ trait Symbols { self: Universe =>
*/
def isVarargs: Boolean
- /** The return type of the method
+ /** The return type of the method.
*
* @group Method
*/
@@ -911,7 +924,7 @@ trait Symbols { self: Universe =>
*/
def superPrefix(supertpe: Type): Type
- /** For a polymorphic class/trait, its type parameters, the empty list for all other classes/trait
+ /** For a polymorphic class/trait, its type parameters, the empty list for all other classes/trait.
*
* @group Class
*/
diff --git a/src/reflect/scala/reflect/internal/ClassfileConstants.scala b/src/reflect/scala/reflect/internal/ClassfileConstants.scala
index 53241fb15b..e5d97e8959 100644
--- a/src/reflect/scala/reflect/internal/ClassfileConstants.scala
+++ b/src/reflect/scala/reflect/internal/ClassfileConstants.scala
@@ -344,7 +344,8 @@ object ClassfileConstants {
case JAVA_ACC_STATIC => STATIC
case JAVA_ACC_ABSTRACT => if (isAnnotation) 0L else if (isClass) ABSTRACT else DEFERRED
case JAVA_ACC_INTERFACE => if (isAnnotation) 0L else TRAIT | INTERFACE | ABSTRACT
- case JAVA_ACC_ENUM => ENUM
+ case JAVA_ACC_ENUM => JAVA_ENUM
+ case JAVA_ACC_ANNOTATION => JAVA_ANNOTATION
case _ => 0L
}
private def translateFlags(jflags: Int, baseFlags: Long, isClass: Boolean): Long = {
@@ -360,6 +361,7 @@ object ClassfileConstants {
res |= translateFlag0(jflags & JAVA_ACC_ABSTRACT)
res |= translateFlag0(jflags & JAVA_ACC_INTERFACE)
res |= translateFlag0(jflags & JAVA_ACC_ENUM)
+ res |= translateFlag0(jflags & JAVA_ACC_ANNOTATION)
res
}
diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala
index 4e0fc1e36e..02fa3c882b 100644
--- a/src/reflect/scala/reflect/internal/Definitions.scala
+++ b/src/reflect/scala/reflect/internal/Definitions.scala
@@ -815,7 +815,7 @@ trait Definitions extends api.StandardDefinitions {
// must filter out "universal" members (getClass is deferred for some reason)
val deferredMembers = (
tp membersBasedOnFlags (excludedFlags = BridgeAndPrivateFlags, requiredFlags = METHOD)
- filter (mem => mem.isDeferredNotDefault && !isUniversalMember(mem)) // TODO: test
+ filter (mem => mem.isDeferredNotJavaDefault && !isUniversalMember(mem)) // TODO: test
)
// if there is only one, it's monomorphic and has a single argument list
@@ -1517,7 +1517,7 @@ trait Definitions extends api.StandardDefinitions {
def isPolymorphicSignature(sym: Symbol) = PolySigMethods(sym)
private lazy val PolySigMethods: Set[Symbol] = Set[Symbol](MethodHandle.info.decl(sn.Invoke), MethodHandle.info.decl(sn.InvokeExact)).filter(_.exists)
- lazy val Scala_Java8_CompatPackage = rootMirror.getPackageIfDefined("scala.compat.java8")
+ lazy val Scala_Java8_CompatPackage = rootMirror.getPackageIfDefined("scala.runtime.java8")
lazy val Scala_Java8_CompatPackage_JFunction = (0 to MaxFunctionArity).toArray map (i => getMemberIfDefined(Scala_Java8_CompatPackage.moduleClass, TypeName("JFunction" + i)))
}
}
diff --git a/src/reflect/scala/reflect/internal/FlagSets.scala b/src/reflect/scala/reflect/internal/FlagSets.scala
index ef9c77878f..b6521634fb 100644
--- a/src/reflect/scala/reflect/internal/FlagSets.scala
+++ b/src/reflect/scala/reflect/internal/FlagSets.scala
@@ -42,7 +42,7 @@ trait FlagSets extends api.FlagSets { self: SymbolTable =>
val DEFAULTPARAM : FlagSet = Flags.DEFAULTPARAM
val PRESUPER : FlagSet = Flags.PRESUPER
val DEFAULTINIT : FlagSet = Flags.DEFAULTINIT
- val ENUM : FlagSet = Flags.ENUM
+ val ENUM : FlagSet = Flags.JAVA_ENUM
val PARAMACCESSOR : FlagSet = Flags.PARAMACCESSOR
val CASEACCESSOR : FlagSet = Flags.CASEACCESSOR
val SYNTHETIC : FlagSet = Flags.SYNTHETIC
diff --git a/src/reflect/scala/reflect/internal/Flags.scala b/src/reflect/scala/reflect/internal/Flags.scala
index 1707061817..754b96a9dd 100644
--- a/src/reflect/scala/reflect/internal/Flags.scala
+++ b/src/reflect/scala/reflect/internal/Flags.scala
@@ -15,65 +15,65 @@ import scala.collection.{ mutable, immutable }
//
// Generated by mkFlagsTable() at Thu Feb 02 20:31:52 PST 2012
//
-// 0: PROTECTED/M
-// 1: OVERRIDE/M
-// 2: PRIVATE/M
-// 3: ABSTRACT/M
-// 4: DEFERRED/M
-// 5: FINAL/M
-// 6: METHOD
-// 7: INTERFACE/M
-// 8: MODULE
-// 9: IMPLICIT/M
-// 10: SEALED/M
-// 11: CASE/M
-// 12: MUTABLE/M
-// 13: PARAM/M
-// 14: PACKAGE
-// 15: MACRO/M
-// 16: BYNAMEPARAM/M CAPTURED COVARIANT/M
-// 17: CONTRAVARIANT/M INCONSTRUCTOR LABEL
-// 18: ABSOVERRIDE/M
-// 19: LOCAL/M
-// 20: JAVA/M
-// 21: SYNTHETIC
-// 22: STABLE
-// 23: STATIC/M
-// 24: CASEACCESSOR/M
-// 25: DEFAULTPARAM/M TRAIT/M
-// 26: BRIDGE
-// 27: ACCESSOR
-// 28: SUPERACCESSOR
-// 29: PARAMACCESSOR/M
-// 30: MODULEVAR
-// 31: LAZY/M
-// 32: IS_ERROR
-// 33: OVERLOADED
-// 34: LIFTED
-// 35: EXISTENTIAL MIXEDIN
-// 36: EXPANDEDNAME
-// 37: IMPLCLASS PRESUPER/M
-// 38: TRANS_FLAG
-// 39: LOCKED
-// 40: SPECIALIZED
-// 41: DEFAULTINIT/M
-// 42: VBRIDGE
-// 43: VARARGS
-// 44: TRIEDCOOKING
-// 45: SYNCHRONIZED/M
-// 46: ARTIFACT
-// 47: DEFAULTMETHOD/M
-// 48: ENUM
-// 49:
+// 0: PROTECTED/M
+// 1: OVERRIDE/M
+// 2: PRIVATE/M
+// 3: ABSTRACT/M
+// 4: DEFERRED/M
+// 5: FINAL/M
+// 6: METHOD
+// 7: INTERFACE/M
+// 8: MODULE
+// 9: IMPLICIT/M
+// 10: SEALED/M
+// 11: CASE/M
+// 12: MUTABLE/M
+// 13: PARAM/M
+// 14: PACKAGE
+// 15: MACRO/M
+// 16: BYNAMEPARAM/M CAPTURED COVARIANT/M
+// 17: CONTRAVARIANT/M INCONSTRUCTOR LABEL
+// 18: ABSOVERRIDE/M
+// 19: LOCAL/M
+// 20: JAVA/M
+// 21: SYNTHETIC
+// 22: STABLE
+// 23: STATIC/M
+// 24: CASEACCESSOR/M
+// 25: DEFAULTPARAM/M TRAIT/M
+// 26: BRIDGE
+// 27: ACCESSOR
+// 28: SUPERACCESSOR
+// 29: PARAMACCESSOR/M
+// 30: MODULEVAR
+// 31: LAZY/M
+// 32: IS_ERROR
+// 33: OVERLOADED
+// 34: LIFTED
+// 35: EXISTENTIAL MIXEDIN
+// 36: EXPANDEDNAME
+// 37: IMPLCLASS PRESUPER/M
+// 38: TRANS_FLAG
+// 39: LOCKED
+// 40: SPECIALIZED
+// 41: DEFAULTINIT/M
+// 42: VBRIDGE
+// 43: VARARGS
+// 44: TRIEDCOOKING
+// 45: SYNCHRONIZED/M
+// 46: ARTIFACT
+// 47: JAVA_DEFAULTMETHOD/M
+// 48: JAVA_ENUM
+// 49: JAVA_ANNOTATION
// 50:
-// 51: lateDEFERRED
-// 52: lateFINAL
-// 53: lateMETHOD
-// 54: lateINTERFACE
-// 55: lateMODULE
-// 56: notPROTECTED
-// 57: notOVERRIDE
-// 58: notPRIVATE
+// 51: lateDEFERRED
+// 52: lateFINAL
+// 53: lateMETHOD
+// 54: lateINTERFACE
+// 55: lateMODULE
+// 56: notPROTECTED
+// 57: notOVERRIDE
+// 58: notPRIVATE
// 59:
// 60:
// 61:
@@ -119,8 +119,9 @@ class ModifierFlags {
final val DEFAULTINIT = 1L << 41 // symbol is initialized to the default value: used by -Xcheckinit
final val ARTIFACT = 1L << 46 // symbol should be ignored when typechecking; will be marked ACC_SYNTHETIC in bytecode
// to see which symbols are marked as ARTIFACT, see scaladocs for FlagValues.ARTIFACT
- final val DEFAULTMETHOD = 1L << 47 // symbol is a java default method
- final val ENUM = 1L << 48 // symbol is an enum
+ final val JAVA_DEFAULTMETHOD = 1L << 47 // symbol is a java default method
+ final val JAVA_ENUM = 1L << 48 // symbol is a java enum
+ final val JAVA_ANNOTATION = 1L << 49 // symbol is a java annotation
// Overridden.
def flagToString(flag: Long): String = ""
@@ -172,12 +173,28 @@ class Flags extends ModifierFlags {
final val SYNCHRONIZED = 1L << 45 // symbol is a method which should be marked ACC_SYNCHRONIZED
// ------- shift definitions -------------------------------------------------------
+ //
+ // Flags from 1L to (1L << 50) are normal flags.
+ //
+ // The flags DEFERRED (1L << 4) to MODULE (1L << 8) have a `late` counterpart. Late flags change
+ // their counterpart from 0 to 1 after a specific phase (see below). The first late flag
+ // (lateDEFERRED) is at (1L << 51), i.e., late flags are shifted by 47. The last one is (1L << 55).
+ //
+ // The flags PROTECTED (1L) to PRIVATE (1L << 2) have a `not` counterpart. Negated flags change
+ // their counterpart from 1 to 0 after a specific phase (see below). They are shifted by 56, i.e.,
+ // the first negated flag (notPROTECTED) is at (1L << 56), the last at (1L << 58).
+ //
+ // Late and negative flags are only enabled after certain phases, implemented by the phaseNewFlags
+ // method of the SubComponent, so they implement a bit of a flag history.
+ //
+ // The flags (1L << 59) to (1L << 63) are currently unused. If added to the InitialFlags mask,
+ // they could be used as normal flags.
- final val InitialFlags = 0x0001FFFFFFFFFFFFL // flags that are enabled from phase 1.
- final val LateFlags = 0x00FE000000000000L // flags that override flags in 0x1FC.
- final val AntiFlags = 0x7F00000000000000L // flags that cancel flags in 0x07F
- final val LateShift = 47L
- final val AntiShift = 56L
+ final val InitialFlags = 0x0007FFFFFFFFFFFFL // normal flags, enabled from the first phase: 1L to (1L << 50)
+ final val LateFlags = 0x00F8000000000000L // flags that override flags in (1L << 4) to (1L << 8): DEFERRED, FINAL, INTERFACE, METHOD, MODULE
+ final val AntiFlags = 0x0700000000000000L // flags that cancel flags in 1L to (1L << 2): PROTECTED, OVERRIDE, PRIVATE
+ final val LateShift = 47
+ final val AntiShift = 56
// Flags which sketchily share the same slot
// 16: BYNAMEPARAM/M CAPTURED COVARIANT/M
@@ -243,7 +260,7 @@ class Flags extends ModifierFlags {
*/
final val ExplicitFlags =
PRIVATE | PROTECTED | ABSTRACT | FINAL | SEALED |
- OVERRIDE | CASE | IMPLICIT | ABSOVERRIDE | LAZY | DEFAULTMETHOD
+ OVERRIDE | CASE | IMPLICIT | ABSOVERRIDE | LAZY | JAVA_DEFAULTMETHOD
/** The two bridge flags */
final val BridgeFlags = BRIDGE | VBRIDGE
@@ -434,9 +451,9 @@ class Flags extends ModifierFlags {
case TRIEDCOOKING => "<triedcooking>" // (1L << 44)
case SYNCHRONIZED => "<synchronized>" // (1L << 45)
case ARTIFACT => "<artifact>" // (1L << 46)
- case DEFAULTMETHOD => "<defaultmethod>" // (1L << 47)
- case ENUM => "<enum>" // (1L << 48)
- case 0x2000000000000L => "" // (1L << 49)
+ case JAVA_DEFAULTMETHOD => "<defaultmethod>" // (1L << 47)
+ case JAVA_ENUM => "<enum>" // (1L << 48)
+ case JAVA_ANNOTATION => "<annotation>" // (1L << 49)
case 0x4000000000000L => "" // (1L << 50)
case `lateDEFERRED` => "<latedeferred>" // (1L << 51)
case `lateFINAL` => "<latefinal>" // (1L << 52)
diff --git a/src/reflect/scala/reflect/internal/HasFlags.scala b/src/reflect/scala/reflect/internal/HasFlags.scala
index aa8f4c532e..5162b15206 100644
--- a/src/reflect/scala/reflect/internal/HasFlags.scala
+++ b/src/reflect/scala/reflect/internal/HasFlags.scala
@@ -79,49 +79,50 @@ trait HasFlags {
// Tests which come through cleanly: both Symbol and Modifiers use these
// identically, testing for a single flag.
- def hasAbstractFlag = hasFlag(ABSTRACT)
- def hasAccessorFlag = hasFlag(ACCESSOR)
- def hasDefault = hasFlag(DEFAULTPARAM) && hasFlag(METHOD | PARAM) // Second condition disambiguates with TRAIT
- def hasEnumFlag = hasFlag(ENUM)
+ def hasAbstractFlag = hasFlag(ABSTRACT)
+ def hasAccessorFlag = hasFlag(ACCESSOR)
+ def hasDefault = hasFlag(DEFAULTPARAM) && hasFlag(METHOD | PARAM) // Second condition disambiguates with TRAIT
+ def hasJavaEnumFlag = hasFlag(JAVA_ENUM)
+ def hasJavaAnnotationFlag = hasFlag(JAVA_ANNOTATION)
@deprecated("Use isLocalToThis instead", "2.11.0")
- def hasLocalFlag = hasFlag(LOCAL)
- def isLocalToThis = hasFlag(LOCAL)
- def hasModuleFlag = hasFlag(MODULE)
- def hasPackageFlag = hasFlag(PACKAGE)
- def hasStableFlag = hasFlag(STABLE)
- def hasStaticFlag = hasFlag(STATIC)
- def isAbstractOverride = hasFlag(ABSOVERRIDE)
- def isAnyOverride = hasFlag(OVERRIDE | ABSOVERRIDE)
- def isCase = hasFlag(CASE)
- def isCaseAccessor = hasFlag(CASEACCESSOR)
- def isDeferred = hasFlag(DEFERRED)
- def isFinal = hasFlag(FINAL)
- def isArtifact = hasFlag(ARTIFACT)
- def isImplicit = hasFlag(IMPLICIT)
- def isInterface = hasFlag(INTERFACE)
- def isJavaDefined = hasFlag(JAVA)
- def isLabel = hasAllFlags(LABEL | METHOD) && !hasAccessorFlag
- def isLazy = hasFlag(LAZY)
- def isLifted = hasFlag(LIFTED)
- def isMacro = hasFlag(MACRO)
- def isMutable = hasFlag(MUTABLE)
- def isOverride = hasFlag(OVERRIDE)
- def isParamAccessor = hasFlag(PARAMACCESSOR)
- def isPrivate = hasFlag(PRIVATE)
+ def hasLocalFlag = hasFlag(LOCAL)
+ def isLocalToThis = hasFlag(LOCAL)
+ def hasModuleFlag = hasFlag(MODULE)
+ def hasPackageFlag = hasFlag(PACKAGE)
+ def hasStableFlag = hasFlag(STABLE)
+ def hasStaticFlag = hasFlag(STATIC)
+ def isAbstractOverride = hasFlag(ABSOVERRIDE)
+ def isAnyOverride = hasFlag(OVERRIDE | ABSOVERRIDE)
+ def isCase = hasFlag(CASE)
+ def isCaseAccessor = hasFlag(CASEACCESSOR)
+ def isDeferred = hasFlag(DEFERRED)
+ def isFinal = hasFlag(FINAL)
+ def isArtifact = hasFlag(ARTIFACT)
+ def isImplicit = hasFlag(IMPLICIT)
+ def isInterface = hasFlag(INTERFACE)
+ def isJavaDefined = hasFlag(JAVA)
+ def isLabel = hasAllFlags(LABEL | METHOD) && !hasAccessorFlag
+ def isLazy = hasFlag(LAZY)
+ def isLifted = hasFlag(LIFTED)
+ def isMacro = hasFlag(MACRO)
+ def isMutable = hasFlag(MUTABLE)
+ def isOverride = hasFlag(OVERRIDE)
+ def isParamAccessor = hasFlag(PARAMACCESSOR)
+ def isPrivate = hasFlag(PRIVATE)
@deprecated ("Use `hasPackageFlag` instead", "2.11.0")
- def isPackage = hasFlag(PACKAGE)
- def isPrivateLocal = hasAllFlags(PrivateLocal)
- def isProtected = hasFlag(PROTECTED)
- def isProtectedLocal = hasAllFlags(ProtectedLocal)
- def isPublic = hasNoFlags(PRIVATE | PROTECTED) && !hasAccessBoundary
- def isSealed = hasFlag(SEALED)
- def isSpecialized = hasFlag(SPECIALIZED)
- def isSuperAccessor = hasFlag(SUPERACCESSOR)
- def isSynthetic = hasFlag(SYNTHETIC)
- def isTrait = hasFlag(TRAIT) && !hasFlag(PARAM)
-
- def isDeferredOrDefault = hasFlag(DEFERRED | DEFAULTMETHOD)
- def isDeferredNotDefault = isDeferred && !hasFlag(DEFAULTMETHOD)
+ def isPackage = hasFlag(PACKAGE)
+ def isPrivateLocal = hasAllFlags(PrivateLocal)
+ def isProtected = hasFlag(PROTECTED)
+ def isProtectedLocal = hasAllFlags(ProtectedLocal)
+ def isPublic = hasNoFlags(PRIVATE | PROTECTED) && !hasAccessBoundary
+ def isSealed = hasFlag(SEALED)
+ def isSpecialized = hasFlag(SPECIALIZED)
+ def isSuperAccessor = hasFlag(SUPERACCESSOR)
+ def isSynthetic = hasFlag(SYNTHETIC)
+ def isTrait = hasFlag(TRAIT) && !hasFlag(PARAM)
+
+ def isDeferredOrJavaDefault = hasFlag(DEFERRED | JAVA_DEFAULTMETHOD)
+ def isDeferredNotJavaDefault = isDeferred && !hasFlag(JAVA_DEFAULTMETHOD)
def flagBitsToString(bits: Long): String = {
// Fast path for common case
diff --git a/src/reflect/scala/reflect/internal/Mirrors.scala b/src/reflect/scala/reflect/internal/Mirrors.scala
index 0cbb976a98..0f0f16574e 100644
--- a/src/reflect/scala/reflect/internal/Mirrors.scala
+++ b/src/reflect/scala/reflect/internal/Mirrors.scala
@@ -180,7 +180,7 @@ trait Mirrors extends api.Mirrors {
def getPackageObject(fullname: String): ModuleSymbol = getPackageObject(newTermName(fullname))
def getPackageObject(fullname: TermName): ModuleSymbol =
- (getPackage(fullname).info member nme.PACKAGE) match {
+ (getPackage(fullname).packageObject) match {
case x: ModuleSymbol => x
case _ => MissingRequirementError.notFound("package object " + fullname)
}
@@ -191,15 +191,6 @@ trait Mirrors extends api.Mirrors {
def getPackageObjectIfDefined(fullname: TermName): Symbol =
wrapMissing(getPackageObject(fullname))
- final def getPackageObjectWithMember(pre: Type, sym: Symbol): Symbol = {
- // The owner of a symbol which requires package qualification may be the
- // package object iself, but it also could be any superclass of the package
- // object. In the latter case, we must go through the qualifier's info
- // to obtain the right symbol.
- if (sym.owner.isModuleClass) sym.owner.sourceModule // fast path, if the member is owned by a module class, that must be linked to the package object
- else pre member nme.PACKAGE // otherwise we have to findMember
- }
-
override def staticPackage(fullname: String): ModuleSymbol =
try ensurePackageSymbol(fullname.toString, getModuleOrClass(newTermNameCached(fullname)), allowModules = false)
catch { case mre: MissingRequirementError => throw new ScalaReflectionException(mre.msg) }
diff --git a/src/reflect/scala/reflect/internal/Reporting.scala b/src/reflect/scala/reflect/internal/Reporting.scala
index f2de83bc5d..2534f59c97 100644
--- a/src/reflect/scala/reflect/internal/Reporting.scala
+++ b/src/reflect/scala/reflect/internal/Reporting.scala
@@ -8,11 +8,11 @@ package reflect
package internal
/** Provides delegates to the reporter doing the actual work.
- * All forwarding methods should be marked final,
- * but some subclasses out of our reach stil override them.
+ * All forwarding methods should be marked final,
+ * but some subclasses out of our reach stil override them.
*
- * Eventually, this interface should be reduced to one method: `reporter`,
- * and clients should indirect themselves (reduce duplication of forwarders).
+ * Eventually, this interface should be reduced to one method: `reporter`,
+ * and clients should indirect themselves (reduce duplication of forwarders).
*/
trait Reporting { self : Positions =>
def reporter: Reporter
@@ -71,8 +71,8 @@ import util.Position
/** Report information, warnings and errors.
*
- * This describes the (future) external interface for issuing information, warnings and errors.
- * Currently, scala.tools.nsc.Reporter is used by sbt/ide/partest.
+ * This describes the (future) external interface for issuing information, warnings and errors.
+ * Currently, scala.tools.nsc.Reporter is used by sbt/ide/partest.
*/
abstract class Reporter {
protected def info0(pos: Position, msg: String, severity: Severity, force: Boolean): Unit
@@ -101,7 +101,10 @@ abstract class Reporter {
resetCount(ERROR)
}
- def flush(): Unit = { }
+ def flush(): Unit = ()
+
+ /** Finish reporting: print summaries, release resources. */
+ def finish(): Unit = ()
}
// TODO: move into superclass once partest cuts tie on Severity
diff --git a/src/reflect/scala/reflect/internal/StdNames.scala b/src/reflect/scala/reflect/internal/StdNames.scala
index 52558d9395..f1016e1b76 100644
--- a/src/reflect/scala/reflect/internal/StdNames.scala
+++ b/src/reflect/scala/reflect/internal/StdNames.scala
@@ -111,6 +111,7 @@ trait StdNames {
val PACKAGE: NameType = "package"
val ROOT: NameType = "<root>"
val SPECIALIZED_SUFFIX: NameType = "$sp"
+ val CASE_ACCESSOR: NameType = "$access"
val NESTED_IN: String = "$nestedIn"
val NESTED_IN_ANON_CLASS: String = NESTED_IN + ANON_CLASS_NAME.toString.replace("$", "")
diff --git a/src/reflect/scala/reflect/internal/SymbolTable.scala b/src/reflect/scala/reflect/internal/SymbolTable.scala
index ef63078f90..b0145f8a89 100644
--- a/src/reflect/scala/reflect/internal/SymbolTable.scala
+++ b/src/reflect/scala/reflect/internal/SymbolTable.scala
@@ -332,7 +332,7 @@ abstract class SymbolTable extends macros.Universe
/** if there's a `package` member object in `pkgClass`, enter its members into it. */
def openPackageModule(pkgClass: Symbol) {
- val pkgModule = pkgClass.info.decl(nme.PACKAGEkw)
+ val pkgModule = pkgClass.packageObject
def fromSource = pkgModule.rawInfo match {
case ltp: SymLoader => ltp.fromSource
case _ => false
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala
index 2329b30638..8a52f0b9d8 100644
--- a/src/reflect/scala/reflect/internal/Symbols.scala
+++ b/src/reflect/scala/reflect/internal/Symbols.scala
@@ -102,6 +102,9 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
def isPrivateThis = (this hasFlag PRIVATE) && (this hasFlag LOCAL)
def isProtectedThis = (this hasFlag PROTECTED) && (this hasFlag LOCAL)
+ def isJavaEnum: Boolean = hasJavaEnumFlag
+ def isJavaAnnotation: Boolean = hasJavaAnnotationFlag
+
def newNestedSymbol(name: Name, pos: Position, newFlags: Long, isClass: Boolean): Symbol = name match {
case n: TermName => newTermSymbol(n, pos, newFlags)
case n: TypeName => if (isClass) newClassSymbol(n, pos, newFlags) else newNonClassSymbol(n, pos, newFlags)
@@ -732,7 +735,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
final def flags: Long = {
if (Statistics.hotEnabled) Statistics.incCounter(flagsCount)
val fs = _rawflags & phase.flagMask
- (fs | ((fs & LateFlags) >>> LateShift)) & ~(fs >>> AntiShift)
+ (fs | ((fs & LateFlags) >>> LateShift)) & ~((fs & AntiFlags) >>> AntiShift)
}
def flags_=(fs: Long) = _rawflags = fs
def rawflags_=(x: Long) { _rawflags = x }
@@ -819,6 +822,12 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
*/
def skipPackageObject: Symbol = this
+ /** The package object symbol corresponding to this package or package class symbol, or NoSymbol otherwise */
+ def packageObject: Symbol =
+ if (isPackageClass) tpe.packageObject
+ else if (isPackage) moduleClass.packageObject
+ else NoSymbol
+
/** If this is a constructor, its owner: otherwise this.
*/
final def skipConstructor: Symbol = if (isConstructor) owner else this
@@ -858,7 +867,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
def isDeprecated = hasAnnotation(DeprecatedAttr)
def deprecationMessage = getAnnotation(DeprecatedAttr) flatMap (_ stringArg 0)
def deprecationVersion = getAnnotation(DeprecatedAttr) flatMap (_ stringArg 1)
- def deprecatedParamName = getAnnotation(DeprecatedNameAttr) flatMap (_ symbolArg 0)
+ def deprecatedParamName = getAnnotation(DeprecatedNameAttr) flatMap (_ symbolArg 0 orElse Some(nme.NO_NAME))
def hasDeprecatedInheritanceAnnotation
= hasAnnotation(DeprecatedInheritanceAttr)
def deprecatedInheritanceMessage
@@ -974,7 +983,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
private def isNotOverridden = (
owner.isClass && (
owner.isEffectivelyFinal
- || owner.isSealed && owner.children.forall(c => c.isEffectivelyFinal && (overridingSymbol(c) == NoSymbol))
+ || (owner.isSealed && owner.sealedChildren.forall(c => c.isEffectivelyFinal && (overridingSymbol(c) == NoSymbol)))
)
)
@@ -986,6 +995,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
isPrivate
|| isLocalToBlock
)
+ || isClass && originalOwner.isTerm && children.isEmpty // we track known subclasses of term-owned classes, use that infer finality
)
/** Is this symbol effectively final or a concrete term member of sealed class whose children do not override it */
final def isEffectivelyFinalOrNotOverridden: Boolean = isEffectivelyFinal || (isTerm && !isDeferred && isNotOverridden)
@@ -2489,14 +2499,15 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
def associatedFile: AbstractFile = enclosingTopLevelClass.associatedFile
def associatedFile_=(f: AbstractFile) { abort("associatedFile_= inapplicable for " + this) }
- /** If this is a sealed class, its known direct subclasses.
+ /** If this is a sealed or local class, its known direct subclasses.
* Otherwise, the empty set.
*/
def children: Set[Symbol] = Set()
+ final def sealedChildren: Set[Symbol] = if (!isSealed) Set.empty else children
/** Recursively assemble all children of this symbol.
*/
- def sealedDescendants: Set[Symbol] = children.flatMap(_.sealedDescendants) + this
+ final def sealedDescendants: Set[Symbol] = if (!isSealed) Set(this) else children.flatMap(_.sealedDescendants) + this
@inline final def orElse(alt: => Symbol): Symbol = if (this ne NoSymbol) this else alt
@inline final def andAlso(f: Symbol => Unit): Symbol = { if (this ne NoSymbol) f(this) ; this }
@@ -3378,13 +3389,9 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
def implicitMembers: Scope = {
val tp = info
if ((implicitMembersCacheKey1 ne tp) || (implicitMembersCacheKey2 ne tp.decls.elems)) {
- // Skip a package object class, because the members are also in
- // the package and we wish to avoid spurious ambiguities as in pos/t3999.
- if (!isPackageObjectClass) {
- implicitMembersCacheValue = tp.implicitMembers
- implicitMembersCacheKey1 = tp
- implicitMembersCacheKey2 = tp.decls.elems
- }
+ implicitMembersCacheValue = tp.membersBasedOnFlags(BridgeFlags, IMPLICIT)
+ implicitMembersCacheKey1 = tp
+ implicitMembersCacheKey2 = tp.decls.elems
}
implicitMembersCacheValue
}
diff --git a/src/reflect/scala/reflect/internal/TreeGen.scala b/src/reflect/scala/reflect/internal/TreeGen.scala
index b2248ad518..894038dd0a 100644
--- a/src/reflect/scala/reflect/internal/TreeGen.scala
+++ b/src/reflect/scala/reflect/internal/TreeGen.scala
@@ -191,8 +191,8 @@ abstract class TreeGen {
)
val pkgQualifier =
if (needsPackageQualifier) {
- val packageObject = rootMirror.getPackageObjectWithMember(qual.tpe, sym)
- Select(qual, nme.PACKAGE) setSymbol packageObject setType singleType(qual.tpe, packageObject)
+ val packageObject = qualsym.packageObject
+ Select(qual, nme.PACKAGE) setSymbol packageObject setType packageObject.typeOfThis
}
else qual
diff --git a/src/reflect/scala/reflect/internal/TreeInfo.scala b/src/reflect/scala/reflect/internal/TreeInfo.scala
index 4657fa0000..7ad5fdf096 100644
--- a/src/reflect/scala/reflect/internal/TreeInfo.scala
+++ b/src/reflect/scala/reflect/internal/TreeInfo.scala
@@ -128,6 +128,7 @@ abstract class TreeInfo {
symOk(tree.symbol)
&& tree.symbol.isStable
&& !definitions.isByNameParamType(tree.tpe)
+ && !definitions.isByName(tree.symbol)
&& (allowVolatile || !tree.symbol.hasVolatileType) // TODO SPEC: not required by spec
)
diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala
index 8c72405c8d..9c681f3423 100644
--- a/src/reflect/scala/reflect/internal/Types.scala
+++ b/src/reflect/scala/reflect/internal/Types.scala
@@ -589,7 +589,12 @@ trait Types
def nonPrivateMembersAdmitting(admit: Long): Scope = membersBasedOnFlags(BridgeAndPrivateFlags & ~admit, 0)
/** A list of all implicit symbols of this type (defined or inherited) */
- def implicitMembers: Scope = membersBasedOnFlags(BridgeFlags, IMPLICIT)
+ def implicitMembers: Scope = {
+ typeSymbolDirect match {
+ case sym: ModuleClassSymbol => sym.implicitMembers
+ case _ => membersBasedOnFlags(BridgeFlags, IMPLICIT)
+ }
+ }
/** A list of all deferred symbols of this type (defined or inherited) */
def deferredMembers: Scope = membersBasedOnFlags(BridgeFlags, DEFERRED)
@@ -606,6 +611,8 @@ trait Types
def nonPrivateMember(name: Name): Symbol =
memberBasedOnName(name, BridgeAndPrivateFlags)
+ def packageObject: Symbol = member(nme.PACKAGE)
+
/** The non-private member with given name, admitting members with given flags `admit`.
* "Admitting" refers to the fact that members with a PRIVATE, BRIDGE, or VBRIDGE
* flag are usually excluded from findMember results, but supplying any of those flags
@@ -659,7 +666,7 @@ trait Types
)
if (trivial) this
else {
- val m = newAsSeenFromMap(pre.normalize, clazz)
+ val m = new AsSeenFromMap(pre.normalize, clazz)
val tp = m(this)
val tp1 = existentialAbstraction(m.capturedParams, tp)
@@ -1600,7 +1607,14 @@ trait Types
private var normalized: Type = _
private def normalizeImpl = {
// TODO see comments around def intersectionType and def merge
- def flatten(tps: List[Type]): List[Type] = tps flatMap { case RefinedType(parents, ds) if ds.isEmpty => flatten(parents) case tp => List(tp) }
+ // SI-8575 The dealias is needed here to keep subtyping transitive, example in run/t8575b.scala
+ def flatten(tps: List[Type]): List[Type] = {
+ def dealiasRefinement(tp: Type) = if (tp.dealias.isInstanceOf[RefinedType]) tp.dealias else tp
+ tps map dealiasRefinement flatMap {
+ case RefinedType(parents, ds) if ds.isEmpty => flatten(parents)
+ case tp => List(tp)
+ }
+ }
val flattened = flatten(parents).distinct
if (decls.isEmpty && hasLength(flattened, 1)) {
flattened.head
diff --git a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
index 1f643b2b23..951c155de6 100644
--- a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
+++ b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
@@ -239,7 +239,6 @@ abstract class UnPickler {
if (missing.startsWith("scala.xml")) Some(("org.scala-lang.modules", "scala-xml"))
else if (missing.startsWith("scala.util.parsing")) Some(("org.scala-lang.modules", "scala-parser-combinators"))
else if (missing.startsWith("scala.swing")) Some(("org.scala-lang.modules", "scala-swing"))
- else if (missing.startsWith("scala.util.continuations")) Some(("org.scala-lang.plugins", "scala-continuations-library"))
else None
(module map { case (group, art) =>
diff --git a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala
index 817c9706b4..d6d216863b 100644
--- a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala
+++ b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala
@@ -449,12 +449,15 @@ private[internal] trait TypeMaps {
(pre eq NoType) || (pre eq NoPrefix) || !isPossiblePrefix(clazz)
)
- def newAsSeenFromMap(pre: Type, clazz: Symbol): AsSeenFromMap =
- new AsSeenFromMap(pre, clazz)
+ @deprecated("Use new AsSeenFromMap instead", "2.12.0")
+ final def newAsSeenFromMap(pre: Type, clazz: Symbol): AsSeenFromMap = new AsSeenFromMap(pre, clazz)
/** A map to compute the asSeenFrom method.
*/
- class AsSeenFromMap(seenFromPrefix: Type, seenFromClass: Symbol) extends TypeMap with KeepOnlyTypeConstraints {
+ class AsSeenFromMap(seenFromPrefix0: Type, seenFromClass: Symbol) extends TypeMap with KeepOnlyTypeConstraints {
+ private val seenFromPrefix: Type = if (seenFromPrefix0.typeSymbolDirect.hasPackageFlag && !seenFromClass.hasPackageFlag)
+ seenFromPrefix0.packageObject.typeOfThis
+ else seenFromPrefix0
// Some example source constructs relevant in asSeenFrom:
//
// object CaptureThis {
diff --git a/src/reflect/scala/reflect/internal/transform/Erasure.scala b/src/reflect/scala/reflect/internal/transform/Erasure.scala
index 01e28e5642..9853a0fa0c 100644
--- a/src/reflect/scala/reflect/internal/transform/Erasure.scala
+++ b/src/reflect/scala/reflect/internal/transform/Erasure.scala
@@ -282,8 +282,17 @@ trait Erasure {
}
object boxingErasure extends ScalaErasureMap {
+ private var boxPrimitives = true
+
+ override def applyInArray(tp: Type): Type = {
+ val saved = boxPrimitives
+ boxPrimitives = false
+ try super.applyInArray(tp)
+ finally boxPrimitives = saved
+ }
+
override def eraseNormalClassRef(tref: TypeRef) =
- if (isPrimitiveValueClass(tref.sym)) boxedClass(tref.sym).tpe
+ if (boxPrimitives && isPrimitiveValueClass(tref.sym)) boxedClass(tref.sym).tpe
else super.eraseNormalClassRef(tref)
override def eraseDerivedValueClassRef(tref: TypeRef) =
super.eraseNormalClassRef(tref)
diff --git a/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala b/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala
index 41011f6c6b..296934e253 100644
--- a/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala
+++ b/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala
@@ -11,7 +11,8 @@ import java.lang.reflect.{ Constructor, Modifier, Method }
import java.io.{ File => JFile }
import java.net.{ URLClassLoader => JURLClassLoader }
import java.net.URL
-import scala.reflect.runtime.ReflectionUtils.unwrapHandler
+import scala.reflect.internal.FatalError
+import scala.reflect.runtime.ReflectionUtils.{ show, unwrapHandler }
import ScalaClassLoader._
import scala.util.control.Exception.{ catching }
import scala.language.implicitConversions
@@ -46,6 +47,33 @@ trait ScalaClassLoader extends JClassLoader {
def create(path: String): AnyRef =
tryToInitializeClass[AnyRef](path).map(_.newInstance()).orNull
+ /** Create an instance with ctor args, or invoke errorFn before throwing. */
+ def create[T <: AnyRef : ClassTag](path: String, errorFn: String => Unit)(args: AnyRef*): T = {
+ def fail(msg: String) = error(msg, new IllegalArgumentException(msg))
+ def error(msg: String, e: Throwable) = { errorFn(msg) ; throw e }
+ try {
+ val clazz = Class.forName(path, /*initialize =*/ true, /*loader =*/ this)
+ if (classTag[T].runtimeClass isAssignableFrom clazz) {
+ val ctor = {
+ val maybes = clazz.getConstructors filter (c => c.getParameterCount == args.size &&
+ (c.getParameterTypes zip args).forall { case (k, a) => k isAssignableFrom a.getClass })
+ if (maybes.size == 1) maybes.head
+ else fail(s"Constructor must accept arg list (${args map (_.getClass.getName) mkString ", "}): ${path}")
+ }
+ (ctor.newInstance(args: _*)).asInstanceOf[T]
+ } else {
+ errorFn(s"""Loader for ${classTag[T]}: [${show(classTag[T].runtimeClass.getClassLoader)}]
+ |Loader for ${clazz.getName}: [${show(clazz.getClassLoader)}]""".stripMargin)
+ fail(s"Not a ${classTag[T]}: ${path}")
+ }
+ } catch {
+ case e: ClassNotFoundException =>
+ error(s"Class not found: ${path}", e)
+ case e @ (_: LinkageError | _: ReflectiveOperationException) =>
+ error(s"Unable to create instance: ${path}: ${e.toString}", e)
+ }
+ }
+
/** The actual bytes for a class file, or an empty array if it can't be found. */
def classBytes(className: String): Array[Byte] = classAsStream(className) match {
case null => Array()
diff --git a/src/reflect/scala/reflect/runtime/JavaMirrors.scala b/src/reflect/scala/reflect/runtime/JavaMirrors.scala
index 8c32a92ecd..d0670f337a 100644
--- a/src/reflect/scala/reflect/runtime/JavaMirrors.scala
+++ b/src/reflect/scala/reflect/runtime/JavaMirrors.scala
@@ -755,6 +755,7 @@ private[scala] trait JavaMirrors extends internal.SymbolTable with api.JavaUnive
val ifaces = jclazz.getGenericInterfaces.toList map typeToScala
val isAnnotation = JavaAccFlags(jclazz).isAnnotation
if (isAnnotation) AnnotationClass.tpe :: ClassfileAnnotationClass.tpe :: ifaces
+ else if (jclazz.isInterface) ObjectTpe :: ifaces // interfaces have Object as superclass in the classfile (see jvm spec), but getGenericSuperclass seems to return null
else (if (jsuperclazz == null) AnyTpe else typeToScala(jsuperclazz)) :: ifaces
} finally {
parentsLevel -= 1
diff --git a/src/repl/scala/tools/nsc/interpreter/ILoop.scala b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
index 6470a450b2..612bdd98c9 100644
--- a/src/repl/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
@@ -267,8 +267,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
}
}
- protected def newJavap() =
- JavapClass(addToolsJarToLoader(), new IMain.ReplStrippingWriter(intp), Some(intp))
+ protected def newJavap() = JavapClass(addToolsJarToLoader(), new IMain.ReplStrippingWriter(intp), intp)
private lazy val javap = substituteAndLog[Javap]("javap", NoJavap)(newJavap())
@@ -307,7 +306,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
if (javap == null)
s":javap unavailable, no tools.jar at $jdkHome. Set JDK_HOME."
else if (line == "")
- ":javap [-lcsvp] [path1 path2 ...]"
+ Javap.helpText
else
javap(words(line)) foreach { res =>
if (res.isError) return s"Failed: ${res.value}"
diff --git a/src/repl/scala/tools/nsc/interpreter/JavapClass.scala b/src/repl/scala/tools/nsc/interpreter/JavapClass.scala
index c240ab027a..04f4512717 100644
--- a/src/repl/scala/tools/nsc/interpreter/JavapClass.scala
+++ b/src/repl/scala/tools/nsc/interpreter/JavapClass.scala
@@ -2,13 +2,11 @@
* Copyright 2005-2013 LAMP/EPFL
* @author Paul Phillips
*/
-
package scala
package tools.nsc
package interpreter
-import java.lang.{ ClassLoader => JavaClassLoader, Iterable => JIterable }
-import scala.tools.asm.Opcodes
+import java.lang.{ Iterable => JIterable }
import scala.tools.nsc.util.ScalaClassLoader
import java.io.{ ByteArrayInputStream, CharArrayWriter, FileNotFoundException, PrintWriter, StringWriter, Writer }
import java.util.{ Locale }
@@ -25,108 +23,55 @@ import scala.collection.JavaConverters._
import scala.collection.generic.Clearable
import java.net.URL
import scala.language.reflectiveCalls
-import PartialFunction.{ cond => when }
-import Javap._
+import Javap.{ JpResult, JpError, Showable, helper, toolArgs, DefaultOptions }
-/** Javap command implementation. Supports platform tool for Java 6 or 7+.
- * Adds a few options for REPL world, to show bodies of `App` classes and closures.
+/** Javap command implementation.
*/
class JavapClass(
val loader: ScalaClassLoader,
val printWriter: PrintWriter,
- intp: Option[IMain] = None
+ intp: IMain
) extends Javap {
- import JavapTool.ToolArgs
import JavapClass._
lazy val tool = JavapTool()
- /** Run the tool. Option args start with "-", except that "-" itself
- * denotes the last REPL result.
- * The default options are "-protected -verbose".
- * Byte data for filename args is retrieved with findBytes.
- * @return results for invoking JpResult.show()
- */
def apply(args: Seq[String]): List[JpResult] = {
- val (options, classes) = args partition (s => (s startsWith "-") && s.length > 1)
- val (flags, upgraded) = upgrade(options)
- import flags.{ app, fun, help, raw }
-
- val targets = if (fun && !help) FunFinder(loader, intp).funs(classes) else classes
+ val (options0, targets) = args partition (s => (s startsWith "-") && s.length > 1)
+ val (options, filter) = {
+ val (opts, flag) = toolArgs(options0)
+ (if (opts.isEmpty) DefaultOptions else opts, flag)
+ }
- if (help || classes.isEmpty)
- List(JpResult(JavapTool.helper(printWriter)))
- else if (targets.isEmpty)
- List(JpResult("No closures found."))
+ if ((options contains "-help") || targets.isEmpty)
+ List(JpResult(helper(printWriter)))
else
- tool(raw, upgraded)(targets map (targeted(_, app))) // JavapTool.apply
+ tool(options, filter)(targets map targeted)
}
- /** Cull our tool options. */
- private def upgrade(options: Seq[String]): (ToolArgs, Seq[String]) =
- ToolArgs fromArgs options match {
- case (t, s) if s.nonEmpty => (t, s)
- case (t, s) => (t, JavapTool.DefaultOptions)
- }
-
/** Associate the requested path with a possibly failed or empty array of bytes. */
- private def targeted(path: String, app: Boolean): (String, Try[Array[Byte]]) =
- bytesFor(path, app) match {
+ private def targeted(path: String): (String, Try[Array[Byte]]) =
+ bytesFor(path) match {
case Success((target, bytes)) => (target, Try(bytes))
case f: Failure[_] => (path, Failure(f.exception))
}
- /** Find bytes. Handle "-", "-app", "Foo#bar" (by ignoring member), "#bar" (by taking "bar").
+ /** Find bytes. Handle "-", "Foo#bar" (by ignoring member), "#bar" (by taking "bar").
* @return the path to use for filtering, and the byte array
*/
- private def bytesFor(path: String, app: Boolean) = Try {
- def last = intp.get.mostRecentVar // fail if no intp
+ private def bytesFor(path: String) = Try {
val req = path match {
- case "-" => last
+ case "-" => intp.mostRecentVar
case HashSplit(prefix, _) if prefix != null => prefix
case HashSplit(_, member) if member != null => member
case s => s
}
- val targetedBytes = if (app) findAppBody(req) else (path, findBytes(req))
- targetedBytes match {
+ (path, findBytes(req)) match {
case (_, bytes) if bytes.isEmpty => throw new FileNotFoundException(s"Could not find class bytes for '$path'")
case ok => ok
}
}
- private def findAppBody(path: String): (String, Array[Byte]) = {
- // is this new style delayedEndpoint? then find it.
- // the name test is naive. could add $mangled path.
- // assumes only the first match is of interest (because only one endpoint is generated).
- def findNewStyle(bytes: Array[Byte]) = {
- import scala.tools.asm.ClassReader
- //foo/Bar.delayedEndpoint$foo$Bar$1
- val endpoint = "delayedEndpoint".r.unanchored
- def isEndPoint(s: String) = (s contains '$') && when(s) { case endpoint() => true }
- new ClassReader(bytes) withMethods { methods =>
- methods collectFirst { case m if isEndPoint(m.name) => m.name }
- }
- }
- // try new style, and add foo#delayedEndpoint$bar$1 to filter on the endpoint
- def asNewStyle(bytes: Array[Byte]) = Some(bytes) filter (_.nonEmpty) flatMap { bs =>
- findNewStyle(bs) map (n => (s"$path#$n", bs))
- }
- // use old style, and add foo# to filter on apply method
- def asOldStyle = {
- def asAppBody(s: String) = {
- val (cls, fix) = s.splitSuffix
- s"${cls}$$delayedInit$$body${fix}"
- }
- val oldStyle = asAppBody(path)
- val oldBytes = findBytes(oldStyle)
- if (oldBytes.nonEmpty) (s"$oldStyle#", oldBytes)
- else (path, oldBytes)
- }
-
- val pathBytes = findBytes(path)
- asNewStyle(pathBytes) getOrElse asOldStyle
- }
-
def findBytes(path: String): Array[Byte] = tryFile(path) getOrElse tryClass(path)
/** Assume the string is a path and try to find the classfile it represents.
@@ -151,7 +96,7 @@ class JavapClass(
if (0 until s.length - 1 contains i) {
val name = s substring (0, i)
val sufx = s substring i
- val tran = intp flatMap (_ translatePath name)
+ val tran = intp translatePath name
def loadableOrNone(strip: Boolean) = {
def suffix(strip: Boolean)(x: String) =
(if (strip && (x endsWith "$")) x.init else x) + sufx
@@ -169,13 +114,13 @@ class JavapClass(
// if repl, translate the name to something replish
// (for translate, would be nicer to get the sym and ask .isClass,
// instead of translatePath and then asking did I get a class back)
- val q = if (intp.isEmpty) p else (
+ val q = (
// only simple names get the scope treatment
Some(p) filter (_ contains '.')
// take path as a Name in scope
- orElse (intp flatMap (_ translatePath p) filter loadable)
+ orElse (intp translatePath p filter loadable)
// take path as a Name in scope and find its enclosing class
- orElse (intp flatMap (_ translateEnclosingClass p) filter loadable)
+ orElse (intp translateEnclosingClass p filter loadable)
// take path as a synthetic derived from some Name in scope
orElse desynthesize(p)
// just try it plain
@@ -184,16 +129,10 @@ class JavapClass(
load(q)
}
- /** Base class for javap tool adapters for java 6 and 7. */
- abstract class JavapTool {
+ class JavapTool {
type ByteAry = Array[Byte]
type Input = Tuple2[String, Try[ByteAry]]
- /** Run the tool. */
- def apply(raw: Boolean, options: Seq[String])(inputs: Seq[Input]): List[JpResult]
-
- // Since the tool is loaded by reflection, check for catastrophic failure.
- protected def failed: Boolean
implicit protected class Failer[A](a: =>A) {
def orFailed[B >: A](b: =>B) = if (failed) b else a
}
@@ -209,8 +148,7 @@ class JavapClass(
}
def filterLines(target: String, text: String): String = {
- // take Foo# as Foo#apply for purposes of filtering. Useful for -fun Foo#;
- // if apply is added here, it's for other than -fun: javap Foo#, perhaps m#?
+ // take Foo# as Foo#apply for purposes of filtering.
val filterOn = target.splitHashMember._2 map { s => if (s.isEmpty) "apply" else s }
var filtering = false // true if in region matching filter
// turn filtering on/off given the pattern of interest
@@ -253,62 +191,6 @@ class JavapClass(
sw.toString
}
- /** Create a Showable with output massage.
- * @param raw show ugly repl names
- * @param target attempt to filter output to show region of interest
- * @param preamble other messages to output
- */
- def showWithPreamble(raw: Boolean, target: String, preamble: String = ""): Showable =
- new Showable {
- private def writeLines() = filterLines(target, preamble + written)
- val output = writeLines()
-
- // ReplStrippingWriter clips and scrubs on write(String)
- // circumvent it by write(mw, 0, mw.length) or wrap it in withoutUnwrapping
- def show() =
- if (raw && intp.isDefined) intp.get withoutUnwrapping { printWriter.write(output, 0, output.length) }
- else intp.get withoutTruncating(printWriter write output)
- }
- }
-
- class JavapTool6 extends JavapTool {
- import JavapTool._
- val EnvClass = loader.tryToInitializeClass[FakeEnvironment](Env).orNull
- val PrinterClass = loader.tryToInitializeClass[FakePrinter](Printer).orNull
- override protected def failed = (EnvClass eq null) || (PrinterClass eq null)
-
- val PrinterCtr = PrinterClass.getConstructor(classOf[InputStream], classOf[PrintWriter], EnvClass) orFailed null
- val printWrapper = new PrintWriter(writer)
- def newPrinter(in: InputStream, env: FakeEnvironment): FakePrinter =
- PrinterCtr.newInstance(in, printWrapper, env) orFailed null
- def showable(raw: Boolean, target: String, fp: FakePrinter): Showable = {
- fp.asInstanceOf[{ def print(): Unit }].print() // run tool and flush to buffer
- printWrapper.flush() // just in case
- showWithPreamble(raw, target)
- }
-
- lazy val parser = new JpOptions
- def newEnv(opts: Seq[String]): FakeEnvironment = {
- def result = {
- val env: FakeEnvironment = EnvClass.newInstance()
- parser(opts) foreach { case (name, value) =>
- val field = EnvClass getDeclaredField name
- field setAccessible true
- field.set(env, value.asInstanceOf[AnyRef])
- }
- env
- }
- result orFailed null
- }
-
- override def apply(raw: Boolean, options: Seq[String])(inputs: Seq[Input]): List[JpResult] =
- (inputs map {
- case (klass, Success(ba)) => JpResult(showable(raw, klass, newPrinter(new ByteArrayInputStream(ba), newEnv(options))))
- case (_, Failure(e)) => JpResult(e.toString)
- }).toList orFailed List(noToolError)
- }
-
- class JavapTool7 extends JavapTool {
import JavapTool._
type Task = {
def call(): Boolean // true = ok
@@ -319,8 +201,9 @@ class JavapClass(
//object TaskResult extends Enumeration {
// val Ok, Error, CmdErr, SysErr, Abnormal = Value
//}
- val TaskClass = loader.tryToInitializeClass[Task](JavapTool.Tool).orNull
- override protected def failed = TaskClass eq null
+ val TaskClass = loader.tryToInitializeClass[Task](JavapTask).orNull
+ // Since the tool is loaded by reflection, check for catastrophic failure.
+ protected def failed = TaskClass eq null
val TaskCtor = TaskClass.getConstructor(
classOf[Writer],
@@ -343,12 +226,9 @@ class JavapClass(
*/
def messages(implicit locale: Locale = null) = diagnostics.asScala.map(_ getMessage locale).toList
- // don't filter this message if raw, since the names are likely to differ
- private val container = "Binary file .* contains .*".r
- def reportable(raw: Boolean): String = {
- val m = if (raw) messages else messages filterNot (when(_) { case container() => true })
+ def reportable(): String = {
clear()
- if (m.nonEmpty) m mkString ("", EOL, EOL) else ""
+ if (messages.nonEmpty) messages mkString ("", EOL, EOL) else ""
}
}
val reporter = new JavaReporter
@@ -403,23 +283,33 @@ class JavapClass(
}
def fileManager(inputs: Seq[Input]) = new JavapFileManager(inputs)()
- // show tool messages and tool output, with output massage
- def showable(raw: Boolean, target: String): Showable = showWithPreamble(raw, target, reporter.reportable(raw))
+ /** Create a Showable to show tool messages and tool output, with output massage.
+ * @param target attempt to filter output to show region of interest
+ * @param filter whether to strip REPL names
+ */
+ def showable(target: String, filter: Boolean): Showable =
+ new Showable {
+ val output = filterLines(target, s"${reporter.reportable()}${written}")
+ def show() =
+ if (filter) intp.withoutTruncating(printWriter.write(output))
+ else intp.withoutUnwrapping(printWriter.write(output, 0, output.length))
+ }
// eventually, use the tool interface
def task(options: Seq[String], classes: Seq[String], inputs: Seq[Input]): Task = {
//ServiceLoader.load(classOf[javax.tools.DisassemblerTool]).
//getTask(writer, fileManager, reporter, options.asJava, classes.asJava)
- TaskCtor.newInstance(writer, fileManager(inputs), reporter, options.asJava, classes.asJava)
+ val toolopts = options filter (_ != "-filter")
+ TaskCtor.newInstance(writer, fileManager(inputs), reporter, toolopts.asJava, classes.asJava)
.orFailed (throw new IllegalStateException)
}
// a result per input
- private def applyOne(raw: Boolean, options: Seq[String], klass: String, inputs: Seq[Input]): Try[JpResult] =
+ private def applyOne(options: Seq[String], filter: Boolean, klass: String, inputs: Seq[Input]): Try[JpResult] =
Try {
task(options, Seq(klass), inputs).call()
} map {
- case true => JpResult(showable(raw, klass))
- case _ => JpResult(reporter.reportable(raw))
+ case true => JpResult(showable(klass, filter))
+ case _ => JpResult(reporter.reportable())
} recoverWith {
case e: java.lang.reflect.InvocationTargetException => e.getCause match {
case t: IllegalArgumentException => Success(JpResult(t.getMessage)) // bad option
@@ -428,139 +318,26 @@ class JavapClass(
} lastly {
reporter.clear()
}
- override def apply(raw: Boolean, options: Seq[String])(inputs: Seq[Input]): List[JpResult] = (inputs map {
- case (klass, Success(_)) => applyOne(raw, options, klass, inputs).get
+ /** Run the tool. */
+ def apply(options: Seq[String], filter: Boolean)(inputs: Seq[Input]): List[JpResult] = (inputs map {
+ case (klass, Success(_)) => applyOne(options, filter, klass, inputs).get
case (_, Failure(e)) => JpResult(e.toString)
}).toList orFailed List(noToolError)
}
object JavapTool {
// >= 1.7
- val Tool = "com.sun.tools.javap.JavapTask"
-
- // < 1.7
- val Env = "sun.tools.javap.JavapEnvironment"
- val Printer = "sun.tools.javap.JavapPrinter"
- // "documentation"
- type FakeEnvironment = AnyRef
- type FakePrinter = AnyRef
-
- // support JavapEnvironment
- class JpOptions {
- private object Access {
- final val PRIVATE = 0
- final val PROTECTED = 1
- final val PACKAGE = 2
- final val PUBLIC = 3
- }
- private val envActionMap: Map[String, (String, Any)] = {
- val map = Map(
- "-l" -> (("showLineAndLocal", true)),
- "-c" -> (("showDisassembled", true)),
- "-s" -> (("showInternalSigs", true)),
- "-verbose" -> (("showVerbose", true)),
- "-private" -> (("showAccess", Access.PRIVATE)),
- "-package" -> (("showAccess", Access.PACKAGE)),
- "-protected" -> (("showAccess", Access.PROTECTED)),
- "-public" -> (("showAccess", Access.PUBLIC)),
- "-all" -> (("showallAttr", true))
- )
- map ++ List(
- "-v" -> map("-verbose"),
- "-p" -> map("-private")
- )
- }
- def apply(opts: Seq[String]): Seq[(String, Any)] = {
- opts flatMap { opt =>
- envActionMap get opt match {
- case Some(pair) => List(pair)
- case _ =>
- val charOpts = opt.tail.toSeq map ("-" + _)
- if (charOpts forall (envActionMap contains _))
- charOpts map envActionMap
- else Nil
- }
- }
- }
- }
-
- case class ToolArgs(raw: Boolean = false, help: Boolean = false, app: Boolean = false, fun: Boolean = false)
-
- object ToolArgs {
- def fromArgs(args: Seq[String]): (ToolArgs, Seq[String]) = ((ToolArgs(), Seq[String]()) /: (args flatMap massage)) {
- case ((t,others), s) => s match {
- case "-fun" => (t copy (fun=true), others :+ "-private")
- case "-app" => (t copy (app=true), others)
- case "-help" => (t copy (help=true), others)
- case "-raw" => (t copy (raw=true), others)
- case _ => (t, others :+ s)
- }
- }
- }
-
- val helps = List(
- "usage" -> ":javap [opts] [path or class or -]...",
- "-help" -> "Prints this help message",
- "-raw" -> "Don't unmangle REPL names",
- "-app" -> "Show the DelayedInit body of Apps",
- "-fun" -> "Show anonfuns for class or Class#method",
- "-verbose/-v" -> "Stack size, number of locals, method args",
- "-private/-p" -> "Private classes and members",
- "-package" -> "Package-private classes and members",
- "-protected" -> "Protected classes and members",
- "-public" -> "Public classes and members",
- "-l" -> "Line and local variable tables",
- "-c" -> "Disassembled code",
- "-s" -> "Internal type signatures",
- "-sysinfo" -> "System info of class",
- "-constants" -> "Static final constants"
- )
-
- // match prefixes and unpack opts, or -help on failure
- def massage(arg: String): Seq[String] = {
- require(arg startsWith "-")
- // arg matches opt "-foo/-f" if prefix of -foo or exactly -f
- val r = """(-[^/]*)(/(-.))?""".r
- def maybe(opt: String, s: String): Option[String] = opt match {
- // disambiguate by preferring short form
- case r(lf,_,sf) if s == sf => Some(sf)
- case r(lf,_,sf) if lf startsWith s => Some(lf)
- case _ => None
- }
- def candidates(s: String) = (helps map (h => maybe(h._1, s))).flatten
- // one candidate or one single-char candidate
- def uniqueOf(maybes: Seq[String]) = {
- def single(s: String) = s.length == 2
- if (maybes.length == 1) maybes
- else if ((maybes count single) == 1) maybes filter single
- else Nil
- }
- // each optchar must decode to exactly one option
- def unpacked(s: String): Try[Seq[String]] = {
- val ones = (s drop 1) map { c =>
- val maybes = uniqueOf(candidates(s"-$c"))
- if (maybes.length == 1) Some(maybes.head) else None
- }
- Try(ones) filter (_ forall (_.isDefined)) map (_.flatten)
- }
- val res = uniqueOf(candidates(arg))
- if (res.nonEmpty) res
- else (unpacked(arg)
- getOrElse (Seq("-help"))) // or else someone needs help
- }
-
- def helper(pw: PrintWriter) = new Showable {
- def show() = helps foreach (p => pw write "%-12.12s%s%n".format(p._1,p._2))
- }
-
- val DefaultOptions = List("-protected", "-verbose")
+ val JavapTask = "com.sun.tools.javap.JavapTask"
private def hasClass(cl: ScalaClassLoader, cn: String) = cl.tryToInitializeClass[AnyRef](cn).isDefined
- def isAvailable = Seq(Env, Tool) exists (hasClass(loader, _))
+ def isAvailable = hasClass(loader, JavapTask)
/** Select the tool implementation for this platform. */
- def apply() = if (hasClass(loader, Tool)) new JavapTool7 else new JavapTool6
+ def apply() = {
+ require(isAvailable)
+ new JavapTool
+ }
}
}
@@ -571,7 +348,7 @@ object JavapClass {
def apply(
loader: ScalaClassLoader = ScalaClassLoader.appLoader,
printWriter: PrintWriter = new PrintWriter(System.out, true),
- intp: Option[IMain] = None
+ intp: IMain
) = new JavapClass(loader, printWriter, intp)
/** Match foo#bar, both groups are optional (may be null). */
@@ -596,209 +373,29 @@ object JavapClass {
}
}
implicit class ClassLoaderOps(val loader: ScalaClassLoader) extends AnyVal {
- private def parentsOf(x: ClassLoader): List[ClassLoader] = if (x == null) Nil else x :: parentsOf(x.getParent)
- def parents: List[ClassLoader] = parentsOf(loader)
- /* all file locations */
- def locations = {
- def alldirs = parents flatMap (_ match {
- case ucl: ScalaClassLoader.URLClassLoader => ucl.classPathURLs
- case jcl: java.net.URLClassLoader => jcl.getURLs
- case _ => Nil
- })
- val dirs = for (d <- alldirs; if d.getProtocol == "file") yield Path(new JFile(d.toURI))
- dirs
- }
- /* only the file location from which the given class is loaded */
- def locate(k: String): Option[Path] = {
- Try {
- val klass = try loader loadClass k catch {
- case _: NoClassDefFoundError => null // let it snow
- }
- // cf ScalaClassLoader.originOfClass
- klass.getProtectionDomain.getCodeSource.getLocation
- } match {
- case Success(null) => None
- case Success(loc) if loc.isFile => Some(Path(new JFile(loc.toURI)))
- case _ => None
- }
- }
/* would classBytes succeed with a nonempty array */
def resourceable(className: String): Boolean = loader.getResource(className.asClassResource) != null
-
- /* class reader of class bytes */
- def classReader(resource: String): ClassReader = new ClassReader(loader classBytes resource)
- }
- implicit class `class reader convenience`(val reader: ClassReader) extends AnyVal {
- def withMethods[A](f: Seq[MethodNode] => A): A = {
- val cls = new ClassNode
- reader.accept(cls, 0)
- f(cls.methods.asScala)
- }
- }
- implicit class PathOps(val p: Path) extends AnyVal {
- import scala.tools.nsc.io.Jar
- def isJar = Jar isJarOrZip p
- }
- implicit class `fun with files`(val f: AbstractFile) extends AnyVal {
- def descend(path: Seq[String]): Option[AbstractFile] = {
- def lookup(f: AbstractFile, path: Seq[String]): Option[AbstractFile] = path match {
- case p if p.isEmpty => Option(f)
- case p => Option(f.lookupName(p.head, directory = true)) flatMap (lookup(_, p.tail))
- }
- lookup(f, path)
- }
}
implicit class URLOps(val url: URL) extends AnyVal {
def isFile: Boolean = url.getProtocol == "file"
}
- object FunFinder {
- def apply(loader: ScalaClassLoader, intp: Option[IMain]) = new FunFinder(loader, intp)
- }
- // FunFinder.funs(ks) finds anonfuns
- class FunFinder(loader: ScalaClassLoader, intp: Option[IMain]) {
-
- // manglese for closure: typename, $anonfun or lambda, opt method, digits
- val closure = """(.*)\$(\$anonfun|lambda)(?:\$+([^$]+))?\$(\d+)""".r
-
- // manglese for closure
- val cleese = "(?:anonfun|lambda)"
-
- // class k, candidate f without prefix
- def isFunOfClass(k: String, f: String) = (s"${Regex quote k}\\$$+$cleese".r findPrefixOf f).nonEmpty
-
- // class k, candidate f without prefix, method m
- def isFunOfMethod(k: String, m: String, f: String) =
- (s"${Regex quote k}\\$$+$cleese\\$$+${Regex quote m}\\$$".r findPrefixOf f).nonEmpty
-
- def isFunOfTarget(target: Target, f: String) =
- target.member map (isFunOfMethod(target.name, _, f)) getOrElse isFunOfClass(target.name, f)
-
- def listFunsInAbsFile(target: Target)(d: AbstractFile) =
- for (f <- d; if !f.isDirectory && isFunOfTarget(target, f.name)) yield f.name
-
- def listFunsInDir(target: Target)(d: Directory) = {
- val subdir = Path(target.prefix)
- for (f <- (d / subdir).toDirectory.list; if f.isFile && isFunOfTarget(target, f.name))
- yield f.name
- }
-
- def listFunsInJar(target: Target)(f: File) = {
- import java.util.jar.JarEntry
- import scala.tools.nsc.io.Jar
- def maybe(e: JarEntry) = {
- val (path, name) = {
- val parts = e.getName split "/"
- if (parts.length < 2) ("", e.getName)
- else (parts.init mkString "/", parts.last)
- }
- if (path == target.prefix && isFunOfTarget(target, name)) Some(name) else None
- }
- (new Jar(f) map maybe).flatten
- }
- def loadable(name: String) = loader resourceable name
- case class Target(path: String, member: Option[String], filter: Option[String], isRepl: Boolean, isModule: Boolean) {
- val splat = path split "\\."
- val name = splat.last
- val prefix = if (splat.length > 1) splat.init mkString "/" else ""
- val pkg = if (splat.length > 1) splat.init mkString "." else ""
- val targetName = s"$name${ if (isModule) "$" else "" }"
- }
- // translated class, optional member, opt member to filter on, whether it is repl output and a module
- def translate(s: String): Target = {
- val (k0, m0) = s.splitHashMember
- val isModule = k0 endsWith "$"
- val k = (k0 stripSuffix "$").asClassName
- val member = m0 filter (_.nonEmpty) // take Foo# as no member, not ""
- val filter = m0 flatMap { case "" => Some("apply") case _ => None } // take Foo# as filter on apply
- // class is either something replish or available to loader
- // $line.$read$$etc$Foo#member
- ((intp flatMap (_ translatePath k) filter (loadable) map (x => Target(x stripSuffix "$", member, filter, true, isModule)))
- // s = "f" and $line.$read$$etc$#f is what we're after,
- // ignoring any #member (except take # as filter on #apply)
- orElse (intp flatMap (_ translateEnclosingClass k) map (x => Target(x stripSuffix "$", Some(k), filter, true, isModule)))
- getOrElse (Target(k, member, filter, false, isModule)))
- }
- /** Find the classnames of anonfuns associated with k,
- * where k may be an available class or a symbol in scope.
- */
- def funsOf(selection: String): Seq[String] = {
- // class is either something replish or available to loader
- val target = translate(selection)
-
- // reconstitute an anonfun with a package
- // if filtered, add the hash back, e.g. pkg.Foo#bar, pkg.Foo$anon$1#apply
- def packaged(s: String) = {
- val p = if (target.pkg.isEmpty) s else s"${target.pkg}.$s"
- target.filter map (p + "#" + _) getOrElse p
- }
- // find closure classes in repl outdir or try asking the classloader where to look
- val fs =
- if (target.isRepl)
- (intp.get.replOutput.dir descend target.splat.init) map { d =>
- listFunsInAbsFile(target)(d) map (_.asClassName) map packaged
- }
- else
- loader locate target.path map {
- case d if d.isDirectory => listFunsInDir(target)(d.toDirectory) map packaged
- case j if j.isJar => listFunsInJar(target)(j.toFile) map packaged
- case _ => Nil
- }
- val res = fs map (_.to[Seq]) getOrElse Seq()
- // on second thought, we don't care about lambda method classes, just the impl methods
- val rev =
- res flatMap {
- case x @ closure(_, "lambda", _, _) => lambdaMethod(x, target)
- //target.member flatMap (_ => lambdaMethod(x, target)) getOrElse s"${target.name}#$$anonfun"
- case x => Some(x)
- }
- rev
- }
- // given C$lambda$$g$n for member g and n in 1..N, find the C.accessor$x
- // and the C.$anonfun$x it forwards to.
- def lambdaMethod(lambda: String, target: Target): Option[String] = {
- import scala.tools.asm.ClassReader
- import scala.tools.asm.Opcodes.INVOKESTATIC
- import scala.tools.asm.tree.{ ClassNode, MethodInsnNode }
- def callees(s: String): List[(String, String)] = {
- loader classReader s withMethods { ms =>
- val nonBridgeApplyMethods = ms filter (_.name == "apply") filter (n => (n.access & Opcodes.ACC_BRIDGE) == 0)
- val instructions = nonBridgeApplyMethods flatMap (_.instructions.toArray)
- instructions.collect {
- case i: MethodInsnNode => (i.owner, i.name)
- }.toList
- }
- }
- callees(lambda) match {
- case (k, _) :: Nil if target.isModule && !(k endsWith "$") => None
- case (k, m) :: _ => Some(s"${k}#${m}")
- case _ => None
- }
- }
- /** Translate the supplied targets to patterns for anonfuns.
- * Pattern is typename $ label [[$]$func] $n where label is $anonfun or lambda,
- * and lambda includes the extra dollar, func is a method name, and n is an int.
- * The typename for a nested class is dollar notation, Betty$Bippy.
- *
- * If C has anonfun closure classes, then use C$$anonfun$f$1 (various names, C# filters on apply).
- * If C has lambda closure classes, then use C#$anonfun (special-cased by output filter).
- */
- def funs(ks: Seq[String]): Seq[String] = ks flatMap funsOf
- }
}
-trait Javap {
- def loader: ScalaClassLoader
- def printWriter: PrintWriter
+abstract class Javap {
+ /** Run the tool. Option args start with "-", except that "-" itself
+ * denotes the last REPL result.
+ * The default options are "-protected -verbose".
+ * Byte data for filename args is retrieved with findBytes.
+ * @return results for invoking JpResult.show()
+ */
def apply(args: Seq[String]): List[Javap.JpResult]
- def tryFile(path: String): Option[Array[Byte]]
- def tryClass(path: String): Array[Byte]
}
object Javap {
- def isAvailable(cl: ScalaClassLoader = ScalaClassLoader.appLoader) = JavapClass(cl).JavapTool.isAvailable
+ def isAvailable(cl: ScalaClassLoader = ScalaClassLoader.appLoader) = JavapClass(cl, intp = null).JavapTool.isAvailable
def apply(path: String): Unit = apply(Seq(path))
- def apply(args: Seq[String]): Unit = JavapClass() apply args foreach (_.show())
+ def apply(args: Seq[String]): Unit = JavapClass(intp=null) apply args foreach (_.show())
private[interpreter] trait Showable {
def show(): Unit
@@ -830,13 +427,70 @@ object Javap {
def isError = false
def show() = value.show() // output to tool's PrintWriter
}
+
+ def toolArgs(args: Seq[String]): (Seq[String], Boolean) = {
+ val (opts, rest) = args flatMap massage partition (_ != "-filter")
+ (opts, rest.nonEmpty)
+ }
+
+ val helps = List(
+ "usage" -> ":javap [opts] [path or class or -]...",
+ "-help" -> "Prints this help message",
+ "-verbose/-v" -> "Stack size, number of locals, method args",
+ "-private/-p" -> "Private classes and members",
+ "-package" -> "Package-private classes and members",
+ "-protected" -> "Protected classes and members",
+ "-public" -> "Public classes and members",
+ "-l" -> "Line and local variable tables",
+ "-c" -> "Disassembled code",
+ "-s" -> "Internal type signatures",
+ "-sysinfo" -> "System info of class",
+ "-constants" -> "Static final constants",
+ "-filter" -> "Filter REPL machinery from output"
+ )
+
+ // match prefixes and unpack opts, or -help on failure
+ private def massage(arg: String): Seq[String] = {
+ require(arg startsWith "-")
+ // arg matches opt "-foo/-f" if prefix of -foo or exactly -f
+ val r = """(-[^/]*)(?:/(-.))?""".r
+ def maybe(opt: String, s: String): Option[String] = opt match {
+ // disambiguate by preferring short form
+ case r(lf, sf) if s == sf => Some(sf)
+ case r(lf, sf) if lf startsWith s => Some(lf)
+ case _ => None
+ }
+ def candidates(s: String) = (helps map (h => maybe(h._1, s))).flatten
+ // one candidate or one single-char candidate
+ def uniqueOf(maybes: Seq[String]) = {
+ def single(s: String) = s.length == 2
+ if (maybes.length == 1) maybes
+ else if ((maybes count single) == 1) maybes filter single
+ else Nil
+ }
+ // each optchar must decode to exactly one option
+ def unpacked(s: String): Try[Seq[String]] = {
+ val ones = (s drop 1) map { c =>
+ val maybes = uniqueOf(candidates(s"-$c"))
+ if (maybes.length == 1) Some(maybes.head) else None
+ }
+ Try(ones) filter (_ forall (_.isDefined)) map (_.flatten)
+ }
+ val res = uniqueOf(candidates(arg))
+ if (res.nonEmpty) res
+ else (unpacked(arg)
+ getOrElse (Seq("-help"))) // or else someone needs help
+ }
+
+ def helpText: String = (helps map { case (name, help) => f"$name%-12.12s$help%n" }).mkString
+
+ def helper(pw: PrintWriter) = new Showable {
+ def show() = pw print helpText
+ }
+
+ val DefaultOptions = List("-protected", "-verbose")
}
object NoJavap extends Javap {
- import Javap._
- def loader: ScalaClassLoader = getClass.getClassLoader
- def printWriter: PrintWriter = new PrintWriter(System.err, true)
- def apply(args: Seq[String]): List[JpResult] = Nil
- def tryFile(path: String): Option[Array[Byte]] = None
- def tryClass(path: String): Array[Byte] = Array()
+ def apply(args: Seq[String]): List[Javap.JpResult] = Nil
}
diff --git a/src/scaladoc/scala/tools/nsc/doc/base/MemberLookupBase.scala b/src/scaladoc/scala/tools/nsc/doc/base/MemberLookupBase.scala
index 839598a15f..9de6ec4ab9 100755
--- a/src/scaladoc/scala/tools/nsc/doc/base/MemberLookupBase.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/base/MemberLookupBase.scala
@@ -62,15 +62,15 @@ trait MemberLookupBase {
syms.flatMap { case (sym, owner) =>
// reconstruct the original link
def linkName(sym: Symbol) = {
- def nameString(s: Symbol) = s.nameString + (if ((s.isModule || s.isModuleClass) && !s.isPackage) "$" else "")
- val packageSuffix = if (sym.isPackage) ".package" else ""
+ def nameString(s: Symbol) = s.nameString + (if ((s.isModule || s.isModuleClass) && !s.hasPackageFlag) "$" else "")
+ val packageSuffix = if (sym.hasPackageFlag) ".package" else ""
sym.ownerChain.reverse.filterNot(isRoot(_)).map(nameString(_)).mkString(".") + packageSuffix
}
- if (sym.isClass || sym.isModule || sym.isTrait || sym.isPackage)
+ if (sym.isClass || sym.isModule || sym.isTrait || sym.hasPackageFlag)
findExternalLink(sym, linkName(sym))
- else if (owner.isClass || owner.isModule || owner.isTrait || owner.isPackage)
+ else if (owner.isClass || owner.isModule || owner.isTrait || owner.hasPackageFlag)
findExternalLink(sym, linkName(owner) + "@" + externalSignature(sym))
else
None
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala b/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala
index b5375558ac..743c2a401c 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala
@@ -147,7 +147,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
{ if (tpl.linearizationTemplates.isEmpty && tpl.conversions.isEmpty) NodeSeq.Empty else
{
if (!tpl.linearizationTemplates.isEmpty)
- <div id="ancestors">
+ <div class="ancestors">
<span class="filtertype">Inherited<br/>
</span>
<ol id="linearization">
@@ -157,7 +157,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
else NodeSeq.Empty
} ++ {
if (!tpl.conversions.isEmpty)
- <div id="ancestors">
+ <div class="ancestors">
<span class="filtertype">Implicitly<br/>
</span>
<ol id="implicits"> {
@@ -171,7 +171,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
</div>
else NodeSeq.Empty
} ++
- <div id="ancestors">
+ <div class="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
@@ -204,28 +204,28 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
}
{ if (absValueMembers.isEmpty) NodeSeq.Empty else
- <div id="values" class="values members">
+ <div class="values members">
<h3>Abstract Value Members</h3>
<ol>{ absValueMembers map (memberToHtml(_, tpl)) }</ol>
</div>
}
{ if (concValueMembers.isEmpty) NodeSeq.Empty else
- <div id="values" class="values members">
+ <div class="values members">
<h3>{ if (absValueMembers.isEmpty) "Value Members" else "Concrete Value Members" }</h3>
<ol>{ concValueMembers map (memberToHtml(_, tpl)) }</ol>
</div>
}
{ if (shadowedImplicitMembers.isEmpty) NodeSeq.Empty else
- <div id="values" class="values members">
+ <div class="values members">
<h3>Shadowed Implicit Value Members</h3>
<ol>{ shadowedImplicitMembers map (memberToHtml(_, tpl)) }</ol>
</div>
}
{ if (deprValueMembers.isEmpty) NodeSeq.Empty else
- <div id="values" class="values members">
+ <div class="values members">
<h3>Deprecated Value Members</h3>
<ol>{ deprValueMembers map (memberToHtml(_, tpl)) }</ol>
</div>
@@ -290,13 +290,19 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
}
def memberToHtml(mbr: MemberEntity, inTpl: DocTemplateEntity): NodeSeq = {
+ // Sometimes it's same, do we need signatureCompat still?
+ val sig = if (mbr.signature == mbr.signatureCompat) {
+ <a id={ mbr.signature }/>
+ } else {
+ <a id={ mbr.signature }/><a id={ mbr.signatureCompat }/>
+ }
+
val memberComment = memberToCommentHtml(mbr, inTpl, isSelf = false)
<li name={ mbr.definitionName } visbl={ if (mbr.visibility.isProtected) "prt" else "pub" }
data-isabs={ mbr.isAbstract.toString }
fullComment={ if(memberComment.filter(_.label=="div").isEmpty) "no" else "yes" }
group={ mbr.group }>
- <a id={ mbr.signature }/>
- <a id={ mbr.signatureCompat }/>
+ { sig }
{ signature(mbr, isSelf = false) }
{ memberComment }
</li>
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala b/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala
index 320a8e23b2..4c0ba32856 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala
@@ -364,7 +364,7 @@ class DotDiagramGenerator(settings: doc.Settings, dotRunner: DotRunner) extends
// add an id and class attribute to the SVG element
case Elem(prefix, "svg", attribs, scope, child @ _*) => {
val klass = if (isInheritanceDiagram) "class-diagram" else "package-diagram"
- Elem(prefix, "svg", attribs, scope, child map(x => transform(x)) : _*) %
+ Elem(prefix, "svg", attribs, scope, true, child map(x => transform(x)) : _*) %
new UnprefixedAttribute("id", "graph" + counter, Null) %
new UnprefixedAttribute("class", klass, Null)
}
@@ -378,7 +378,7 @@ class DotDiagramGenerator(settings: doc.Settings, dotRunner: DotRunner) extends
// assign id and class attributes to edges and nodes:
// the id attribute generated by dot has the format: "{class}|{id}"
case g @ Elem(prefix, "g", attribs, scope, children @ _*) if (List("edge", "node").contains((g \ "@class").toString)) => {
- var res = new Elem(prefix, "g", attribs, scope, (children map(x => transform(x))): _*)
+ var res = new Elem(prefix, "g", attribs, scope, true, (children map(x => transform(x))): _*)
val dotId = (g \ "@id").toString
if (dotId.count(_ == '|') == 1) {
val Array(klass, id) = dotId.toString.split("\\|")
@@ -395,11 +395,11 @@ class DotDiagramGenerator(settings: doc.Settings, dotRunner: DotRunner) extends
val imageNode = <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href={ ("./lib/" + kind + "_diagram.png") } width="16px" height="16px" preserveAspectRatio="xMinYMin meet" x={ xposition.get.toString } y={ yposition.get.toString }/>
val anchorNode = (g \ "a") match {
case Seq(Elem(prefix, "a", attribs, scope, children @ _*)) =>
- transform(new Elem(prefix, "a", attribs, scope, (children ++ imageNode): _*))
+ transform(new Elem(prefix, "a", attribs, scope, true, (children ++ imageNode): _*))
case _ =>
g \ "a"
}
- res = new Elem(prefix, "g", attribs, scope, anchorNode: _*)
+ res = new Elem(prefix, "g", attribs, scope, true, anchorNode: _*)
DiagramStats.addFixedImage()
}
}
@@ -413,7 +413,7 @@ class DotDiagramGenerator(settings: doc.Settings, dotRunner: DotRunner) extends
scala.xml.Text("")
// apply recursively
case Elem(prefix, label, attribs, scope, child @ _*) =>
- Elem(prefix, label, attribs, scope, child map(x => transform(x)) : _*)
+ Elem(prefix, label, attribs, scope, true, child map(x => transform(x)) : _*)
case x => x
}
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css
index e84d7c1ca6..f158aa7309 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css
+++ b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css
@@ -218,7 +218,7 @@ dl.attributes > dd {
height: 18px;
}
-#values ol li:last-child {
+.values ol li:last-child {
margin-bottom: 5px;
}
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js
index 798a2d430b..c1e3010834 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js
+++ b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js
@@ -147,19 +147,19 @@ $(document).ready(function(){
filter();
});
- $("#mbrsel > div[id=ancestors] > ol > li.hideall").click(function() {
+ $("#mbrsel > div.ancestors > ol > li.hideall").click(function() {
$("#linearization li.in").removeClass("in").addClass("out");
$("#linearization li:first").removeClass("out").addClass("in");
$("#implicits li.in").removeClass("in").addClass("out");
- if ($(this).hasClass("out") && $("#mbrsel > div[id=ancestors] > ol > li.showall").hasClass("in")) {
+ if ($(this).hasClass("out") && $("#mbrsel > div.ancestors > ol > li.showall").hasClass("in")) {
$(this).removeClass("out").addClass("in");
- $("#mbrsel > div[id=ancestors] > ol > li.showall").removeClass("in").addClass("out");
+ $("#mbrsel > div.ancestors > ol > li.showall").removeClass("in").addClass("out");
}
filter();
})
- $("#mbrsel > div[id=ancestors] > ol > li.showall").click(function() {
+ $("#mbrsel > div.ancestors > ol > li.showall").click(function() {
var filteredLinearization =
$("#linearization li.out").filter(function() {
return ! isHiddenClass($(this).attr("name"));
@@ -172,9 +172,9 @@ $(document).ready(function(){
});
filteredImplicits.removeClass("out").addClass("in");
- if ($(this).hasClass("out") && $("#mbrsel > div[id=ancestors] > ol > li.hideall").hasClass("in")) {
+ if ($(this).hasClass("out") && $("#mbrsel > div.ancestors > ol > li.hideall").hasClass("in")) {
$(this).removeClass("out").addClass("in");
- $("#mbrsel > div[id=ancestors] > ol > li.hideall").removeClass("in").addClass("out");
+ $("#mbrsel > div.ancestors > ol > li.hideall").removeClass("in").addClass("out");
}
filter();
@@ -275,7 +275,7 @@ function orderAlpha() {
$("#order > ol > li.group").removeClass("in").addClass("out");
$("#template > div.parent").hide();
$("#template > div.conversion").hide();
- $("#mbrsel > div[id=ancestors]").show();
+ $("#mbrsel > div.ancestors").show();
filter();
};
@@ -285,7 +285,7 @@ function orderInherit() {
$("#order > ol > li.group").removeClass("in").addClass("out");
$("#template > div.parent").show();
$("#template > div.conversion").show();
- $("#mbrsel > div[id=ancestors]").hide();
+ $("#mbrsel > div.ancestors").hide();
filter();
};
@@ -295,7 +295,7 @@ function orderGroup() {
$("#order > ol > li.inherit").removeClass("in").addClass("out");
$("#template > div.parent").hide();
$("#template > div.conversion").hide();
- $("#mbrsel > div[id=ancestors]").show();
+ $("#mbrsel > div.ancestors").show();
filter();
};
@@ -350,7 +350,7 @@ function initInherit() {
}
});
- $("#values > ol > li").each(function(){
+ $(".values > ol > li").each(function(){
var mbr = $(this);
this.mbrText = mbr.find("> .fullcomment .cmt").text();
var qualName = mbr.attr("name");
diff --git a/src/scaladoc/scala/tools/nsc/doc/model/MemberLookup.scala b/src/scaladoc/scala/tools/nsc/doc/model/MemberLookup.scala
index 64eb1adbea..20aaab29fc 100644
--- a/src/scaladoc/scala/tools/nsc/doc/model/MemberLookup.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/model/MemberLookup.scala
@@ -40,7 +40,7 @@ trait MemberLookup extends base.MemberLookupBase {
override def findExternalLink(sym: Symbol, name: String): Option[LinkToExternal] = {
val sym1 =
if (sym == AnyClass || sym == AnyRefClass || sym == AnyValClass || sym == NothingClass) ListClass
- else if (sym.isPackage)
+ else if (sym.hasPackageFlag)
/* Get package object which has associatedFile ne null */
sym.info.member(newTermName("package"))
else sym
diff --git a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala
index 8ae31ce1c3..3432e5e150 100644
--- a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala
@@ -93,10 +93,10 @@ class ModelFactory(val global: Global, val settings: doc.Settings) {
trait TemplateImpl extends EntityImpl with TemplateEntity {
override def qualifiedName: String =
if (inTemplate == null || inTemplate.isRootPackage) name else optimize(inTemplate.qualifiedName + "." + name)
- def isPackage = sym.isPackage
+ def isPackage = sym.hasPackageFlag
def isTrait = sym.isTrait
def isClass = sym.isClass && !sym.isTrait
- def isObject = sym.isModule && !sym.isPackage
+ def isObject = sym.isModule && !sym.hasPackageFlag
def isCaseClass = sym.isCaseClass
def isRootPackage = false
def selfType = if (sym.thisSym eq sym) None else Some(makeType(sym.thisSym.typeOfThis, this))
@@ -254,7 +254,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) {
def valueParams: List[List[ValueParam]] = Nil /** TODO, these are now only computed for DocTemplates */
def parentTypes =
- if (sym.isPackage || sym == AnyClass) List() else {
+ if (sym.hasPackageFlag || sym == AnyClass) List() else {
val tps = (this match {
case a: AliasType => sym.tpe.dealias.parents
case a: AbstractType => sym.info.bounds match {
@@ -665,7 +665,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) {
s != EmptyPackage && s != RootPackage
}
})
- else if (bSym.isPackage) // (2)
+ else if (bSym.hasPackageFlag) // (2)
if (settings.skipPackage(makeQualifiedName(bSym)))
None
else
@@ -778,7 +778,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) {
Some(new MemberTemplateImpl(bSym, inTpl) with AliasImpl with AliasType {
override def isAliasType = true
})
- else if (!modelFinished && (bSym.isPackage || templateShouldDocument(bSym, inTpl)))
+ else if (!modelFinished && (bSym.hasPackageFlag || templateShouldDocument(bSym, inTpl)))
modelCreation.createTemplate(bSym, inTpl)
else
None
diff --git a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryTypeSupport.scala b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryTypeSupport.scala
index 8834bc3efd..45745b5f55 100644
--- a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryTypeSupport.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryTypeSupport.scala
@@ -94,7 +94,7 @@ trait ModelFactoryTypeSupport {
LinkToMember(bMbr, oTpl)
case _ =>
val name = makeQualifiedName(bSym)
- if (!bSym.owner.isPackage)
+ if (!bSym.owner.hasPackageFlag)
Tooltip(name)
else
findExternalLink(bSym, name).getOrElse (
diff --git a/src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala b/src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala
index 86a7a67160..c1228e8735 100755
--- a/src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala
@@ -49,7 +49,7 @@ trait TreeFactory { thisTreeFactory: ModelFactory with TreeFactory =>
case _ =>
}
else if (asym.isTerm && asym.owner.isClass){
- if (asym.isSetter) asym = asym.getter(asym.owner)
+ if (asym.isSetter) asym = asym.getterIn(asym.owner)
makeTemplate(asym.owner) match {
case docTmpl: DocTemplateImpl =>
val mbrs: Option[MemberImpl] = findMember(asym, docTmpl)
diff --git a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala
index 44d8886e4e..b300752a34 100644
--- a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala
@@ -177,7 +177,7 @@ trait DiagramDirectiveParser {
def warning(message: String) = {
// we need the position from the package object (well, ideally its comment, but yeah ...)
- val sym = if (template.sym.isPackage) template.sym.info.member(global.nme.PACKAGE) else template.sym
+ val sym = if (template.sym.hasPackageFlag) template.sym.packageObject else template.sym
assert((sym != global.NoSymbol) || (sym == global.rootMirror.RootPackage))
global.reporter.warning(sym.pos, message)
}
diff --git a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ClassFileParser.scala b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ClassFileParser.scala
index cfd750055b..eed76c3774 100644
--- a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ClassFileParser.scala
+++ b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ClassFileParser.scala
@@ -114,6 +114,9 @@ object ClassFileParser extends ByteCodeReader {
val methodRef = memberRef("Method")
val interfaceMethodRef = memberRef("InterfaceMethod")
val nameAndType = u2 ~ u2 ^^ add1 { case name ~ descriptor => pool => "NameAndType: " + pool(name) + ", " + pool(descriptor) }
+ val methodHandle = u1 ~ u2 ^^ add1 { case referenceKind ~ referenceIndex => pool => "MethodHandle: " + referenceKind + ", " + pool(referenceIndex) }
+ val methodType = u2 ^^ add1 { case descriptorIndex => pool => "MethodType: " + pool(descriptorIndex) }
+ val invokeDynamic = u2 ~ u2 ^^ add1 { case bootstrapMethodAttrIndex ~ nameAndTypeIndex => pool => "InvokeDynamic: " + "bootstrapMethodAttrIndex = " + bootstrapMethodAttrIndex + ", " + pool(nameAndTypeIndex) }
val constantPoolEntry = u1 >> {
case 1 => utf8String
@@ -127,6 +130,9 @@ object ClassFileParser extends ByteCodeReader {
case 10 => methodRef
case 11 => interfaceMethodRef
case 12 => nameAndType
+ case 15 => methodHandle
+ case 16 => methodType
+ case 18 => invokeDynamic
}
val interfaces = u2 >> u2.times
diff --git a/test/benchmarking/AVL-insert-random.scala b/test/benchmarking/AVL-insert-random.scala
deleted file mode 100644
index 7299e330f5..0000000000
--- a/test/benchmarking/AVL-insert-random.scala
+++ /dev/null
@@ -1,67 +0,0 @@
-package scala.collection
-
-
-
-
-
-class Dummy(val a: Int) extends math.Ordered[Dummy] {
- def compare(other: Dummy) = this.a - other.a
- override def toString = a.toString
-}
-
-
-object RandomGlobal {
- val sz = 500000
- val data = util.Random.shuffle((0 until sz) map { new Dummy(_) }) toArray;
-}
-
-
-import RandomGlobal._
-
-
-object RandomAVL extends testing.Benchmark {
-
- def run() {
- val avl = new collection.mutable.TreeSet[Dummy]
-
- var i = 0
- while (i < sz) {
- val elem = data(i)
- avl += elem
- i += 1
- }
- }
-
-}
-
-
-object RandomImmutableTreeSet extends testing.Benchmark {
-
- def run() {
- var tree = new collection.immutable.TreeSet[Dummy]
-
- var i = 0
- while (i < sz) {
- val elem = data(i)
- tree += elem
- i += 1
- }
- }
-
-}
-
-
-object RandomJavaTreeSet extends testing.Benchmark {
-
- def run() {
- val tree = new java.util.TreeSet[Dummy]
-
- var i = 0
- while (i < sz) {
- val elem = data(i)
- tree add elem
- i += 1
- }
- }
-
-}
diff --git a/test/benchmarking/AVL-insert.scala b/test/benchmarking/AVL-insert.scala
deleted file mode 100644
index 4f3ab390c9..0000000000
--- a/test/benchmarking/AVL-insert.scala
+++ /dev/null
@@ -1,67 +0,0 @@
-package scala.collection
-
-
-
-
-
-class Dummy(val a: Int) extends math.Ordered[Dummy] {
- def compare(other: Dummy) = this.a - other.a
- override def toString = a.toString
-}
-
-
-object Global {
- val sz = 500000
- val data = (0 until sz) map { new Dummy(_) } toArray
-}
-
-
-import Global._
-
-
-object AVL extends testing.Benchmark {
-
- def run() {
- val avl = new collection.mutable.TreeSet[Dummy]
-
- var i = 0
- while (i < sz) {
- val elem = data(i)
- avl += elem
- i += 1
- }
- }
-
-}
-
-
-object ImmutableTreeSet extends testing.Benchmark {
-
- def run() {
- var tree = new collection.immutable.TreeSet[Dummy]
-
- var i = 0
- while (i < sz) {
- val elem = data(i)
- tree += elem
- i += 1
- }
- }
-
-}
-
-
-object JavaTreeSet extends testing.Benchmark {
-
- def run() {
- val tree = new java.util.TreeSet[Dummy]
-
- var i = 0
- while (i < sz) {
- val elem = data(i)
- tree add elem
- i += 1
- }
- }
-
-}
diff --git a/test/benchmarking/ParCtrie-bfs.scala b/test/benchmarking/ParCtrie-bfs.scala
deleted file mode 100644
index 59149fff8c..0000000000
--- a/test/benchmarking/ParCtrie-bfs.scala
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-import collection.parallel.mutable.ParCtrie
-
-
-object Bfs extends testing.Benchmark {
- val length = sys.props("length").toInt
- val par = sys.props("par").toInt
-
- type Node = (Int, Int);
- type Parent = (Int, Int);
-
- def up(n: Node) = (n._1, n._2 - 1);
- def down(n: Node) = (n._1, n._2 + 1);
- def left(n: Node) = (n._1 - 1, n._2);
- def right(n: Node) = (n._1 + 1, n._2);
-
- // create a map and a target
- val target = (length / 2, length / 2);
- val map = Array.tabulate(length, length)((x, y) => (x % 3) != 0 || (y % 3) != 0 || (x, y) == target)
- def onMap(n: Node) = n._1 >= 0 && n._1 < length && n._2 >= 0 && n._2 < length
-
- // open and closed lists
- val open = ParCtrie[Node, Parent]()
- val closed = ParCtrie[Node, Parent]()
-
- collection.parallel.ForkJoinTasks.defaultForkJoinPool.setParallelism(par)
-
- override def setUp() {
- open.clear()
- closed.clear()
-
- // a couple of starting positions
- open((0, 0)) = null
- open((length - 1, length - 1)) = null
- open((0, length - 1)) = null
- open((length - 1, 0)) = null
- }
-
- def run() = {
- // greedy bfs path search
- while (open.nonEmpty && !open.contains(target)) {
- for ((node, parent) <- open) {
- def expand(next: Node) {
- if (onMap(next) && map(next._1)(next._2) && !closed.contains(next) && !open.contains(next)) {
- open(next) = node
- }
- }
- expand(up(node))
- expand(down(node))
- expand(left(node))
- expand(right(node))
- closed(node) = parent
- open.remove(node)
- }
- }
- }
-
- override def tearDown() {
- // print path
- var pathnode = open(target)
- while (closed.contains(pathnode)) {
- print(pathnode + "->")
- pathnode = closed(pathnode)
- }
- println()
- }
-
-}
-
diff --git a/test/benchmarking/ParCtrie-map.scala b/test/benchmarking/ParCtrie-map.scala
deleted file mode 100644
index f1d2f560b7..0000000000
--- a/test/benchmarking/ParCtrie-map.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-import collection.parallel.mutable.ParCtrie
-
-
-
-object Map extends testing.Benchmark {
- val length = sys.props("length").toInt
- val par = sys.props("par").toInt
- val parctrie = ParCtrie((0 until length) zip (0 until length): _*)
-
- parctrie.tasksupport = new collection.parallel.ForkJoinTaskSupport(new scala.concurrent.forkjoin.ForkJoinPool(par))
-
- def run = {
- parctrie map {
- kv => kv
- }
- }
-}
-
diff --git a/test/benchmarking/ParCtrie-nums.scala b/test/benchmarking/ParCtrie-nums.scala
deleted file mode 100644
index 76d1966d1f..0000000000
--- a/test/benchmarking/ParCtrie-nums.scala
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-import collection.parallel.mutable.ParCtrie
-
-
-case class Entry(num: Double) {
- var sqrt = num
-}
-
-
-object Nums extends testing.Benchmark {
- val length = sys.props("length").toInt
- val par = sys.props("par").toInt
- var entries: Seq[Entry] = null
- var results: ParCtrie[Double, Entry] = null
-
- collection.parallel.ForkJoinTasks.defaultForkJoinPool.setParallelism(par)
-
- override def setUp() {
- entries = (1 until length) map { num => Entry(num.toDouble) }
- results = ParCtrie()
- for (e <- entries) results += ((e.num, e))
- }
-
- def run() = {
- while (results.nonEmpty) {
- for ((num, e) <- results) {
- val nsqrt = 0.5 * (e.sqrt + e.num / e.sqrt)
- if (math.abs(nsqrt - e.sqrt) < 0.01) {
- results.remove(num)
- } else e.sqrt = nsqrt
- }
- }
- }
-}
-
diff --git a/test/benchmarking/ParCtrie-size.scala b/test/benchmarking/ParCtrie-size.scala
deleted file mode 100644
index 3f47dc23fd..0000000000
--- a/test/benchmarking/ParCtrie-size.scala
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-import collection.parallel.mutable.ParTrieMap
-
-
-
-object Size extends testing.Benchmark {
- val length = sys.props("length").toInt
- val par = sys.props("par").toInt
- var parctrie = ParTrieMap((0 until length) zip (0 until length): _*)
-
- //collection.parallel.ForkJoinTasks.defaultForkJoinPool.setParallelism(par)
- val ts = new collection.parallel.ForkJoinTaskSupport(new concurrent.forkjoin.ForkJoinPool(par))
- parctrie.tasksupport = ts
-
- def run = {
- parctrie.size
- }
-
- var iteration = 0
-
- override def tearDown() {
- iteration += 1
- if (iteration % 4 == 0) parctrie = ParTrieMap((0 until length) zip (0 until length): _*)
- parctrie.tasksupport = ts
- }
-
-}
-
-
-
-
-
-
-
diff --git a/test/benchmarking/ParHashMap.scala b/test/benchmarking/ParHashMap.scala
deleted file mode 100644
index 33a378fb04..0000000000
--- a/test/benchmarking/ParHashMap.scala
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-import collection.parallel.mutable.ParHashMap
-
-
-
-object Map extends testing.Benchmark {
- val length = sys.props("length").toInt
- val par = sys.props("par").toInt
- val phm = ParHashMap((0 until length) zip (0 until length): _*)
-
- phm.tasksupport = new collection.parallel.ForkJoinTaskSupport(new scala.concurrent.forkjoin.ForkJoinPool(par))
-
- def run = {
- phm map {
- kv => kv
- }
- }
-}
-
-
-object MapSeq extends testing.Benchmark {
- val length = sys.props("length").toInt
- val hm = collection.mutable.HashMap((0 until length) zip (0 until length): _*)
-
- def run = {
- hm map {
- kv => kv
- }
- }
-}
-
diff --git a/test/benchmarking/ParVector-reduce.scala b/test/benchmarking/ParVector-reduce.scala
deleted file mode 100644
index 2b4594e997..0000000000
--- a/test/benchmarking/ParVector-reduce.scala
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-import collection.parallel.immutable.ParVector
-
-
-
-object Reduce extends testing.Benchmark {
- val length = sys.props("length").toInt
- val par = sys.props("par").toInt
- val parvector = ParVector((0 until length): _*)
-
- parvector.tasksupport = new collection.parallel.ForkJoinTaskSupport(new scala.concurrent.forkjoin.ForkJoinPool(par))
-
- def run = {
- parvector reduce {
- (a, b) => a + b
- }
- }
-}
-
-
-object ReduceSeq extends testing.Benchmark {
- val length = sys.props("length").toInt
- val vector = collection.immutable.Vector((0 until length): _*)
-
- def run = {
- vector reduce {
- (a, b) => a + b
- }
- }
-}
-
diff --git a/test/benchmarking/TreeSetInsert.scala b/test/benchmarking/TreeSetInsert.scala
deleted file mode 100644
index 23444aa305..0000000000
--- a/test/benchmarking/TreeSetInsert.scala
+++ /dev/null
@@ -1,70 +0,0 @@
-
-object TreeSetInsert {
-
- def main(args: Array[String]): Unit = {
- val n = 500000
- JavaUtilTS.main(args)
- MutableTS.main(args)
- ImmutableTS.main(args)
- }
-}
-
-class Dummy(val a: Int) extends math.Ordered[Dummy] {
- def compare(other: Dummy) = this.a - other.a
-
- override def toString = a.toString
- }
-
-
-object JavaUtilTS extends testing.Benchmark {
- val length = sys.props("length").toInt
- var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray
- var t: java.util.TreeSet[Dummy] = null
-
- def run = {
- t = new java.util.TreeSet[Dummy]()
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t add elem
- i += 1
- }
- }
-}
-
-
-object MutableTS extends testing.Benchmark {
- val length = sys.props("length").toInt
- var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray
- var t: collection.mutable.TreeSet[Dummy] = null
-
- def run = {
- t = collection.mutable.TreeSet[Dummy]()
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t += elem
- i += 1
- }
- }
-}
-
-
-object ImmutableTS extends testing.Benchmark {
- val length = sys.props("length").toInt
- var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray
- var t: collection.immutable.TreeSet[Dummy] = null
-
- def run = {
- t = collection.immutable.TreeSet[Dummy]()
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t += elem
- i += 1
- }
- }
-}
diff --git a/test/benchmarking/TreeSetInsertRandom.scala b/test/benchmarking/TreeSetInsertRandom.scala
deleted file mode 100644
index 7f182548b7..0000000000
--- a/test/benchmarking/TreeSetInsertRandom.scala
+++ /dev/null
@@ -1,65 +0,0 @@
-
-object TreeSetInsertRandom {
-
- def main(args: Array[String]): Unit = {
- val n = 500000
- new JavaUtilTS(n).main(args)
- new MutableTS(n).main(args)
- new ImmutableTS(n).main(args)
- }
-}
-
-class Dummy(val a: Int) extends math.Ordered[Dummy] {
- def compare(other: Dummy) = this.a - other.a
-
- override def toString = a.toString
- }
-
-
-class JavaUtilTS(val length: Int) extends testing.Benchmark {
- var data: Array[Dummy] = util.Random.shuffle((0 until length) map { a => new Dummy(a) }) toArray
- var t: java.util.TreeSet[Dummy] = null
-
- def run = {
- t = new java.util.TreeSet[Dummy]()
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t add elem
- i += 1
- }
- }
-}
-
-class MutableTS(val length: Int) extends testing.Benchmark {
- var data: Array[Dummy] = util.Random.shuffle((0 until length) map { a => new Dummy(a) }) toArray
- var t: collection.mutable.TreeSet[Dummy] = null
-
- def run = {
- t = collection.mutable.TreeSet[Dummy]()
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t += elem
- i += 1
- }
- }
-}
-
-class ImmutableTS(val length: Int) extends testing.Benchmark {
- var data: Array[Dummy] = util.Random.shuffle((0 until length) map { a => new Dummy(a) }) toArray
- var t: collection.immutable.TreeSet[Dummy] = null
-
- def run = {
- t = collection.immutable.TreeSet[Dummy]()
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t += elem
- i += 1
- }
- }
-}
diff --git a/test/benchmarking/TreeSetIterator.scala b/test/benchmarking/TreeSetIterator.scala
deleted file mode 100644
index 08c20e8b0c..0000000000
--- a/test/benchmarking/TreeSetIterator.scala
+++ /dev/null
@@ -1,69 +0,0 @@
-
-object TreeSetIterator {
-
- def main(args: Array[String]): Unit = {
- val n = 500000
- JavaUtilTS.main(args)
- MutableTS.main(args)
- ImmutableTS.main(args)
- }
-}
-
-class Dummy(val a: Int) extends math.Ordered[Dummy] {
- def compare(other: Dummy) = this.a - other.a
-
- override def toString = a.toString
- }
-
-
-object JavaUtilTS extends testing.Benchmark {
- val length = sys.props("length").toInt
- var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray
- var t: java.util.TreeSet[Dummy] = null
-
- def run = {
- t = new java.util.TreeSet[Dummy]()
- data foreach { a => t add a }
-
- var i: Dummy = null
- var it = t.iterator
- while (it.hasNext) {
- i = it.next
- }
- i
- }
-}
-
-object MutableTS extends testing.Benchmark {
- val length = sys.props("length").toInt
- var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray
- var t: collection.mutable.TreeSet[Dummy] = null
-
- def run = {
- t = collection.mutable.TreeSet[Dummy](data: _*)
-
- var i: Dummy = null
- var it = t.iterator
- while (it.hasNext) {
- i = it.next
- }
- i
- }
-}
-
-object ImmutableTS extends testing.Benchmark {
- val length = sys.props("length").toInt
- var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray
- var t: collection.immutable.TreeSet[Dummy] = null
-
- def run = {
- t = collection.immutable.TreeSet[Dummy](data: _*)
-
- var i: Dummy = null
- var it = t.iterator
- while (it.hasNext) {
- i = it.next
- }
- i
- }
-}
diff --git a/test/benchmarking/TreeSetRemove.scala b/test/benchmarking/TreeSetRemove.scala
deleted file mode 100644
index f84066f336..0000000000
--- a/test/benchmarking/TreeSetRemove.scala
+++ /dev/null
@@ -1,69 +0,0 @@
-
-object TreeSetRemove {
-
- def main(args: Array[String]): Unit = {
- val n = 500000
- JavaUtilTS.main(args)
- MutableTS.main(args)
- ImmutableTS.main(args)
- }
-}
-
-class Dummy(val a: Int) extends math.Ordered[Dummy] {
- def compare(other: Dummy) = this.a - other.a
-
- override def toString = a.toString
- }
-
-
-object JavaUtilTS extends testing.Benchmark {
- val length = sys.props("length").toInt
- var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray
- var t: java.util.TreeSet[Dummy] = null
-
- def run = {
- t = new java.util.TreeSet[Dummy]()
- data foreach { a => t add a }
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t remove elem
- i += 1
- }
- }
-}
-
-object MutableTS extends testing.Benchmark {
- val length = sys.props("length").toInt
- var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray
- var t: collection.mutable.TreeSet[Dummy] = null
-
- def run = {
- t = collection.mutable.TreeSet[Dummy](data: _*)
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t -= elem
- i += 1
- }
- }
-}
-
-object ImmutableTS extends testing.Benchmark {
- val length = sys.props("length").toInt
- var data: Array[Dummy] = (0 until length) map { a => new Dummy(a) } toArray
- var t: collection.immutable.TreeSet[Dummy] = null
-
- def run = {
- t = collection.immutable.TreeSet[Dummy](data: _*)
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t -= elem
- i += 1
- }
- }
-}
diff --git a/test/benchmarking/TreeSetRemoveRandom.scala b/test/benchmarking/TreeSetRemoveRandom.scala
deleted file mode 100644
index 4d311679e3..0000000000
--- a/test/benchmarking/TreeSetRemoveRandom.scala
+++ /dev/null
@@ -1,66 +0,0 @@
-
-object TreeSetRemoveRandom {
-
- def main(args: Array[String]): Unit = {
- val n = 500000
- new JavaUtilTS(n).main(args)
- new MutableTS(n).main(args)
- new ImmutableTS(n).main(args)
- }
-}
-
-class Dummy(val a: Int) extends math.Ordered[Dummy] {
- def compare(other: Dummy) = this.a - other.a
-
- override def toString = a.toString
- }
-
-
-class JavaUtilTS(val length: Int) extends testing.Benchmark {
- var data: Array[Dummy] = util.Random.shuffle((0 until length) map { a => new Dummy(a) }) toArray
- var t: java.util.TreeSet[Dummy] = null
-
- def run = {
- t = new java.util.TreeSet[Dummy]()
- data foreach { a => t add a }
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t remove elem
- i += 1
- }
- }
-}
-
-class MutableTS(val length: Int) extends testing.Benchmark {
- var data: Array[Dummy] = util.Random.shuffle((0 until length) map { a => new Dummy(a) }) toArray
- var t: collection.mutable.TreeSet[Dummy] = null
-
- def run = {
- t = collection.mutable.TreeSet[Dummy](data: _*)
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t -= elem
- i += 1
- }
- }
-}
-
-class ImmutableTS(val length: Int) extends testing.Benchmark {
- var data: Array[Dummy] = util.Random.shuffle((0 until length) map { a => new Dummy(a) }) toArray
- var t: collection.immutable.TreeSet[Dummy] = null
-
- def run = {
- t = collection.immutable.TreeSet[Dummy](data: _*)
-
- var i = 0
- while (i < length) {
- val elem = data(i)
- t -= elem
- i += 1
- }
- }
-}
diff --git a/test/benchmarking/t6726-patmat-analysis.scala b/test/benchmarking/t6726-patmat-analysis.scala
deleted file mode 100644
index bcb7f6c6b2..0000000000
--- a/test/benchmarking/t6726-patmat-analysis.scala
+++ /dev/null
@@ -1,4005 +0,0 @@
-trait Foo{
-abstract class Base
-case class Dummy0(x: Int) extends Base
-case class Dummy1(x: Int) extends Base
-case class Dummy2(x: Int) extends Base
-case class Dummy3(x: Int) extends Base
-case class Dummy4(x: Int) extends Base
-case class Dummy5(x: Int) extends Base
-case class Dummy6(x: Int) extends Base
-case class Dummy7(x: Int) extends Base
-case class Dummy8(x: Int) extends Base
-case class Dummy9(x: Int) extends Base
-case class Dummy10(x: Int) extends Base
-case class Dummy11(x: Int) extends Base
-case class Dummy12(x: Int) extends Base
-case class Dummy13(x: Int) extends Base
-case class Dummy14(x: Int) extends Base
-case class Dummy15(x: Int) extends Base
-case class Dummy16(x: Int) extends Base
-case class Dummy17(x: Int) extends Base
-case class Dummy18(x: Int) extends Base
-case class Dummy19(x: Int) extends Base
-case class Dummy20(x: Int) extends Base
-case class Dummy21(x: Int) extends Base
-case class Dummy22(x: Int) extends Base
-case class Dummy23(x: Int) extends Base
-case class Dummy24(x: Int) extends Base
-case class Dummy25(x: Int) extends Base
-case class Dummy26(x: Int) extends Base
-case class Dummy27(x: Int) extends Base
-case class Dummy28(x: Int) extends Base
-case class Dummy29(x: Int) extends Base
-case class Dummy30(x: Int) extends Base
-case class Dummy31(x: Int) extends Base
-case class Dummy32(x: Int) extends Base
-case class Dummy33(x: Int) extends Base
-case class Dummy34(x: Int) extends Base
-case class Dummy35(x: Int) extends Base
-case class Dummy36(x: Int) extends Base
-case class Dummy37(x: Int) extends Base
-case class Dummy38(x: Int) extends Base
-case class Dummy39(x: Int) extends Base
-case class Dummy40(x: Int) extends Base
-case class Dummy41(x: Int) extends Base
-case class Dummy42(x: Int) extends Base
-case class Dummy43(x: Int) extends Base
-case class Dummy44(x: Int) extends Base
-case class Dummy45(x: Int) extends Base
-case class Dummy46(x: Int) extends Base
-case class Dummy47(x: Int) extends Base
-case class Dummy48(x: Int) extends Base
-case class Dummy49(x: Int) extends Base
-case class Dummy50(x: Int) extends Base
-case class Dummy51(x: Int) extends Base
-case class Dummy52(x: Int) extends Base
-case class Dummy53(x: Int) extends Base
-case class Dummy54(x: Int) extends Base
-case class Dummy55(x: Int) extends Base
-case class Dummy56(x: Int) extends Base
-case class Dummy57(x: Int) extends Base
-case class Dummy58(x: Int) extends Base
-case class Dummy59(x: Int) extends Base
-case class Dummy60(x: Int) extends Base
-case class Dummy61(x: Int) extends Base
-case class Dummy62(x: Int) extends Base
-case class Dummy63(x: Int) extends Base
-case class Dummy64(x: Int) extends Base
-case class Dummy65(x: Int) extends Base
-case class Dummy66(x: Int) extends Base
-case class Dummy67(x: Int) extends Base
-case class Dummy68(x: Int) extends Base
-case class Dummy69(x: Int) extends Base
-case class Dummy70(x: Int) extends Base
-case class Dummy71(x: Int) extends Base
-case class Dummy72(x: Int) extends Base
-case class Dummy73(x: Int) extends Base
-case class Dummy74(x: Int) extends Base
-case class Dummy75(x: Int) extends Base
-case class Dummy76(x: Int) extends Base
-case class Dummy77(x: Int) extends Base
-case class Dummy78(x: Int) extends Base
-case class Dummy79(x: Int) extends Base
-case class Dummy80(x: Int) extends Base
-case class Dummy81(x: Int) extends Base
-case class Dummy82(x: Int) extends Base
-case class Dummy83(x: Int) extends Base
-case class Dummy84(x: Int) extends Base
-case class Dummy85(x: Int) extends Base
-case class Dummy86(x: Int) extends Base
-case class Dummy87(x: Int) extends Base
-case class Dummy88(x: Int) extends Base
-case class Dummy89(x: Int) extends Base
-case class Dummy90(x: Int) extends Base
-case class Dummy91(x: Int) extends Base
-case class Dummy92(x: Int) extends Base
-case class Dummy93(x: Int) extends Base
-case class Dummy94(x: Int) extends Base
-case class Dummy95(x: Int) extends Base
-case class Dummy96(x: Int) extends Base
-case class Dummy97(x: Int) extends Base
-case class Dummy98(x: Int) extends Base
-case class Dummy99(x: Int) extends Base
-case class Dummy100(x: Int) extends Base
-case class Dummy101(x: Int) extends Base
-case class Dummy102(x: Int) extends Base
-case class Dummy103(x: Int) extends Base
-case class Dummy104(x: Int) extends Base
-case class Dummy105(x: Int) extends Base
-case class Dummy106(x: Int) extends Base
-case class Dummy107(x: Int) extends Base
-case class Dummy108(x: Int) extends Base
-case class Dummy109(x: Int) extends Base
-case class Dummy110(x: Int) extends Base
-case class Dummy111(x: Int) extends Base
-case class Dummy112(x: Int) extends Base
-case class Dummy113(x: Int) extends Base
-case class Dummy114(x: Int) extends Base
-case class Dummy115(x: Int) extends Base
-case class Dummy116(x: Int) extends Base
-case class Dummy117(x: Int) extends Base
-case class Dummy118(x: Int) extends Base
-case class Dummy119(x: Int) extends Base
-case class Dummy120(x: Int) extends Base
-case class Dummy121(x: Int) extends Base
-case class Dummy122(x: Int) extends Base
-case class Dummy123(x: Int) extends Base
-case class Dummy124(x: Int) extends Base
-case class Dummy125(x: Int) extends Base
-case class Dummy126(x: Int) extends Base
-case class Dummy127(x: Int) extends Base
-case class Dummy128(x: Int) extends Base
-case class Dummy129(x: Int) extends Base
-case class Dummy130(x: Int) extends Base
-case class Dummy131(x: Int) extends Base
-case class Dummy132(x: Int) extends Base
-case class Dummy133(x: Int) extends Base
-case class Dummy134(x: Int) extends Base
-case class Dummy135(x: Int) extends Base
-case class Dummy136(x: Int) extends Base
-case class Dummy137(x: Int) extends Base
-case class Dummy138(x: Int) extends Base
-case class Dummy139(x: Int) extends Base
-case class Dummy140(x: Int) extends Base
-case class Dummy141(x: Int) extends Base
-case class Dummy142(x: Int) extends Base
-case class Dummy143(x: Int) extends Base
-case class Dummy144(x: Int) extends Base
-case class Dummy145(x: Int) extends Base
-case class Dummy146(x: Int) extends Base
-case class Dummy147(x: Int) extends Base
-case class Dummy148(x: Int) extends Base
-case class Dummy149(x: Int) extends Base
-case class Dummy150(x: Int) extends Base
-case class Dummy151(x: Int) extends Base
-case class Dummy152(x: Int) extends Base
-case class Dummy153(x: Int) extends Base
-case class Dummy154(x: Int) extends Base
-case class Dummy155(x: Int) extends Base
-case class Dummy156(x: Int) extends Base
-case class Dummy157(x: Int) extends Base
-case class Dummy158(x: Int) extends Base
-case class Dummy159(x: Int) extends Base
-case class Dummy160(x: Int) extends Base
-case class Dummy161(x: Int) extends Base
-case class Dummy162(x: Int) extends Base
-case class Dummy163(x: Int) extends Base
-case class Dummy164(x: Int) extends Base
-case class Dummy165(x: Int) extends Base
-case class Dummy166(x: Int) extends Base
-case class Dummy167(x: Int) extends Base
-case class Dummy168(x: Int) extends Base
-case class Dummy169(x: Int) extends Base
-case class Dummy170(x: Int) extends Base
-case class Dummy171(x: Int) extends Base
-case class Dummy172(x: Int) extends Base
-case class Dummy173(x: Int) extends Base
-case class Dummy174(x: Int) extends Base
-case class Dummy175(x: Int) extends Base
-case class Dummy176(x: Int) extends Base
-case class Dummy177(x: Int) extends Base
-case class Dummy178(x: Int) extends Base
-case class Dummy179(x: Int) extends Base
-case class Dummy180(x: Int) extends Base
-case class Dummy181(x: Int) extends Base
-case class Dummy182(x: Int) extends Base
-case class Dummy183(x: Int) extends Base
-case class Dummy184(x: Int) extends Base
-case class Dummy185(x: Int) extends Base
-case class Dummy186(x: Int) extends Base
-case class Dummy187(x: Int) extends Base
-case class Dummy188(x: Int) extends Base
-case class Dummy189(x: Int) extends Base
-case class Dummy190(x: Int) extends Base
-case class Dummy191(x: Int) extends Base
-case class Dummy192(x: Int) extends Base
-case class Dummy193(x: Int) extends Base
-case class Dummy194(x: Int) extends Base
-case class Dummy195(x: Int) extends Base
-case class Dummy196(x: Int) extends Base
-case class Dummy197(x: Int) extends Base
-case class Dummy198(x: Int) extends Base
-case class Dummy199(x: Int) extends Base
-case class Dummy200(x: Int) extends Base
-case class Dummy201(x: Int) extends Base
-case class Dummy202(x: Int) extends Base
-case class Dummy203(x: Int) extends Base
-case class Dummy204(x: Int) extends Base
-case class Dummy205(x: Int) extends Base
-case class Dummy206(x: Int) extends Base
-case class Dummy207(x: Int) extends Base
-case class Dummy208(x: Int) extends Base
-case class Dummy209(x: Int) extends Base
-case class Dummy210(x: Int) extends Base
-case class Dummy211(x: Int) extends Base
-case class Dummy212(x: Int) extends Base
-case class Dummy213(x: Int) extends Base
-case class Dummy214(x: Int) extends Base
-case class Dummy215(x: Int) extends Base
-case class Dummy216(x: Int) extends Base
-case class Dummy217(x: Int) extends Base
-case class Dummy218(x: Int) extends Base
-case class Dummy219(x: Int) extends Base
-case class Dummy220(x: Int) extends Base
-case class Dummy221(x: Int) extends Base
-case class Dummy222(x: Int) extends Base
-case class Dummy223(x: Int) extends Base
-case class Dummy224(x: Int) extends Base
-case class Dummy225(x: Int) extends Base
-case class Dummy226(x: Int) extends Base
-case class Dummy227(x: Int) extends Base
-case class Dummy228(x: Int) extends Base
-case class Dummy229(x: Int) extends Base
-case class Dummy230(x: Int) extends Base
-case class Dummy231(x: Int) extends Base
-case class Dummy232(x: Int) extends Base
-case class Dummy233(x: Int) extends Base
-case class Dummy234(x: Int) extends Base
-case class Dummy235(x: Int) extends Base
-case class Dummy236(x: Int) extends Base
-case class Dummy237(x: Int) extends Base
-case class Dummy238(x: Int) extends Base
-case class Dummy239(x: Int) extends Base
-case class Dummy240(x: Int) extends Base
-case class Dummy241(x: Int) extends Base
-case class Dummy242(x: Int) extends Base
-case class Dummy243(x: Int) extends Base
-case class Dummy244(x: Int) extends Base
-case class Dummy245(x: Int) extends Base
-case class Dummy246(x: Int) extends Base
-case class Dummy247(x: Int) extends Base
-case class Dummy248(x: Int) extends Base
-case class Dummy249(x: Int) extends Base
-case class Dummy250(x: Int) extends Base
-case class Dummy251(x: Int) extends Base
-case class Dummy252(x: Int) extends Base
-case class Dummy253(x: Int) extends Base
-case class Dummy254(x: Int) extends Base
-case class Dummy255(x: Int) extends Base
-case class Dummy256(x: Int) extends Base
-case class Dummy257(x: Int) extends Base
-case class Dummy258(x: Int) extends Base
-case class Dummy259(x: Int) extends Base
-case class Dummy260(x: Int) extends Base
-case class Dummy261(x: Int) extends Base
-case class Dummy262(x: Int) extends Base
-case class Dummy263(x: Int) extends Base
-case class Dummy264(x: Int) extends Base
-case class Dummy265(x: Int) extends Base
-case class Dummy266(x: Int) extends Base
-case class Dummy267(x: Int) extends Base
-case class Dummy268(x: Int) extends Base
-case class Dummy269(x: Int) extends Base
-case class Dummy270(x: Int) extends Base
-case class Dummy271(x: Int) extends Base
-case class Dummy272(x: Int) extends Base
-case class Dummy273(x: Int) extends Base
-case class Dummy274(x: Int) extends Base
-case class Dummy275(x: Int) extends Base
-case class Dummy276(x: Int) extends Base
-case class Dummy277(x: Int) extends Base
-case class Dummy278(x: Int) extends Base
-case class Dummy279(x: Int) extends Base
-case class Dummy280(x: Int) extends Base
-case class Dummy281(x: Int) extends Base
-case class Dummy282(x: Int) extends Base
-case class Dummy283(x: Int) extends Base
-case class Dummy284(x: Int) extends Base
-case class Dummy285(x: Int) extends Base
-case class Dummy286(x: Int) extends Base
-case class Dummy287(x: Int) extends Base
-case class Dummy288(x: Int) extends Base
-case class Dummy289(x: Int) extends Base
-case class Dummy290(x: Int) extends Base
-case class Dummy291(x: Int) extends Base
-case class Dummy292(x: Int) extends Base
-case class Dummy293(x: Int) extends Base
-case class Dummy294(x: Int) extends Base
-case class Dummy295(x: Int) extends Base
-case class Dummy296(x: Int) extends Base
-case class Dummy297(x: Int) extends Base
-case class Dummy298(x: Int) extends Base
-case class Dummy299(x: Int) extends Base
-case class Dummy300(x: Int) extends Base
-case class Dummy301(x: Int) extends Base
-case class Dummy302(x: Int) extends Base
-case class Dummy303(x: Int) extends Base
-case class Dummy304(x: Int) extends Base
-case class Dummy305(x: Int) extends Base
-case class Dummy306(x: Int) extends Base
-case class Dummy307(x: Int) extends Base
-case class Dummy308(x: Int) extends Base
-case class Dummy309(x: Int) extends Base
-case class Dummy310(x: Int) extends Base
-case class Dummy311(x: Int) extends Base
-case class Dummy312(x: Int) extends Base
-case class Dummy313(x: Int) extends Base
-case class Dummy314(x: Int) extends Base
-case class Dummy315(x: Int) extends Base
-case class Dummy316(x: Int) extends Base
-case class Dummy317(x: Int) extends Base
-case class Dummy318(x: Int) extends Base
-case class Dummy319(x: Int) extends Base
-case class Dummy320(x: Int) extends Base
-case class Dummy321(x: Int) extends Base
-case class Dummy322(x: Int) extends Base
-case class Dummy323(x: Int) extends Base
-case class Dummy324(x: Int) extends Base
-case class Dummy325(x: Int) extends Base
-case class Dummy326(x: Int) extends Base
-case class Dummy327(x: Int) extends Base
-case class Dummy328(x: Int) extends Base
-case class Dummy329(x: Int) extends Base
-case class Dummy330(x: Int) extends Base
-case class Dummy331(x: Int) extends Base
-case class Dummy332(x: Int) extends Base
-case class Dummy333(x: Int) extends Base
-case class Dummy334(x: Int) extends Base
-case class Dummy335(x: Int) extends Base
-case class Dummy336(x: Int) extends Base
-case class Dummy337(x: Int) extends Base
-case class Dummy338(x: Int) extends Base
-case class Dummy339(x: Int) extends Base
-case class Dummy340(x: Int) extends Base
-case class Dummy341(x: Int) extends Base
-case class Dummy342(x: Int) extends Base
-case class Dummy343(x: Int) extends Base
-case class Dummy344(x: Int) extends Base
-case class Dummy345(x: Int) extends Base
-case class Dummy346(x: Int) extends Base
-case class Dummy347(x: Int) extends Base
-case class Dummy348(x: Int) extends Base
-case class Dummy349(x: Int) extends Base
-case class Dummy350(x: Int) extends Base
-case class Dummy351(x: Int) extends Base
-case class Dummy352(x: Int) extends Base
-case class Dummy353(x: Int) extends Base
-case class Dummy354(x: Int) extends Base
-case class Dummy355(x: Int) extends Base
-case class Dummy356(x: Int) extends Base
-case class Dummy357(x: Int) extends Base
-case class Dummy358(x: Int) extends Base
-case class Dummy359(x: Int) extends Base
-case class Dummy360(x: Int) extends Base
-case class Dummy361(x: Int) extends Base
-case class Dummy362(x: Int) extends Base
-case class Dummy363(x: Int) extends Base
-case class Dummy364(x: Int) extends Base
-case class Dummy365(x: Int) extends Base
-case class Dummy366(x: Int) extends Base
-case class Dummy367(x: Int) extends Base
-case class Dummy368(x: Int) extends Base
-case class Dummy369(x: Int) extends Base
-case class Dummy370(x: Int) extends Base
-case class Dummy371(x: Int) extends Base
-case class Dummy372(x: Int) extends Base
-case class Dummy373(x: Int) extends Base
-case class Dummy374(x: Int) extends Base
-case class Dummy375(x: Int) extends Base
-case class Dummy376(x: Int) extends Base
-case class Dummy377(x: Int) extends Base
-case class Dummy378(x: Int) extends Base
-case class Dummy379(x: Int) extends Base
-case class Dummy380(x: Int) extends Base
-case class Dummy381(x: Int) extends Base
-case class Dummy382(x: Int) extends Base
-case class Dummy383(x: Int) extends Base
-case class Dummy384(x: Int) extends Base
-case class Dummy385(x: Int) extends Base
-case class Dummy386(x: Int) extends Base
-case class Dummy387(x: Int) extends Base
-case class Dummy388(x: Int) extends Base
-case class Dummy389(x: Int) extends Base
-case class Dummy390(x: Int) extends Base
-case class Dummy391(x: Int) extends Base
-case class Dummy392(x: Int) extends Base
-case class Dummy393(x: Int) extends Base
-case class Dummy394(x: Int) extends Base
-case class Dummy395(x: Int) extends Base
-case class Dummy396(x: Int) extends Base
-case class Dummy397(x: Int) extends Base
-case class Dummy398(x: Int) extends Base
-case class Dummy399(x: Int) extends Base
-case class Dummy400(x: Int) extends Base
-case class Dummy401(x: Int) extends Base
-case class Dummy402(x: Int) extends Base
-case class Dummy403(x: Int) extends Base
-case class Dummy404(x: Int) extends Base
-case class Dummy405(x: Int) extends Base
-case class Dummy406(x: Int) extends Base
-case class Dummy407(x: Int) extends Base
-case class Dummy408(x: Int) extends Base
-case class Dummy409(x: Int) extends Base
-case class Dummy410(x: Int) extends Base
-case class Dummy411(x: Int) extends Base
-case class Dummy412(x: Int) extends Base
-case class Dummy413(x: Int) extends Base
-case class Dummy414(x: Int) extends Base
-case class Dummy415(x: Int) extends Base
-case class Dummy416(x: Int) extends Base
-case class Dummy417(x: Int) extends Base
-case class Dummy418(x: Int) extends Base
-case class Dummy419(x: Int) extends Base
-case class Dummy420(x: Int) extends Base
-case class Dummy421(x: Int) extends Base
-case class Dummy422(x: Int) extends Base
-case class Dummy423(x: Int) extends Base
-case class Dummy424(x: Int) extends Base
-case class Dummy425(x: Int) extends Base
-case class Dummy426(x: Int) extends Base
-case class Dummy427(x: Int) extends Base
-case class Dummy428(x: Int) extends Base
-case class Dummy429(x: Int) extends Base
-case class Dummy430(x: Int) extends Base
-case class Dummy431(x: Int) extends Base
-case class Dummy432(x: Int) extends Base
-case class Dummy433(x: Int) extends Base
-case class Dummy434(x: Int) extends Base
-case class Dummy435(x: Int) extends Base
-case class Dummy436(x: Int) extends Base
-case class Dummy437(x: Int) extends Base
-case class Dummy438(x: Int) extends Base
-case class Dummy439(x: Int) extends Base
-case class Dummy440(x: Int) extends Base
-case class Dummy441(x: Int) extends Base
-case class Dummy442(x: Int) extends Base
-case class Dummy443(x: Int) extends Base
-case class Dummy444(x: Int) extends Base
-case class Dummy445(x: Int) extends Base
-case class Dummy446(x: Int) extends Base
-case class Dummy447(x: Int) extends Base
-case class Dummy448(x: Int) extends Base
-case class Dummy449(x: Int) extends Base
-case class Dummy450(x: Int) extends Base
-case class Dummy451(x: Int) extends Base
-case class Dummy452(x: Int) extends Base
-case class Dummy453(x: Int) extends Base
-case class Dummy454(x: Int) extends Base
-case class Dummy455(x: Int) extends Base
-case class Dummy456(x: Int) extends Base
-case class Dummy457(x: Int) extends Base
-case class Dummy458(x: Int) extends Base
-case class Dummy459(x: Int) extends Base
-case class Dummy460(x: Int) extends Base
-case class Dummy461(x: Int) extends Base
-case class Dummy462(x: Int) extends Base
-case class Dummy463(x: Int) extends Base
-case class Dummy464(x: Int) extends Base
-case class Dummy465(x: Int) extends Base
-case class Dummy466(x: Int) extends Base
-case class Dummy467(x: Int) extends Base
-case class Dummy468(x: Int) extends Base
-case class Dummy469(x: Int) extends Base
-case class Dummy470(x: Int) extends Base
-case class Dummy471(x: Int) extends Base
-case class Dummy472(x: Int) extends Base
-case class Dummy473(x: Int) extends Base
-case class Dummy474(x: Int) extends Base
-case class Dummy475(x: Int) extends Base
-case class Dummy476(x: Int) extends Base
-case class Dummy477(x: Int) extends Base
-case class Dummy478(x: Int) extends Base
-case class Dummy479(x: Int) extends Base
-case class Dummy480(x: Int) extends Base
-case class Dummy481(x: Int) extends Base
-case class Dummy482(x: Int) extends Base
-case class Dummy483(x: Int) extends Base
-case class Dummy484(x: Int) extends Base
-case class Dummy485(x: Int) extends Base
-case class Dummy486(x: Int) extends Base
-case class Dummy487(x: Int) extends Base
-case class Dummy488(x: Int) extends Base
-case class Dummy489(x: Int) extends Base
-case class Dummy490(x: Int) extends Base
-case class Dummy491(x: Int) extends Base
-case class Dummy492(x: Int) extends Base
-case class Dummy493(x: Int) extends Base
-case class Dummy494(x: Int) extends Base
-case class Dummy495(x: Int) extends Base
-case class Dummy496(x: Int) extends Base
-case class Dummy497(x: Int) extends Base
-case class Dummy498(x: Int) extends Base
-case class Dummy499(x: Int) extends Base
-case class Dummy500(x: Int) extends Base
-case class Dummy501(x: Int) extends Base
-case class Dummy502(x: Int) extends Base
-case class Dummy503(x: Int) extends Base
-case class Dummy504(x: Int) extends Base
-case class Dummy505(x: Int) extends Base
-case class Dummy506(x: Int) extends Base
-case class Dummy507(x: Int) extends Base
-case class Dummy508(x: Int) extends Base
-case class Dummy509(x: Int) extends Base
-case class Dummy510(x: Int) extends Base
-case class Dummy511(x: Int) extends Base
-case class Dummy512(x: Int) extends Base
-case class Dummy513(x: Int) extends Base
-case class Dummy514(x: Int) extends Base
-case class Dummy515(x: Int) extends Base
-case class Dummy516(x: Int) extends Base
-case class Dummy517(x: Int) extends Base
-case class Dummy518(x: Int) extends Base
-case class Dummy519(x: Int) extends Base
-case class Dummy520(x: Int) extends Base
-case class Dummy521(x: Int) extends Base
-case class Dummy522(x: Int) extends Base
-case class Dummy523(x: Int) extends Base
-case class Dummy524(x: Int) extends Base
-case class Dummy525(x: Int) extends Base
-case class Dummy526(x: Int) extends Base
-case class Dummy527(x: Int) extends Base
-case class Dummy528(x: Int) extends Base
-case class Dummy529(x: Int) extends Base
-case class Dummy530(x: Int) extends Base
-case class Dummy531(x: Int) extends Base
-case class Dummy532(x: Int) extends Base
-case class Dummy533(x: Int) extends Base
-case class Dummy534(x: Int) extends Base
-case class Dummy535(x: Int) extends Base
-case class Dummy536(x: Int) extends Base
-case class Dummy537(x: Int) extends Base
-case class Dummy538(x: Int) extends Base
-case class Dummy539(x: Int) extends Base
-case class Dummy540(x: Int) extends Base
-case class Dummy541(x: Int) extends Base
-case class Dummy542(x: Int) extends Base
-case class Dummy543(x: Int) extends Base
-case class Dummy544(x: Int) extends Base
-case class Dummy545(x: Int) extends Base
-case class Dummy546(x: Int) extends Base
-case class Dummy547(x: Int) extends Base
-case class Dummy548(x: Int) extends Base
-case class Dummy549(x: Int) extends Base
-case class Dummy550(x: Int) extends Base
-case class Dummy551(x: Int) extends Base
-case class Dummy552(x: Int) extends Base
-case class Dummy553(x: Int) extends Base
-case class Dummy554(x: Int) extends Base
-case class Dummy555(x: Int) extends Base
-case class Dummy556(x: Int) extends Base
-case class Dummy557(x: Int) extends Base
-case class Dummy558(x: Int) extends Base
-case class Dummy559(x: Int) extends Base
-case class Dummy560(x: Int) extends Base
-case class Dummy561(x: Int) extends Base
-case class Dummy562(x: Int) extends Base
-case class Dummy563(x: Int) extends Base
-case class Dummy564(x: Int) extends Base
-case class Dummy565(x: Int) extends Base
-case class Dummy566(x: Int) extends Base
-case class Dummy567(x: Int) extends Base
-case class Dummy568(x: Int) extends Base
-case class Dummy569(x: Int) extends Base
-case class Dummy570(x: Int) extends Base
-case class Dummy571(x: Int) extends Base
-case class Dummy572(x: Int) extends Base
-case class Dummy573(x: Int) extends Base
-case class Dummy574(x: Int) extends Base
-case class Dummy575(x: Int) extends Base
-case class Dummy576(x: Int) extends Base
-case class Dummy577(x: Int) extends Base
-case class Dummy578(x: Int) extends Base
-case class Dummy579(x: Int) extends Base
-case class Dummy580(x: Int) extends Base
-case class Dummy581(x: Int) extends Base
-case class Dummy582(x: Int) extends Base
-case class Dummy583(x: Int) extends Base
-case class Dummy584(x: Int) extends Base
-case class Dummy585(x: Int) extends Base
-case class Dummy586(x: Int) extends Base
-case class Dummy587(x: Int) extends Base
-case class Dummy588(x: Int) extends Base
-case class Dummy589(x: Int) extends Base
-case class Dummy590(x: Int) extends Base
-case class Dummy591(x: Int) extends Base
-case class Dummy592(x: Int) extends Base
-case class Dummy593(x: Int) extends Base
-case class Dummy594(x: Int) extends Base
-case class Dummy595(x: Int) extends Base
-case class Dummy596(x: Int) extends Base
-case class Dummy597(x: Int) extends Base
-case class Dummy598(x: Int) extends Base
-case class Dummy599(x: Int) extends Base
-case class Dummy600(x: Int) extends Base
-case class Dummy601(x: Int) extends Base
-case class Dummy602(x: Int) extends Base
-case class Dummy603(x: Int) extends Base
-case class Dummy604(x: Int) extends Base
-case class Dummy605(x: Int) extends Base
-case class Dummy606(x: Int) extends Base
-case class Dummy607(x: Int) extends Base
-case class Dummy608(x: Int) extends Base
-case class Dummy609(x: Int) extends Base
-case class Dummy610(x: Int) extends Base
-case class Dummy611(x: Int) extends Base
-case class Dummy612(x: Int) extends Base
-case class Dummy613(x: Int) extends Base
-case class Dummy614(x: Int) extends Base
-case class Dummy615(x: Int) extends Base
-case class Dummy616(x: Int) extends Base
-case class Dummy617(x: Int) extends Base
-case class Dummy618(x: Int) extends Base
-case class Dummy619(x: Int) extends Base
-case class Dummy620(x: Int) extends Base
-case class Dummy621(x: Int) extends Base
-case class Dummy622(x: Int) extends Base
-case class Dummy623(x: Int) extends Base
-case class Dummy624(x: Int) extends Base
-case class Dummy625(x: Int) extends Base
-case class Dummy626(x: Int) extends Base
-case class Dummy627(x: Int) extends Base
-case class Dummy628(x: Int) extends Base
-case class Dummy629(x: Int) extends Base
-case class Dummy630(x: Int) extends Base
-case class Dummy631(x: Int) extends Base
-case class Dummy632(x: Int) extends Base
-case class Dummy633(x: Int) extends Base
-case class Dummy634(x: Int) extends Base
-case class Dummy635(x: Int) extends Base
-case class Dummy636(x: Int) extends Base
-case class Dummy637(x: Int) extends Base
-case class Dummy638(x: Int) extends Base
-case class Dummy639(x: Int) extends Base
-case class Dummy640(x: Int) extends Base
-case class Dummy641(x: Int) extends Base
-case class Dummy642(x: Int) extends Base
-case class Dummy643(x: Int) extends Base
-case class Dummy644(x: Int) extends Base
-case class Dummy645(x: Int) extends Base
-case class Dummy646(x: Int) extends Base
-case class Dummy647(x: Int) extends Base
-case class Dummy648(x: Int) extends Base
-case class Dummy649(x: Int) extends Base
-case class Dummy650(x: Int) extends Base
-case class Dummy651(x: Int) extends Base
-case class Dummy652(x: Int) extends Base
-case class Dummy653(x: Int) extends Base
-case class Dummy654(x: Int) extends Base
-case class Dummy655(x: Int) extends Base
-case class Dummy656(x: Int) extends Base
-case class Dummy657(x: Int) extends Base
-case class Dummy658(x: Int) extends Base
-case class Dummy659(x: Int) extends Base
-case class Dummy660(x: Int) extends Base
-case class Dummy661(x: Int) extends Base
-case class Dummy662(x: Int) extends Base
-case class Dummy663(x: Int) extends Base
-case class Dummy664(x: Int) extends Base
-case class Dummy665(x: Int) extends Base
-case class Dummy666(x: Int) extends Base
-case class Dummy667(x: Int) extends Base
-case class Dummy668(x: Int) extends Base
-case class Dummy669(x: Int) extends Base
-case class Dummy670(x: Int) extends Base
-case class Dummy671(x: Int) extends Base
-case class Dummy672(x: Int) extends Base
-case class Dummy673(x: Int) extends Base
-case class Dummy674(x: Int) extends Base
-case class Dummy675(x: Int) extends Base
-case class Dummy676(x: Int) extends Base
-case class Dummy677(x: Int) extends Base
-case class Dummy678(x: Int) extends Base
-case class Dummy679(x: Int) extends Base
-case class Dummy680(x: Int) extends Base
-case class Dummy681(x: Int) extends Base
-case class Dummy682(x: Int) extends Base
-case class Dummy683(x: Int) extends Base
-case class Dummy684(x: Int) extends Base
-case class Dummy685(x: Int) extends Base
-case class Dummy686(x: Int) extends Base
-case class Dummy687(x: Int) extends Base
-case class Dummy688(x: Int) extends Base
-case class Dummy689(x: Int) extends Base
-case class Dummy690(x: Int) extends Base
-case class Dummy691(x: Int) extends Base
-case class Dummy692(x: Int) extends Base
-case class Dummy693(x: Int) extends Base
-case class Dummy694(x: Int) extends Base
-case class Dummy695(x: Int) extends Base
-case class Dummy696(x: Int) extends Base
-case class Dummy697(x: Int) extends Base
-case class Dummy698(x: Int) extends Base
-case class Dummy699(x: Int) extends Base
-case class Dummy700(x: Int) extends Base
-case class Dummy701(x: Int) extends Base
-case class Dummy702(x: Int) extends Base
-case class Dummy703(x: Int) extends Base
-case class Dummy704(x: Int) extends Base
-case class Dummy705(x: Int) extends Base
-case class Dummy706(x: Int) extends Base
-case class Dummy707(x: Int) extends Base
-case class Dummy708(x: Int) extends Base
-case class Dummy709(x: Int) extends Base
-case class Dummy710(x: Int) extends Base
-case class Dummy711(x: Int) extends Base
-case class Dummy712(x: Int) extends Base
-case class Dummy713(x: Int) extends Base
-case class Dummy714(x: Int) extends Base
-case class Dummy715(x: Int) extends Base
-case class Dummy716(x: Int) extends Base
-case class Dummy717(x: Int) extends Base
-case class Dummy718(x: Int) extends Base
-case class Dummy719(x: Int) extends Base
-case class Dummy720(x: Int) extends Base
-case class Dummy721(x: Int) extends Base
-case class Dummy722(x: Int) extends Base
-case class Dummy723(x: Int) extends Base
-case class Dummy724(x: Int) extends Base
-case class Dummy725(x: Int) extends Base
-case class Dummy726(x: Int) extends Base
-case class Dummy727(x: Int) extends Base
-case class Dummy728(x: Int) extends Base
-case class Dummy729(x: Int) extends Base
-case class Dummy730(x: Int) extends Base
-case class Dummy731(x: Int) extends Base
-case class Dummy732(x: Int) extends Base
-case class Dummy733(x: Int) extends Base
-case class Dummy734(x: Int) extends Base
-case class Dummy735(x: Int) extends Base
-case class Dummy736(x: Int) extends Base
-case class Dummy737(x: Int) extends Base
-case class Dummy738(x: Int) extends Base
-case class Dummy739(x: Int) extends Base
-case class Dummy740(x: Int) extends Base
-case class Dummy741(x: Int) extends Base
-case class Dummy742(x: Int) extends Base
-case class Dummy743(x: Int) extends Base
-case class Dummy744(x: Int) extends Base
-case class Dummy745(x: Int) extends Base
-case class Dummy746(x: Int) extends Base
-case class Dummy747(x: Int) extends Base
-case class Dummy748(x: Int) extends Base
-case class Dummy749(x: Int) extends Base
-case class Dummy750(x: Int) extends Base
-case class Dummy751(x: Int) extends Base
-case class Dummy752(x: Int) extends Base
-case class Dummy753(x: Int) extends Base
-case class Dummy754(x: Int) extends Base
-case class Dummy755(x: Int) extends Base
-case class Dummy756(x: Int) extends Base
-case class Dummy757(x: Int) extends Base
-case class Dummy758(x: Int) extends Base
-case class Dummy759(x: Int) extends Base
-case class Dummy760(x: Int) extends Base
-case class Dummy761(x: Int) extends Base
-case class Dummy762(x: Int) extends Base
-case class Dummy763(x: Int) extends Base
-case class Dummy764(x: Int) extends Base
-case class Dummy765(x: Int) extends Base
-case class Dummy766(x: Int) extends Base
-case class Dummy767(x: Int) extends Base
-case class Dummy768(x: Int) extends Base
-case class Dummy769(x: Int) extends Base
-case class Dummy770(x: Int) extends Base
-case class Dummy771(x: Int) extends Base
-case class Dummy772(x: Int) extends Base
-case class Dummy773(x: Int) extends Base
-case class Dummy774(x: Int) extends Base
-case class Dummy775(x: Int) extends Base
-case class Dummy776(x: Int) extends Base
-case class Dummy777(x: Int) extends Base
-case class Dummy778(x: Int) extends Base
-case class Dummy779(x: Int) extends Base
-case class Dummy780(x: Int) extends Base
-case class Dummy781(x: Int) extends Base
-case class Dummy782(x: Int) extends Base
-case class Dummy783(x: Int) extends Base
-case class Dummy784(x: Int) extends Base
-case class Dummy785(x: Int) extends Base
-case class Dummy786(x: Int) extends Base
-case class Dummy787(x: Int) extends Base
-case class Dummy788(x: Int) extends Base
-case class Dummy789(x: Int) extends Base
-case class Dummy790(x: Int) extends Base
-case class Dummy791(x: Int) extends Base
-case class Dummy792(x: Int) extends Base
-case class Dummy793(x: Int) extends Base
-case class Dummy794(x: Int) extends Base
-case class Dummy795(x: Int) extends Base
-case class Dummy796(x: Int) extends Base
-case class Dummy797(x: Int) extends Base
-case class Dummy798(x: Int) extends Base
-case class Dummy799(x: Int) extends Base
-case class Dummy800(x: Int) extends Base
-case class Dummy801(x: Int) extends Base
-case class Dummy802(x: Int) extends Base
-case class Dummy803(x: Int) extends Base
-case class Dummy804(x: Int) extends Base
-case class Dummy805(x: Int) extends Base
-case class Dummy806(x: Int) extends Base
-case class Dummy807(x: Int) extends Base
-case class Dummy808(x: Int) extends Base
-case class Dummy809(x: Int) extends Base
-case class Dummy810(x: Int) extends Base
-case class Dummy811(x: Int) extends Base
-case class Dummy812(x: Int) extends Base
-case class Dummy813(x: Int) extends Base
-case class Dummy814(x: Int) extends Base
-case class Dummy815(x: Int) extends Base
-case class Dummy816(x: Int) extends Base
-case class Dummy817(x: Int) extends Base
-case class Dummy818(x: Int) extends Base
-case class Dummy819(x: Int) extends Base
-case class Dummy820(x: Int) extends Base
-case class Dummy821(x: Int) extends Base
-case class Dummy822(x: Int) extends Base
-case class Dummy823(x: Int) extends Base
-case class Dummy824(x: Int) extends Base
-case class Dummy825(x: Int) extends Base
-case class Dummy826(x: Int) extends Base
-case class Dummy827(x: Int) extends Base
-case class Dummy828(x: Int) extends Base
-case class Dummy829(x: Int) extends Base
-case class Dummy830(x: Int) extends Base
-case class Dummy831(x: Int) extends Base
-case class Dummy832(x: Int) extends Base
-case class Dummy833(x: Int) extends Base
-case class Dummy834(x: Int) extends Base
-case class Dummy835(x: Int) extends Base
-case class Dummy836(x: Int) extends Base
-case class Dummy837(x: Int) extends Base
-case class Dummy838(x: Int) extends Base
-case class Dummy839(x: Int) extends Base
-case class Dummy840(x: Int) extends Base
-case class Dummy841(x: Int) extends Base
-case class Dummy842(x: Int) extends Base
-case class Dummy843(x: Int) extends Base
-case class Dummy844(x: Int) extends Base
-case class Dummy845(x: Int) extends Base
-case class Dummy846(x: Int) extends Base
-case class Dummy847(x: Int) extends Base
-case class Dummy848(x: Int) extends Base
-case class Dummy849(x: Int) extends Base
-case class Dummy850(x: Int) extends Base
-case class Dummy851(x: Int) extends Base
-case class Dummy852(x: Int) extends Base
-case class Dummy853(x: Int) extends Base
-case class Dummy854(x: Int) extends Base
-case class Dummy855(x: Int) extends Base
-case class Dummy856(x: Int) extends Base
-case class Dummy857(x: Int) extends Base
-case class Dummy858(x: Int) extends Base
-case class Dummy859(x: Int) extends Base
-case class Dummy860(x: Int) extends Base
-case class Dummy861(x: Int) extends Base
-case class Dummy862(x: Int) extends Base
-case class Dummy863(x: Int) extends Base
-case class Dummy864(x: Int) extends Base
-case class Dummy865(x: Int) extends Base
-case class Dummy866(x: Int) extends Base
-case class Dummy867(x: Int) extends Base
-case class Dummy868(x: Int) extends Base
-case class Dummy869(x: Int) extends Base
-case class Dummy870(x: Int) extends Base
-case class Dummy871(x: Int) extends Base
-case class Dummy872(x: Int) extends Base
-case class Dummy873(x: Int) extends Base
-case class Dummy874(x: Int) extends Base
-case class Dummy875(x: Int) extends Base
-case class Dummy876(x: Int) extends Base
-case class Dummy877(x: Int) extends Base
-case class Dummy878(x: Int) extends Base
-case class Dummy879(x: Int) extends Base
-case class Dummy880(x: Int) extends Base
-case class Dummy881(x: Int) extends Base
-case class Dummy882(x: Int) extends Base
-case class Dummy883(x: Int) extends Base
-case class Dummy884(x: Int) extends Base
-case class Dummy885(x: Int) extends Base
-case class Dummy886(x: Int) extends Base
-case class Dummy887(x: Int) extends Base
-case class Dummy888(x: Int) extends Base
-case class Dummy889(x: Int) extends Base
-case class Dummy890(x: Int) extends Base
-case class Dummy891(x: Int) extends Base
-case class Dummy892(x: Int) extends Base
-case class Dummy893(x: Int) extends Base
-case class Dummy894(x: Int) extends Base
-case class Dummy895(x: Int) extends Base
-case class Dummy896(x: Int) extends Base
-case class Dummy897(x: Int) extends Base
-case class Dummy898(x: Int) extends Base
-case class Dummy899(x: Int) extends Base
-case class Dummy900(x: Int) extends Base
-case class Dummy901(x: Int) extends Base
-case class Dummy902(x: Int) extends Base
-case class Dummy903(x: Int) extends Base
-case class Dummy904(x: Int) extends Base
-case class Dummy905(x: Int) extends Base
-case class Dummy906(x: Int) extends Base
-case class Dummy907(x: Int) extends Base
-case class Dummy908(x: Int) extends Base
-case class Dummy909(x: Int) extends Base
-case class Dummy910(x: Int) extends Base
-case class Dummy911(x: Int) extends Base
-case class Dummy912(x: Int) extends Base
-case class Dummy913(x: Int) extends Base
-case class Dummy914(x: Int) extends Base
-case class Dummy915(x: Int) extends Base
-case class Dummy916(x: Int) extends Base
-case class Dummy917(x: Int) extends Base
-case class Dummy918(x: Int) extends Base
-case class Dummy919(x: Int) extends Base
-case class Dummy920(x: Int) extends Base
-case class Dummy921(x: Int) extends Base
-case class Dummy922(x: Int) extends Base
-case class Dummy923(x: Int) extends Base
-case class Dummy924(x: Int) extends Base
-case class Dummy925(x: Int) extends Base
-case class Dummy926(x: Int) extends Base
-case class Dummy927(x: Int) extends Base
-case class Dummy928(x: Int) extends Base
-case class Dummy929(x: Int) extends Base
-case class Dummy930(x: Int) extends Base
-case class Dummy931(x: Int) extends Base
-case class Dummy932(x: Int) extends Base
-case class Dummy933(x: Int) extends Base
-case class Dummy934(x: Int) extends Base
-case class Dummy935(x: Int) extends Base
-case class Dummy936(x: Int) extends Base
-case class Dummy937(x: Int) extends Base
-case class Dummy938(x: Int) extends Base
-case class Dummy939(x: Int) extends Base
-case class Dummy940(x: Int) extends Base
-case class Dummy941(x: Int) extends Base
-case class Dummy942(x: Int) extends Base
-case class Dummy943(x: Int) extends Base
-case class Dummy944(x: Int) extends Base
-case class Dummy945(x: Int) extends Base
-case class Dummy946(x: Int) extends Base
-case class Dummy947(x: Int) extends Base
-case class Dummy948(x: Int) extends Base
-case class Dummy949(x: Int) extends Base
-case class Dummy950(x: Int) extends Base
-case class Dummy951(x: Int) extends Base
-case class Dummy952(x: Int) extends Base
-case class Dummy953(x: Int) extends Base
-case class Dummy954(x: Int) extends Base
-case class Dummy955(x: Int) extends Base
-case class Dummy956(x: Int) extends Base
-case class Dummy957(x: Int) extends Base
-case class Dummy958(x: Int) extends Base
-case class Dummy959(x: Int) extends Base
-case class Dummy960(x: Int) extends Base
-case class Dummy961(x: Int) extends Base
-case class Dummy962(x: Int) extends Base
-case class Dummy963(x: Int) extends Base
-case class Dummy964(x: Int) extends Base
-case class Dummy965(x: Int) extends Base
-case class Dummy966(x: Int) extends Base
-case class Dummy967(x: Int) extends Base
-case class Dummy968(x: Int) extends Base
-case class Dummy969(x: Int) extends Base
-case class Dummy970(x: Int) extends Base
-case class Dummy971(x: Int) extends Base
-case class Dummy972(x: Int) extends Base
-case class Dummy973(x: Int) extends Base
-case class Dummy974(x: Int) extends Base
-case class Dummy975(x: Int) extends Base
-case class Dummy976(x: Int) extends Base
-case class Dummy977(x: Int) extends Base
-case class Dummy978(x: Int) extends Base
-case class Dummy979(x: Int) extends Base
-case class Dummy980(x: Int) extends Base
-case class Dummy981(x: Int) extends Base
-case class Dummy982(x: Int) extends Base
-case class Dummy983(x: Int) extends Base
-case class Dummy984(x: Int) extends Base
-case class Dummy985(x: Int) extends Base
-case class Dummy986(x: Int) extends Base
-case class Dummy987(x: Int) extends Base
-case class Dummy988(x: Int) extends Base
-case class Dummy989(x: Int) extends Base
-case class Dummy990(x: Int) extends Base
-case class Dummy991(x: Int) extends Base
-case class Dummy992(x: Int) extends Base
-case class Dummy993(x: Int) extends Base
-case class Dummy994(x: Int) extends Base
-case class Dummy995(x: Int) extends Base
-case class Dummy996(x: Int) extends Base
-case class Dummy997(x: Int) extends Base
-case class Dummy998(x: Int) extends Base
-case class Dummy999(x: Int) extends Base
-case class Dummy1000(x: Int) extends Base
-case class Dummy1001(x: Int) extends Base
-case class Dummy1002(x: Int) extends Base
-case class Dummy1003(x: Int) extends Base
-case class Dummy1004(x: Int) extends Base
-case class Dummy1005(x: Int) extends Base
-case class Dummy1006(x: Int) extends Base
-case class Dummy1007(x: Int) extends Base
-case class Dummy1008(x: Int) extends Base
-case class Dummy1009(x: Int) extends Base
-case class Dummy1010(x: Int) extends Base
-case class Dummy1011(x: Int) extends Base
-case class Dummy1012(x: Int) extends Base
-case class Dummy1013(x: Int) extends Base
-case class Dummy1014(x: Int) extends Base
-case class Dummy1015(x: Int) extends Base
-case class Dummy1016(x: Int) extends Base
-case class Dummy1017(x: Int) extends Base
-case class Dummy1018(x: Int) extends Base
-case class Dummy1019(x: Int) extends Base
-case class Dummy1020(x: Int) extends Base
-case class Dummy1021(x: Int) extends Base
-case class Dummy1022(x: Int) extends Base
-case class Dummy1023(x: Int) extends Base
-case class Dummy1024(x: Int) extends Base
-case class Dummy1025(x: Int) extends Base
-case class Dummy1026(x: Int) extends Base
-case class Dummy1027(x: Int) extends Base
-case class Dummy1028(x: Int) extends Base
-case class Dummy1029(x: Int) extends Base
-case class Dummy1030(x: Int) extends Base
-case class Dummy1031(x: Int) extends Base
-case class Dummy1032(x: Int) extends Base
-case class Dummy1033(x: Int) extends Base
-case class Dummy1034(x: Int) extends Base
-case class Dummy1035(x: Int) extends Base
-case class Dummy1036(x: Int) extends Base
-case class Dummy1037(x: Int) extends Base
-case class Dummy1038(x: Int) extends Base
-case class Dummy1039(x: Int) extends Base
-case class Dummy1040(x: Int) extends Base
-case class Dummy1041(x: Int) extends Base
-case class Dummy1042(x: Int) extends Base
-case class Dummy1043(x: Int) extends Base
-case class Dummy1044(x: Int) extends Base
-case class Dummy1045(x: Int) extends Base
-case class Dummy1046(x: Int) extends Base
-case class Dummy1047(x: Int) extends Base
-case class Dummy1048(x: Int) extends Base
-case class Dummy1049(x: Int) extends Base
-case class Dummy1050(x: Int) extends Base
-case class Dummy1051(x: Int) extends Base
-case class Dummy1052(x: Int) extends Base
-case class Dummy1053(x: Int) extends Base
-case class Dummy1054(x: Int) extends Base
-case class Dummy1055(x: Int) extends Base
-case class Dummy1056(x: Int) extends Base
-case class Dummy1057(x: Int) extends Base
-case class Dummy1058(x: Int) extends Base
-case class Dummy1059(x: Int) extends Base
-case class Dummy1060(x: Int) extends Base
-case class Dummy1061(x: Int) extends Base
-case class Dummy1062(x: Int) extends Base
-case class Dummy1063(x: Int) extends Base
-case class Dummy1064(x: Int) extends Base
-case class Dummy1065(x: Int) extends Base
-case class Dummy1066(x: Int) extends Base
-case class Dummy1067(x: Int) extends Base
-case class Dummy1068(x: Int) extends Base
-case class Dummy1069(x: Int) extends Base
-case class Dummy1070(x: Int) extends Base
-case class Dummy1071(x: Int) extends Base
-case class Dummy1072(x: Int) extends Base
-case class Dummy1073(x: Int) extends Base
-case class Dummy1074(x: Int) extends Base
-case class Dummy1075(x: Int) extends Base
-case class Dummy1076(x: Int) extends Base
-case class Dummy1077(x: Int) extends Base
-case class Dummy1078(x: Int) extends Base
-case class Dummy1079(x: Int) extends Base
-case class Dummy1080(x: Int) extends Base
-case class Dummy1081(x: Int) extends Base
-case class Dummy1082(x: Int) extends Base
-case class Dummy1083(x: Int) extends Base
-case class Dummy1084(x: Int) extends Base
-case class Dummy1085(x: Int) extends Base
-case class Dummy1086(x: Int) extends Base
-case class Dummy1087(x: Int) extends Base
-case class Dummy1088(x: Int) extends Base
-case class Dummy1089(x: Int) extends Base
-case class Dummy1090(x: Int) extends Base
-case class Dummy1091(x: Int) extends Base
-case class Dummy1092(x: Int) extends Base
-case class Dummy1093(x: Int) extends Base
-case class Dummy1094(x: Int) extends Base
-case class Dummy1095(x: Int) extends Base
-case class Dummy1096(x: Int) extends Base
-case class Dummy1097(x: Int) extends Base
-case class Dummy1098(x: Int) extends Base
-case class Dummy1099(x: Int) extends Base
-case class Dummy1100(x: Int) extends Base
-case class Dummy1101(x: Int) extends Base
-case class Dummy1102(x: Int) extends Base
-case class Dummy1103(x: Int) extends Base
-case class Dummy1104(x: Int) extends Base
-case class Dummy1105(x: Int) extends Base
-case class Dummy1106(x: Int) extends Base
-case class Dummy1107(x: Int) extends Base
-case class Dummy1108(x: Int) extends Base
-case class Dummy1109(x: Int) extends Base
-case class Dummy1110(x: Int) extends Base
-case class Dummy1111(x: Int) extends Base
-case class Dummy1112(x: Int) extends Base
-case class Dummy1113(x: Int) extends Base
-case class Dummy1114(x: Int) extends Base
-case class Dummy1115(x: Int) extends Base
-case class Dummy1116(x: Int) extends Base
-case class Dummy1117(x: Int) extends Base
-case class Dummy1118(x: Int) extends Base
-case class Dummy1119(x: Int) extends Base
-case class Dummy1120(x: Int) extends Base
-case class Dummy1121(x: Int) extends Base
-case class Dummy1122(x: Int) extends Base
-case class Dummy1123(x: Int) extends Base
-case class Dummy1124(x: Int) extends Base
-case class Dummy1125(x: Int) extends Base
-case class Dummy1126(x: Int) extends Base
-case class Dummy1127(x: Int) extends Base
-case class Dummy1128(x: Int) extends Base
-case class Dummy1129(x: Int) extends Base
-case class Dummy1130(x: Int) extends Base
-case class Dummy1131(x: Int) extends Base
-case class Dummy1132(x: Int) extends Base
-case class Dummy1133(x: Int) extends Base
-case class Dummy1134(x: Int) extends Base
-case class Dummy1135(x: Int) extends Base
-case class Dummy1136(x: Int) extends Base
-case class Dummy1137(x: Int) extends Base
-case class Dummy1138(x: Int) extends Base
-case class Dummy1139(x: Int) extends Base
-case class Dummy1140(x: Int) extends Base
-case class Dummy1141(x: Int) extends Base
-case class Dummy1142(x: Int) extends Base
-case class Dummy1143(x: Int) extends Base
-case class Dummy1144(x: Int) extends Base
-case class Dummy1145(x: Int) extends Base
-case class Dummy1146(x: Int) extends Base
-case class Dummy1147(x: Int) extends Base
-case class Dummy1148(x: Int) extends Base
-case class Dummy1149(x: Int) extends Base
-case class Dummy1150(x: Int) extends Base
-case class Dummy1151(x: Int) extends Base
-case class Dummy1152(x: Int) extends Base
-case class Dummy1153(x: Int) extends Base
-case class Dummy1154(x: Int) extends Base
-case class Dummy1155(x: Int) extends Base
-case class Dummy1156(x: Int) extends Base
-case class Dummy1157(x: Int) extends Base
-case class Dummy1158(x: Int) extends Base
-case class Dummy1159(x: Int) extends Base
-case class Dummy1160(x: Int) extends Base
-case class Dummy1161(x: Int) extends Base
-case class Dummy1162(x: Int) extends Base
-case class Dummy1163(x: Int) extends Base
-case class Dummy1164(x: Int) extends Base
-case class Dummy1165(x: Int) extends Base
-case class Dummy1166(x: Int) extends Base
-case class Dummy1167(x: Int) extends Base
-case class Dummy1168(x: Int) extends Base
-case class Dummy1169(x: Int) extends Base
-case class Dummy1170(x: Int) extends Base
-case class Dummy1171(x: Int) extends Base
-case class Dummy1172(x: Int) extends Base
-case class Dummy1173(x: Int) extends Base
-case class Dummy1174(x: Int) extends Base
-case class Dummy1175(x: Int) extends Base
-case class Dummy1176(x: Int) extends Base
-case class Dummy1177(x: Int) extends Base
-case class Dummy1178(x: Int) extends Base
-case class Dummy1179(x: Int) extends Base
-case class Dummy1180(x: Int) extends Base
-case class Dummy1181(x: Int) extends Base
-case class Dummy1182(x: Int) extends Base
-case class Dummy1183(x: Int) extends Base
-case class Dummy1184(x: Int) extends Base
-case class Dummy1185(x: Int) extends Base
-case class Dummy1186(x: Int) extends Base
-case class Dummy1187(x: Int) extends Base
-case class Dummy1188(x: Int) extends Base
-case class Dummy1189(x: Int) extends Base
-case class Dummy1190(x: Int) extends Base
-case class Dummy1191(x: Int) extends Base
-case class Dummy1192(x: Int) extends Base
-case class Dummy1193(x: Int) extends Base
-case class Dummy1194(x: Int) extends Base
-case class Dummy1195(x: Int) extends Base
-case class Dummy1196(x: Int) extends Base
-case class Dummy1197(x: Int) extends Base
-case class Dummy1198(x: Int) extends Base
-case class Dummy1199(x: Int) extends Base
-case class Dummy1200(x: Int) extends Base
-case class Dummy1201(x: Int) extends Base
-case class Dummy1202(x: Int) extends Base
-case class Dummy1203(x: Int) extends Base
-case class Dummy1204(x: Int) extends Base
-case class Dummy1205(x: Int) extends Base
-case class Dummy1206(x: Int) extends Base
-case class Dummy1207(x: Int) extends Base
-case class Dummy1208(x: Int) extends Base
-case class Dummy1209(x: Int) extends Base
-case class Dummy1210(x: Int) extends Base
-case class Dummy1211(x: Int) extends Base
-case class Dummy1212(x: Int) extends Base
-case class Dummy1213(x: Int) extends Base
-case class Dummy1214(x: Int) extends Base
-case class Dummy1215(x: Int) extends Base
-case class Dummy1216(x: Int) extends Base
-case class Dummy1217(x: Int) extends Base
-case class Dummy1218(x: Int) extends Base
-case class Dummy1219(x: Int) extends Base
-case class Dummy1220(x: Int) extends Base
-case class Dummy1221(x: Int) extends Base
-case class Dummy1222(x: Int) extends Base
-case class Dummy1223(x: Int) extends Base
-case class Dummy1224(x: Int) extends Base
-case class Dummy1225(x: Int) extends Base
-case class Dummy1226(x: Int) extends Base
-case class Dummy1227(x: Int) extends Base
-case class Dummy1228(x: Int) extends Base
-case class Dummy1229(x: Int) extends Base
-case class Dummy1230(x: Int) extends Base
-case class Dummy1231(x: Int) extends Base
-case class Dummy1232(x: Int) extends Base
-case class Dummy1233(x: Int) extends Base
-case class Dummy1234(x: Int) extends Base
-case class Dummy1235(x: Int) extends Base
-case class Dummy1236(x: Int) extends Base
-case class Dummy1237(x: Int) extends Base
-case class Dummy1238(x: Int) extends Base
-case class Dummy1239(x: Int) extends Base
-case class Dummy1240(x: Int) extends Base
-case class Dummy1241(x: Int) extends Base
-case class Dummy1242(x: Int) extends Base
-case class Dummy1243(x: Int) extends Base
-case class Dummy1244(x: Int) extends Base
-case class Dummy1245(x: Int) extends Base
-case class Dummy1246(x: Int) extends Base
-case class Dummy1247(x: Int) extends Base
-case class Dummy1248(x: Int) extends Base
-case class Dummy1249(x: Int) extends Base
-case class Dummy1250(x: Int) extends Base
-case class Dummy1251(x: Int) extends Base
-case class Dummy1252(x: Int) extends Base
-case class Dummy1253(x: Int) extends Base
-case class Dummy1254(x: Int) extends Base
-case class Dummy1255(x: Int) extends Base
-case class Dummy1256(x: Int) extends Base
-case class Dummy1257(x: Int) extends Base
-case class Dummy1258(x: Int) extends Base
-case class Dummy1259(x: Int) extends Base
-case class Dummy1260(x: Int) extends Base
-case class Dummy1261(x: Int) extends Base
-case class Dummy1262(x: Int) extends Base
-case class Dummy1263(x: Int) extends Base
-case class Dummy1264(x: Int) extends Base
-case class Dummy1265(x: Int) extends Base
-case class Dummy1266(x: Int) extends Base
-case class Dummy1267(x: Int) extends Base
-case class Dummy1268(x: Int) extends Base
-case class Dummy1269(x: Int) extends Base
-case class Dummy1270(x: Int) extends Base
-case class Dummy1271(x: Int) extends Base
-case class Dummy1272(x: Int) extends Base
-case class Dummy1273(x: Int) extends Base
-case class Dummy1274(x: Int) extends Base
-case class Dummy1275(x: Int) extends Base
-case class Dummy1276(x: Int) extends Base
-case class Dummy1277(x: Int) extends Base
-case class Dummy1278(x: Int) extends Base
-case class Dummy1279(x: Int) extends Base
-case class Dummy1280(x: Int) extends Base
-case class Dummy1281(x: Int) extends Base
-case class Dummy1282(x: Int) extends Base
-case class Dummy1283(x: Int) extends Base
-case class Dummy1284(x: Int) extends Base
-case class Dummy1285(x: Int) extends Base
-case class Dummy1286(x: Int) extends Base
-case class Dummy1287(x: Int) extends Base
-case class Dummy1288(x: Int) extends Base
-case class Dummy1289(x: Int) extends Base
-case class Dummy1290(x: Int) extends Base
-case class Dummy1291(x: Int) extends Base
-case class Dummy1292(x: Int) extends Base
-case class Dummy1293(x: Int) extends Base
-case class Dummy1294(x: Int) extends Base
-case class Dummy1295(x: Int) extends Base
-case class Dummy1296(x: Int) extends Base
-case class Dummy1297(x: Int) extends Base
-case class Dummy1298(x: Int) extends Base
-case class Dummy1299(x: Int) extends Base
-case class Dummy1300(x: Int) extends Base
-case class Dummy1301(x: Int) extends Base
-case class Dummy1302(x: Int) extends Base
-case class Dummy1303(x: Int) extends Base
-case class Dummy1304(x: Int) extends Base
-case class Dummy1305(x: Int) extends Base
-case class Dummy1306(x: Int) extends Base
-case class Dummy1307(x: Int) extends Base
-case class Dummy1308(x: Int) extends Base
-case class Dummy1309(x: Int) extends Base
-case class Dummy1310(x: Int) extends Base
-case class Dummy1311(x: Int) extends Base
-case class Dummy1312(x: Int) extends Base
-case class Dummy1313(x: Int) extends Base
-case class Dummy1314(x: Int) extends Base
-case class Dummy1315(x: Int) extends Base
-case class Dummy1316(x: Int) extends Base
-case class Dummy1317(x: Int) extends Base
-case class Dummy1318(x: Int) extends Base
-case class Dummy1319(x: Int) extends Base
-case class Dummy1320(x: Int) extends Base
-case class Dummy1321(x: Int) extends Base
-case class Dummy1322(x: Int) extends Base
-case class Dummy1323(x: Int) extends Base
-case class Dummy1324(x: Int) extends Base
-case class Dummy1325(x: Int) extends Base
-case class Dummy1326(x: Int) extends Base
-case class Dummy1327(x: Int) extends Base
-case class Dummy1328(x: Int) extends Base
-case class Dummy1329(x: Int) extends Base
-case class Dummy1330(x: Int) extends Base
-case class Dummy1331(x: Int) extends Base
-case class Dummy1332(x: Int) extends Base
-case class Dummy1333(x: Int) extends Base
-case class Dummy1334(x: Int) extends Base
-case class Dummy1335(x: Int) extends Base
-case class Dummy1336(x: Int) extends Base
-case class Dummy1337(x: Int) extends Base
-case class Dummy1338(x: Int) extends Base
-case class Dummy1339(x: Int) extends Base
-case class Dummy1340(x: Int) extends Base
-case class Dummy1341(x: Int) extends Base
-case class Dummy1342(x: Int) extends Base
-case class Dummy1343(x: Int) extends Base
-case class Dummy1344(x: Int) extends Base
-case class Dummy1345(x: Int) extends Base
-case class Dummy1346(x: Int) extends Base
-case class Dummy1347(x: Int) extends Base
-case class Dummy1348(x: Int) extends Base
-case class Dummy1349(x: Int) extends Base
-case class Dummy1350(x: Int) extends Base
-case class Dummy1351(x: Int) extends Base
-case class Dummy1352(x: Int) extends Base
-case class Dummy1353(x: Int) extends Base
-case class Dummy1354(x: Int) extends Base
-case class Dummy1355(x: Int) extends Base
-case class Dummy1356(x: Int) extends Base
-case class Dummy1357(x: Int) extends Base
-case class Dummy1358(x: Int) extends Base
-case class Dummy1359(x: Int) extends Base
-case class Dummy1360(x: Int) extends Base
-case class Dummy1361(x: Int) extends Base
-case class Dummy1362(x: Int) extends Base
-case class Dummy1363(x: Int) extends Base
-case class Dummy1364(x: Int) extends Base
-case class Dummy1365(x: Int) extends Base
-case class Dummy1366(x: Int) extends Base
-case class Dummy1367(x: Int) extends Base
-case class Dummy1368(x: Int) extends Base
-case class Dummy1369(x: Int) extends Base
-case class Dummy1370(x: Int) extends Base
-case class Dummy1371(x: Int) extends Base
-case class Dummy1372(x: Int) extends Base
-case class Dummy1373(x: Int) extends Base
-case class Dummy1374(x: Int) extends Base
-case class Dummy1375(x: Int) extends Base
-case class Dummy1376(x: Int) extends Base
-case class Dummy1377(x: Int) extends Base
-case class Dummy1378(x: Int) extends Base
-case class Dummy1379(x: Int) extends Base
-case class Dummy1380(x: Int) extends Base
-case class Dummy1381(x: Int) extends Base
-case class Dummy1382(x: Int) extends Base
-case class Dummy1383(x: Int) extends Base
-case class Dummy1384(x: Int) extends Base
-case class Dummy1385(x: Int) extends Base
-case class Dummy1386(x: Int) extends Base
-case class Dummy1387(x: Int) extends Base
-case class Dummy1388(x: Int) extends Base
-case class Dummy1389(x: Int) extends Base
-case class Dummy1390(x: Int) extends Base
-case class Dummy1391(x: Int) extends Base
-case class Dummy1392(x: Int) extends Base
-case class Dummy1393(x: Int) extends Base
-case class Dummy1394(x: Int) extends Base
-case class Dummy1395(x: Int) extends Base
-case class Dummy1396(x: Int) extends Base
-case class Dummy1397(x: Int) extends Base
-case class Dummy1398(x: Int) extends Base
-case class Dummy1399(x: Int) extends Base
-case class Dummy1400(x: Int) extends Base
-case class Dummy1401(x: Int) extends Base
-case class Dummy1402(x: Int) extends Base
-case class Dummy1403(x: Int) extends Base
-case class Dummy1404(x: Int) extends Base
-case class Dummy1405(x: Int) extends Base
-case class Dummy1406(x: Int) extends Base
-case class Dummy1407(x: Int) extends Base
-case class Dummy1408(x: Int) extends Base
-case class Dummy1409(x: Int) extends Base
-case class Dummy1410(x: Int) extends Base
-case class Dummy1411(x: Int) extends Base
-case class Dummy1412(x: Int) extends Base
-case class Dummy1413(x: Int) extends Base
-case class Dummy1414(x: Int) extends Base
-case class Dummy1415(x: Int) extends Base
-case class Dummy1416(x: Int) extends Base
-case class Dummy1417(x: Int) extends Base
-case class Dummy1418(x: Int) extends Base
-case class Dummy1419(x: Int) extends Base
-case class Dummy1420(x: Int) extends Base
-case class Dummy1421(x: Int) extends Base
-case class Dummy1422(x: Int) extends Base
-case class Dummy1423(x: Int) extends Base
-case class Dummy1424(x: Int) extends Base
-case class Dummy1425(x: Int) extends Base
-case class Dummy1426(x: Int) extends Base
-case class Dummy1427(x: Int) extends Base
-case class Dummy1428(x: Int) extends Base
-case class Dummy1429(x: Int) extends Base
-case class Dummy1430(x: Int) extends Base
-case class Dummy1431(x: Int) extends Base
-case class Dummy1432(x: Int) extends Base
-case class Dummy1433(x: Int) extends Base
-case class Dummy1434(x: Int) extends Base
-case class Dummy1435(x: Int) extends Base
-case class Dummy1436(x: Int) extends Base
-case class Dummy1437(x: Int) extends Base
-case class Dummy1438(x: Int) extends Base
-case class Dummy1439(x: Int) extends Base
-case class Dummy1440(x: Int) extends Base
-case class Dummy1441(x: Int) extends Base
-case class Dummy1442(x: Int) extends Base
-case class Dummy1443(x: Int) extends Base
-case class Dummy1444(x: Int) extends Base
-case class Dummy1445(x: Int) extends Base
-case class Dummy1446(x: Int) extends Base
-case class Dummy1447(x: Int) extends Base
-case class Dummy1448(x: Int) extends Base
-case class Dummy1449(x: Int) extends Base
-case class Dummy1450(x: Int) extends Base
-case class Dummy1451(x: Int) extends Base
-case class Dummy1452(x: Int) extends Base
-case class Dummy1453(x: Int) extends Base
-case class Dummy1454(x: Int) extends Base
-case class Dummy1455(x: Int) extends Base
-case class Dummy1456(x: Int) extends Base
-case class Dummy1457(x: Int) extends Base
-case class Dummy1458(x: Int) extends Base
-case class Dummy1459(x: Int) extends Base
-case class Dummy1460(x: Int) extends Base
-case class Dummy1461(x: Int) extends Base
-case class Dummy1462(x: Int) extends Base
-case class Dummy1463(x: Int) extends Base
-case class Dummy1464(x: Int) extends Base
-case class Dummy1465(x: Int) extends Base
-case class Dummy1466(x: Int) extends Base
-case class Dummy1467(x: Int) extends Base
-case class Dummy1468(x: Int) extends Base
-case class Dummy1469(x: Int) extends Base
-case class Dummy1470(x: Int) extends Base
-case class Dummy1471(x: Int) extends Base
-case class Dummy1472(x: Int) extends Base
-case class Dummy1473(x: Int) extends Base
-case class Dummy1474(x: Int) extends Base
-case class Dummy1475(x: Int) extends Base
-case class Dummy1476(x: Int) extends Base
-case class Dummy1477(x: Int) extends Base
-case class Dummy1478(x: Int) extends Base
-case class Dummy1479(x: Int) extends Base
-case class Dummy1480(x: Int) extends Base
-case class Dummy1481(x: Int) extends Base
-case class Dummy1482(x: Int) extends Base
-case class Dummy1483(x: Int) extends Base
-case class Dummy1484(x: Int) extends Base
-case class Dummy1485(x: Int) extends Base
-case class Dummy1486(x: Int) extends Base
-case class Dummy1487(x: Int) extends Base
-case class Dummy1488(x: Int) extends Base
-case class Dummy1489(x: Int) extends Base
-case class Dummy1490(x: Int) extends Base
-case class Dummy1491(x: Int) extends Base
-case class Dummy1492(x: Int) extends Base
-case class Dummy1493(x: Int) extends Base
-case class Dummy1494(x: Int) extends Base
-case class Dummy1495(x: Int) extends Base
-case class Dummy1496(x: Int) extends Base
-case class Dummy1497(x: Int) extends Base
-case class Dummy1498(x: Int) extends Base
-case class Dummy1499(x: Int) extends Base
-case class Dummy1500(x: Int) extends Base
-case class Dummy1501(x: Int) extends Base
-case class Dummy1502(x: Int) extends Base
-case class Dummy1503(x: Int) extends Base
-case class Dummy1504(x: Int) extends Base
-case class Dummy1505(x: Int) extends Base
-case class Dummy1506(x: Int) extends Base
-case class Dummy1507(x: Int) extends Base
-case class Dummy1508(x: Int) extends Base
-case class Dummy1509(x: Int) extends Base
-case class Dummy1510(x: Int) extends Base
-case class Dummy1511(x: Int) extends Base
-case class Dummy1512(x: Int) extends Base
-case class Dummy1513(x: Int) extends Base
-case class Dummy1514(x: Int) extends Base
-case class Dummy1515(x: Int) extends Base
-case class Dummy1516(x: Int) extends Base
-case class Dummy1517(x: Int) extends Base
-case class Dummy1518(x: Int) extends Base
-case class Dummy1519(x: Int) extends Base
-case class Dummy1520(x: Int) extends Base
-case class Dummy1521(x: Int) extends Base
-case class Dummy1522(x: Int) extends Base
-case class Dummy1523(x: Int) extends Base
-case class Dummy1524(x: Int) extends Base
-case class Dummy1525(x: Int) extends Base
-case class Dummy1526(x: Int) extends Base
-case class Dummy1527(x: Int) extends Base
-case class Dummy1528(x: Int) extends Base
-case class Dummy1529(x: Int) extends Base
-case class Dummy1530(x: Int) extends Base
-case class Dummy1531(x: Int) extends Base
-case class Dummy1532(x: Int) extends Base
-case class Dummy1533(x: Int) extends Base
-case class Dummy1534(x: Int) extends Base
-case class Dummy1535(x: Int) extends Base
-case class Dummy1536(x: Int) extends Base
-case class Dummy1537(x: Int) extends Base
-case class Dummy1538(x: Int) extends Base
-case class Dummy1539(x: Int) extends Base
-case class Dummy1540(x: Int) extends Base
-case class Dummy1541(x: Int) extends Base
-case class Dummy1542(x: Int) extends Base
-case class Dummy1543(x: Int) extends Base
-case class Dummy1544(x: Int) extends Base
-case class Dummy1545(x: Int) extends Base
-case class Dummy1546(x: Int) extends Base
-case class Dummy1547(x: Int) extends Base
-case class Dummy1548(x: Int) extends Base
-case class Dummy1549(x: Int) extends Base
-case class Dummy1550(x: Int) extends Base
-case class Dummy1551(x: Int) extends Base
-case class Dummy1552(x: Int) extends Base
-case class Dummy1553(x: Int) extends Base
-case class Dummy1554(x: Int) extends Base
-case class Dummy1555(x: Int) extends Base
-case class Dummy1556(x: Int) extends Base
-case class Dummy1557(x: Int) extends Base
-case class Dummy1558(x: Int) extends Base
-case class Dummy1559(x: Int) extends Base
-case class Dummy1560(x: Int) extends Base
-case class Dummy1561(x: Int) extends Base
-case class Dummy1562(x: Int) extends Base
-case class Dummy1563(x: Int) extends Base
-case class Dummy1564(x: Int) extends Base
-case class Dummy1565(x: Int) extends Base
-case class Dummy1566(x: Int) extends Base
-case class Dummy1567(x: Int) extends Base
-case class Dummy1568(x: Int) extends Base
-case class Dummy1569(x: Int) extends Base
-case class Dummy1570(x: Int) extends Base
-case class Dummy1571(x: Int) extends Base
-case class Dummy1572(x: Int) extends Base
-case class Dummy1573(x: Int) extends Base
-case class Dummy1574(x: Int) extends Base
-case class Dummy1575(x: Int) extends Base
-case class Dummy1576(x: Int) extends Base
-case class Dummy1577(x: Int) extends Base
-case class Dummy1578(x: Int) extends Base
-case class Dummy1579(x: Int) extends Base
-case class Dummy1580(x: Int) extends Base
-case class Dummy1581(x: Int) extends Base
-case class Dummy1582(x: Int) extends Base
-case class Dummy1583(x: Int) extends Base
-case class Dummy1584(x: Int) extends Base
-case class Dummy1585(x: Int) extends Base
-case class Dummy1586(x: Int) extends Base
-case class Dummy1587(x: Int) extends Base
-case class Dummy1588(x: Int) extends Base
-case class Dummy1589(x: Int) extends Base
-case class Dummy1590(x: Int) extends Base
-case class Dummy1591(x: Int) extends Base
-case class Dummy1592(x: Int) extends Base
-case class Dummy1593(x: Int) extends Base
-case class Dummy1594(x: Int) extends Base
-case class Dummy1595(x: Int) extends Base
-case class Dummy1596(x: Int) extends Base
-case class Dummy1597(x: Int) extends Base
-case class Dummy1598(x: Int) extends Base
-case class Dummy1599(x: Int) extends Base
-case class Dummy1600(x: Int) extends Base
-case class Dummy1601(x: Int) extends Base
-case class Dummy1602(x: Int) extends Base
-case class Dummy1603(x: Int) extends Base
-case class Dummy1604(x: Int) extends Base
-case class Dummy1605(x: Int) extends Base
-case class Dummy1606(x: Int) extends Base
-case class Dummy1607(x: Int) extends Base
-case class Dummy1608(x: Int) extends Base
-case class Dummy1609(x: Int) extends Base
-case class Dummy1610(x: Int) extends Base
-case class Dummy1611(x: Int) extends Base
-case class Dummy1612(x: Int) extends Base
-case class Dummy1613(x: Int) extends Base
-case class Dummy1614(x: Int) extends Base
-case class Dummy1615(x: Int) extends Base
-case class Dummy1616(x: Int) extends Base
-case class Dummy1617(x: Int) extends Base
-case class Dummy1618(x: Int) extends Base
-case class Dummy1619(x: Int) extends Base
-case class Dummy1620(x: Int) extends Base
-case class Dummy1621(x: Int) extends Base
-case class Dummy1622(x: Int) extends Base
-case class Dummy1623(x: Int) extends Base
-case class Dummy1624(x: Int) extends Base
-case class Dummy1625(x: Int) extends Base
-case class Dummy1626(x: Int) extends Base
-case class Dummy1627(x: Int) extends Base
-case class Dummy1628(x: Int) extends Base
-case class Dummy1629(x: Int) extends Base
-case class Dummy1630(x: Int) extends Base
-case class Dummy1631(x: Int) extends Base
-case class Dummy1632(x: Int) extends Base
-case class Dummy1633(x: Int) extends Base
-case class Dummy1634(x: Int) extends Base
-case class Dummy1635(x: Int) extends Base
-case class Dummy1636(x: Int) extends Base
-case class Dummy1637(x: Int) extends Base
-case class Dummy1638(x: Int) extends Base
-case class Dummy1639(x: Int) extends Base
-case class Dummy1640(x: Int) extends Base
-case class Dummy1641(x: Int) extends Base
-case class Dummy1642(x: Int) extends Base
-case class Dummy1643(x: Int) extends Base
-case class Dummy1644(x: Int) extends Base
-case class Dummy1645(x: Int) extends Base
-case class Dummy1646(x: Int) extends Base
-case class Dummy1647(x: Int) extends Base
-case class Dummy1648(x: Int) extends Base
-case class Dummy1649(x: Int) extends Base
-case class Dummy1650(x: Int) extends Base
-case class Dummy1651(x: Int) extends Base
-case class Dummy1652(x: Int) extends Base
-case class Dummy1653(x: Int) extends Base
-case class Dummy1654(x: Int) extends Base
-case class Dummy1655(x: Int) extends Base
-case class Dummy1656(x: Int) extends Base
-case class Dummy1657(x: Int) extends Base
-case class Dummy1658(x: Int) extends Base
-case class Dummy1659(x: Int) extends Base
-case class Dummy1660(x: Int) extends Base
-case class Dummy1661(x: Int) extends Base
-case class Dummy1662(x: Int) extends Base
-case class Dummy1663(x: Int) extends Base
-case class Dummy1664(x: Int) extends Base
-case class Dummy1665(x: Int) extends Base
-case class Dummy1666(x: Int) extends Base
-case class Dummy1667(x: Int) extends Base
-case class Dummy1668(x: Int) extends Base
-case class Dummy1669(x: Int) extends Base
-case class Dummy1670(x: Int) extends Base
-case class Dummy1671(x: Int) extends Base
-case class Dummy1672(x: Int) extends Base
-case class Dummy1673(x: Int) extends Base
-case class Dummy1674(x: Int) extends Base
-case class Dummy1675(x: Int) extends Base
-case class Dummy1676(x: Int) extends Base
-case class Dummy1677(x: Int) extends Base
-case class Dummy1678(x: Int) extends Base
-case class Dummy1679(x: Int) extends Base
-case class Dummy1680(x: Int) extends Base
-case class Dummy1681(x: Int) extends Base
-case class Dummy1682(x: Int) extends Base
-case class Dummy1683(x: Int) extends Base
-case class Dummy1684(x: Int) extends Base
-case class Dummy1685(x: Int) extends Base
-case class Dummy1686(x: Int) extends Base
-case class Dummy1687(x: Int) extends Base
-case class Dummy1688(x: Int) extends Base
-case class Dummy1689(x: Int) extends Base
-case class Dummy1690(x: Int) extends Base
-case class Dummy1691(x: Int) extends Base
-case class Dummy1692(x: Int) extends Base
-case class Dummy1693(x: Int) extends Base
-case class Dummy1694(x: Int) extends Base
-case class Dummy1695(x: Int) extends Base
-case class Dummy1696(x: Int) extends Base
-case class Dummy1697(x: Int) extends Base
-case class Dummy1698(x: Int) extends Base
-case class Dummy1699(x: Int) extends Base
-case class Dummy1700(x: Int) extends Base
-case class Dummy1701(x: Int) extends Base
-case class Dummy1702(x: Int) extends Base
-case class Dummy1703(x: Int) extends Base
-case class Dummy1704(x: Int) extends Base
-case class Dummy1705(x: Int) extends Base
-case class Dummy1706(x: Int) extends Base
-case class Dummy1707(x: Int) extends Base
-case class Dummy1708(x: Int) extends Base
-case class Dummy1709(x: Int) extends Base
-case class Dummy1710(x: Int) extends Base
-case class Dummy1711(x: Int) extends Base
-case class Dummy1712(x: Int) extends Base
-case class Dummy1713(x: Int) extends Base
-case class Dummy1714(x: Int) extends Base
-case class Dummy1715(x: Int) extends Base
-case class Dummy1716(x: Int) extends Base
-case class Dummy1717(x: Int) extends Base
-case class Dummy1718(x: Int) extends Base
-case class Dummy1719(x: Int) extends Base
-case class Dummy1720(x: Int) extends Base
-case class Dummy1721(x: Int) extends Base
-case class Dummy1722(x: Int) extends Base
-case class Dummy1723(x: Int) extends Base
-case class Dummy1724(x: Int) extends Base
-case class Dummy1725(x: Int) extends Base
-case class Dummy1726(x: Int) extends Base
-case class Dummy1727(x: Int) extends Base
-case class Dummy1728(x: Int) extends Base
-case class Dummy1729(x: Int) extends Base
-case class Dummy1730(x: Int) extends Base
-case class Dummy1731(x: Int) extends Base
-case class Dummy1732(x: Int) extends Base
-case class Dummy1733(x: Int) extends Base
-case class Dummy1734(x: Int) extends Base
-case class Dummy1735(x: Int) extends Base
-case class Dummy1736(x: Int) extends Base
-case class Dummy1737(x: Int) extends Base
-case class Dummy1738(x: Int) extends Base
-case class Dummy1739(x: Int) extends Base
-case class Dummy1740(x: Int) extends Base
-case class Dummy1741(x: Int) extends Base
-case class Dummy1742(x: Int) extends Base
-case class Dummy1743(x: Int) extends Base
-case class Dummy1744(x: Int) extends Base
-case class Dummy1745(x: Int) extends Base
-case class Dummy1746(x: Int) extends Base
-case class Dummy1747(x: Int) extends Base
-case class Dummy1748(x: Int) extends Base
-case class Dummy1749(x: Int) extends Base
-case class Dummy1750(x: Int) extends Base
-case class Dummy1751(x: Int) extends Base
-case class Dummy1752(x: Int) extends Base
-case class Dummy1753(x: Int) extends Base
-case class Dummy1754(x: Int) extends Base
-case class Dummy1755(x: Int) extends Base
-case class Dummy1756(x: Int) extends Base
-case class Dummy1757(x: Int) extends Base
-case class Dummy1758(x: Int) extends Base
-case class Dummy1759(x: Int) extends Base
-case class Dummy1760(x: Int) extends Base
-case class Dummy1761(x: Int) extends Base
-case class Dummy1762(x: Int) extends Base
-case class Dummy1763(x: Int) extends Base
-case class Dummy1764(x: Int) extends Base
-case class Dummy1765(x: Int) extends Base
-case class Dummy1766(x: Int) extends Base
-case class Dummy1767(x: Int) extends Base
-case class Dummy1768(x: Int) extends Base
-case class Dummy1769(x: Int) extends Base
-case class Dummy1770(x: Int) extends Base
-case class Dummy1771(x: Int) extends Base
-case class Dummy1772(x: Int) extends Base
-case class Dummy1773(x: Int) extends Base
-case class Dummy1774(x: Int) extends Base
-case class Dummy1775(x: Int) extends Base
-case class Dummy1776(x: Int) extends Base
-case class Dummy1777(x: Int) extends Base
-case class Dummy1778(x: Int) extends Base
-case class Dummy1779(x: Int) extends Base
-case class Dummy1780(x: Int) extends Base
-case class Dummy1781(x: Int) extends Base
-case class Dummy1782(x: Int) extends Base
-case class Dummy1783(x: Int) extends Base
-case class Dummy1784(x: Int) extends Base
-case class Dummy1785(x: Int) extends Base
-case class Dummy1786(x: Int) extends Base
-case class Dummy1787(x: Int) extends Base
-case class Dummy1788(x: Int) extends Base
-case class Dummy1789(x: Int) extends Base
-case class Dummy1790(x: Int) extends Base
-case class Dummy1791(x: Int) extends Base
-case class Dummy1792(x: Int) extends Base
-case class Dummy1793(x: Int) extends Base
-case class Dummy1794(x: Int) extends Base
-case class Dummy1795(x: Int) extends Base
-case class Dummy1796(x: Int) extends Base
-case class Dummy1797(x: Int) extends Base
-case class Dummy1798(x: Int) extends Base
-case class Dummy1799(x: Int) extends Base
-case class Dummy1800(x: Int) extends Base
-case class Dummy1801(x: Int) extends Base
-case class Dummy1802(x: Int) extends Base
-case class Dummy1803(x: Int) extends Base
-case class Dummy1804(x: Int) extends Base
-case class Dummy1805(x: Int) extends Base
-case class Dummy1806(x: Int) extends Base
-case class Dummy1807(x: Int) extends Base
-case class Dummy1808(x: Int) extends Base
-case class Dummy1809(x: Int) extends Base
-case class Dummy1810(x: Int) extends Base
-case class Dummy1811(x: Int) extends Base
-case class Dummy1812(x: Int) extends Base
-case class Dummy1813(x: Int) extends Base
-case class Dummy1814(x: Int) extends Base
-case class Dummy1815(x: Int) extends Base
-case class Dummy1816(x: Int) extends Base
-case class Dummy1817(x: Int) extends Base
-case class Dummy1818(x: Int) extends Base
-case class Dummy1819(x: Int) extends Base
-case class Dummy1820(x: Int) extends Base
-case class Dummy1821(x: Int) extends Base
-case class Dummy1822(x: Int) extends Base
-case class Dummy1823(x: Int) extends Base
-case class Dummy1824(x: Int) extends Base
-case class Dummy1825(x: Int) extends Base
-case class Dummy1826(x: Int) extends Base
-case class Dummy1827(x: Int) extends Base
-case class Dummy1828(x: Int) extends Base
-case class Dummy1829(x: Int) extends Base
-case class Dummy1830(x: Int) extends Base
-case class Dummy1831(x: Int) extends Base
-case class Dummy1832(x: Int) extends Base
-case class Dummy1833(x: Int) extends Base
-case class Dummy1834(x: Int) extends Base
-case class Dummy1835(x: Int) extends Base
-case class Dummy1836(x: Int) extends Base
-case class Dummy1837(x: Int) extends Base
-case class Dummy1838(x: Int) extends Base
-case class Dummy1839(x: Int) extends Base
-case class Dummy1840(x: Int) extends Base
-case class Dummy1841(x: Int) extends Base
-case class Dummy1842(x: Int) extends Base
-case class Dummy1843(x: Int) extends Base
-case class Dummy1844(x: Int) extends Base
-case class Dummy1845(x: Int) extends Base
-case class Dummy1846(x: Int) extends Base
-case class Dummy1847(x: Int) extends Base
-case class Dummy1848(x: Int) extends Base
-case class Dummy1849(x: Int) extends Base
-case class Dummy1850(x: Int) extends Base
-case class Dummy1851(x: Int) extends Base
-case class Dummy1852(x: Int) extends Base
-case class Dummy1853(x: Int) extends Base
-case class Dummy1854(x: Int) extends Base
-case class Dummy1855(x: Int) extends Base
-case class Dummy1856(x: Int) extends Base
-case class Dummy1857(x: Int) extends Base
-case class Dummy1858(x: Int) extends Base
-case class Dummy1859(x: Int) extends Base
-case class Dummy1860(x: Int) extends Base
-case class Dummy1861(x: Int) extends Base
-case class Dummy1862(x: Int) extends Base
-case class Dummy1863(x: Int) extends Base
-case class Dummy1864(x: Int) extends Base
-case class Dummy1865(x: Int) extends Base
-case class Dummy1866(x: Int) extends Base
-case class Dummy1867(x: Int) extends Base
-case class Dummy1868(x: Int) extends Base
-case class Dummy1869(x: Int) extends Base
-case class Dummy1870(x: Int) extends Base
-case class Dummy1871(x: Int) extends Base
-case class Dummy1872(x: Int) extends Base
-case class Dummy1873(x: Int) extends Base
-case class Dummy1874(x: Int) extends Base
-case class Dummy1875(x: Int) extends Base
-case class Dummy1876(x: Int) extends Base
-case class Dummy1877(x: Int) extends Base
-case class Dummy1878(x: Int) extends Base
-case class Dummy1879(x: Int) extends Base
-case class Dummy1880(x: Int) extends Base
-case class Dummy1881(x: Int) extends Base
-case class Dummy1882(x: Int) extends Base
-case class Dummy1883(x: Int) extends Base
-case class Dummy1884(x: Int) extends Base
-case class Dummy1885(x: Int) extends Base
-case class Dummy1886(x: Int) extends Base
-case class Dummy1887(x: Int) extends Base
-case class Dummy1888(x: Int) extends Base
-case class Dummy1889(x: Int) extends Base
-case class Dummy1890(x: Int) extends Base
-case class Dummy1891(x: Int) extends Base
-case class Dummy1892(x: Int) extends Base
-case class Dummy1893(x: Int) extends Base
-case class Dummy1894(x: Int) extends Base
-case class Dummy1895(x: Int) extends Base
-case class Dummy1896(x: Int) extends Base
-case class Dummy1897(x: Int) extends Base
-case class Dummy1898(x: Int) extends Base
-case class Dummy1899(x: Int) extends Base
-case class Dummy1900(x: Int) extends Base
-case class Dummy1901(x: Int) extends Base
-case class Dummy1902(x: Int) extends Base
-case class Dummy1903(x: Int) extends Base
-case class Dummy1904(x: Int) extends Base
-case class Dummy1905(x: Int) extends Base
-case class Dummy1906(x: Int) extends Base
-case class Dummy1907(x: Int) extends Base
-case class Dummy1908(x: Int) extends Base
-case class Dummy1909(x: Int) extends Base
-case class Dummy1910(x: Int) extends Base
-case class Dummy1911(x: Int) extends Base
-case class Dummy1912(x: Int) extends Base
-case class Dummy1913(x: Int) extends Base
-case class Dummy1914(x: Int) extends Base
-case class Dummy1915(x: Int) extends Base
-case class Dummy1916(x: Int) extends Base
-case class Dummy1917(x: Int) extends Base
-case class Dummy1918(x: Int) extends Base
-case class Dummy1919(x: Int) extends Base
-case class Dummy1920(x: Int) extends Base
-case class Dummy1921(x: Int) extends Base
-case class Dummy1922(x: Int) extends Base
-case class Dummy1923(x: Int) extends Base
-case class Dummy1924(x: Int) extends Base
-case class Dummy1925(x: Int) extends Base
-case class Dummy1926(x: Int) extends Base
-case class Dummy1927(x: Int) extends Base
-case class Dummy1928(x: Int) extends Base
-case class Dummy1929(x: Int) extends Base
-case class Dummy1930(x: Int) extends Base
-case class Dummy1931(x: Int) extends Base
-case class Dummy1932(x: Int) extends Base
-case class Dummy1933(x: Int) extends Base
-case class Dummy1934(x: Int) extends Base
-case class Dummy1935(x: Int) extends Base
-case class Dummy1936(x: Int) extends Base
-case class Dummy1937(x: Int) extends Base
-case class Dummy1938(x: Int) extends Base
-case class Dummy1939(x: Int) extends Base
-case class Dummy1940(x: Int) extends Base
-case class Dummy1941(x: Int) extends Base
-case class Dummy1942(x: Int) extends Base
-case class Dummy1943(x: Int) extends Base
-case class Dummy1944(x: Int) extends Base
-case class Dummy1945(x: Int) extends Base
-case class Dummy1946(x: Int) extends Base
-case class Dummy1947(x: Int) extends Base
-case class Dummy1948(x: Int) extends Base
-case class Dummy1949(x: Int) extends Base
-case class Dummy1950(x: Int) extends Base
-case class Dummy1951(x: Int) extends Base
-case class Dummy1952(x: Int) extends Base
-case class Dummy1953(x: Int) extends Base
-case class Dummy1954(x: Int) extends Base
-case class Dummy1955(x: Int) extends Base
-case class Dummy1956(x: Int) extends Base
-case class Dummy1957(x: Int) extends Base
-case class Dummy1958(x: Int) extends Base
-case class Dummy1959(x: Int) extends Base
-case class Dummy1960(x: Int) extends Base
-case class Dummy1961(x: Int) extends Base
-case class Dummy1962(x: Int) extends Base
-case class Dummy1963(x: Int) extends Base
-case class Dummy1964(x: Int) extends Base
-case class Dummy1965(x: Int) extends Base
-case class Dummy1966(x: Int) extends Base
-case class Dummy1967(x: Int) extends Base
-case class Dummy1968(x: Int) extends Base
-case class Dummy1969(x: Int) extends Base
-case class Dummy1970(x: Int) extends Base
-case class Dummy1971(x: Int) extends Base
-case class Dummy1972(x: Int) extends Base
-case class Dummy1973(x: Int) extends Base
-case class Dummy1974(x: Int) extends Base
-case class Dummy1975(x: Int) extends Base
-case class Dummy1976(x: Int) extends Base
-case class Dummy1977(x: Int) extends Base
-case class Dummy1978(x: Int) extends Base
-case class Dummy1979(x: Int) extends Base
-case class Dummy1980(x: Int) extends Base
-case class Dummy1981(x: Int) extends Base
-case class Dummy1982(x: Int) extends Base
-case class Dummy1983(x: Int) extends Base
-case class Dummy1984(x: Int) extends Base
-case class Dummy1985(x: Int) extends Base
-case class Dummy1986(x: Int) extends Base
-case class Dummy1987(x: Int) extends Base
-case class Dummy1988(x: Int) extends Base
-case class Dummy1989(x: Int) extends Base
-case class Dummy1990(x: Int) extends Base
-case class Dummy1991(x: Int) extends Base
-case class Dummy1992(x: Int) extends Base
-case class Dummy1993(x: Int) extends Base
-case class Dummy1994(x: Int) extends Base
-case class Dummy1995(x: Int) extends Base
-case class Dummy1996(x: Int) extends Base
-case class Dummy1997(x: Int) extends Base
-case class Dummy1998(x: Int) extends Base
-case class Dummy1999(x: Int) extends Base
-def test(y: Base) = y match {
- case Dummy0(p) => p
- case Dummy1(p) => p
- case Dummy2(p) => p
- case Dummy3(p) => p
- case Dummy4(p) => p
- case Dummy5(p) => p
- case Dummy6(p) => p
- case Dummy7(p) => p
- case Dummy8(p) => p
- case Dummy9(p) => p
- case Dummy10(p) => p
- case Dummy11(p) => p
- case Dummy12(p) => p
- case Dummy13(p) => p
- case Dummy14(p) => p
- case Dummy15(p) => p
- case Dummy16(p) => p
- case Dummy17(p) => p
- case Dummy18(p) => p
- case Dummy19(p) => p
- case Dummy20(p) => p
- case Dummy21(p) => p
- case Dummy22(p) => p
- case Dummy23(p) => p
- case Dummy24(p) => p
- case Dummy25(p) => p
- case Dummy26(p) => p
- case Dummy27(p) => p
- case Dummy28(p) => p
- case Dummy29(p) => p
- case Dummy30(p) => p
- case Dummy31(p) => p
- case Dummy32(p) => p
- case Dummy33(p) => p
- case Dummy34(p) => p
- case Dummy35(p) => p
- case Dummy36(p) => p
- case Dummy37(p) => p
- case Dummy38(p) => p
- case Dummy39(p) => p
- case Dummy40(p) => p
- case Dummy41(p) => p
- case Dummy42(p) => p
- case Dummy43(p) => p
- case Dummy44(p) => p
- case Dummy45(p) => p
- case Dummy46(p) => p
- case Dummy47(p) => p
- case Dummy48(p) => p
- case Dummy49(p) => p
- case Dummy50(p) => p
- case Dummy51(p) => p
- case Dummy52(p) => p
- case Dummy53(p) => p
- case Dummy54(p) => p
- case Dummy55(p) => p
- case Dummy56(p) => p
- case Dummy57(p) => p
- case Dummy58(p) => p
- case Dummy59(p) => p
- case Dummy60(p) => p
- case Dummy61(p) => p
- case Dummy62(p) => p
- case Dummy63(p) => p
- case Dummy64(p) => p
- case Dummy65(p) => p
- case Dummy66(p) => p
- case Dummy67(p) => p
- case Dummy68(p) => p
- case Dummy69(p) => p
- case Dummy70(p) => p
- case Dummy71(p) => p
- case Dummy72(p) => p
- case Dummy73(p) => p
- case Dummy74(p) => p
- case Dummy75(p) => p
- case Dummy76(p) => p
- case Dummy77(p) => p
- case Dummy78(p) => p
- case Dummy79(p) => p
- case Dummy80(p) => p
- case Dummy81(p) => p
- case Dummy82(p) => p
- case Dummy83(p) => p
- case Dummy84(p) => p
- case Dummy85(p) => p
- case Dummy86(p) => p
- case Dummy87(p) => p
- case Dummy88(p) => p
- case Dummy89(p) => p
- case Dummy90(p) => p
- case Dummy91(p) => p
- case Dummy92(p) => p
- case Dummy93(p) => p
- case Dummy94(p) => p
- case Dummy95(p) => p
- case Dummy96(p) => p
- case Dummy97(p) => p
- case Dummy98(p) => p
- case Dummy99(p) => p
- case Dummy100(p) => p
- case Dummy101(p) => p
- case Dummy102(p) => p
- case Dummy103(p) => p
- case Dummy104(p) => p
- case Dummy105(p) => p
- case Dummy106(p) => p
- case Dummy107(p) => p
- case Dummy108(p) => p
- case Dummy109(p) => p
- case Dummy110(p) => p
- case Dummy111(p) => p
- case Dummy112(p) => p
- case Dummy113(p) => p
- case Dummy114(p) => p
- case Dummy115(p) => p
- case Dummy116(p) => p
- case Dummy117(p) => p
- case Dummy118(p) => p
- case Dummy119(p) => p
- case Dummy120(p) => p
- case Dummy121(p) => p
- case Dummy122(p) => p
- case Dummy123(p) => p
- case Dummy124(p) => p
- case Dummy125(p) => p
- case Dummy126(p) => p
- case Dummy127(p) => p
- case Dummy128(p) => p
- case Dummy129(p) => p
- case Dummy130(p) => p
- case Dummy131(p) => p
- case Dummy132(p) => p
- case Dummy133(p) => p
- case Dummy134(p) => p
- case Dummy135(p) => p
- case Dummy136(p) => p
- case Dummy137(p) => p
- case Dummy138(p) => p
- case Dummy139(p) => p
- case Dummy140(p) => p
- case Dummy141(p) => p
- case Dummy142(p) => p
- case Dummy143(p) => p
- case Dummy144(p) => p
- case Dummy145(p) => p
- case Dummy146(p) => p
- case Dummy147(p) => p
- case Dummy148(p) => p
- case Dummy149(p) => p
- case Dummy150(p) => p
- case Dummy151(p) => p
- case Dummy152(p) => p
- case Dummy153(p) => p
- case Dummy154(p) => p
- case Dummy155(p) => p
- case Dummy156(p) => p
- case Dummy157(p) => p
- case Dummy158(p) => p
- case Dummy159(p) => p
- case Dummy160(p) => p
- case Dummy161(p) => p
- case Dummy162(p) => p
- case Dummy163(p) => p
- case Dummy164(p) => p
- case Dummy165(p) => p
- case Dummy166(p) => p
- case Dummy167(p) => p
- case Dummy168(p) => p
- case Dummy169(p) => p
- case Dummy170(p) => p
- case Dummy171(p) => p
- case Dummy172(p) => p
- case Dummy173(p) => p
- case Dummy174(p) => p
- case Dummy175(p) => p
- case Dummy176(p) => p
- case Dummy177(p) => p
- case Dummy178(p) => p
- case Dummy179(p) => p
- case Dummy180(p) => p
- case Dummy181(p) => p
- case Dummy182(p) => p
- case Dummy183(p) => p
- case Dummy184(p) => p
- case Dummy185(p) => p
- case Dummy186(p) => p
- case Dummy187(p) => p
- case Dummy188(p) => p
- case Dummy189(p) => p
- case Dummy190(p) => p
- case Dummy191(p) => p
- case Dummy192(p) => p
- case Dummy193(p) => p
- case Dummy194(p) => p
- case Dummy195(p) => p
- case Dummy196(p) => p
- case Dummy197(p) => p
- case Dummy198(p) => p
- case Dummy199(p) => p
- case Dummy200(p) => p
- case Dummy201(p) => p
- case Dummy202(p) => p
- case Dummy203(p) => p
- case Dummy204(p) => p
- case Dummy205(p) => p
- case Dummy206(p) => p
- case Dummy207(p) => p
- case Dummy208(p) => p
- case Dummy209(p) => p
- case Dummy210(p) => p
- case Dummy211(p) => p
- case Dummy212(p) => p
- case Dummy213(p) => p
- case Dummy214(p) => p
- case Dummy215(p) => p
- case Dummy216(p) => p
- case Dummy217(p) => p
- case Dummy218(p) => p
- case Dummy219(p) => p
- case Dummy220(p) => p
- case Dummy221(p) => p
- case Dummy222(p) => p
- case Dummy223(p) => p
- case Dummy224(p) => p
- case Dummy225(p) => p
- case Dummy226(p) => p
- case Dummy227(p) => p
- case Dummy228(p) => p
- case Dummy229(p) => p
- case Dummy230(p) => p
- case Dummy231(p) => p
- case Dummy232(p) => p
- case Dummy233(p) => p
- case Dummy234(p) => p
- case Dummy235(p) => p
- case Dummy236(p) => p
- case Dummy237(p) => p
- case Dummy238(p) => p
- case Dummy239(p) => p
- case Dummy240(p) => p
- case Dummy241(p) => p
- case Dummy242(p) => p
- case Dummy243(p) => p
- case Dummy244(p) => p
- case Dummy245(p) => p
- case Dummy246(p) => p
- case Dummy247(p) => p
- case Dummy248(p) => p
- case Dummy249(p) => p
- case Dummy250(p) => p
- case Dummy251(p) => p
- case Dummy252(p) => p
- case Dummy253(p) => p
- case Dummy254(p) => p
- case Dummy255(p) => p
- case Dummy256(p) => p
- case Dummy257(p) => p
- case Dummy258(p) => p
- case Dummy259(p) => p
- case Dummy260(p) => p
- case Dummy261(p) => p
- case Dummy262(p) => p
- case Dummy263(p) => p
- case Dummy264(p) => p
- case Dummy265(p) => p
- case Dummy266(p) => p
- case Dummy267(p) => p
- case Dummy268(p) => p
- case Dummy269(p) => p
- case Dummy270(p) => p
- case Dummy271(p) => p
- case Dummy272(p) => p
- case Dummy273(p) => p
- case Dummy274(p) => p
- case Dummy275(p) => p
- case Dummy276(p) => p
- case Dummy277(p) => p
- case Dummy278(p) => p
- case Dummy279(p) => p
- case Dummy280(p) => p
- case Dummy281(p) => p
- case Dummy282(p) => p
- case Dummy283(p) => p
- case Dummy284(p) => p
- case Dummy285(p) => p
- case Dummy286(p) => p
- case Dummy287(p) => p
- case Dummy288(p) => p
- case Dummy289(p) => p
- case Dummy290(p) => p
- case Dummy291(p) => p
- case Dummy292(p) => p
- case Dummy293(p) => p
- case Dummy294(p) => p
- case Dummy295(p) => p
- case Dummy296(p) => p
- case Dummy297(p) => p
- case Dummy298(p) => p
- case Dummy299(p) => p
- case Dummy300(p) => p
- case Dummy301(p) => p
- case Dummy302(p) => p
- case Dummy303(p) => p
- case Dummy304(p) => p
- case Dummy305(p) => p
- case Dummy306(p) => p
- case Dummy307(p) => p
- case Dummy308(p) => p
- case Dummy309(p) => p
- case Dummy310(p) => p
- case Dummy311(p) => p
- case Dummy312(p) => p
- case Dummy313(p) => p
- case Dummy314(p) => p
- case Dummy315(p) => p
- case Dummy316(p) => p
- case Dummy317(p) => p
- case Dummy318(p) => p
- case Dummy319(p) => p
- case Dummy320(p) => p
- case Dummy321(p) => p
- case Dummy322(p) => p
- case Dummy323(p) => p
- case Dummy324(p) => p
- case Dummy325(p) => p
- case Dummy326(p) => p
- case Dummy327(p) => p
- case Dummy328(p) => p
- case Dummy329(p) => p
- case Dummy330(p) => p
- case Dummy331(p) => p
- case Dummy332(p) => p
- case Dummy333(p) => p
- case Dummy334(p) => p
- case Dummy335(p) => p
- case Dummy336(p) => p
- case Dummy337(p) => p
- case Dummy338(p) => p
- case Dummy339(p) => p
- case Dummy340(p) => p
- case Dummy341(p) => p
- case Dummy342(p) => p
- case Dummy343(p) => p
- case Dummy344(p) => p
- case Dummy345(p) => p
- case Dummy346(p) => p
- case Dummy347(p) => p
- case Dummy348(p) => p
- case Dummy349(p) => p
- case Dummy350(p) => p
- case Dummy351(p) => p
- case Dummy352(p) => p
- case Dummy353(p) => p
- case Dummy354(p) => p
- case Dummy355(p) => p
- case Dummy356(p) => p
- case Dummy357(p) => p
- case Dummy358(p) => p
- case Dummy359(p) => p
- case Dummy360(p) => p
- case Dummy361(p) => p
- case Dummy362(p) => p
- case Dummy363(p) => p
- case Dummy364(p) => p
- case Dummy365(p) => p
- case Dummy366(p) => p
- case Dummy367(p) => p
- case Dummy368(p) => p
- case Dummy369(p) => p
- case Dummy370(p) => p
- case Dummy371(p) => p
- case Dummy372(p) => p
- case Dummy373(p) => p
- case Dummy374(p) => p
- case Dummy375(p) => p
- case Dummy376(p) => p
- case Dummy377(p) => p
- case Dummy378(p) => p
- case Dummy379(p) => p
- case Dummy380(p) => p
- case Dummy381(p) => p
- case Dummy382(p) => p
- case Dummy383(p) => p
- case Dummy384(p) => p
- case Dummy385(p) => p
- case Dummy386(p) => p
- case Dummy387(p) => p
- case Dummy388(p) => p
- case Dummy389(p) => p
- case Dummy390(p) => p
- case Dummy391(p) => p
- case Dummy392(p) => p
- case Dummy393(p) => p
- case Dummy394(p) => p
- case Dummy395(p) => p
- case Dummy396(p) => p
- case Dummy397(p) => p
- case Dummy398(p) => p
- case Dummy399(p) => p
- case Dummy400(p) => p
- case Dummy401(p) => p
- case Dummy402(p) => p
- case Dummy403(p) => p
- case Dummy404(p) => p
- case Dummy405(p) => p
- case Dummy406(p) => p
- case Dummy407(p) => p
- case Dummy408(p) => p
- case Dummy409(p) => p
- case Dummy410(p) => p
- case Dummy411(p) => p
- case Dummy412(p) => p
- case Dummy413(p) => p
- case Dummy414(p) => p
- case Dummy415(p) => p
- case Dummy416(p) => p
- case Dummy417(p) => p
- case Dummy418(p) => p
- case Dummy419(p) => p
- case Dummy420(p) => p
- case Dummy421(p) => p
- case Dummy422(p) => p
- case Dummy423(p) => p
- case Dummy424(p) => p
- case Dummy425(p) => p
- case Dummy426(p) => p
- case Dummy427(p) => p
- case Dummy428(p) => p
- case Dummy429(p) => p
- case Dummy430(p) => p
- case Dummy431(p) => p
- case Dummy432(p) => p
- case Dummy433(p) => p
- case Dummy434(p) => p
- case Dummy435(p) => p
- case Dummy436(p) => p
- case Dummy437(p) => p
- case Dummy438(p) => p
- case Dummy439(p) => p
- case Dummy440(p) => p
- case Dummy441(p) => p
- case Dummy442(p) => p
- case Dummy443(p) => p
- case Dummy444(p) => p
- case Dummy445(p) => p
- case Dummy446(p) => p
- case Dummy447(p) => p
- case Dummy448(p) => p
- case Dummy449(p) => p
- case Dummy450(p) => p
- case Dummy451(p) => p
- case Dummy452(p) => p
- case Dummy453(p) => p
- case Dummy454(p) => p
- case Dummy455(p) => p
- case Dummy456(p) => p
- case Dummy457(p) => p
- case Dummy458(p) => p
- case Dummy459(p) => p
- case Dummy460(p) => p
- case Dummy461(p) => p
- case Dummy462(p) => p
- case Dummy463(p) => p
- case Dummy464(p) => p
- case Dummy465(p) => p
- case Dummy466(p) => p
- case Dummy467(p) => p
- case Dummy468(p) => p
- case Dummy469(p) => p
- case Dummy470(p) => p
- case Dummy471(p) => p
- case Dummy472(p) => p
- case Dummy473(p) => p
- case Dummy474(p) => p
- case Dummy475(p) => p
- case Dummy476(p) => p
- case Dummy477(p) => p
- case Dummy478(p) => p
- case Dummy479(p) => p
- case Dummy480(p) => p
- case Dummy481(p) => p
- case Dummy482(p) => p
- case Dummy483(p) => p
- case Dummy484(p) => p
- case Dummy485(p) => p
- case Dummy486(p) => p
- case Dummy487(p) => p
- case Dummy488(p) => p
- case Dummy489(p) => p
- case Dummy490(p) => p
- case Dummy491(p) => p
- case Dummy492(p) => p
- case Dummy493(p) => p
- case Dummy494(p) => p
- case Dummy495(p) => p
- case Dummy496(p) => p
- case Dummy497(p) => p
- case Dummy498(p) => p
- case Dummy499(p) => p
- case Dummy500(p) => p
- case Dummy501(p) => p
- case Dummy502(p) => p
- case Dummy503(p) => p
- case Dummy504(p) => p
- case Dummy505(p) => p
- case Dummy506(p) => p
- case Dummy507(p) => p
- case Dummy508(p) => p
- case Dummy509(p) => p
- case Dummy510(p) => p
- case Dummy511(p) => p
- case Dummy512(p) => p
- case Dummy513(p) => p
- case Dummy514(p) => p
- case Dummy515(p) => p
- case Dummy516(p) => p
- case Dummy517(p) => p
- case Dummy518(p) => p
- case Dummy519(p) => p
- case Dummy520(p) => p
- case Dummy521(p) => p
- case Dummy522(p) => p
- case Dummy523(p) => p
- case Dummy524(p) => p
- case Dummy525(p) => p
- case Dummy526(p) => p
- case Dummy527(p) => p
- case Dummy528(p) => p
- case Dummy529(p) => p
- case Dummy530(p) => p
- case Dummy531(p) => p
- case Dummy532(p) => p
- case Dummy533(p) => p
- case Dummy534(p) => p
- case Dummy535(p) => p
- case Dummy536(p) => p
- case Dummy537(p) => p
- case Dummy538(p) => p
- case Dummy539(p) => p
- case Dummy540(p) => p
- case Dummy541(p) => p
- case Dummy542(p) => p
- case Dummy543(p) => p
- case Dummy544(p) => p
- case Dummy545(p) => p
- case Dummy546(p) => p
- case Dummy547(p) => p
- case Dummy548(p) => p
- case Dummy549(p) => p
- case Dummy550(p) => p
- case Dummy551(p) => p
- case Dummy552(p) => p
- case Dummy553(p) => p
- case Dummy554(p) => p
- case Dummy555(p) => p
- case Dummy556(p) => p
- case Dummy557(p) => p
- case Dummy558(p) => p
- case Dummy559(p) => p
- case Dummy560(p) => p
- case Dummy561(p) => p
- case Dummy562(p) => p
- case Dummy563(p) => p
- case Dummy564(p) => p
- case Dummy565(p) => p
- case Dummy566(p) => p
- case Dummy567(p) => p
- case Dummy568(p) => p
- case Dummy569(p) => p
- case Dummy570(p) => p
- case Dummy571(p) => p
- case Dummy572(p) => p
- case Dummy573(p) => p
- case Dummy574(p) => p
- case Dummy575(p) => p
- case Dummy576(p) => p
- case Dummy577(p) => p
- case Dummy578(p) => p
- case Dummy579(p) => p
- case Dummy580(p) => p
- case Dummy581(p) => p
- case Dummy582(p) => p
- case Dummy583(p) => p
- case Dummy584(p) => p
- case Dummy585(p) => p
- case Dummy586(p) => p
- case Dummy587(p) => p
- case Dummy588(p) => p
- case Dummy589(p) => p
- case Dummy590(p) => p
- case Dummy591(p) => p
- case Dummy592(p) => p
- case Dummy593(p) => p
- case Dummy594(p) => p
- case Dummy595(p) => p
- case Dummy596(p) => p
- case Dummy597(p) => p
- case Dummy598(p) => p
- case Dummy599(p) => p
- case Dummy600(p) => p
- case Dummy601(p) => p
- case Dummy602(p) => p
- case Dummy603(p) => p
- case Dummy604(p) => p
- case Dummy605(p) => p
- case Dummy606(p) => p
- case Dummy607(p) => p
- case Dummy608(p) => p
- case Dummy609(p) => p
- case Dummy610(p) => p
- case Dummy611(p) => p
- case Dummy612(p) => p
- case Dummy613(p) => p
- case Dummy614(p) => p
- case Dummy615(p) => p
- case Dummy616(p) => p
- case Dummy617(p) => p
- case Dummy618(p) => p
- case Dummy619(p) => p
- case Dummy620(p) => p
- case Dummy621(p) => p
- case Dummy622(p) => p
- case Dummy623(p) => p
- case Dummy624(p) => p
- case Dummy625(p) => p
- case Dummy626(p) => p
- case Dummy627(p) => p
- case Dummy628(p) => p
- case Dummy629(p) => p
- case Dummy630(p) => p
- case Dummy631(p) => p
- case Dummy632(p) => p
- case Dummy633(p) => p
- case Dummy634(p) => p
- case Dummy635(p) => p
- case Dummy636(p) => p
- case Dummy637(p) => p
- case Dummy638(p) => p
- case Dummy639(p) => p
- case Dummy640(p) => p
- case Dummy641(p) => p
- case Dummy642(p) => p
- case Dummy643(p) => p
- case Dummy644(p) => p
- case Dummy645(p) => p
- case Dummy646(p) => p
- case Dummy647(p) => p
- case Dummy648(p) => p
- case Dummy649(p) => p
- case Dummy650(p) => p
- case Dummy651(p) => p
- case Dummy652(p) => p
- case Dummy653(p) => p
- case Dummy654(p) => p
- case Dummy655(p) => p
- case Dummy656(p) => p
- case Dummy657(p) => p
- case Dummy658(p) => p
- case Dummy659(p) => p
- case Dummy660(p) => p
- case Dummy661(p) => p
- case Dummy662(p) => p
- case Dummy663(p) => p
- case Dummy664(p) => p
- case Dummy665(p) => p
- case Dummy666(p) => p
- case Dummy667(p) => p
- case Dummy668(p) => p
- case Dummy669(p) => p
- case Dummy670(p) => p
- case Dummy671(p) => p
- case Dummy672(p) => p
- case Dummy673(p) => p
- case Dummy674(p) => p
- case Dummy675(p) => p
- case Dummy676(p) => p
- case Dummy677(p) => p
- case Dummy678(p) => p
- case Dummy679(p) => p
- case Dummy680(p) => p
- case Dummy681(p) => p
- case Dummy682(p) => p
- case Dummy683(p) => p
- case Dummy684(p) => p
- case Dummy685(p) => p
- case Dummy686(p) => p
- case Dummy687(p) => p
- case Dummy688(p) => p
- case Dummy689(p) => p
- case Dummy690(p) => p
- case Dummy691(p) => p
- case Dummy692(p) => p
- case Dummy693(p) => p
- case Dummy694(p) => p
- case Dummy695(p) => p
- case Dummy696(p) => p
- case Dummy697(p) => p
- case Dummy698(p) => p
- case Dummy699(p) => p
- case Dummy700(p) => p
- case Dummy701(p) => p
- case Dummy702(p) => p
- case Dummy703(p) => p
- case Dummy704(p) => p
- case Dummy705(p) => p
- case Dummy706(p) => p
- case Dummy707(p) => p
- case Dummy708(p) => p
- case Dummy709(p) => p
- case Dummy710(p) => p
- case Dummy711(p) => p
- case Dummy712(p) => p
- case Dummy713(p) => p
- case Dummy714(p) => p
- case Dummy715(p) => p
- case Dummy716(p) => p
- case Dummy717(p) => p
- case Dummy718(p) => p
- case Dummy719(p) => p
- case Dummy720(p) => p
- case Dummy721(p) => p
- case Dummy722(p) => p
- case Dummy723(p) => p
- case Dummy724(p) => p
- case Dummy725(p) => p
- case Dummy726(p) => p
- case Dummy727(p) => p
- case Dummy728(p) => p
- case Dummy729(p) => p
- case Dummy730(p) => p
- case Dummy731(p) => p
- case Dummy732(p) => p
- case Dummy733(p) => p
- case Dummy734(p) => p
- case Dummy735(p) => p
- case Dummy736(p) => p
- case Dummy737(p) => p
- case Dummy738(p) => p
- case Dummy739(p) => p
- case Dummy740(p) => p
- case Dummy741(p) => p
- case Dummy742(p) => p
- case Dummy743(p) => p
- case Dummy744(p) => p
- case Dummy745(p) => p
- case Dummy746(p) => p
- case Dummy747(p) => p
- case Dummy748(p) => p
- case Dummy749(p) => p
- case Dummy750(p) => p
- case Dummy751(p) => p
- case Dummy752(p) => p
- case Dummy753(p) => p
- case Dummy754(p) => p
- case Dummy755(p) => p
- case Dummy756(p) => p
- case Dummy757(p) => p
- case Dummy758(p) => p
- case Dummy759(p) => p
- case Dummy760(p) => p
- case Dummy761(p) => p
- case Dummy762(p) => p
- case Dummy763(p) => p
- case Dummy764(p) => p
- case Dummy765(p) => p
- case Dummy766(p) => p
- case Dummy767(p) => p
- case Dummy768(p) => p
- case Dummy769(p) => p
- case Dummy770(p) => p
- case Dummy771(p) => p
- case Dummy772(p) => p
- case Dummy773(p) => p
- case Dummy774(p) => p
- case Dummy775(p) => p
- case Dummy776(p) => p
- case Dummy777(p) => p
- case Dummy778(p) => p
- case Dummy779(p) => p
- case Dummy780(p) => p
- case Dummy781(p) => p
- case Dummy782(p) => p
- case Dummy783(p) => p
- case Dummy784(p) => p
- case Dummy785(p) => p
- case Dummy786(p) => p
- case Dummy787(p) => p
- case Dummy788(p) => p
- case Dummy789(p) => p
- case Dummy790(p) => p
- case Dummy791(p) => p
- case Dummy792(p) => p
- case Dummy793(p) => p
- case Dummy794(p) => p
- case Dummy795(p) => p
- case Dummy796(p) => p
- case Dummy797(p) => p
- case Dummy798(p) => p
- case Dummy799(p) => p
- case Dummy800(p) => p
- case Dummy801(p) => p
- case Dummy802(p) => p
- case Dummy803(p) => p
- case Dummy804(p) => p
- case Dummy805(p) => p
- case Dummy806(p) => p
- case Dummy807(p) => p
- case Dummy808(p) => p
- case Dummy809(p) => p
- case Dummy810(p) => p
- case Dummy811(p) => p
- case Dummy812(p) => p
- case Dummy813(p) => p
- case Dummy814(p) => p
- case Dummy815(p) => p
- case Dummy816(p) => p
- case Dummy817(p) => p
- case Dummy818(p) => p
- case Dummy819(p) => p
- case Dummy820(p) => p
- case Dummy821(p) => p
- case Dummy822(p) => p
- case Dummy823(p) => p
- case Dummy824(p) => p
- case Dummy825(p) => p
- case Dummy826(p) => p
- case Dummy827(p) => p
- case Dummy828(p) => p
- case Dummy829(p) => p
- case Dummy830(p) => p
- case Dummy831(p) => p
- case Dummy832(p) => p
- case Dummy833(p) => p
- case Dummy834(p) => p
- case Dummy835(p) => p
- case Dummy836(p) => p
- case Dummy837(p) => p
- case Dummy838(p) => p
- case Dummy839(p) => p
- case Dummy840(p) => p
- case Dummy841(p) => p
- case Dummy842(p) => p
- case Dummy843(p) => p
- case Dummy844(p) => p
- case Dummy845(p) => p
- case Dummy846(p) => p
- case Dummy847(p) => p
- case Dummy848(p) => p
- case Dummy849(p) => p
- case Dummy850(p) => p
- case Dummy851(p) => p
- case Dummy852(p) => p
- case Dummy853(p) => p
- case Dummy854(p) => p
- case Dummy855(p) => p
- case Dummy856(p) => p
- case Dummy857(p) => p
- case Dummy858(p) => p
- case Dummy859(p) => p
- case Dummy860(p) => p
- case Dummy861(p) => p
- case Dummy862(p) => p
- case Dummy863(p) => p
- case Dummy864(p) => p
- case Dummy865(p) => p
- case Dummy866(p) => p
- case Dummy867(p) => p
- case Dummy868(p) => p
- case Dummy869(p) => p
- case Dummy870(p) => p
- case Dummy871(p) => p
- case Dummy872(p) => p
- case Dummy873(p) => p
- case Dummy874(p) => p
- case Dummy875(p) => p
- case Dummy876(p) => p
- case Dummy877(p) => p
- case Dummy878(p) => p
- case Dummy879(p) => p
- case Dummy880(p) => p
- case Dummy881(p) => p
- case Dummy882(p) => p
- case Dummy883(p) => p
- case Dummy884(p) => p
- case Dummy885(p) => p
- case Dummy886(p) => p
- case Dummy887(p) => p
- case Dummy888(p) => p
- case Dummy889(p) => p
- case Dummy890(p) => p
- case Dummy891(p) => p
- case Dummy892(p) => p
- case Dummy893(p) => p
- case Dummy894(p) => p
- case Dummy895(p) => p
- case Dummy896(p) => p
- case Dummy897(p) => p
- case Dummy898(p) => p
- case Dummy899(p) => p
- case Dummy900(p) => p
- case Dummy901(p) => p
- case Dummy902(p) => p
- case Dummy903(p) => p
- case Dummy904(p) => p
- case Dummy905(p) => p
- case Dummy906(p) => p
- case Dummy907(p) => p
- case Dummy908(p) => p
- case Dummy909(p) => p
- case Dummy910(p) => p
- case Dummy911(p) => p
- case Dummy912(p) => p
- case Dummy913(p) => p
- case Dummy914(p) => p
- case Dummy915(p) => p
- case Dummy916(p) => p
- case Dummy917(p) => p
- case Dummy918(p) => p
- case Dummy919(p) => p
- case Dummy920(p) => p
- case Dummy921(p) => p
- case Dummy922(p) => p
- case Dummy923(p) => p
- case Dummy924(p) => p
- case Dummy925(p) => p
- case Dummy926(p) => p
- case Dummy927(p) => p
- case Dummy928(p) => p
- case Dummy929(p) => p
- case Dummy930(p) => p
- case Dummy931(p) => p
- case Dummy932(p) => p
- case Dummy933(p) => p
- case Dummy934(p) => p
- case Dummy935(p) => p
- case Dummy936(p) => p
- case Dummy937(p) => p
- case Dummy938(p) => p
- case Dummy939(p) => p
- case Dummy940(p) => p
- case Dummy941(p) => p
- case Dummy942(p) => p
- case Dummy943(p) => p
- case Dummy944(p) => p
- case Dummy945(p) => p
- case Dummy946(p) => p
- case Dummy947(p) => p
- case Dummy948(p) => p
- case Dummy949(p) => p
- case Dummy950(p) => p
- case Dummy951(p) => p
- case Dummy952(p) => p
- case Dummy953(p) => p
- case Dummy954(p) => p
- case Dummy955(p) => p
- case Dummy956(p) => p
- case Dummy957(p) => p
- case Dummy958(p) => p
- case Dummy959(p) => p
- case Dummy960(p) => p
- case Dummy961(p) => p
- case Dummy962(p) => p
- case Dummy963(p) => p
- case Dummy964(p) => p
- case Dummy965(p) => p
- case Dummy966(p) => p
- case Dummy967(p) => p
- case Dummy968(p) => p
- case Dummy969(p) => p
- case Dummy970(p) => p
- case Dummy971(p) => p
- case Dummy972(p) => p
- case Dummy973(p) => p
- case Dummy974(p) => p
- case Dummy975(p) => p
- case Dummy976(p) => p
- case Dummy977(p) => p
- case Dummy978(p) => p
- case Dummy979(p) => p
- case Dummy980(p) => p
- case Dummy981(p) => p
- case Dummy982(p) => p
- case Dummy983(p) => p
- case Dummy984(p) => p
- case Dummy985(p) => p
- case Dummy986(p) => p
- case Dummy987(p) => p
- case Dummy988(p) => p
- case Dummy989(p) => p
- case Dummy990(p) => p
- case Dummy991(p) => p
- case Dummy992(p) => p
- case Dummy993(p) => p
- case Dummy994(p) => p
- case Dummy995(p) => p
- case Dummy996(p) => p
- case Dummy997(p) => p
- case Dummy998(p) => p
- case Dummy999(p) => p
- case Dummy1000(p) => p
- case Dummy1001(p) => p
- case Dummy1002(p) => p
- case Dummy1003(p) => p
- case Dummy1004(p) => p
- case Dummy1005(p) => p
- case Dummy1006(p) => p
- case Dummy1007(p) => p
- case Dummy1008(p) => p
- case Dummy1009(p) => p
- case Dummy1010(p) => p
- case Dummy1011(p) => p
- case Dummy1012(p) => p
- case Dummy1013(p) => p
- case Dummy1014(p) => p
- case Dummy1015(p) => p
- case Dummy1016(p) => p
- case Dummy1017(p) => p
- case Dummy1018(p) => p
- case Dummy1019(p) => p
- case Dummy1020(p) => p
- case Dummy1021(p) => p
- case Dummy1022(p) => p
- case Dummy1023(p) => p
- case Dummy1024(p) => p
- case Dummy1025(p) => p
- case Dummy1026(p) => p
- case Dummy1027(p) => p
- case Dummy1028(p) => p
- case Dummy1029(p) => p
- case Dummy1030(p) => p
- case Dummy1031(p) => p
- case Dummy1032(p) => p
- case Dummy1033(p) => p
- case Dummy1034(p) => p
- case Dummy1035(p) => p
- case Dummy1036(p) => p
- case Dummy1037(p) => p
- case Dummy1038(p) => p
- case Dummy1039(p) => p
- case Dummy1040(p) => p
- case Dummy1041(p) => p
- case Dummy1042(p) => p
- case Dummy1043(p) => p
- case Dummy1044(p) => p
- case Dummy1045(p) => p
- case Dummy1046(p) => p
- case Dummy1047(p) => p
- case Dummy1048(p) => p
- case Dummy1049(p) => p
- case Dummy1050(p) => p
- case Dummy1051(p) => p
- case Dummy1052(p) => p
- case Dummy1053(p) => p
- case Dummy1054(p) => p
- case Dummy1055(p) => p
- case Dummy1056(p) => p
- case Dummy1057(p) => p
- case Dummy1058(p) => p
- case Dummy1059(p) => p
- case Dummy1060(p) => p
- case Dummy1061(p) => p
- case Dummy1062(p) => p
- case Dummy1063(p) => p
- case Dummy1064(p) => p
- case Dummy1065(p) => p
- case Dummy1066(p) => p
- case Dummy1067(p) => p
- case Dummy1068(p) => p
- case Dummy1069(p) => p
- case Dummy1070(p) => p
- case Dummy1071(p) => p
- case Dummy1072(p) => p
- case Dummy1073(p) => p
- case Dummy1074(p) => p
- case Dummy1075(p) => p
- case Dummy1076(p) => p
- case Dummy1077(p) => p
- case Dummy1078(p) => p
- case Dummy1079(p) => p
- case Dummy1080(p) => p
- case Dummy1081(p) => p
- case Dummy1082(p) => p
- case Dummy1083(p) => p
- case Dummy1084(p) => p
- case Dummy1085(p) => p
- case Dummy1086(p) => p
- case Dummy1087(p) => p
- case Dummy1088(p) => p
- case Dummy1089(p) => p
- case Dummy1090(p) => p
- case Dummy1091(p) => p
- case Dummy1092(p) => p
- case Dummy1093(p) => p
- case Dummy1094(p) => p
- case Dummy1095(p) => p
- case Dummy1096(p) => p
- case Dummy1097(p) => p
- case Dummy1098(p) => p
- case Dummy1099(p) => p
- case Dummy1100(p) => p
- case Dummy1101(p) => p
- case Dummy1102(p) => p
- case Dummy1103(p) => p
- case Dummy1104(p) => p
- case Dummy1105(p) => p
- case Dummy1106(p) => p
- case Dummy1107(p) => p
- case Dummy1108(p) => p
- case Dummy1109(p) => p
- case Dummy1110(p) => p
- case Dummy1111(p) => p
- case Dummy1112(p) => p
- case Dummy1113(p) => p
- case Dummy1114(p) => p
- case Dummy1115(p) => p
- case Dummy1116(p) => p
- case Dummy1117(p) => p
- case Dummy1118(p) => p
- case Dummy1119(p) => p
- case Dummy1120(p) => p
- case Dummy1121(p) => p
- case Dummy1122(p) => p
- case Dummy1123(p) => p
- case Dummy1124(p) => p
- case Dummy1125(p) => p
- case Dummy1126(p) => p
- case Dummy1127(p) => p
- case Dummy1128(p) => p
- case Dummy1129(p) => p
- case Dummy1130(p) => p
- case Dummy1131(p) => p
- case Dummy1132(p) => p
- case Dummy1133(p) => p
- case Dummy1134(p) => p
- case Dummy1135(p) => p
- case Dummy1136(p) => p
- case Dummy1137(p) => p
- case Dummy1138(p) => p
- case Dummy1139(p) => p
- case Dummy1140(p) => p
- case Dummy1141(p) => p
- case Dummy1142(p) => p
- case Dummy1143(p) => p
- case Dummy1144(p) => p
- case Dummy1145(p) => p
- case Dummy1146(p) => p
- case Dummy1147(p) => p
- case Dummy1148(p) => p
- case Dummy1149(p) => p
- case Dummy1150(p) => p
- case Dummy1151(p) => p
- case Dummy1152(p) => p
- case Dummy1153(p) => p
- case Dummy1154(p) => p
- case Dummy1155(p) => p
- case Dummy1156(p) => p
- case Dummy1157(p) => p
- case Dummy1158(p) => p
- case Dummy1159(p) => p
- case Dummy1160(p) => p
- case Dummy1161(p) => p
- case Dummy1162(p) => p
- case Dummy1163(p) => p
- case Dummy1164(p) => p
- case Dummy1165(p) => p
- case Dummy1166(p) => p
- case Dummy1167(p) => p
- case Dummy1168(p) => p
- case Dummy1169(p) => p
- case Dummy1170(p) => p
- case Dummy1171(p) => p
- case Dummy1172(p) => p
- case Dummy1173(p) => p
- case Dummy1174(p) => p
- case Dummy1175(p) => p
- case Dummy1176(p) => p
- case Dummy1177(p) => p
- case Dummy1178(p) => p
- case Dummy1179(p) => p
- case Dummy1180(p) => p
- case Dummy1181(p) => p
- case Dummy1182(p) => p
- case Dummy1183(p) => p
- case Dummy1184(p) => p
- case Dummy1185(p) => p
- case Dummy1186(p) => p
- case Dummy1187(p) => p
- case Dummy1188(p) => p
- case Dummy1189(p) => p
- case Dummy1190(p) => p
- case Dummy1191(p) => p
- case Dummy1192(p) => p
- case Dummy1193(p) => p
- case Dummy1194(p) => p
- case Dummy1195(p) => p
- case Dummy1196(p) => p
- case Dummy1197(p) => p
- case Dummy1198(p) => p
- case Dummy1199(p) => p
- case Dummy1200(p) => p
- case Dummy1201(p) => p
- case Dummy1202(p) => p
- case Dummy1203(p) => p
- case Dummy1204(p) => p
- case Dummy1205(p) => p
- case Dummy1206(p) => p
- case Dummy1207(p) => p
- case Dummy1208(p) => p
- case Dummy1209(p) => p
- case Dummy1210(p) => p
- case Dummy1211(p) => p
- case Dummy1212(p) => p
- case Dummy1213(p) => p
- case Dummy1214(p) => p
- case Dummy1215(p) => p
- case Dummy1216(p) => p
- case Dummy1217(p) => p
- case Dummy1218(p) => p
- case Dummy1219(p) => p
- case Dummy1220(p) => p
- case Dummy1221(p) => p
- case Dummy1222(p) => p
- case Dummy1223(p) => p
- case Dummy1224(p) => p
- case Dummy1225(p) => p
- case Dummy1226(p) => p
- case Dummy1227(p) => p
- case Dummy1228(p) => p
- case Dummy1229(p) => p
- case Dummy1230(p) => p
- case Dummy1231(p) => p
- case Dummy1232(p) => p
- case Dummy1233(p) => p
- case Dummy1234(p) => p
- case Dummy1235(p) => p
- case Dummy1236(p) => p
- case Dummy1237(p) => p
- case Dummy1238(p) => p
- case Dummy1239(p) => p
- case Dummy1240(p) => p
- case Dummy1241(p) => p
- case Dummy1242(p) => p
- case Dummy1243(p) => p
- case Dummy1244(p) => p
- case Dummy1245(p) => p
- case Dummy1246(p) => p
- case Dummy1247(p) => p
- case Dummy1248(p) => p
- case Dummy1249(p) => p
- case Dummy1250(p) => p
- case Dummy1251(p) => p
- case Dummy1252(p) => p
- case Dummy1253(p) => p
- case Dummy1254(p) => p
- case Dummy1255(p) => p
- case Dummy1256(p) => p
- case Dummy1257(p) => p
- case Dummy1258(p) => p
- case Dummy1259(p) => p
- case Dummy1260(p) => p
- case Dummy1261(p) => p
- case Dummy1262(p) => p
- case Dummy1263(p) => p
- case Dummy1264(p) => p
- case Dummy1265(p) => p
- case Dummy1266(p) => p
- case Dummy1267(p) => p
- case Dummy1268(p) => p
- case Dummy1269(p) => p
- case Dummy1270(p) => p
- case Dummy1271(p) => p
- case Dummy1272(p) => p
- case Dummy1273(p) => p
- case Dummy1274(p) => p
- case Dummy1275(p) => p
- case Dummy1276(p) => p
- case Dummy1277(p) => p
- case Dummy1278(p) => p
- case Dummy1279(p) => p
- case Dummy1280(p) => p
- case Dummy1281(p) => p
- case Dummy1282(p) => p
- case Dummy1283(p) => p
- case Dummy1284(p) => p
- case Dummy1285(p) => p
- case Dummy1286(p) => p
- case Dummy1287(p) => p
- case Dummy1288(p) => p
- case Dummy1289(p) => p
- case Dummy1290(p) => p
- case Dummy1291(p) => p
- case Dummy1292(p) => p
- case Dummy1293(p) => p
- case Dummy1294(p) => p
- case Dummy1295(p) => p
- case Dummy1296(p) => p
- case Dummy1297(p) => p
- case Dummy1298(p) => p
- case Dummy1299(p) => p
- case Dummy1300(p) => p
- case Dummy1301(p) => p
- case Dummy1302(p) => p
- case Dummy1303(p) => p
- case Dummy1304(p) => p
- case Dummy1305(p) => p
- case Dummy1306(p) => p
- case Dummy1307(p) => p
- case Dummy1308(p) => p
- case Dummy1309(p) => p
- case Dummy1310(p) => p
- case Dummy1311(p) => p
- case Dummy1312(p) => p
- case Dummy1313(p) => p
- case Dummy1314(p) => p
- case Dummy1315(p) => p
- case Dummy1316(p) => p
- case Dummy1317(p) => p
- case Dummy1318(p) => p
- case Dummy1319(p) => p
- case Dummy1320(p) => p
- case Dummy1321(p) => p
- case Dummy1322(p) => p
- case Dummy1323(p) => p
- case Dummy1324(p) => p
- case Dummy1325(p) => p
- case Dummy1326(p) => p
- case Dummy1327(p) => p
- case Dummy1328(p) => p
- case Dummy1329(p) => p
- case Dummy1330(p) => p
- case Dummy1331(p) => p
- case Dummy1332(p) => p
- case Dummy1333(p) => p
- case Dummy1334(p) => p
- case Dummy1335(p) => p
- case Dummy1336(p) => p
- case Dummy1337(p) => p
- case Dummy1338(p) => p
- case Dummy1339(p) => p
- case Dummy1340(p) => p
- case Dummy1341(p) => p
- case Dummy1342(p) => p
- case Dummy1343(p) => p
- case Dummy1344(p) => p
- case Dummy1345(p) => p
- case Dummy1346(p) => p
- case Dummy1347(p) => p
- case Dummy1348(p) => p
- case Dummy1349(p) => p
- case Dummy1350(p) => p
- case Dummy1351(p) => p
- case Dummy1352(p) => p
- case Dummy1353(p) => p
- case Dummy1354(p) => p
- case Dummy1355(p) => p
- case Dummy1356(p) => p
- case Dummy1357(p) => p
- case Dummy1358(p) => p
- case Dummy1359(p) => p
- case Dummy1360(p) => p
- case Dummy1361(p) => p
- case Dummy1362(p) => p
- case Dummy1363(p) => p
- case Dummy1364(p) => p
- case Dummy1365(p) => p
- case Dummy1366(p) => p
- case Dummy1367(p) => p
- case Dummy1368(p) => p
- case Dummy1369(p) => p
- case Dummy1370(p) => p
- case Dummy1371(p) => p
- case Dummy1372(p) => p
- case Dummy1373(p) => p
- case Dummy1374(p) => p
- case Dummy1375(p) => p
- case Dummy1376(p) => p
- case Dummy1377(p) => p
- case Dummy1378(p) => p
- case Dummy1379(p) => p
- case Dummy1380(p) => p
- case Dummy1381(p) => p
- case Dummy1382(p) => p
- case Dummy1383(p) => p
- case Dummy1384(p) => p
- case Dummy1385(p) => p
- case Dummy1386(p) => p
- case Dummy1387(p) => p
- case Dummy1388(p) => p
- case Dummy1389(p) => p
- case Dummy1390(p) => p
- case Dummy1391(p) => p
- case Dummy1392(p) => p
- case Dummy1393(p) => p
- case Dummy1394(p) => p
- case Dummy1395(p) => p
- case Dummy1396(p) => p
- case Dummy1397(p) => p
- case Dummy1398(p) => p
- case Dummy1399(p) => p
- case Dummy1400(p) => p
- case Dummy1401(p) => p
- case Dummy1402(p) => p
- case Dummy1403(p) => p
- case Dummy1404(p) => p
- case Dummy1405(p) => p
- case Dummy1406(p) => p
- case Dummy1407(p) => p
- case Dummy1408(p) => p
- case Dummy1409(p) => p
- case Dummy1410(p) => p
- case Dummy1411(p) => p
- case Dummy1412(p) => p
- case Dummy1413(p) => p
- case Dummy1414(p) => p
- case Dummy1415(p) => p
- case Dummy1416(p) => p
- case Dummy1417(p) => p
- case Dummy1418(p) => p
- case Dummy1419(p) => p
- case Dummy1420(p) => p
- case Dummy1421(p) => p
- case Dummy1422(p) => p
- case Dummy1423(p) => p
- case Dummy1424(p) => p
- case Dummy1425(p) => p
- case Dummy1426(p) => p
- case Dummy1427(p) => p
- case Dummy1428(p) => p
- case Dummy1429(p) => p
- case Dummy1430(p) => p
- case Dummy1431(p) => p
- case Dummy1432(p) => p
- case Dummy1433(p) => p
- case Dummy1434(p) => p
- case Dummy1435(p) => p
- case Dummy1436(p) => p
- case Dummy1437(p) => p
- case Dummy1438(p) => p
- case Dummy1439(p) => p
- case Dummy1440(p) => p
- case Dummy1441(p) => p
- case Dummy1442(p) => p
- case Dummy1443(p) => p
- case Dummy1444(p) => p
- case Dummy1445(p) => p
- case Dummy1446(p) => p
- case Dummy1447(p) => p
- case Dummy1448(p) => p
- case Dummy1449(p) => p
- case Dummy1450(p) => p
- case Dummy1451(p) => p
- case Dummy1452(p) => p
- case Dummy1453(p) => p
- case Dummy1454(p) => p
- case Dummy1455(p) => p
- case Dummy1456(p) => p
- case Dummy1457(p) => p
- case Dummy1458(p) => p
- case Dummy1459(p) => p
- case Dummy1460(p) => p
- case Dummy1461(p) => p
- case Dummy1462(p) => p
- case Dummy1463(p) => p
- case Dummy1464(p) => p
- case Dummy1465(p) => p
- case Dummy1466(p) => p
- case Dummy1467(p) => p
- case Dummy1468(p) => p
- case Dummy1469(p) => p
- case Dummy1470(p) => p
- case Dummy1471(p) => p
- case Dummy1472(p) => p
- case Dummy1473(p) => p
- case Dummy1474(p) => p
- case Dummy1475(p) => p
- case Dummy1476(p) => p
- case Dummy1477(p) => p
- case Dummy1478(p) => p
- case Dummy1479(p) => p
- case Dummy1480(p) => p
- case Dummy1481(p) => p
- case Dummy1482(p) => p
- case Dummy1483(p) => p
- case Dummy1484(p) => p
- case Dummy1485(p) => p
- case Dummy1486(p) => p
- case Dummy1487(p) => p
- case Dummy1488(p) => p
- case Dummy1489(p) => p
- case Dummy1490(p) => p
- case Dummy1491(p) => p
- case Dummy1492(p) => p
- case Dummy1493(p) => p
- case Dummy1494(p) => p
- case Dummy1495(p) => p
- case Dummy1496(p) => p
- case Dummy1497(p) => p
- case Dummy1498(p) => p
- case Dummy1499(p) => p
- case Dummy1500(p) => p
- case Dummy1501(p) => p
- case Dummy1502(p) => p
- case Dummy1503(p) => p
- case Dummy1504(p) => p
- case Dummy1505(p) => p
- case Dummy1506(p) => p
- case Dummy1507(p) => p
- case Dummy1508(p) => p
- case Dummy1509(p) => p
- case Dummy1510(p) => p
- case Dummy1511(p) => p
- case Dummy1512(p) => p
- case Dummy1513(p) => p
- case Dummy1514(p) => p
- case Dummy1515(p) => p
- case Dummy1516(p) => p
- case Dummy1517(p) => p
- case Dummy1518(p) => p
- case Dummy1519(p) => p
- case Dummy1520(p) => p
- case Dummy1521(p) => p
- case Dummy1522(p) => p
- case Dummy1523(p) => p
- case Dummy1524(p) => p
- case Dummy1525(p) => p
- case Dummy1526(p) => p
- case Dummy1527(p) => p
- case Dummy1528(p) => p
- case Dummy1529(p) => p
- case Dummy1530(p) => p
- case Dummy1531(p) => p
- case Dummy1532(p) => p
- case Dummy1533(p) => p
- case Dummy1534(p) => p
- case Dummy1535(p) => p
- case Dummy1536(p) => p
- case Dummy1537(p) => p
- case Dummy1538(p) => p
- case Dummy1539(p) => p
- case Dummy1540(p) => p
- case Dummy1541(p) => p
- case Dummy1542(p) => p
- case Dummy1543(p) => p
- case Dummy1544(p) => p
- case Dummy1545(p) => p
- case Dummy1546(p) => p
- case Dummy1547(p) => p
- case Dummy1548(p) => p
- case Dummy1549(p) => p
- case Dummy1550(p) => p
- case Dummy1551(p) => p
- case Dummy1552(p) => p
- case Dummy1553(p) => p
- case Dummy1554(p) => p
- case Dummy1555(p) => p
- case Dummy1556(p) => p
- case Dummy1557(p) => p
- case Dummy1558(p) => p
- case Dummy1559(p) => p
- case Dummy1560(p) => p
- case Dummy1561(p) => p
- case Dummy1562(p) => p
- case Dummy1563(p) => p
- case Dummy1564(p) => p
- case Dummy1565(p) => p
- case Dummy1566(p) => p
- case Dummy1567(p) => p
- case Dummy1568(p) => p
- case Dummy1569(p) => p
- case Dummy1570(p) => p
- case Dummy1571(p) => p
- case Dummy1572(p) => p
- case Dummy1573(p) => p
- case Dummy1574(p) => p
- case Dummy1575(p) => p
- case Dummy1576(p) => p
- case Dummy1577(p) => p
- case Dummy1578(p) => p
- case Dummy1579(p) => p
- case Dummy1580(p) => p
- case Dummy1581(p) => p
- case Dummy1582(p) => p
- case Dummy1583(p) => p
- case Dummy1584(p) => p
- case Dummy1585(p) => p
- case Dummy1586(p) => p
- case Dummy1587(p) => p
- case Dummy1588(p) => p
- case Dummy1589(p) => p
- case Dummy1590(p) => p
- case Dummy1591(p) => p
- case Dummy1592(p) => p
- case Dummy1593(p) => p
- case Dummy1594(p) => p
- case Dummy1595(p) => p
- case Dummy1596(p) => p
- case Dummy1597(p) => p
- case Dummy1598(p) => p
- case Dummy1599(p) => p
- case Dummy1600(p) => p
- case Dummy1601(p) => p
- case Dummy1602(p) => p
- case Dummy1603(p) => p
- case Dummy1604(p) => p
- case Dummy1605(p) => p
- case Dummy1606(p) => p
- case Dummy1607(p) => p
- case Dummy1608(p) => p
- case Dummy1609(p) => p
- case Dummy1610(p) => p
- case Dummy1611(p) => p
- case Dummy1612(p) => p
- case Dummy1613(p) => p
- case Dummy1614(p) => p
- case Dummy1615(p) => p
- case Dummy1616(p) => p
- case Dummy1617(p) => p
- case Dummy1618(p) => p
- case Dummy1619(p) => p
- case Dummy1620(p) => p
- case Dummy1621(p) => p
- case Dummy1622(p) => p
- case Dummy1623(p) => p
- case Dummy1624(p) => p
- case Dummy1625(p) => p
- case Dummy1626(p) => p
- case Dummy1627(p) => p
- case Dummy1628(p) => p
- case Dummy1629(p) => p
- case Dummy1630(p) => p
- case Dummy1631(p) => p
- case Dummy1632(p) => p
- case Dummy1633(p) => p
- case Dummy1634(p) => p
- case Dummy1635(p) => p
- case Dummy1636(p) => p
- case Dummy1637(p) => p
- case Dummy1638(p) => p
- case Dummy1639(p) => p
- case Dummy1640(p) => p
- case Dummy1641(p) => p
- case Dummy1642(p) => p
- case Dummy1643(p) => p
- case Dummy1644(p) => p
- case Dummy1645(p) => p
- case Dummy1646(p) => p
- case Dummy1647(p) => p
- case Dummy1648(p) => p
- case Dummy1649(p) => p
- case Dummy1650(p) => p
- case Dummy1651(p) => p
- case Dummy1652(p) => p
- case Dummy1653(p) => p
- case Dummy1654(p) => p
- case Dummy1655(p) => p
- case Dummy1656(p) => p
- case Dummy1657(p) => p
- case Dummy1658(p) => p
- case Dummy1659(p) => p
- case Dummy1660(p) => p
- case Dummy1661(p) => p
- case Dummy1662(p) => p
- case Dummy1663(p) => p
- case Dummy1664(p) => p
- case Dummy1665(p) => p
- case Dummy1666(p) => p
- case Dummy1667(p) => p
- case Dummy1668(p) => p
- case Dummy1669(p) => p
- case Dummy1670(p) => p
- case Dummy1671(p) => p
- case Dummy1672(p) => p
- case Dummy1673(p) => p
- case Dummy1674(p) => p
- case Dummy1675(p) => p
- case Dummy1676(p) => p
- case Dummy1677(p) => p
- case Dummy1678(p) => p
- case Dummy1679(p) => p
- case Dummy1680(p) => p
- case Dummy1681(p) => p
- case Dummy1682(p) => p
- case Dummy1683(p) => p
- case Dummy1684(p) => p
- case Dummy1685(p) => p
- case Dummy1686(p) => p
- case Dummy1687(p) => p
- case Dummy1688(p) => p
- case Dummy1689(p) => p
- case Dummy1690(p) => p
- case Dummy1691(p) => p
- case Dummy1692(p) => p
- case Dummy1693(p) => p
- case Dummy1694(p) => p
- case Dummy1695(p) => p
- case Dummy1696(p) => p
- case Dummy1697(p) => p
- case Dummy1698(p) => p
- case Dummy1699(p) => p
- case Dummy1700(p) => p
- case Dummy1701(p) => p
- case Dummy1702(p) => p
- case Dummy1703(p) => p
- case Dummy1704(p) => p
- case Dummy1705(p) => p
- case Dummy1706(p) => p
- case Dummy1707(p) => p
- case Dummy1708(p) => p
- case Dummy1709(p) => p
- case Dummy1710(p) => p
- case Dummy1711(p) => p
- case Dummy1712(p) => p
- case Dummy1713(p) => p
- case Dummy1714(p) => p
- case Dummy1715(p) => p
- case Dummy1716(p) => p
- case Dummy1717(p) => p
- case Dummy1718(p) => p
- case Dummy1719(p) => p
- case Dummy1720(p) => p
- case Dummy1721(p) => p
- case Dummy1722(p) => p
- case Dummy1723(p) => p
- case Dummy1724(p) => p
- case Dummy1725(p) => p
- case Dummy1726(p) => p
- case Dummy1727(p) => p
- case Dummy1728(p) => p
- case Dummy1729(p) => p
- case Dummy1730(p) => p
- case Dummy1731(p) => p
- case Dummy1732(p) => p
- case Dummy1733(p) => p
- case Dummy1734(p) => p
- case Dummy1735(p) => p
- case Dummy1736(p) => p
- case Dummy1737(p) => p
- case Dummy1738(p) => p
- case Dummy1739(p) => p
- case Dummy1740(p) => p
- case Dummy1741(p) => p
- case Dummy1742(p) => p
- case Dummy1743(p) => p
- case Dummy1744(p) => p
- case Dummy1745(p) => p
- case Dummy1746(p) => p
- case Dummy1747(p) => p
- case Dummy1748(p) => p
- case Dummy1749(p) => p
- case Dummy1750(p) => p
- case Dummy1751(p) => p
- case Dummy1752(p) => p
- case Dummy1753(p) => p
- case Dummy1754(p) => p
- case Dummy1755(p) => p
- case Dummy1756(p) => p
- case Dummy1757(p) => p
- case Dummy1758(p) => p
- case Dummy1759(p) => p
- case Dummy1760(p) => p
- case Dummy1761(p) => p
- case Dummy1762(p) => p
- case Dummy1763(p) => p
- case Dummy1764(p) => p
- case Dummy1765(p) => p
- case Dummy1766(p) => p
- case Dummy1767(p) => p
- case Dummy1768(p) => p
- case Dummy1769(p) => p
- case Dummy1770(p) => p
- case Dummy1771(p) => p
- case Dummy1772(p) => p
- case Dummy1773(p) => p
- case Dummy1774(p) => p
- case Dummy1775(p) => p
- case Dummy1776(p) => p
- case Dummy1777(p) => p
- case Dummy1778(p) => p
- case Dummy1779(p) => p
- case Dummy1780(p) => p
- case Dummy1781(p) => p
- case Dummy1782(p) => p
- case Dummy1783(p) => p
- case Dummy1784(p) => p
- case Dummy1785(p) => p
- case Dummy1786(p) => p
- case Dummy1787(p) => p
- case Dummy1788(p) => p
- case Dummy1789(p) => p
- case Dummy1790(p) => p
- case Dummy1791(p) => p
- case Dummy1792(p) => p
- case Dummy1793(p) => p
- case Dummy1794(p) => p
- case Dummy1795(p) => p
- case Dummy1796(p) => p
- case Dummy1797(p) => p
- case Dummy1798(p) => p
- case Dummy1799(p) => p
- case Dummy1800(p) => p
- case Dummy1801(p) => p
- case Dummy1802(p) => p
- case Dummy1803(p) => p
- case Dummy1804(p) => p
- case Dummy1805(p) => p
- case Dummy1806(p) => p
- case Dummy1807(p) => p
- case Dummy1808(p) => p
- case Dummy1809(p) => p
- case Dummy1810(p) => p
- case Dummy1811(p) => p
- case Dummy1812(p) => p
- case Dummy1813(p) => p
- case Dummy1814(p) => p
- case Dummy1815(p) => p
- case Dummy1816(p) => p
- case Dummy1817(p) => p
- case Dummy1818(p) => p
- case Dummy1819(p) => p
- case Dummy1820(p) => p
- case Dummy1821(p) => p
- case Dummy1822(p) => p
- case Dummy1823(p) => p
- case Dummy1824(p) => p
- case Dummy1825(p) => p
- case Dummy1826(p) => p
- case Dummy1827(p) => p
- case Dummy1828(p) => p
- case Dummy1829(p) => p
- case Dummy1830(p) => p
- case Dummy1831(p) => p
- case Dummy1832(p) => p
- case Dummy1833(p) => p
- case Dummy1834(p) => p
- case Dummy1835(p) => p
- case Dummy1836(p) => p
- case Dummy1837(p) => p
- case Dummy1838(p) => p
- case Dummy1839(p) => p
- case Dummy1840(p) => p
- case Dummy1841(p) => p
- case Dummy1842(p) => p
- case Dummy1843(p) => p
- case Dummy1844(p) => p
- case Dummy1845(p) => p
- case Dummy1846(p) => p
- case Dummy1847(p) => p
- case Dummy1848(p) => p
- case Dummy1849(p) => p
- case Dummy1850(p) => p
- case Dummy1851(p) => p
- case Dummy1852(p) => p
- case Dummy1853(p) => p
- case Dummy1854(p) => p
- case Dummy1855(p) => p
- case Dummy1856(p) => p
- case Dummy1857(p) => p
- case Dummy1858(p) => p
- case Dummy1859(p) => p
- case Dummy1860(p) => p
- case Dummy1861(p) => p
- case Dummy1862(p) => p
- case Dummy1863(p) => p
- case Dummy1864(p) => p
- case Dummy1865(p) => p
- case Dummy1866(p) => p
- case Dummy1867(p) => p
- case Dummy1868(p) => p
- case Dummy1869(p) => p
- case Dummy1870(p) => p
- case Dummy1871(p) => p
- case Dummy1872(p) => p
- case Dummy1873(p) => p
- case Dummy1874(p) => p
- case Dummy1875(p) => p
- case Dummy1876(p) => p
- case Dummy1877(p) => p
- case Dummy1878(p) => p
- case Dummy1879(p) => p
- case Dummy1880(p) => p
- case Dummy1881(p) => p
- case Dummy1882(p) => p
- case Dummy1883(p) => p
- case Dummy1884(p) => p
- case Dummy1885(p) => p
- case Dummy1886(p) => p
- case Dummy1887(p) => p
- case Dummy1888(p) => p
- case Dummy1889(p) => p
- case Dummy1890(p) => p
- case Dummy1891(p) => p
- case Dummy1892(p) => p
- case Dummy1893(p) => p
- case Dummy1894(p) => p
- case Dummy1895(p) => p
- case Dummy1896(p) => p
- case Dummy1897(p) => p
- case Dummy1898(p) => p
- case Dummy1899(p) => p
- case Dummy1900(p) => p
- case Dummy1901(p) => p
- case Dummy1902(p) => p
- case Dummy1903(p) => p
- case Dummy1904(p) => p
- case Dummy1905(p) => p
- case Dummy1906(p) => p
- case Dummy1907(p) => p
- case Dummy1908(p) => p
- case Dummy1909(p) => p
- case Dummy1910(p) => p
- case Dummy1911(p) => p
- case Dummy1912(p) => p
- case Dummy1913(p) => p
- case Dummy1914(p) => p
- case Dummy1915(p) => p
- case Dummy1916(p) => p
- case Dummy1917(p) => p
- case Dummy1918(p) => p
- case Dummy1919(p) => p
- case Dummy1920(p) => p
- case Dummy1921(p) => p
- case Dummy1922(p) => p
- case Dummy1923(p) => p
- case Dummy1924(p) => p
- case Dummy1925(p) => p
- case Dummy1926(p) => p
- case Dummy1927(p) => p
- case Dummy1928(p) => p
- case Dummy1929(p) => p
- case Dummy1930(p) => p
- case Dummy1931(p) => p
- case Dummy1932(p) => p
- case Dummy1933(p) => p
- case Dummy1934(p) => p
- case Dummy1935(p) => p
- case Dummy1936(p) => p
- case Dummy1937(p) => p
- case Dummy1938(p) => p
- case Dummy1939(p) => p
- case Dummy1940(p) => p
- case Dummy1941(p) => p
- case Dummy1942(p) => p
- case Dummy1943(p) => p
- case Dummy1944(p) => p
- case Dummy1945(p) => p
- case Dummy1946(p) => p
- case Dummy1947(p) => p
- case Dummy1948(p) => p
- case Dummy1949(p) => p
- case Dummy1950(p) => p
- case Dummy1951(p) => p
- case Dummy1952(p) => p
- case Dummy1953(p) => p
- case Dummy1954(p) => p
- case Dummy1955(p) => p
- case Dummy1956(p) => p
- case Dummy1957(p) => p
- case Dummy1958(p) => p
- case Dummy1959(p) => p
- case Dummy1960(p) => p
- case Dummy1961(p) => p
- case Dummy1962(p) => p
- case Dummy1963(p) => p
- case Dummy1964(p) => p
- case Dummy1965(p) => p
- case Dummy1966(p) => p
- case Dummy1967(p) => p
- case Dummy1968(p) => p
- case Dummy1969(p) => p
- case Dummy1970(p) => p
- case Dummy1971(p) => p
- case Dummy1972(p) => p
- case Dummy1973(p) => p
- case Dummy1974(p) => p
- case Dummy1975(p) => p
- case Dummy1976(p) => p
- case Dummy1977(p) => p
- case Dummy1978(p) => p
- case Dummy1979(p) => p
- case Dummy1980(p) => p
- case Dummy1981(p) => p
- case Dummy1982(p) => p
- case Dummy1983(p) => p
- case Dummy1984(p) => p
- case Dummy1985(p) => p
- case Dummy1986(p) => p
- case Dummy1987(p) => p
- case Dummy1988(p) => p
- case Dummy1989(p) => p
- case Dummy1990(p) => p
- case Dummy1991(p) => p
- case Dummy1992(p) => p
- case Dummy1993(p) => p
- case Dummy1994(p) => p
- case Dummy1995(p) => p
- case Dummy1996(p) => p
- case Dummy1997(p) => p
- case Dummy1998(p) => p
- case Dummy1999(p) => p
-}
-}
diff --git a/test/benchmarks/bench b/test/benchmarks/bench
deleted file mode 100755
index 3aa7e7468c..0000000000
--- a/test/benchmarks/bench
+++ /dev/null
@@ -1,63 +0,0 @@
-
-#################################################################
-#
-# A simple script used to rebuild benchmarks using fsc and then run them.
-# If you need to rebuild, use:
-#
-# ./bench <arguments>
-#
-# Omitting <arguments> will print more information.
-# If you don't want to rebuild:
-#
-# ./bench skip <same-args-as-above>
-#
-#################################################################
-
-
-TOP_DIR=$PWD
-# build/pack for ant, target/pack for sbt
-SCALA_BUILD_DIR=../../target/pack
-SRC_DIR=src/
-TARGET_DIR=target
-CLASS_DIR=$TARGET_DIR/classes
-
-FSC=$SCALA_BUILD_DIR/bin/fsc
-SCALA_LIBS_PATH=$SCALA_BUILD_DIR/lib
-CLASSPATH=$SCALA_LIBS_PATH/scala-library.jar:lib/jsr166_and_extra.jar
-
-ARTIFACT=benchmarks.jar
-ARTIFACT_PATH=$TARGET_DIR/$ARTIFACT
-
-
-if [ "$1" != "skip" ]
-then
- # fetch source file list
- find $SRC_DIR -name *.scala -print > source.list
-
- # recompile with fsc
- $FSC -cp $CLASSPATH -d $CLASS_DIR @source.list
-
- # copy files
- cd $SRC_DIR
- cp -r * ../$CLASS_DIR
- cd ..
-
- # jar it up
- rm $ARTIFACT_PATH
- cd $CLASS_DIR
- jar cf $ARTIFACT .
- mv $ARTIFACT $TOP_DIR/$ARTIFACT_PATH
- cd $TOP_DIR
-fi
-
-# run a benchmark
-RUNCOMMAND="java -Xms256m -Xmx512m -server -cp $CLASSPATH:$ARTIFACT_PATH scala.collection.parallel.Benchmarking "
-if [ "$1" != skip ]
-then
- $RUNCOMMAND "$@"
-else
- $RUNCOMMAND $2 $3 $4 $5 $6 $7 $8
-fi
-
-
-
diff --git a/test/benchmarks/lib/jsr166_and_extra.jar.desired.sha1 b/test/benchmarks/lib/jsr166_and_extra.jar.desired.sha1
deleted file mode 100644
index c879571eae..0000000000
--- a/test/benchmarks/lib/jsr166_and_extra.jar.desired.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0392ecdeb306263c471ce51fa368223388b82b61 ?jsr166_and_extra.jar
diff --git a/test/benchmarks/source.list b/test/benchmarks/source.list
deleted file mode 100644
index c5d5f7f8fe..0000000000
--- a/test/benchmarks/source.list
+++ /dev/null
@@ -1,79 +0,0 @@
-src/scala/collection/parallel/Benchmarking.scala
-src/scala/collection/parallel/benchmarks/parallel_view/SeqViewBenches.scala
-src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala
-src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala
-src/scala/collection/parallel/benchmarks/arrays/ObjectAccess.scala
-src/scala/collection/parallel/benchmarks/arrays/IntAccess.scala
-src/scala/collection/parallel/benchmarks/arrays/Resetting.scala
-src/scala/collection/parallel/benchmarks/arrays/Arrays.scala
-src/scala/collection/parallel/benchmarks/arrays/UnknownManif.scala
-src/scala/collection/parallel/benchmarks/arrays/Dummy.scala
-src/scala/collection/parallel/benchmarks/parallel_array/FlatMapLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/FilterLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/CountHeavy.scala
-src/scala/collection/parallel/benchmarks/parallel_array/PartitionLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/SliceFew.scala
-src/scala/collection/parallel/benchmarks/parallel_array/SplitHalf.scala
-src/scala/collection/parallel/benchmarks/parallel_array/PadToDouble.scala
-src/scala/collection/parallel/benchmarks/parallel_array/IntersectHalf.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ForallLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/AggregateLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/SumLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/MinLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/CountList.scala
-src/scala/collection/parallel/benchmarks/parallel_array/PatchHalf.scala
-src/scala/collection/parallel/benchmarks/parallel_array/GroupBy.scala
-src/scala/collection/parallel/benchmarks/parallel_array/DiffHalf.scala
-src/scala/collection/parallel/benchmarks/parallel_array/TakeMany.scala
-src/scala/collection/parallel/benchmarks/parallel_array/PartialMapLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ScanLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/Reverse.scala
-src/scala/collection/parallel/benchmarks/parallel_array/SpanLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/PlusPlus.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ReduceNew.scala
-src/scala/collection/parallel/benchmarks/parallel_array/Resettable.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ReducePrime.scala
-src/scala/collection/parallel/benchmarks/parallel_array/DropMany.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ReduceList.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ScanMedium.scala
-src/scala/collection/parallel/benchmarks/parallel_array/MatrixMultiplication.scala
-src/scala/collection/parallel/benchmarks/parallel_array/SliceMedium.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ReverseMap.scala
-src/scala/collection/parallel/benchmarks/parallel_array/Companion.scala
-src/scala/collection/parallel/benchmarks/parallel_array/CountLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/IndexWhere.scala
-src/scala/collection/parallel/benchmarks/parallel_array/LastIndexWhere.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ReduceLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/CopyToArray.scala
-src/scala/collection/parallel/benchmarks/parallel_array/MapLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/RemoveDuplicates.scala
-src/scala/collection/parallel/benchmarks/parallel_array/SliceMany.scala
-src/scala/collection/parallel/benchmarks/parallel_array/TakeWhileLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/SegmentLength.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala
-src/scala/collection/parallel/benchmarks/parallel_array/FindLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ForallQuickStop.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ForallStop80k.scala
-src/scala/collection/parallel/benchmarks/parallel_array/SameElementsLong.scala
-src/scala/collection/parallel/benchmarks/parallel_array/SequentialOps.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ForallHeavy.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ExistsLight.scala
-src/scala/collection/parallel/benchmarks/parallel_array/ReduceHeavy.scala
-src/scala/collection/parallel/benchmarks/parallel_array/Corresponds.scala
-src/scala/collection/parallel/benchmarks/generic/Operators.scala
-src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala
-src/scala/collection/parallel/benchmarks/generic/Dummy.scala
-src/scala/collection/parallel/benchmarks/parallel_range/RangeBenches.scala
-src/scala/collection/parallel/benchmarks/misc/Dictionary.scala
-src/scala/collection/parallel/benchmarks/misc/Loader.scala
-src/scala/collection/parallel/benchmarks/misc/Coder.scala
-src/scala/collection/parallel/benchmarks/Bench.scala
-src/scala/collection/parallel/benchmarks/hashtries/Foreach.scala
-src/scala/collection/parallel/benchmarks/hashtries/Combine.scala
-src/scala/collection/parallel/benchmarks/hashtries/MultipleCombine.scala
-src/scala/collection/parallel/benchmarks/hashtries/Iterate.scala
-src/scala/collection/parallel/benchmarks/hashtries/Construct.scala
-src/scala/collection/parallel/benchmarks/hashtries/IntInit.scala
-src/scala/collection/parallel/benchmarks/hashtries/Lookup.scala
-src/scala/collection/parallel/benchmarks/hashtries/ParallelHashTries.scala
diff --git a/test/benchmarks/src/scala/collection/immutable/range-bench.scala b/test/benchmarks/src/scala/collection/immutable/range-bench.scala
deleted file mode 100644
index e167ff04e8..0000000000
--- a/test/benchmarks/src/scala/collection/immutable/range-bench.scala
+++ /dev/null
@@ -1,61 +0,0 @@
-package scala.collection.immutable
-package benchmarks
-
-object RangeTest {
- // not inlined any more, needs investigation
- //
- // class XXS {
- // private val array = Array.range(0, 100)
- // def tst = { var sum = 0; for (i <- 0 until array.length) sum += array(i); sum }
- // }
-
- var x: Int = 0
-
- def foreachSum(max: Int): Int = {
- var sum = 0
- 1 to max foreach (sum += _)
- sum
- }
- def whileSum(max: Int) = {
- var sum = 0
- var num = 1
- while (num <= max) {
- sum += num
- num += 1
- }
- sum
- }
-
- def show(max: Int, foreachNanos: Long, whileNanos: Long) {
- val winner = if (foreachNanos < whileNanos) "foreachSum" else "whileSum"
- val ratio = if (foreachNanos < whileNanos) foreachNanos.toDouble / whileNanos else whileNanos.toDouble / foreachNanos
- println("1 to %d:, %12s wins, %.3f: foreach %.3f while %.3f".format(
- max, winner, ratio,
- foreachNanos.toDouble / 1000000L,
- whileNanos.toDouble / 1000000L)
- )
- }
-
- def run(max: Int) = {
- val foreachFirst = util.Random.nextBoolean
- val t1 = System.nanoTime
- x = if (foreachFirst) foreachSum(max) else whileSum(max)
- val t2 = System.nanoTime
- x = if (foreachFirst) whileSum(max) else foreachSum(max)
- val t3 = System.nanoTime
-
- val foreachNanos = if (foreachFirst) t2 - t1 else t3 - t2
- val whileNanos = if (foreachFirst) t3 - t2 else t2 - t1
- show(max, foreachNanos, whileNanos)
- }
-
- def main(args: Array[String]): Unit = {
- var max = if (args.isEmpty) 100 else args(0).toInt
- while (max > 0) {
- run(max)
- run(max)
- run(max)
- max += (max / 7)
- }
- }
-}
diff --git a/test/benchmarks/src/scala/collection/mutable/hashtable-bench.scala b/test/benchmarks/src/scala/collection/mutable/hashtable-bench.scala
deleted file mode 100644
index c01e7cb46e..0000000000
--- a/test/benchmarks/src/scala/collection/mutable/hashtable-bench.scala
+++ /dev/null
@@ -1,61 +0,0 @@
-import scala.collection.mutable.HashMap
-
-object Test {
- var dummy: Long = 0L
- var _foreach: Long = 0L
- var _iterator: Long = 0L
-
- def numbers: Seq[Int] = 1 to 1000000
- val map: HashMap[Int, Int] = HashMap(numbers zip numbers: _*)
-
- @inline final def timed(body: => Unit): Long = {
- val start = System.nanoTime
- body
- System.nanoTime - start
- }
-
- def go(xs: Iterable[Int], reps: Int) = {
- _foreach = 0L
- _iterator = 0L
-
- 0 until reps foreach { _ =>
- _foreach += timed(xs foreach (dummy += _))
- _iterator += timed(xs.iterator foreach (dummy += _))
- }
-
- " foreach avg " + (_foreach / reps) + "\n iterator avg " + (_iterator / reps) + "\n"
- }
-
- def go2(xs: collection.Map[Int, Int], reps: Int) = {
- _foreach = 0L
- _iterator = 0L
-
- def incDummy(nums: (Int, Int)) = {
- dummy += nums._1
- dummy -= nums._2
- }
-
- 0 until reps foreach { _ =>
- _foreach += timed(xs foreach incDummy)
- _iterator += timed(xs.iterator foreach incDummy)
- }
-
- " foreach avg " + (_foreach / reps) + "\n iterator avg " + (_iterator / reps) + "\n"
- }
-
- def main(args: Array[String]): Unit = {
- println("map.keys:")
- go(map.keys, 10) // warm
- println(go(map.keys, 10))
-
- println("map.values:")
- go(map.values, 10) // warm
- println(go(map.values, 10))
-
- println("map:")
- go2(map, 10) // warm
- println(go2(map, 10))
-
- println("// pay me no mind ... " + dummy)
- }
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/Benchmarking.scala b/test/benchmarks/src/scala/collection/parallel/Benchmarking.scala
deleted file mode 100644
index bd75764636..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/Benchmarking.scala
+++ /dev/null
@@ -1,223 +0,0 @@
-package scala.collection.parallel
-
-
-import scala.collection.mutable.LinkedHashSet
-
-import benchmarks._
-
-
-/**
- * All benchmarks are registered here.
- *
- * @author prokopec
- */
-trait BenchmarkRegister {
-
- val benchcreators = LinkedHashSet[BenchCompanion]()
-
- def register(companion: BenchCompanion) = benchcreators += companion
-
- // parallel array benchmarks
- register(parallel_array.ReduceLight)
- register(parallel_array.ReduceNew)
- register(parallel_array.ReduceList)
- register(parallel_array.ReducePrime)
- register(parallel_array.ReduceHeavy)
- register(parallel_array.CountLight)
- register(parallel_array.CountList)
- register(parallel_array.CountHeavy)
- register(parallel_array.ForeachLight)
- register(parallel_array.ForeachHeavy)
- register(parallel_array.SumLight)
- register(parallel_array.MinLight)
- register(parallel_array.MapLight)
- register(parallel_array.FilterLight)
- register(parallel_array.PartitionLight)
- register(parallel_array.PartialMapLight)
- register(parallel_array.FlatMapLight)
- register(parallel_array.PlusPlus)
- register(parallel_array.ForallLight)
- register(parallel_array.ForallQuickStop)
- register(parallel_array.ForallStop80k)
- register(parallel_array.ForallHeavy)
- register(parallel_array.ExistsLight)
- register(parallel_array.FindLight)
- register(parallel_array.TakeMany)
- register(parallel_array.DropMany)
- register(parallel_array.SliceMany)
- register(parallel_array.SliceMedium)
- register(parallel_array.SliceFew)
- register(parallel_array.SplitHalf)
- register(parallel_array.TakeWhileLight)
- register(parallel_array.SpanLight)
- register(parallel_array.CopyToArray)
- register(parallel_array.SegmentLength)
- register(parallel_array.IndexWhere)
- register(parallel_array.LastIndexWhere)
- register(parallel_array.Reverse)
- register(parallel_array.ReverseMap)
- register(parallel_array.SameElementsLong)
- register(parallel_array.Corresponds)
- register(parallel_array.DiffHalf)
- register(parallel_array.IntersectHalf)
- register(parallel_array.RemoveDuplicates)
- register(parallel_array.PatchHalf)
- register(parallel_array.PadToDouble)
- register(parallel_array.AggregateLight)
- register(parallel_array.ScanLight)
- register(parallel_array.ScanMedium)
- register(parallel_array.GroupByLight)
- register(parallel_array.MatrixMultiplication)
-
- // parallel views
- register(parallel_view.DummyViewBenchList.Reduce)
- register(parallel_view.DummyViewBenchList.MediumReduce)
- register(parallel_view.DummyViewBenchList.ModifyThenReduce)
- register(parallel_view.DummyViewBenchList.ModifyThenForce)
- register(parallel_view.DummyViewBenchList.Iteration)
- register(parallel_view.DummyViewBenchList.IterationS)
- register(parallel_view.DummyViewBenchList.IterationM)
- register(parallel_view.DummyViewBenchList.IterationA)
- register(parallel_view.DummyViewBenchList.IterationZ)
- register(parallel_view.DummyViewBenchList.IterationP)
-
- // parallel ranges
- register(parallel_range.RangeBenches.Reduce)
- register(parallel_range.RangeBenches.ReduceMedium)
- register(parallel_range.RangeBenches.ForeachAdd)
- register(parallel_range.RangeBenches.ForeachAddCollatz)
- register(parallel_range.RangeBenches.ForeachModify)
- register(parallel_range.RangeBenches.ForeachModifyMedium)
- register(parallel_range.RangeBenches.ForeachModifyHeavy)
- register(parallel_range.RangeBenches.MapLight)
- register(parallel_range.RangeBenches.MapMedium)
-
- // array benchmarks
- register(arrays.ObjectAccess)
- register(arrays.IntAccess)
-
- // hash benchmarks
- register(hashtries.Foreach)
- register(hashtries.Iterate)
- register(hashtries.Construct)
- register(hashtries.Lookup)
- register(hashtries.Combine)
- register(hashtries.MultipleCombine)
-
- // parallel hash trie benchmarks
- register(hashtries.RefParHashTrieBenches.Reduce)
- register(hashtries.RefParHashTrieBenches.ReduceMedium)
- register(hashtries.RefParHashTrieBenches.Reduce2)
- register(hashtries.RefParHashTrieBenches.Map)
- register(hashtries.RefParHashTrieBenches.Map2)
-
- // parallel hash table map benchmarks
- register(hashtables.RefParHashTableBenches.Reduce)
- register(hashtables.RefParHashTableBenches.Reduce2)
- register(hashtables.RefParHashTableBenches.Foreach)
- register(hashtables.RefParHashTableBenches.ForeachSet)
- register(hashtables.RefParHashTableBenches.Map)
- register(hashtables.RefParHashTableBenches.Map2)
- register(hashtables.RefParHashTableBenches.HeavyMap)
- register(hashtables.RefParHashTableBenches.Filter)
- register(hashtables.RefParHashTableBenches.FlatMap)
- register(hashtables.RefParHashTableBenches.FlatMap2)
-
- // parallel hash table set benchmarks
- register(hashtables.RefParHashTableSetBenches.Reduce)
- register(hashtables.RefParHashTableSetBenches.Reduce2)
- register(hashtables.RefParHashTableSetBenches.Foreach)
- register(hashtables.RefParHashTableSetBenches.ForeachSet)
- register(hashtables.RefParHashTableSetBenches.Map)
- register(hashtables.RefParHashTableSetBenches.Map2)
- register(hashtables.RefParHashTableSetBenches.HeavyMap)
- register(hashtables.RefParHashTableSetBenches.Filter)
- register(hashtables.RefParHashTableSetBenches.FlatMap)
-
- // general examples
- register(misc.Coder)
- register(misc.Loader)
-}
-
-
-/**
- * Serves as an entrypoint to run all the benchmarks.
- */
-object Benchmarking extends BenchmarkRegister {
-
- def printHelp {
- println("Must enter at least four arguments: <collection> <benchmark> <size of the collection> <type>")
- println(" Example: ParArray reduce-light 50000 par")
- println(" Example: ParArray -all 50000 par")
- println
- println("General synthax: <collection> <benchmark> <size> <type> <parallelism-level>")
- println(" <collection> - name of the collection to test, `-all` runs benchmarks for all collections")
- println(" <benchmark> - name of the specific benchmark, `-all` runs all benchmarks for the chosen collections")
- println(" <size> - the size (number of elements) of the collection, or `-default` for default size per benchmark")
- println(" <type> - `seq` for benchmarking sequential version of the functionality")
- println(" `par` for benchmarking parallel version of the functionality")
- println(" `<something-else>` for running comparison benchmarks")
- println(" `-all` for running sequential, parallel and comparison benchmarks")
- println(" <parallelism-level> - the level of parallelism used (default 2)")
- }
-
- def otherOptions(args: Array[String]) {
- if (args.length == 0) printHelp
- else args(0) match {
- case "-list" => // lists all benchmarks
- for (bc <- benchcreators) println(bc.fullname)
- case _ => printHelp
- }
- }
-
- def main(args: Array[String]) {
- if (args.length < 4) {
- otherOptions(args)
- return
- }
-
- val collname = args(0)
- val benchname = args(1)
- val size = if (args(2) == "-default") -1 else args(2).toInt
- val tpe = args(3)
- val parlevel = if (args.length >= 5) args(4).toInt else 2
-
- // find all benchmarks to run
- val benches = benchcreators.filter(comp => {
- (collname, benchname) match {
- case ("-all", "-all") => true
- case ("-all", bn) if (benchname != "-all") => bn == comp.benchName
- case (cn, "-all") if (collname != "-all") => cn == comp.collectionName
- case (cn, bn) => cn == comp.collectionName && bn == comp.benchName
- }
- }).flatMap(comp => {
- val collsz = if (size != -1) size else comp.defaultSize
- if (tpe != "-all") List(comp.apply(collsz, parlevel, tpe))
- else for (benchtype <- "seq" :: "par" :: comp.comparisons)
- yield comp.apply(collsz, parlevel, benchtype)
- })
-
- println("Running benchmarks...")
- for (b <- benches) b.executeBenchmark
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/Bench.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/Bench.scala
deleted file mode 100644
index c20bbaeef1..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/Bench.scala
+++ /dev/null
@@ -1,126 +0,0 @@
-package scala.collection.parallel.benchmarks
-
-
-import scala.collection._
-import scala.testing.Benchmark
-
-
-
-trait BenchCompanion {
- def benchName: String
- def collectionName: String
- def fullname = collectionName + "." + benchName
- def defaultSize = 100000
- def comparisons = List[String]()
- def apply(sz: Int, parallelism: Int, what: String): Bench
-}
-
-
-/**
- * An interface for all benchmark classes.
- * A benchmark runs some functionality a prespecified number of times.
- */
-trait Bench extends Benchmark {
- val size: Int
-
- val parallelism: Int
-
- val runWhat: String
-
- /**
- * Name of the benchmark. Convention is for it to start with the name of the collection being
- * tested, continuing '.' and ending with the name of the specific functionality being benchmarked.
- * @return
- */
- def name: String = companion.fullname
- def collectionName: String = companion.collectionName
- def benchName: String = companion.benchName
-
- def companion: BenchCompanion
-
- def runseq: Unit
-
- def runpar: Unit
-
- /**
- * Describes the number of runs of the test.
- */
- val runs = 10
-
- /**
- * Returns the number of repetitions for this benchmark.
- */
- def repetitionsPerRun = 500
-
- /**
- * Resets the benchmark object. Typically, this means recreating
- * the collection being tested.
- */
- def reset: Unit
-
- /**
- * Returns a map of available comparison tests.
- */
- def comparisons: List[String] = companion.comparisons
-
- def comparison(name: String): Option[() => Unit] = comparisonMap.get(name)
-
- def comparisonMap: Map[String, () => Unit]
-
- def run = runWhat match {
- case "seq" => for (i <- 0 until repetitionsPerRun) runseq
- case "par" => for (i <- 0 until repetitionsPerRun) runpar
- case _ => comparison(runWhat) match {
- case Some(fun) => for (i <- 0 until repetitionsPerRun) fun()
- case None => throw new IllegalArgumentException("Unknown bench option: `" + runWhat +
- "`, need `seq`, `par` or one of: " + comparisons.mkString("`", "`, `", "`"))
- }
- }
-
- /**
- * Prints results of the benchmark. May be overridden in benchmarks.
- */
- def printResults {}
-
- def onEnd {}
-
- def executeBenchmark = {
- println("-----------------------")
- print(name + ", " + runWhat + ", par.=" + parallelism + ", sz=" + niceSize + ": ")
-
- val times = runBenchmark(runs)
-
- onEnd
-
- for (t <- times) print(t + " ")
- println
- printResults
- }
-
- private def niceSize = if (size < 1000 || size % 1000 != 0) size.toString else size / 1000 + "k"
-}
-
-
-trait HavingResult[T] extends Bench {
- var runresult: T = null.asInstanceOf[T]
-
- abstract override def printResults {
- println("result: " + (if (runresult != null) runresult else "<not set>"))
- super.printResults
- }
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Arrays.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Arrays.scala
deleted file mode 100644
index 39232122a9..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Arrays.scala
+++ /dev/null
@@ -1,63 +0,0 @@
-package scala.collection.parallel.benchmarks.arrays
-
-
-
-
-
-
-
-object Arrays {
-
- @inline def genericApply[T](xs: Array[T], idx: Int): T = xs.asInstanceOf[AnyRef] match {
- case x: Array[AnyRef] => x(idx).asInstanceOf[T]
- case _ => genericApplyNotAnyRef(xs, idx)
- }
-
- @noinline private def genericApplyNotAnyRef[T](xs: Array[T], idx: Int): T = xs.asInstanceOf[AnyRef] match {
- case x: Array[Int] => x(idx).asInstanceOf[T]
- case x: Array[Double] => x(idx).asInstanceOf[T]
- case x: Array[Long] => x(idx).asInstanceOf[T]
- case x: Array[Float] => x(idx).asInstanceOf[T]
- case x: Array[Char] => x(idx).asInstanceOf[T]
- case x: Array[Byte] => x(idx).asInstanceOf[T]
- case x: Array[Short] => x(idx).asInstanceOf[T]
- case x: Array[Boolean] => x(idx).asInstanceOf[T]
- case x: Array[Unit] => x(idx).asInstanceOf[T]
- case null => throw new NullPointerException
- }
-
- @inline def apply(xs: AnyRef, idx: Int): Any = xs match {
- case x: Array[AnyRef] => x(idx).asInstanceOf[Any]
- case _ => applyNotAnyRef(xs, idx)
- }
-
- @noinline private def applyNotAnyRef(xs: AnyRef, idx: Int): Any = xs match {
- case x: Array[Int] => x(idx).asInstanceOf[Any]
- case x: Array[Double] => x(idx).asInstanceOf[Any]
- case x: Array[Long] => x(idx).asInstanceOf[Any]
- case x: Array[Float] => x(idx).asInstanceOf[Any]
- case x: Array[Char] => x(idx).asInstanceOf[Any]
- case x: Array[Byte] => x(idx).asInstanceOf[Any]
- case x: Array[Short] => x(idx).asInstanceOf[Any]
- case x: Array[Boolean] => x(idx).asInstanceOf[Any]
- case x: Array[Unit] => x(idx).asInstanceOf[Any]
- case null => throw new NullPointerException
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Dummy.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Dummy.scala
deleted file mode 100644
index 56af7b9d85..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Dummy.scala
+++ /dev/null
@@ -1,22 +0,0 @@
-package scala.collection.parallel.benchmarks.arrays
-
-
-
-
-case class Dummy(in: Int) {
- def op = {}
-}
-
-object Dummy {
- def dummyOp(a: Int) = { if (a < 0) -1 }
- def dummyOp(d: Dummy) = { if (d.in < 0) d.op }
-}
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/IntAccess.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/IntAccess.scala
deleted file mode 100644
index 81f0e4da03..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/IntAccess.scala
+++ /dev/null
@@ -1,68 +0,0 @@
-package scala.collection.parallel.benchmarks.arrays
-
-
-import scala.collection.parallel.benchmarks._
-
-
-
-object IntAccess extends BenchCompanion {
- def collectionName = "array";
- def benchName = "access-int";
- def apply(sz: Int, p: Int, what: String) = new IntAccess(sz, p, what)
- override def comparisons = List("any", "cast", "manif", "unknown")
- override def defaultSize = 100000
-}
-
-
-class IntAccess(sz: Int, p: Int, what: String)
-extends Resetting(n => n, sz, p, what) with UnknownManif[Int] {
- def companion = IntAccess
-
- def runseq {}
- def runpar {}
-
- def runany = {
- var i = 0
- while (i < sz) {
- val d = anyarray(i).asInstanceOf[Int]
- i += 1
- }
- }
-
- def runcast = {
- var i = 0
- while (i < sz) {
- val d = Arrays.apply(castarray, i).asInstanceOf[Int]
- i += 1
- }
- }
-
- def runmanif = {
- var i = 0
- while (i < sz) {
- val d = manifarray(i)
- if (op(d)) i += 1
- i += 1
- }
- }
-
- def op(a: Int) = a < 0
-
- def comparisonMap = collection.Map("any" -> runany _, "cast" -> runcast _,
- "manif" -> runmanif _, "unknown" -> rununknown _)
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/ObjectAccess.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/ObjectAccess.scala
deleted file mode 100644
index 29251f3719..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/ObjectAccess.scala
+++ /dev/null
@@ -1,75 +0,0 @@
-package scala.collection.parallel.benchmarks.arrays
-
-
-import scala.collection.parallel.benchmarks._
-
-
-
-object ObjectAccess extends BenchCompanion {
- def collectionName = "array";
- def benchName = "access-obj";
- def apply(sz: Int, p: Int, what: String) = new ObjectAccess(sz, p, what)
- override def comparisons = List("any", "cast", "gencast", "manif", "unknown")
- override def defaultSize = 100000
-}
-
-
-class ObjectAccess(sz: Int, p: Int, what: String)
-extends Resetting(Dummy(_), sz, p, what) with UnknownManif[Dummy] {
- def companion = ObjectAccess
-
- def runseq {}
- def runpar {}
-
- def runany = {
- var i = 0
- while (i < sz) {
- val d = anyarray(i).asInstanceOf[Dummy]
- Dummy.dummyOp(d)
- i += 1
- }
- }
-
- def runcast = {
- var i = 0
- while (i < sz) {
- val d = Arrays.apply(castarray, i).asInstanceOf[Dummy]
- i += 1
- }
- }
-
- def rungenericcast = {
- var i = 0
- while (i < sz) {
- val d = Arrays.genericApply(gencastarray, i)
- i += 1
- }
- }
-
- def runmanif = {
- var i = 0
- while (i < sz) {
- val d = manifarray(i)
- if (d.in < 0) i += 1
- i += 1
- }
- }
-
- def comparisonMap = collection.Map("any" -> runany _, "cast" -> runcast _, "gencast" -> rungenericcast _,
- "manif" -> runmanif _, "unknown" -> rununknown _)
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Resetting.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Resetting.scala
deleted file mode 100644
index 22d2107f62..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Resetting.scala
+++ /dev/null
@@ -1,39 +0,0 @@
-package scala.collection.parallel.benchmarks.arrays
-
-
-import scala.collection.parallel.benchmarks._
-
-
-abstract class Resetting[T: ClassTag](elemcreate: Int => T, sz: Int, p: Int, what: String)
-extends Bench {
- val size = sz
- val parallelism = p
- val runWhat = what
-
- var anyarray: Array[Any] = null
- var castarray: AnyRef = null
- var gencastarray: Array[T] = null
- var manifarray: Array[T] = null
-
- reset
-
- def reset = what match {
- case "any" =>
- anyarray = new Array[Any](sz)
- for (i <- 0 until sz) anyarray(i) = elemcreate(i)
- case "cast" =>
- val arr = new Array[T](sz)
- for (i <- 0 until sz) arr(i) = elemcreate(i)
- castarray = arr
- case "gencast" =>
- gencastarray = new Array[T](sz)
- for (i <- 0 until sz) gencastarray(i) = elemcreate(i)
- case "manif" =>
- manifarray = new Array[T](sz)
- for (i <- 0 until sz) manifarray(i) = elemcreate(i)
- case "unknown" =>
- manifarray = new Array[T](sz)
- for (i <- 0 until sz) manifarray(i) = elemcreate(i)
- case _ =>
- }
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/UnknownManif.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/UnknownManif.scala
deleted file mode 100644
index 46a28ae111..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/UnknownManif.scala
+++ /dev/null
@@ -1,38 +0,0 @@
-package scala.collection.parallel.benchmarks.arrays
-
-
-
-
-trait UnknownManif[T] {
- def manifarray: Array[T]
- def size: Int
-
- def rununknown {
- val arr = manifarray
- val sz = size
- var i = 0
- while (i < sz) {
- val d = arr(i)
- op(d)
- i += 1
- }
- }
-
- def op(d: Any) {}
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/Dummy.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/Dummy.scala
deleted file mode 100644
index 3b5308f8c2..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/Dummy.scala
+++ /dev/null
@@ -1,83 +0,0 @@
-package scala.collection.parallel.benchmarks.generic
-
-
-
-
-class Dummy(val in: Int) {
- var num = in
- override def toString = in.toString
- override def hashCode = in
- def dummy = num + in
- def one = "1".length
-}
-
-
-object DummyOperators extends Operators[Dummy] {
- val foreachFun = (a: Dummy) => {
- a
- ()
- }
- val reducer = (a: Dummy, b: Dummy) => {
- var i = 0
- if (a.in > b.in) {
- a.num = a.in + b.in + i
- a
- } else {
- b.num = a.in + b.in + i
- b
- }
- }
- private def rec(a: Int, b: Int): Int = {
- val result = if (b == 0) a else {
- rec(b, a - b * (a / b))
- }
- result + 1000
- }
- val mediumreducer = (a: Dummy, b: Dummy) => {
- var i = 0
- var sum = a.num + b.num
- b.num = rec(a.num, b.num)
- b
- }
- val filterer = (a: Dummy) => {
- a.in % 2 == 0
- }
- val mapper = (a: Dummy) => {
- a.num = a.dummy + a.num + a.in + a.one
- a
- }
- override val mapper2 = (a: Dummy) => {
- val x = 1
- new Dummy(a.in * -2 + x)
- }
- val heavymapper = (a: Dummy) => {
- var i = -100
- while (i < 0) {
- if (a.in < i) a.num += 1
- i += 1
- }
- a
- }
- val flatmapper = (a: Dummy) => {
- List(a, a, a, a, a)
- }
- val taker = (a: Dummy) => {
- a.in >= 0
- }
- val eachFun: Dummy => Unit = (d: Dummy) => {
- d.dummy
- }
- override val eachPairFun: ((Dummy, Dummy)) => Unit = p => {
- p._1.dummy
- p._2.dummy
- }
- override def sequence(sz: Int): Seq[Dummy] = {
- val pa = new collection.parallel.mutable.ParArray[Dummy](sz)
- for (i <- 0 until sz) pa(i) = new Dummy(i)
- pa
- }
-}
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/Operators.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/Operators.scala
deleted file mode 100644
index 539e3f6972..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/Operators.scala
+++ /dev/null
@@ -1,64 +0,0 @@
-package scala.collection.parallel.benchmarks.generic
-
-
-
-
-
-
-trait Operators[T] {
-
- def foreachFun: T => Unit
- def reducer: (T, T) => T
- def mediumreducer: (T, T) => T
- def filterer: T => Boolean
- def mapper: T => T
- def mapper2: T => T = error("unsupported")
- def heavymapper: T => T
- def flatmapper: T => Seq[T]
- def taker: T => Boolean
- def eachFun: T => Unit
- def eachPairFun: ((T, T)) => Unit = error("unsupported")
- def sequence(sz: Int): Seq[T] = error("unsupported")
-
-}
-
-
-
-trait IntOperators extends Operators[Int] {
-
- val foreachFun: Int => Unit = x => ()
- val reducer: (Int, Int) => Int = _ + _
- val mediumreducer: (Int, Int) => Int = (a: Int, b: Int) => {
- val result = if (b == 0) a else {
- mediumreducer.apply(b, a - b * (a / b))
- }
- result + 1000
- }
- val filterer: Int => Boolean = _ % 2 == 0
- val mapper: Int => Int = _ * 2
- val heavymapper: Int => Int = (n: Int) => {
- var i = -10
- var sum = 0
- while (i < 0) {
- sum += -i
- i += 1
- }
- n + sum
- }
- val flatmapper: Int => Seq[Int] = (n: Int) => {
- List(n, n, n, n, n)
- }
- val taker: Int => Boolean = _ < 10000
- val eachFun: Int => Unit = { n =>
- n % 2 == 0
- }
-
-}
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala
deleted file mode 100644
index c39c384927..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala
+++ /dev/null
@@ -1,362 +0,0 @@
-package scala.collection.parallel
-package benchmarks
-package generic
-
-
-
-import scala.collection.SeqView
-
-
-
-trait ParIterableBenches[T, Coll <: ParIterable[T]] {
-self =>
-
- def createSequential(sz: Int, p: Int): Iterable[T]
- def createParallel(sz: Int, p: Int): Coll
- def nameOfCollection: String
- def operators: Operators[T]
-
- trait IterableBenchCompanion extends BenchCompanion {
- def collectionName = self.nameOfCollection
- }
-
- trait IterableBench extends collection.parallel.benchmarks.Bench {
- protected var seqcoll: Iterable[T] = null
- protected var parcoll: Coll = null.asInstanceOf[Coll]
-
- reset
-
- def reset = runWhat match {
- case "seq" => this.seqcoll = createSequential(size, parallelism)
- case "par" => this.parcoll = createParallel(size, parallelism)
- case _ =>
- }
-
- def nameOfCollection = self.nameOfCollection
- def operators = self.operators
- def createSequential(sz: Int, p: Int) = self.createSequential(size, parallelism)
- def createParallel(sz: Int, p: Int) = self.createParallel(size, parallelism)
- def forkJoinPool: scala.concurrent.forkjoin.ForkJoinPool = self.forkJoinPool
-
- override def printResults {
- println(" --- Fork join pool state --- ")
- println("Parallelism: " + forkJoinPool.getParallelism)
- println("Active threads: " + forkJoinPool.getActiveThreadCount)
- println("Work stealings: " + forkJoinPool.getStealCount)
- }
-
- }
-
- def forkJoinPool: scala.concurrent.forkjoin.ForkJoinPool
-
-}
-
-
-trait ParSeqBenches[T, Coll <: ParSeq[T]] extends ParIterableBenches[T, Coll] {
-self =>
-
- def createSequential(sz: Int, p: Int): Seq[T]
-
- trait SeqBenchCompanion extends BenchCompanion {
- def collectionName = self.nameOfCollection
- }
-
- trait SeqBench extends IterableBench {
- def seqcollAsSeq = seqcoll.asInstanceOf[Seq[T]]
- override def createSequential(sz: Int, p: Int) = self.createSequential(sz, p)
- }
-
-}
-
-
-
-
-/** Standard benchmarks for collections.
- */
-trait StandardParIterableBenches[T, Coll <: ParIterable[T]] extends ParIterableBenches[T, Coll] {
-
- object Reduce extends IterableBenchCompanion {
- override def defaultSize = 50000
- def benchName = "reduce";
- def apply(sz: Int, p: Int, w: String) = new Reduce(sz, p, w)
- }
-
- class Reduce(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def comparisonMap = collection.Map()
- def runseq = this.seqcoll.reduceLeft(operators.reducer)
- def runpar = this.parcoll.reduce(operators.reducer)
- def companion = Reduce
- }
-
- object ReduceMedium extends IterableBenchCompanion {
- override def defaultSize = 5000
- def benchName = "reduce-medium";
- def apply(sz: Int, p: Int, w: String) = new ReduceMedium(sz, p, w)
- }
-
- class ReduceMedium(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def comparisonMap = collection.Map()
- def runseq = this.seqcoll.reduceLeft(operators.mediumreducer)
- def runpar = this.parcoll.reduce(operators.mediumreducer)
- def companion = ReduceMedium
- }
-
- object Map extends IterableBenchCompanion {
- override def defaultSize = 5000
- def benchName = "map";
- def apply(sz: Int, p: Int, w: String) = new Map(sz, p, w)
- }
-
- class Map(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def comparisonMap = collection.Map()
- def runseq = this.seqcoll.map(operators.mapper)
- def runpar = this.parcoll.map(operators.mapper)
- def companion = Map
- }
-
- object Filter extends IterableBenchCompanion {
- override def defaultSize = 5000
- def benchName = "filter";
- def apply(sz: Int, p: Int, w: String) = new Filter(sz, p, w)
- }
-
- class Filter(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def comparisonMap = collection.Map()
- def runseq = this.seqcoll.filter(operators.filterer)
- def runpar = this.parcoll.filter(operators.filterer)
- def companion = Filter
- }
-
- object FlatMap extends IterableBenchCompanion {
- override def defaultSize = 5000
- def benchName = "flatmap";
- def apply(sz: Int, p: Int, w: String) = new FlatMap(sz, p, w)
- }
-
- class FlatMap(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def comparisonMap = collection.Map()
- def runseq = this.seqcoll.flatMap(operators.flatmapper)
- def runpar = this.parcoll.flatMap(operators.flatmapper)
- def companion = FlatMap
- }
-
-}
-
-
-
-/** Benchmarks for sequence views.
- */
-trait ParSeqViewBenches[T, Coll <: ParSeqView[T, ParSeq[T], CollSeq], CollSeq] extends ParSeqBenches[T, Coll] {
-self =>
-
- trait SeqViewBench extends SeqBench {
- lazy val seqview: SeqView[T, Seq[T]] = createSeqView(size, parallelism)
-
- def createSeqView(sz: Int, p: Int) = self.createSeqView(sz, p)
- }
-
- def createSeqView(sz: Int, p: Int): SeqView[T, Seq[T]]
-
- object Iteration extends SeqBenchCompanion {
- override def defaultSize = 250000
- def benchName = "iter"
- def apply(sz: Int, p: Int, w: String) = new Iteration(sz, p, w)
- }
-
- class Iteration(val size: Int, val parallelism: Int, val runWhat: String)
- extends SeqBench with SeqViewBench {
- def comparisonMap = collection.Map("seqview" -> runseqview _)
- def runseq = this.seqcoll.foreach(operators.eachFun)
- def runpar = this.parcoll.pforeach(operators.eachFun)
- def runseqview = {
- this.seqview.foreach(operators.eachFun)
- }
- def companion = Iteration
- }
-
- object IterationS extends SeqBenchCompanion {
- override def defaultSize = 250000
- def benchName = "iter-s"
- def apply(sz: Int, p: Int, w: String) = new IterationS(sz, p, w)
- }
-
- class IterationS(val size: Int, val parallelism: Int, val runWhat: String)
- extends SeqBench with SeqViewBench {
- def comparisonMap = collection.Map("seqview" -> runseqview _)
- def runseq = this.seqcoll.slice(0, size / 2).foreach(operators.eachFun)
- def runpar = this.parcoll.slice(0, size / 2).pforeach(operators.eachFun)
- def runseqview = this.seqview.slice(0, size / 2).foreach(operators.eachFun)
- def companion = IterationS
- }
-
- object IterationM extends SeqBenchCompanion {
- override def defaultSize = 100000
- def benchName = "iter-m"
- def apply(sz: Int, p: Int, w: String) = new IterationM(sz, p, w)
- }
-
- class IterationM(val size: Int, val parallelism: Int, val runWhat: String)
- extends SeqBench with SeqViewBench {
- def comparisonMap = collection.Map("seqview" -> runseqview _)
- def runseq = this.seqcoll.map(operators.mapper).foreach(operators.eachFun)
- def runpar = this.parcoll.map(operators.mapper).pforeach(operators.eachFun)
- def runseqview = this.seqview.map(operators.mapper).foreach(operators.eachFun)
- def companion = IterationM
- }
-
- object IterationA extends SeqBenchCompanion {
- override def defaultSize = 50000
- def benchName = "iter-a"
- def apply(sz: Int, p: Int, w: String) = new IterationA(sz, p, w)
- }
-
- class IterationA(val size: Int, val parallelism: Int, val runWhat: String)
- extends SeqBench with SeqViewBench {
- val appended = operators.sequence(size)
- val sqappended = appended.toSeq
- def comparisonMap = collection.Map("seqview" -> runseqview _)
- def runseq = {
- val withapp = this.seqcoll.++(sqappended)
- withapp.foreach(operators.eachFun)
- }
- def runpar = this.parcoll.++(appended).pforeach(operators.eachFun)
- def runseqview = this.seqview.++(appended).foreach(operators.eachFun)
- def companion = IterationA
- }
-
- object IterationZ extends SeqBenchCompanion {
- override def defaultSize = 50000
- def benchName = "iter-z"
- def apply(sz: Int, p: Int, w: String) = new IterationZ(sz, p, w)
- }
-
- class IterationZ(val size: Int, val parallelism: Int, val runWhat: String)
- extends SeqBench with SeqViewBench {
- val zipped = operators.sequence(size)
- def comparisonMap = collection.Map("seqview" -> runseqview _)
- def runseq = {
- val withzip = this.seqcoll.zip(zipped)
- withzip.foreach(operators.eachPairFun)
- }
- def runpar = this.parcoll.zip(zipped).pforeach(operators.eachPairFun)
- def runseqview = this.seqview.zip(zipped).foreach(operators.eachPairFun)
- def companion = IterationZ
- }
-
- object IterationP extends SeqBenchCompanion {
- override def defaultSize = 50000
- def benchName = "iter-p"
- def apply(sz: Int, p: Int, w: String) = new IterationP(sz, p, w)
- }
-
- class IterationP(val size: Int, val parallelism: Int, val runWhat: String)
- extends SeqBench with SeqViewBench {
- val patch = operators.sequence(size / 4)
- val sqpatch = patch.toSeq
- def comparisonMap = collection.Map("seqview" -> runseqview _)
- def runseq = {
- val withpatch = this.seqcollAsSeq.patch(size / 4, sqpatch, size / 2)
- withpatch.foreach(operators.eachFun)
- }
- def runpar = this.parcoll.patch(size / 4, patch, size / 2).pforeach(operators.eachFun)
- def runseqview = this.seqview.patch(size / 4, patch, size / 2).foreach(operators.eachFun)
- def companion = IterationP
- }
-
- object Reduce extends SeqBenchCompanion {
- override def defaultSize = 50000
- def benchName = "reduce";
- def apply(sz: Int, p: Int, w: String) = new Reduce(sz, p, w)
- }
-
- class Reduce(val size: Int, val parallelism: Int, val runWhat: String)
- extends SeqBench with SeqViewBench {
- def comparisonMap = collection.Map()
- def runseq = this.seqcoll.reduceLeft(operators.reducer)
- def runpar = this.parcoll.reduce(operators.reducer)
- def companion = Reduce
- }
-
- object MediumReduce extends SeqBenchCompanion {
- override def defaultSize = 50000
- def benchName = "reduce-medium";
- def apply(sz: Int, p: Int, w: String) = new MediumReduce(sz, p, w)
- }
-
- class MediumReduce(val size: Int, val parallelism: Int, val runWhat: String)
- extends SeqBench with SeqViewBench {
- def comparisonMap = collection.Map()
- def runseq = this.seqcoll.reduceLeft(operators.mediumreducer)
- def runpar = this.parcoll.reduce(operators.mediumreducer)
- def companion = Reduce
- }
-
- object ModifyThenReduce extends SeqBenchCompanion {
- override def defaultSize = 20000
- def benchName = "modify-then-reduce";
- def apply(sz: Int, p: Int, w: String) = new ModifyThenReduce(sz, p, w)
- }
-
- class ModifyThenReduce(val size: Int, val parallelism: Int, val runWhat: String)
- extends SeqBench with SeqViewBench {
- val toadd = createSequential(size, parallelism)
- def comparisonMap = collection.Map()
- def runseq = {
- val modified = (seqcoll ++ toadd).drop(size).map(operators.mapper).++(toadd).take(size)
- modified.reduceLeft(operators.reducer)
- }
- def runpar = {
- val modified = (parcoll ++ toadd).drop(size).map(operators.mapper).++(toadd).take(size)
- modified.reduce(operators.reducer)
- }
- def companion = ModifyThenReduce
- }
-
- object ModifyThenForce extends SeqBenchCompanion {
- override def defaultSize = 20000
- def benchName = "modify-then-force";
- def apply(sz: Int, p: Int, w: String) = new ModifyThenForce(sz, p, w)
- }
-
- class ModifyThenForce(val size: Int, val parallelism: Int, val runWhat: String)
- extends SeqBench with SeqViewBench {
- val toadd = createSequential(size, parallelism)
- def comparisonMap = collection.Map()
- def runseq = (seqcoll ++ toadd).drop(size).map(operators.mapper).++(toadd).take(size)
- def runpar = {
- val r: ParSeqView[T, ParSeq[T], Seq[T]] = (parcoll ++ toadd).drop(size).map(operators.mapper).++(toadd).take(size)
- r.force
- }
- def companion = ModifyThenForce
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala
deleted file mode 100644
index 17f0315103..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala
+++ /dev/null
@@ -1,144 +0,0 @@
-package scala.collection.parallel.benchmarks.hashtables
-
-
-
-
-import scala.collection.parallel.benchmarks.generic.StandardParIterableBenches
-import scala.collection.parallel.benchmarks.generic.Dummy
-import scala.collection.parallel.benchmarks.generic.DummyOperators
-import scala.collection.parallel.mutable.ParHashSet
-
-
-
-
-
-trait ParHashTableSetBenches[T] extends StandardParIterableBenches[T, ParHashSet[T]] {
-
- def nameOfCollection = "mutable.ParHashSet"
- def comparisonMap = collection.mutable.Set()
- val forkJoinPool = new scala.concurrent.forkjoin.ForkJoinPool
-
- object Map2 extends IterableBenchCompanion {
- override def defaultSize = 50000
- override def comparisons = List()
- def benchName = "map2";
- def apply(sz: Int, p: Int, w: String) = new Map2(sz, p, w)
- }
-
- class Map2(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- var result: Int = 0
- def comparisonMap = collection.Map()
- def runseq = {
- val r = this.seqcoll.asInstanceOf[collection.mutable.HashSet[T]].map(operators.mapper2)
- result = r.size
- }
- def runpar = {
- result = this.parcoll.map(operators.mapper2).size
- }
- def companion = Map2
- override def repetitionsPerRun = 50
- override def printResults {
- println("Size of last result: " + result)
- }
- }
-
- object HeavyMap extends IterableBenchCompanion {
- override def defaultSize = 5000
- override def comparisons = List()
- def benchName = "heavy-map";
- def apply(sz: Int, p: Int, w: String) = new HeavyMap(sz, p, w)
- }
-
- class HeavyMap(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- var result: Int = 0
- def comparisonMap = collection.Map()
- def runseq = {
- val r = this.seqcoll.asInstanceOf[collection.mutable.HashSet[T]].map(operators.heavymapper)
- result = r.size
- }
- def runpar = {
- result = this.parcoll.map(operators.heavymapper).size
- }
- def companion = HeavyMap
- override def repetitionsPerRun = 50
- }
-
- object Reduce2 extends IterableBenchCompanion {
- override def defaultSize = 50000
- override def comparisons = List()
- def benchName = "reduce2";
- def apply(sz: Int, p: Int, w: String) = new Reduce2(sz, p, w)
- }
-
- class Reduce2(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def comparisonMap = collection.Map()
- def runseq = this.seqcoll.reduceLeft(operators.mediumreducer)
- def runpar = this.parcoll.reduce(operators.mediumreducer)
- def companion = Reduce2
- }
-
- object Foreach extends IterableBenchCompanion {
- override def defaultSize = 50000
- override def comparisons = List()
- def benchName = "foreach";
- def apply(sz: Int, p: Int, w: String) = new Foreach(sz, p, w)
- }
-
- class Foreach(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def comparisonMap = collection.Map()
- def runseq = this.seqcoll.foreach(operators.foreachFun)
- def runpar = this.parcoll.pforeach(operators.foreachFun)
- def companion = Foreach
- }
-
-}
-
-
-
-
-
-object RefParHashTableSetBenches extends ParHashTableSetBenches[Dummy] {
-
- object ForeachSet extends IterableBenchCompanion {
- override def defaultSize = 50000
- override def comparisons = List()
- def benchName = "foreach-set";
- def apply(sz: Int, p: Int, w: String) = new ForeachSet(sz, p, w)
- }
-
- class ForeachSet(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- val array = new Array[Int](size)
- def comparisonMap = collection.Map()
- def runseq = for (x <- this.seqcoll) array(x.in) += 1
- def runpar = this.parcoll.pforeach { x => array(x.in) += 1 }
- def companion = ForeachSet
-
- override def onEnd {
- for (i <- 0 until array.length) {
- assert(array(i) == repetitionsPerRun * runs)
- }
- }
- }
-
- val operators = DummyOperators
-
- def createSequential(sz: Int, p: Int) = {
- val ht = new collection.mutable.HashSet[Dummy]
- for (i <- 0 until sz) ht += new Dummy(i)
- ht
- }
-
- def createParallel(sz: Int, p: Int) = {
- val phm = new ParHashSet[Dummy]
- for (i <- 0 until sz) phm += new Dummy(i)
- forkJoinPool.setParallelism(p)
- collection.parallel.tasksupport.environment = forkJoinPool
- phm
- }
-
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala
deleted file mode 100644
index 79d038bf3d..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala
+++ /dev/null
@@ -1,232 +0,0 @@
-package scala.collection.parallel.benchmarks.hashtables
-
-
-
-
-import scala.collection.parallel.benchmarks.generic.StandardParIterableBenches
-import scala.collection.parallel.benchmarks.generic.Dummy
-import scala.collection.parallel.benchmarks.generic.Operators
-import scala.collection.parallel.mutable.ParHashMap
-
-
-
-
-
-trait ParHashTableBenches[K, V] extends StandardParIterableBenches[(K, V), ParHashMap[K, V]] {
-
- def nameOfCollection = "mutable.ParHashMap"
- def comparisonMap = collection.mutable.Map()
- val forkJoinPool = new scala.concurrent.forkjoin.ForkJoinPool
-
- object Map2 extends IterableBenchCompanion {
- override def defaultSize = 40000
- override def comparisons = List("jhashtable")
- def benchName = "map2";
- def apply(sz: Int, p: Int, w: String) = new Map2(sz, p, w)
- }
-
- class Map2(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- var result: Int = 0
- def comparisonMap = collection.Map("jhashtable" -> runjhashtable _)
- def runseq = {
- val r = this.seqcoll.asInstanceOf[collection.mutable.HashMap[K, V]].map(operators.mapper2)
- result = r.size
- }
- def runpar = {
- result = this.parcoll.map(operators.mapper2).size
- }
- def runjhashtable = {
- val jumap = new java.util.HashMap[K, V]()
- val it = this.seqcoll.iterator
- val f = operators.mapper2
- while (it.hasNext) {
- val p = f(it.next)
- jumap.put(p._1, p._2)
- }
- result = jumap.size
- }
- override def reset = runWhat match {
- case "jhashtable" => this.seqcoll = createSequential(size, parallelism)
- case _ => super.reset
- }
- def companion = Map2
- override def repetitionsPerRun = 50
- override def printResults {
- println("Size of last result: " + result)
- }
- }
-
- object FlatMap2 extends IterableBenchCompanion {
- override def defaultSize = 5000
- def benchName = "flatmap2";
- def apply(sz: Int, p: Int, w: String) = new FlatMap2(sz, p, w)
- }
-
- class FlatMap2(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def comparisonMap = collection.Map()
- override def repetitionsPerRun = 25
- def runseq = this.seqcoll.flatMap(operators.flatmapper)
- def runpar = this.parcoll.flatMap(operators.flatmapper)
- def companion = FlatMap2
- }
-
- object HeavyMap extends IterableBenchCompanion {
- override def defaultSize = 5000
- override def comparisons = List()
- def benchName = "heavy-map";
- def apply(sz: Int, p: Int, w: String) = new HeavyMap(sz, p, w)
- }
-
- class HeavyMap(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- var result: Int = 0
- def comparisonMap = collection.Map()
- def runseq = {
- val r = this.seqcoll.asInstanceOf[collection.mutable.HashMap[K, V]].map(operators.heavymapper)
- result = r.size
- }
- def runpar = {
- result = this.parcoll.map(operators.heavymapper).size
- }
- def companion = HeavyMap
- override def repetitionsPerRun = 50
- }
-
- object Reduce2 extends IterableBenchCompanion {
- override def defaultSize = 50000
- override def comparisons = List()
- def benchName = "reduce2";
- def apply(sz: Int, p: Int, w: String) = new Reduce2(sz, p, w)
- }
-
- class Reduce2(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def comparisonMap = collection.Map()
- def runseq = this.seqcoll.reduceLeft(operators.mediumreducer)
- def runpar = this.parcoll.reduce(operators.mediumreducer)
- def companion = Reduce2
- }
-
- object Foreach extends IterableBenchCompanion {
- override def defaultSize = 50000
- override def comparisons = List()
- def benchName = "foreach";
- def apply(sz: Int, p: Int, w: String) = new Foreach(sz, p, w)
- }
-
- class Foreach(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def comparisonMap = collection.Map()
- def runseq = this.seqcoll.foreach(operators.foreachFun)
- def runpar = this.parcoll.pforeach(operators.foreachFun)
- def companion = Foreach
- }
-
-}
-
-
-
-
-
-object RefParHashTableBenches extends ParHashTableBenches[Dummy, Dummy] {
-
- type DPair = (Dummy, Dummy);
-
- object ForeachSet extends IterableBenchCompanion {
- override def defaultSize = 50000
- override def comparisons = List()
- def benchName = "foreach-set";
- def apply(sz: Int, p: Int, w: String) = new ForeachSet(sz, p, w)
- }
-
- class ForeachSet(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- val array = new Array[Int](size)
- def comparisonMap = collection.Map()
- def runseq = for (p <- this.seqcoll) array(p._1.in) += 1
- def runpar = this.parcoll.pforeach { p => array(p._1.in) += 1 }
- def companion = ForeachSet
-
- override def onEnd {
- for (i <- 0 until array.length) {
- assert(array(i) == repetitionsPerRun * runs)
- }
- }
- }
-
- object operators extends Operators[DPair] {
- def gcd(a: Int, b: Int): Int = {
- val result = if (b == 0) a else {
- gcd(b, a - b * (a / b))
- }
- result + 1000
- }
- def heavy(a: Int): Int = {
- var i = 0
- var sum = a
- while (i < 3000) {
- i += 1
- sum += a + i
- }
- sum
- }
- val foreachFun = (t: DPair) => {
- t
- ()
- }
- val reducer = (x: DPair, y: DPair) => {
- //y._2.num = x._2.in + y._2.in
- y
- }
- val mediumreducer = (x: DPair, y: DPair) => {
- y._2.num = gcd(x._2.in, y._2.in)
- y
- }
- val filterer = (p: DPair) => {
- p._1.num % 2 == 0
- }
- val mapper = (p: DPair) => {
- val a = p._1
- a.num = a.in % 2
- (a, p._2)
- }
- val flatmapper = (p: DPair) => {
- for (i <- 0 until 20) yield p
- }
- override val mapper2 = (p: DPair) => {
- val a = 1 //heavy(p._1.in)
- (new Dummy(p._1.in * -2 + a), p._2)
- }
- val heavymapper = (p: DPair) => {
- var i = -2000
- var t = p._1.in
- while (i < 0) {
- t += (p._2.num - p._1.num) / 500
- p._1.num += p._2.num + t
- i += 1
- }
- (p._1, new Dummy(0))
- }
- val taker = (p: DPair) => true
- val eachFun: DPair => Unit = { dp =>
- dp._1.dummy
- }
- }
-
- def createSequential(sz: Int, p: Int) = {
- val ht = new collection.mutable.HashMap[Dummy, Dummy]
- for (i <- 0 until sz) ht += ((new Dummy(i), new Dummy(i)))
- ht
- }
-
- def createParallel(sz: Int, p: Int) = {
- val phm = new ParHashMap[Dummy, Dummy]
- for (i <- 0 until sz) phm += ((new Dummy(i), new Dummy(i)))
- forkJoinPool.setParallelism(p)
- collection.parallel.tasksupport.environment = forkJoinPool
- phm
- }
-
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Combine.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Combine.scala
deleted file mode 100644
index 96598840fd..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Combine.scala
+++ /dev/null
@@ -1,66 +0,0 @@
-package scala.collection.parallel.benchmarks
-package hashtries
-
-
-
-
-import collection.immutable.{HashMap => HashTrie}
-import collection.mutable.HashMap
-
-
-
-
-
-
-class Combine(val size: Int, val parallelism: Int, val runWhat: String) extends Bench with IntInit {
- var thattrie = new HashTrie[Int, Int]
- for (i <- size until 2 * size) thattrie += ((i, i))
- val thatmap = new HashMap[Int, Int]
- for (i <- size until 2 * size) thatmap += ((i, i))
-
- def runpar = throw new UnsupportedOperationException
- def runseq = runhashtrie
- def runhashtrie = {
- hashtrie merge thattrie
- // println
- // println("both tries: " + HashTrie.bothtries)
- // println("one trie, one item: " + HashTrie.onetrie)
- // println("both single: " + HashTrie.bothsingle)
- // System exit 1
- }
- def rundestructive = {
- hashtrie merge thattrie
- }
- def runappendtrie = hashtrie ++ thattrie
- def runhashmap = hashmap ++ thatmap
- def companion = Combine
- def comparisonMap = Map("hashtrie" -> runhashtrie _, "hashmap" -> runhashmap _, "destruct" -> rundestructive _, "appendtrie" -> runappendtrie _)
- override def reset = runWhat match {
- case "appendtrie" => initHashTrie
- case "destruct" => initHashTrie
- case _ => super.reset
- }
-}
-
-
-object Combine extends BenchCompanion {
- def collectionName = "HashTrie"
- def benchName = "combine";
- def apply(sz: Int, p: Int, what: String) = new Combine(sz, p, what)
- override def defaultSize = 5000
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Construct.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Construct.scala
deleted file mode 100644
index f65a349ec5..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Construct.scala
+++ /dev/null
@@ -1,54 +0,0 @@
-package scala.collection.parallel.benchmarks
-package hashtries
-
-
-
-
-import collection.immutable.{HashMap => HashTrie}
-import collection.mutable.HashMap
-
-
-
-
-
-
-class Construct(val size: Int, val parallelism: Int, val runWhat: String) extends Bench {
- def reset {}
-
- def runpar = throw new UnsupportedOperationException
- def runseq = throw new UnsupportedOperationException
- def runhashmap = {
- val hashmap = new HashMap[Int, Int]
- for (i <- 0 until size) hashmap += ((i, i))
- }
- def runhashtrie = {
- var hashtrie = new HashTrie[Int, Int]
- for (i <- 0 until size) hashtrie += ((i, i))
- }
-
- def companion = Construct
- def comparisonMap = Map("hashmap" -> runhashmap _, "hashtrie" -> runhashtrie _)
-}
-
-
-object Construct extends BenchCompanion {
- def collectionName = "HashTrie"
- def benchName = "construct";
- def apply(sz: Int, p: Int, what: String) = new Construct(sz, p, what)
- override def defaultSize = 5000
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Foreach.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Foreach.scala
deleted file mode 100644
index f53ea02e36..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Foreach.scala
+++ /dev/null
@@ -1,45 +0,0 @@
-package scala.collection.parallel.benchmarks
-package hashtries
-
-
-
-
-import collection.immutable.{HashMap => HashTrie}
-import collection.mutable.HashMap
-
-
-
-
-
-
-class Foreach(val size: Int, val parallelism: Int, val runWhat: String) extends Bench with IntInit {
- def runpar = throw new UnsupportedOperationException
- def runseq = runhashtrie
- def runhashmap = hashmap.foreach(n => ())
- def runhashtrie = hashtrie.foreach(n => ())
- def companion = Foreach
- def comparisonMap = Map("hashmap" -> runhashmap _, "hashtrie" -> runhashtrie _)
-}
-
-
-object Foreach extends BenchCompanion {
- def collectionName = "HashTrie"
- def benchName = "foreach-light";
- def apply(sz: Int, p: Int, what: String) = new Foreach(sz, p, what)
- override def defaultSize = 25000
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/IntInit.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/IntInit.scala
deleted file mode 100644
index 79ebd0e98c..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/IntInit.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-package scala.collection.parallel.benchmarks
-package hashtries
-
-
-
-
-import collection.immutable.{HashMap => HashTrie}
-import collection.mutable.HashMap
-
-
-
-trait IntInit extends Bench {
- var hashmap: HashMap[Int, Int] = null
- var hashtrie: HashTrie[Int, Int] = null
-
- reset
- def reset = runWhat match {
- case "hashmap" => initHashMap
- case "hashtrie" => initHashTrie
- case "seq" => initHashTrie
- }
- def initHashTrie = {
- hashtrie = new HashTrie
- for (i <- 0 until size) hashtrie += ((i, i))
- }
- def initHashMap = {
- hashmap = new HashMap
- for (i <- 0 until size) hashmap += ((i, i))
- }
-
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Iterate.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Iterate.scala
deleted file mode 100644
index d27aa200b8..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Iterate.scala
+++ /dev/null
@@ -1,51 +0,0 @@
-package scala.collection.parallel.benchmarks
-package hashtries
-
-
-
-
-import collection.immutable.{HashMap => HashTrie}
-import collection.mutable.HashMap
-
-
-
-
-
-
-class Iterate(val size: Int, val parallelism: Int, val runWhat: String) extends Bench with IntInit {
- def runpar = throw new UnsupportedOperationException
- def runseq = throw new UnsupportedOperationException
- def runhashmap = {
- val it = hashmap.iterator
- while (it.hasNext) it.next
- }
- def runhashtrie = {
- val it = hashtrie.iterator
- while (it.hasNext) it.next
- }
- def companion = Iterate
- def comparisonMap = Map("hashmap" -> runhashmap _, "hashtrie" -> runhashtrie _)
-}
-
-
-object Iterate extends BenchCompanion {
- def collectionName = "HashTrie"
- def benchName = "iterate-light";
- def apply(sz: Int, p: Int, what: String) = new Iterate(sz, p, what)
- override def defaultSize = 25000
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Lookup.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Lookup.scala
deleted file mode 100644
index 4ee8c17118..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/Lookup.scala
+++ /dev/null
@@ -1,57 +0,0 @@
-package scala.collection.parallel.benchmarks
-package hashtries
-
-
-
-
-import collection.immutable.{HashMap => HashTrie}
-import collection.mutable.HashMap
-
-
-
-
-
-
-class Lookup(val size: Int, val parallelism: Int, val runWhat: String) extends Bench with IntInit {
- def runpar = throw new UnsupportedOperationException
- def runseq = throw new UnsupportedOperationException
- def runhashmap = {
- var i = 0
- while (i < size) {
- hashmap(i)
- i += 1
- }
- }
- def runhashtrie = {
- var i = 0
- while (i < size) {
- hashtrie(i)
- i += 1
- }
- }
- def companion = Iterate
- def comparisonMap = Map("hashmap" -> runhashmap _, "hashtrie" -> runhashtrie _)
-}
-
-
-object Lookup extends BenchCompanion {
- def collectionName = "HashTrie"
- def benchName = "lookup";
- def apply(sz: Int, p: Int, what: String) = new Lookup(sz, p, what)
- override def defaultSize = 25000
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/MultipleCombine.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/MultipleCombine.scala
deleted file mode 100644
index c08d6b5cad..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/MultipleCombine.scala
+++ /dev/null
@@ -1,87 +0,0 @@
-package scala.collection.parallel.benchmarks
-package hashtries
-
-
-
-
-import collection.immutable.{HashMap => HashTrie}
-import collection.mutable.HashMap
-
-
-
-
-
-
-class MultipleCombine(val size: Int, val parallelism: Int, val runWhat: String) extends Bench with IntInit {
- var combines = 10
-
- var thattries = new Array[HashTrie[Int, Int]](combines)
- def initTries = for (r <- 0 until combines) {
- var thattrie = new HashTrie[Int, Int]
- for (i <- ((r + 1) * size) until ((r + 2) * size)) thattrie += ((i, i))
- thattries(r) = thattrie
- }
- initTries
-
- val thatmaps = new Array[HashMap[Int, Int]](10)
- def initMaps = for (r <- 0 until combines) {
- var thatmap = new HashMap[Int, Int]
- for (i <- ((r + 1) * size) until ((r + 2) * size)) thatmap += ((i, i))
- thatmaps(r) = thatmap
- }
- initMaps
-
- override def repetitionsPerRun = 25
- def runpar = throw new UnsupportedOperationException
- def runseq = runhashtrie
- def runhashtrie = {
- initHashTrie
- var trie = hashtrie
- for (r <- 0 until combines) trie = trie merge thattries(r)
- }
- def runappendtrie = {
- initHashTrie
- var trie = hashtrie
- for (r <- 0 until combines) trie = trie ++ thattries(r)
- }
- def runhashmap = {
- initHashMap
- var map = hashmap
- for (r <- 0 until combines) map = map ++ thatmaps(r)
- }
- def rundestructive = {
- initHashTrie
- var trie = hashtrie
- for (r <- 0 until combines) trie = trie merge thattries(r)
- }
- def companion = MultipleCombine
- def comparisonMap = Map("hashtrie" -> runhashtrie _, "hashmap" -> runhashmap _, "appendtrie" -> runappendtrie _, "destruct" -> rundestructive _)
- override def reset = runWhat match {
- case "appendtrie" => initHashTrie
- case "destruct" => initHashTrie
- case _ => super.reset
- }
-}
-
-
-object MultipleCombine extends BenchCompanion {
- def collectionName = "HashTrie"
- def benchName = "multi-combine";
- def apply(sz: Int, p: Int, what: String) = new MultipleCombine(sz, p, what)
- override def defaultSize = 5000
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/ParallelHashTries.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/ParallelHashTries.scala
deleted file mode 100644
index dc8804cf57..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtries/ParallelHashTries.scala
+++ /dev/null
@@ -1,180 +0,0 @@
-package scala.collection.parallel.benchmarks.hashtries
-
-
-
-
-import scala.collection.parallel.benchmarks.generic.StandardParIterableBenches
-import scala.collection.parallel.benchmarks.generic.Dummy
-import scala.collection.parallel.benchmarks.generic.Operators
-import scala.collection.parallel.immutable.ParHashMap
-
-
-
-
-
-trait ParHashTrieBenches[K, V] extends StandardParIterableBenches[(K, V), ParHashMap[K, V]] {
-
- def nameOfCollection = "immutable.ParHashMap"
- def comparisonMap = collection.Map()
- val forkJoinPool = new scala.concurrent.forkjoin.ForkJoinPool
-
- object Map2 extends IterableBenchCompanion {
- override def defaultSize = 5000
- override def comparisons = List("jhashtable", "hashtable")
- def benchName = "map2";
- def apply(sz: Int, p: Int, w: String) = new Map2(sz, p, w)
- }
-
- class Map2(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- var result: Int = 0
- def comparisonMap = collection.Map("jhashtable" -> runjhashtable _, "hashtable" -> runhashtable _)
- def runseq = {
- val r = this.seqcoll.asInstanceOf[collection.immutable.HashMap[K, V]].map(operators.mapper2)
- result = r.size
- }
- def runpar = {
- result = this.parcoll.map(operators.mapper2).size
- }
- def runjhashtable = {
- val jumap = new java.util.HashMap[K, V]()
- val it = this.seqcoll.iterator
- while (it.hasNext) {
- val p = it.next
- jumap.put(p._1, p._2)
- }
- result = jumap.size
- }
- def runhashtable = {
- val smap = collection.mutable.HashMap[K, V]()
- val it = this.seqcoll.iterator
- while (it.hasNext) {
- val p = it.next
- smap.put(p._1, p._2)
- }
- result = smap.size
- }
- override def reset = runWhat match {
- case "jhashtable" => this.seqcoll = createSequential(size, parallelism)
- case "hashtable" => this.seqcoll = createSequential(size, parallelism)
- case _ => super.reset
- }
- def companion = Map2
- override def repetitionsPerRun = 50
- override def printResults {
- println("Size of last result: " + result)
- }
- }
-
- object Reduce2 extends IterableBenchCompanion {
- override def defaultSize = 50000
- override def comparisons = List("hashtable")
- def benchName = "reduce2";
- def apply(sz: Int, p: Int, w: String) = new Reduce2(sz, p, w)
- }
-
- class Reduce2(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- private var ht: collection.mutable.HashMap[K, V] = _
- def comparisonMap = collection.Map("hashtable" -> runhashtable _)
- def runseq = this.seqcoll.reduceLeft(operators.reducer)
- def runpar = this.parcoll.reduce(operators.reducer)
- def runhashtable = ht.reduceLeft(operators.reducer)
- override def reset = runWhat match {
- case "hashtable" => ht = createHashTable(size)
- case _ => super.reset
- }
- def companion = Reduce2
- }
-
- def createHashTable(sz: Int): collection.mutable.HashMap[K, V]
-
-}
-
-
-
-
-
-object RefParHashTrieBenches extends ParHashTrieBenches[Dummy, Dummy] {
-
- type DPair = (Dummy, Dummy)
-
- object operators extends Operators[DPair] {
- def gcd(a: Int, b: Int): Int = {
- val result = if (b == 0) a else {
- gcd(b, a - b * (a / b))
- }
- result + 1000
- }
- def heavy(a: Int): Int = {
- var i = 0
- var sum = a
- while (i < 3000) {
- i += 1
- sum += a + i
- }
- sum
- }
- val foreachFun = (t: DPair) => {
- t
- ()
- }
- val reducer = (x: DPair, y: DPair) => {
- //y._2.num = x._2.in + y._2.in
- y
- }
- val mediumreducer = (x: DPair, y: DPair) => {
- y._2.num = gcd(x._2.in, y._2.in)
- y
- }
- val filterer = (p: DPair) => {
- p._1.num % 2 == 0
- }
- val mapper = (p: DPair) => {
- val a = p._1
- a.num = a.in % 2
- (a, p._2)
- }
- val flatmapper = (p: DPair) => {
- List(p, p, p, p, p)
- }
- override val mapper2 = (p: DPair) => {
- val a = 1 //heavy(p._1.in)
- (new Dummy(p._1.in * -2 + a), p._2)
- }
- val heavymapper = (p: DPair) => {
- val a = p._1
- var i = -100
- while (i < 0) {
- if (a.in < i) a.num += 1
- i += 1
- }
- (a, p._2)
- }
- val taker = (p: DPair) => true
- val eachFun: DPair => Unit = { dp =>
- dp._1.dummy
- }
- }
-
- def createSequential(sz: Int, p: Int) = {
- var ht = new collection.immutable.HashMap[Dummy, Dummy]
- for (i <- 0 until sz) ht += ((new Dummy(i), new Dummy(i)))
- ht
- }
-
- def createParallel(sz: Int, p: Int) = {
- var pht = new ParHashMap[Dummy, Dummy]
- for (i <- 0 until sz) pht += ((new Dummy(i), new Dummy(i)))
- forkJoinPool.setParallelism(p)
- collection.parallel.tasksupport.environment = forkJoinPool
- pht
- }
-
- def createHashTable(sz: Int) = {
- val hm = collection.mutable.HashMap[Dummy, Dummy]()
- for (i <- 0 until sz) hm.put(new Dummy(i), new Dummy(i))
- hm
- }
-
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Coder.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Coder.scala
deleted file mode 100644
index 04e37085b8..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Coder.scala
+++ /dev/null
@@ -1,162 +0,0 @@
-package scala.collection.parallel.benchmarks
-package misc
-
-
-
-
-
-
-import collection._ //immutable._
-import collection.parallel._//immutable._
-
-
-class SeqCoder(words: List[String]) {
-
- private val m = Map(
- '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL",
- '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ")
-
- /** Invert the mnemonics map to give a map from chars 'A' ... 'Z' to '2' ... '9' */
- private val charCode: Map[Char, Char] =
- for ((digit, letters) <- m; letter <- letters) yield letter -> digit
-
- /** Maps a word to the digit string it represents,
- * e.g. `Java` -> `5282` */
- private def wordCode(word: String): String = word.toUpperCase map charCode
-
- /** A map from digit strings to the words that represent
- * them e.g. `5282` -> List(`Java`, `Kata`, `Lava`, ...)
- */
- val wordsForNum: Map[String, Seq[String]] =
- (words groupBy wordCode).map(t => (t._1, t._2.toSeq)) withDefaultValue Seq()
-
- /** All ways to encode a number as a list of words */
- def encode(number: String): Set[Seq[String]] =
- if (number.isEmpty) Set(Seq())
- else {
- val splits = (1 to number.length).toSet
- // for {
- // split <- splits
- // word <- wordsForNum(number take split)
- // rest <- encode(number drop split)
- // } yield word :: rest
- val r = splits.flatMap(split => {
- val wfn = wordsForNum(number take split).flatMap(word => {
- val subs = encode(number drop split)
- subs.map(rest => word +: rest)
- })
- wfn
- })
- r
- }
-
- /** Maps a number to a list of all word phrases that can
- * represent it */
- def translate(number: String) = encode(number)// map (_ mkString " ")
-
- def ??? : Nothing = throw new UnsupportedOperationException
-}
-
-class ParCoder(words: List[String]) {
-
- private val m = Map(
- '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL",
- '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ")
-
- /** Invert the mnemonics map to give a map from chars 'A' ... 'Z' to '2' ... '9' */
- private val charCode: Map[Char, Char] =
- for ((digit, letters) <- m; letter <- letters) yield letter -> digit
-
- /** Maps a word to the digit string it represents,
- * e.g. `Java` -> `5282` */
- private def wordCode(word: String): String = word.toUpperCase map charCode
-
- /** A map from digit strings to the words that represent
- * them e.g. `5282` -> List(`Java`, `Kata`, `Lava`, ...)
- */
- val wordsForNum: Map[String, Seq[String]] =
- (words groupBy wordCode).map(t => (t._1, t._2)) withDefaultValue Seq()
-
- /** All ways to encode a number as a list of words */
- def encode(number: String): Set[Seq[String]] = if (number.length > 12) {
- if (number.isEmpty) ParSet(ParSeq())
- else {
- val splits = (1 to number.length).toParSet
- for {
- split <- splits
- word <- wordsForNum(number take split)
- rest <- encode(number drop split)
- } yield word +: rest
- }
- } else {
- if (number.isEmpty) Set(Seq())
- else {
- val splits = (1 to number.length).toSet
- for {
- split <- splits
- word <- wordsForNum(number take split)
- rest <- encode(number drop split)
- } yield word +: rest
- }
- }
-
- /** Maps a number to a list of all word phrases that can
- * represent it */
- def translate(number: String) = {
- encode(number)// map (_ mkString " ")
- }
-
- def ??? : Nothing = throw new UnsupportedOperationException
-}
-
-
-
-
-
-object Coder extends BenchCompanion {
- def benchName = "Coder"
- def collectionName = "General"
- def apply(sz: Int, p: Int, what: String) = new Coder(sz, p, what)
- override def defaultSize = 100
-}
-
-class Coder(val size: Int, val parallelism: Int, val runWhat: String) extends Bench {
- def companion = Coder
-
- var seqcoder: SeqCoder = null
- var parcoder: ParCoder = null
-
- override def repetitionsPerRun = 1
-
- val code = "23284374729473626268379762538"
-
- reset
-
- def runseq {
- val translations = seqcoder.translate(code)
- //println(translations)
- }
-
- def runpar {
- val translations = parcoder.translate(code)
- //println(translations)
- }
-
- def reset = runWhat match {
- case "seq" =>
- seqcoder = new SeqCoder(Dictionary.wordlist)
- val t = seqcoder.translate(code)
- println("Translation check: " + t.size)
- //println(t)
- case "par" =>
- collection.parallel.tasksupport.environment.asInstanceOf[concurrent.forkjoin.ForkJoinPool].setParallelism(parallelism)
- parcoder = new ParCoder(Dictionary.wordlist)
- val t = parcoder.translate(code)
- println("Translation check: " + t.size)
- //println(t)
- }
-
- def comparisonMap = Map()
-
-}
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Dictionary.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Dictionary.scala
deleted file mode 100644
index e6ff55d234..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Dictionary.scala
+++ /dev/null
@@ -1,13 +0,0 @@
-package scala.collection.parallel.benchmarks.misc
-
-
-
-
-object Dictionary {
- val wordlist = wordlines.split(System.getProperty("line.separator")).filter(_.trim != "").toList
- val wordarray = wordlist.toArray
- def wordlines = {
- val is = getClass.getClassLoader.getResourceAsStream("scala/collection/parallel/benchmarks/misc/dict.txt")
- scala.io.Source.fromInputStream(is).mkString
- }
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Loader.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Loader.scala
deleted file mode 100644
index c7e4723e64..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Loader.scala
+++ /dev/null
@@ -1,66 +0,0 @@
-package scala.collection.parallel.benchmarks
-package misc
-
-
-
-
-
-
-import collection._ //immutable._
-import collection.parallel._//immutable._
-
-
-
-
-
-
-
-object Loader extends BenchCompanion {
- def benchName = "Loader"
- def collectionName = "General"
- def apply(sz: Int, p: Int, what: String) = new Loader(sz, p, what)
- override def defaultSize = 100
-}
-
-
-class Loader(val size: Int, val parallelism: Int, val runWhat: String) extends Bench {
- def companion = Loader
-
- override def repetitionsPerRun = 1
-
- reset
-
- val wa = Dictionary.wordarray ++ Dictionary.wordarray ++ Dictionary.wordarray
-
- def runseq {
- val m = Map(
- '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL",
- '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ"
- )
- val charCode: Map[Char, Char] = for ((digit, letters) <- m; letter <- letters) yield letter -> digit
- def wordCode(word: String): String = (word.toUpperCase.toList map charCode).toString
-
- wa groupBy wordCode
- }
-
- def runpar {
- val m = Map(
- '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL",
- '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ"
- )
- val charCode: Map[Char, Char] = for ((digit, letters) <- m; letter <- letters) yield letter -> digit
- def wordCode(word: String): String = (word.toUpperCase.toList map charCode).toString
-
- wa.par groupBy wordCode
- }
-
- def reset = runWhat match {
- case "seq" =>
- case "par" =>
- collection.parallel.tasksupport.environment.asInstanceOf[concurrent.forkjoin.ForkJoinPool].setParallelism(parallelism)
- }
-
- def comparisonMap = Map()
-
-}
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/dict.txt b/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/dict.txt
deleted file mode 100644
index 46e95c907f..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/dict.txt
+++ /dev/null
@@ -1,58111 +0,0 @@
-aardvark
-aardwolf
-aaron
-aback
-abacus
-abaft
-abalone
-abandon
-abandoned
-abandonment
-abandons
-abase
-abased
-abasement
-abash
-abashed
-abate
-abated
-abatement
-abates
-abattoir
-abattoirs
-abbe
-abbess
-abbey
-abbeys
-abbot
-abbots
-abbreviate
-abbreviated
-abbreviates
-abbreviating
-abbreviation
-abbreviations
-abdicate
-abdicated
-abdicates
-abdicating
-abdication
-abdomen
-abdomens
-abdominal
-abduct
-abducted
-abducting
-abduction
-abductions
-abductor
-abductors
-abducts
-abe
-abeam
-abel
-abele
-aberdeen
-aberrant
-aberration
-aberrations
-abet
-abets
-abetted
-abetting
-abeyance
-abhor
-abhorred
-abhorrence
-abhorrent
-abhors
-abide
-abided
-abides
-abiding
-abidjan
-abies
-abilities
-ability
-abject
-abjectly
-abjure
-abjured
-ablate
-ablates
-ablating
-ablation
-ablative
-ablaze
-able
-ablebodied
-abler
-ablest
-abloom
-ablution
-ablutions
-ably
-abnegation
-abnormal
-abnormalities
-abnormality
-abnormally
-aboard
-abode
-abodes
-abolish
-abolished
-abolishes
-abolishing
-abolition
-abolitionist
-abolitionists
-abomb
-abominable
-abominably
-abominate
-abominated
-abomination
-abominations
-aboriginal
-aborigines
-abort
-aborted
-aborting
-abortion
-abortionist
-abortionists
-abortions
-abortive
-aborts
-abound
-abounded
-abounding
-abounds
-about
-above
-abraded
-abraham
-abrasion
-abrasions
-abrasive
-abrasively
-abrasiveness
-abrasives
-abreast
-abridge
-abridged
-abridgement
-abridging
-abroad
-abrogate
-abrogated
-abrogating
-abrogation
-abrogations
-abrupt
-abruptly
-abruptness
-abscess
-abscesses
-abscissa
-abscissae
-abscissas
-abscond
-absconded
-absconder
-absconding
-absconds
-abseil
-abseiled
-abseiler
-abseiling
-abseils
-absence
-absences
-absent
-absented
-absentee
-absenteeism
-absentees
-absenting
-absently
-absentminded
-absentmindedly
-absentmindedness
-absolute
-absolutely
-absoluteness
-absolutes
-absolution
-absolutism
-absolutist
-absolutists
-absolve
-absolved
-absolves
-absolving
-absorb
-absorbed
-absorbency
-absorbent
-absorber
-absorbers
-absorbing
-absorbingly
-absorbs
-absorption
-absorptions
-absorptive
-absorptivity
-abstain
-abstained
-abstainer
-abstainers
-abstaining
-abstains
-abstemious
-abstemiously
-abstemiousness
-abstention
-abstentions
-abstinence
-abstinent
-abstract
-abstracted
-abstractedly
-abstracting
-abstraction
-abstractions
-abstractly
-abstracts
-abstruse
-abstrusely
-absurd
-absurder
-absurdest
-absurdist
-absurdities
-absurdity
-absurdly
-abundance
-abundances
-abundant
-abundantly
-abuse
-abused
-abuser
-abusers
-abuses
-abusing
-abusive
-abusively
-abusiveness
-abut
-abutment
-abutments
-abutted
-abutting
-abuzz
-aby
-abysmal
-abysmally
-abyss
-abyssal
-abysses
-acacia
-academe
-academia
-academic
-academical
-academically
-academician
-academicians
-academics
-academies
-academy
-acanthus
-acapulco
-accede
-acceded
-acceding
-accelerate
-accelerated
-accelerates
-accelerating
-acceleration
-accelerations
-accelerator
-accelerators
-accelerometer
-accelerometers
-accent
-accented
-accenting
-accents
-accentuate
-accentuated
-accentuates
-accentuating
-accentuation
-accept
-acceptability
-acceptable
-acceptably
-acceptance
-acceptances
-accepted
-accepting
-acceptor
-acceptors
-accepts
-access
-accessed
-accesses
-accessibility
-accessible
-accessing
-accession
-accessions
-accessories
-accessory
-accidence
-accident
-accidental
-accidentally
-accidentprone
-accidents
-acclaim
-acclaimed
-acclaims
-acclamation
-acclamations
-acclimatisation
-acclimatise
-acclimatised
-acclimatising
-accolade
-accolades
-accommodate
-accommodated
-accommodates
-accommodating
-accommodation
-accommodations
-accompanied
-accompanies
-accompaniment
-accompaniments
-accompanist
-accompany
-accompanying
-accomplice
-accomplices
-accomplish
-accomplished
-accomplishes
-accomplishing
-accomplishment
-accomplishments
-accord
-accordance
-accorded
-according
-accordingly
-accordion
-accordionist
-accordions
-accords
-accost
-accosted
-accosting
-accosts
-account
-accountability
-accountable
-accountancy
-accountant
-accountants
-accounted
-accounting
-accounts
-accra
-accredit
-accreditation
-accredited
-accrediting
-accredits
-accreted
-accretion
-accretions
-accrual
-accruals
-accrue
-accrued
-accrues
-accruing
-accumulate
-accumulated
-accumulates
-accumulating
-accumulation
-accumulations
-accumulative
-accumulator
-accumulators
-accuracies
-accuracy
-accurate
-accurately
-accursed
-accusal
-accusals
-accusation
-accusations
-accusative
-accusatory
-accuse
-accused
-accuser
-accusers
-accuses
-accusing
-accusingly
-accustom
-accustomed
-accustoming
-ace
-aced
-acentric
-acerbic
-acerbity
-acers
-aces
-acetal
-acetate
-acetates
-acetic
-acetone
-acetylene
-ache
-ached
-aches
-achievable
-achieve
-achieved
-achievement
-achievements
-achiever
-achievers
-achieves
-achieving
-aching
-achingly
-achings
-achromatic
-achy
-acid
-acidic
-acidification
-acidified
-acidify
-acidifying
-acidity
-acidly
-acidophiles
-acidrain
-acids
-acknowledge
-acknowledged
-acknowledgement
-acknowledgements
-acknowledges
-acknowledging
-acknowledgment
-acknowledgments
-acme
-acne
-acolyte
-acolytes
-aconite
-acorn
-acorns
-acoustic
-acoustical
-acoustically
-acoustics
-acquaint
-acquaintance
-acquaintances
-acquainted
-acquainting
-acquaints
-acquiesce
-acquiesced
-acquiescence
-acquiescent
-acquiescing
-acquire
-acquired
-acquirer
-acquirers
-acquires
-acquiring
-acquisition
-acquisitions
-acquisitive
-acquisitiveness
-acquit
-acquited
-acquites
-acquits
-acquittal
-acquittals
-acquittance
-acquitted
-acquitting
-acre
-acreage
-acres
-acrid
-acrimonious
-acrimoniously
-acrimony
-acrobat
-acrobatic
-acrobatics
-acrobats
-acronym
-acronyms
-across
-acrostic
-acrostics
-acrylic
-acrylics
-act
-acted
-acting
-actings
-actinides
-action
-actionable
-actions
-activate
-activated
-activates
-activating
-activation
-activations
-activator
-activators
-active
-actively
-actives
-activism
-activist
-activists
-activities
-activity
-actor
-actors
-actress
-actresses
-acts
-actual
-actualisation
-actualise
-actualised
-actualities
-actuality
-actually
-actuarial
-actuaries
-actuary
-actuate
-actuated
-actuates
-actuating
-actuation
-actuator
-actuators
-acuity
-acumen
-acupuncture
-acupuncturist
-acupuncturists
-acute
-acutely
-acuteness
-acuter
-acutest
-acyclic
-adage
-adages
-adagio
-adam
-adamant
-adamantly
-adapt
-adaptability
-adaptable
-adaptation
-adaptations
-adapted
-adapter
-adapters
-adapting
-adaptive
-adaptively
-adaptivity
-adaptor
-adaptors
-adapts
-add
-added
-addenda
-addendum
-adder
-adders
-addict
-addicted
-addiction
-addictions
-addictive
-addictiveness
-addicts
-adding
-addition
-additional
-additionally
-additions
-additive
-additively
-additives
-addle
-addled
-addles
-addling
-address
-addressability
-addressable
-addressed
-addressee
-addressees
-addresses
-addressing
-adds
-adduce
-adduced
-adduces
-adducing
-adelaide
-aden
-adenine
-adenoid
-adenoids
-adenoma
-adenomas
-adept
-adepts
-adequacy
-adequate
-adequately
-adhere
-adhered
-adherence
-adherent
-adherents
-adherer
-adherers
-adheres
-adhering
-adhesion
-adhesions
-adhesive
-adhesiveness
-adhesives
-adhoc
-adiabatic
-adiabatically
-adieu
-adieus
-adieux
-adios
-adipose
-adit
-adjacency
-adjacent
-adjacently
-adjectival
-adjective
-adjectives
-adjoin
-adjoined
-adjoining
-adjoins
-adjourn
-adjourned
-adjourning
-adjournment
-adjourns
-adjudge
-adjudged
-adjudges
-adjudicate
-adjudicated
-adjudicates
-adjudicating
-adjudication
-adjudications
-adjudicator
-adjudicators
-adjunct
-adjuncts
-adjure
-adjust
-adjustable
-adjusted
-adjuster
-adjusting
-adjustment
-adjustments
-adjusts
-adjutant
-adlib
-adlibs
-adman
-admen
-admin
-administer
-administered
-administering
-administers
-administrate
-administrated
-administrating
-administration
-administrations
-administrative
-administratively
-administrator
-administrators
-admirable
-admirably
-admiral
-admirals
-admiration
-admire
-admired
-admirer
-admirers
-admires
-admiring
-admiringly
-admissibility
-admissible
-admission
-admissions
-admit
-admits
-admittance
-admittances
-admitted
-admittedly
-admitting
-admix
-admixture
-admonish
-admonished
-admonishes
-admonishing
-admonishment
-admonition
-admonitions
-admonitory
-ado
-adobe
-adolescence
-adolescent
-adolescents
-adonis
-adopt
-adopted
-adopter
-adopting
-adoption
-adoptions
-adoptive
-adopts
-adorable
-adorably
-adoration
-adore
-adored
-adorer
-adorers
-adores
-adoring
-adoringly
-adorn
-adorned
-adorning
-adornment
-adornments
-adorns
-adrenal
-adrenalin
-adrenaline
-adrift
-adroit
-adroitly
-adroitness
-adsorb
-adsorbed
-adsorption
-adulation
-adulatory
-adult
-adulterate
-adulterated
-adulterates
-adulterating
-adulteration
-adulterations
-adulterer
-adulterers
-adulteress
-adulteresses
-adulterous
-adultery
-adulthood
-adults
-adumbrate
-adumbrated
-adumbrating
-advance
-advanced
-advancement
-advancements
-advancer
-advances
-advancing
-advantage
-advantaged
-advantageous
-advantageously
-advantages
-advent
-advents
-adventure
-adventured
-adventurer
-adventurers
-adventures
-adventuring
-adventurism
-adventurous
-adventurously
-adverb
-adverbial
-adverbs
-adversarial
-adversaries
-adversary
-adverse
-adversely
-adversities
-adversity
-advert
-adverted
-advertise
-advertised
-advertisement
-advertisements
-advertiser
-advertisers
-advertises
-advertising
-adverts
-advice
-advices
-advisability
-advisable
-advise
-advised
-advisedly
-adviser
-advisers
-advises
-advising
-advisory
-advocacy
-advocate
-advocated
-advocates
-advocating
-adze
-aegean
-aegina
-aegis
-aeolian
-aeon
-aeons
-aerate
-aerated
-aerates
-aerating
-aeration
-aerator
-aerial
-aerially
-aerials
-aerify
-aerobatic
-aerobatics
-aerobe
-aerobes
-aerobic
-aerobically
-aerobics
-aerobraking
-aerodrome
-aerodromes
-aerodynamic
-aerodynamically
-aerodynamics
-aerofoil
-aerofoils
-aeronaut
-aeronautic
-aeronautical
-aeronautics
-aeroplane
-aeroplanes
-aerosol
-aerosols
-aerospace
-aesop
-aesthete
-aesthetes
-aesthetic
-aesthetically
-aestheticism
-aestheticsy
-afar
-affability
-affable
-affably
-affair
-affairs
-affect
-affectation
-affectations
-affected
-affectedly
-affecting
-affection
-affectionate
-affectionately
-affections
-affective
-affects
-afferent
-affidavit
-affidavits
-affiliate
-affiliated
-affiliates
-affiliating
-affiliation
-affiliations
-affine
-affinities
-affinity
-affirm
-affirmation
-affirmations
-affirmative
-affirmatively
-affirmed
-affirming
-affirms
-affix
-affixed
-affixes
-affixing
-afflict
-afflicted
-afflicting
-affliction
-afflictions
-afflicts
-affluence
-affluent
-afflux
-afford
-affordability
-affordable
-afforded
-affording
-affords
-afforestation
-afforested
-affray
-affront
-affronted
-affronts
-afghan
-afghani
-afghans
-afield
-afire
-aflame
-afloat
-afoot
-aforementioned
-aforesaid
-aforethought
-afraid
-afresh
-africa
-african
-africans
-afro
-afros
-aft
-after
-afterbirth
-aftercare
-aftereffect
-aftereffects
-afterglow
-afterlife
-afterlives
-aftermath
-afternoon
-afternoons
-aftershave
-aftershocks
-aftertaste
-afterthought
-afterthoughts
-afterward
-afterwards
-aga
-again
-against
-agakhan
-agape
-agar
-agaragar
-agave
-agaves
-age
-aged
-ageing
-ageings
-ageism
-ageless
-agencies
-agency
-agenda
-agendas
-agendums
-agent
-agents
-ageold
-ages
-agglomerated
-agglomerating
-agglomeration
-agglomerations
-agglutinative
-aggravate
-aggravated
-aggravates
-aggravating
-aggravation
-aggravations
-aggregate
-aggregated
-aggregates
-aggregating
-aggregation
-aggregations
-aggression
-aggressions
-aggressive
-aggressively
-aggressiveness
-aggressor
-aggressors
-aggrieved
-aggrievedly
-aghast
-agile
-agiler
-agility
-aging
-agings
-agio
-agitate
-agitated
-agitatedly
-agitates
-agitating
-agitation
-agitations
-agitator
-agitators
-agitprop
-agleam
-aglow
-agnostic
-agnosticism
-agnostics
-ago
-agog
-agonies
-agonise
-agonised
-agonises
-agonising
-agonisingly
-agonist
-agonists
-agony
-agora
-agoraphobia
-agoraphobic
-agouti
-agrarian
-agree
-agreeable
-agreeableness
-agreeably
-agreed
-agreeing
-agreement
-agreements
-agrees
-agribusiness
-agricultural
-agriculturalist
-agriculturalists
-agriculturally
-agriculture
-agrimony
-agrochemical
-agrochemicals
-agronomist
-agronomists
-agronomy
-aground
-ague
-ah
-aha
-ahead
-ahem
-ahoy
-aid
-aide
-aided
-aidedecamp
-aider
-aiders
-aides
-aidesdecamp
-aiding
-aids
-ail
-aileron
-ailerons
-ailing
-ailment
-ailments
-ails
-aim
-aimed
-aimer
-aiming
-aimless
-aimlessly
-aimlessness
-aims
-aint
-air
-airbase
-airborne
-airbrush
-airbus
-airconditioned
-airconditioner
-airconditioning
-aircraft
-aircrew
-aircrews
-aire
-aired
-airfield
-airfields
-airflow
-airforce
-airframe
-airframes
-airgun
-airier
-airiest
-airily
-airiness
-airing
-airings
-airless
-airlift
-airlifted
-airlifting
-airlifts
-airline
-airliner
-airliners
-airlines
-airlock
-airlocks
-airmail
-airman
-airmen
-airplane
-airplay
-airport
-airports
-airraid
-airs
-airship
-airships
-airsick
-airsickness
-airspace
-airstream
-airstrip
-airstrips
-airtight
-airtime
-airwave
-airwaves
-airway
-airways
-airworthiness
-airworthy
-airy
-aisle
-aisles
-aitches
-ajar
-akimbo
-akin
-ala
-alabama
-alabaster
-alacarte
-alack
-alacrity
-aladdin
-alanine
-alarm
-alarmed
-alarming
-alarmingly
-alarmism
-alarmist
-alarms
-alas
-alaska
-alaskan
-alb
-albania
-albany
-albatross
-albatrosses
-albeit
-albinism
-albino
-album
-albumen
-albumin
-albums
-alchemical
-alchemist
-alchemists
-alchemy
-alcohol
-alcoholic
-alcoholics
-alcoholism
-alcohols
-alcove
-alcoves
-aldehyde
-aldehydes
-alder
-alderman
-aldermen
-aldrin
-ale
-alehouse
-alembic
-alert
-alerted
-alerting
-alertly
-alertness
-alerts
-ales
-alfalfa
-alfatah
-alga
-algae
-algal
-algebra
-algebraic
-algebraical
-algebraically
-algebraist
-algebras
-algeria
-algerian
-algiers
-algorithm
-algorithmic
-algorithmically
-algorithms
-alias
-aliases
-alibaba
-alibi
-alibis
-alien
-alienate
-alienated
-alienates
-alienating
-alienation
-aliened
-aliening
-aliens
-alight
-alighted
-alighting
-alights
-align
-aligned
-aligning
-alignment
-alignments
-aligns
-alike
-alimentary
-alimony
-aline
-alined
-alines
-alining
-aliphatic
-aliquot
-aliquots
-alive
-alkali
-alkalic
-alkaline
-alkalinity
-alkalis
-alkalise
-alkaloid
-alkaloids
-alkanes
-alkyl
-all
-allay
-allayed
-allaying
-allays
-allegation
-allegations
-allege
-alleged
-allegedly
-alleges
-allegiance
-allegiances
-alleging
-allegorical
-allegorically
-allegories
-allegory
-allegri
-allegro
-allele
-alleles
-allelic
-allergen
-allergens
-allergic
-allergies
-allergy
-alleviate
-alleviated
-alleviates
-alleviating
-alleviation
-alleviations
-alley
-alleys
-alleyway
-alleyways
-alliance
-alliances
-allied
-allies
-alligator
-alligators
-alliterate
-alliterated
-alliterating
-alliteration
-alliterations
-alliterative
-allocatable
-allocate
-allocated
-allocates
-allocating
-allocation
-allocations
-allocator
-allocators
-allophones
-allot
-allotment
-allotments
-allotrope
-allotropic
-allots
-allotted
-allotting
-allow
-allowable
-allowance
-allowances
-allowed
-allowing
-allows
-alloy
-alloyed
-alloying
-alloys
-allude
-alluded
-alludes
-alluding
-allure
-allured
-allurement
-allurements
-allures
-alluring
-alluringly
-allusion
-allusions
-allusive
-alluvia
-alluvial
-alluvium
-ally
-allying
-almanac
-almanacs
-almighty
-almond
-almonds
-almost
-alms
-almshouse
-almshouses
-aloe
-aloes
-aloft
-aloha
-alone
-aloneness
-along
-alongside
-aloof
-aloofness
-aloud
-alp
-alpaca
-alpacas
-alpha
-alphabet
-alphabetic
-alphabetical
-alphabetically
-alphabets
-alphanumeric
-alphas
-alpine
-alps
-already
-alright
-also
-alt
-altar
-altarpiece
-altarpieces
-altars
-alter
-alterable
-alteration
-alterations
-altercate
-altercation
-altercations
-altered
-alterego
-altering
-alternate
-alternated
-alternately
-alternates
-alternating
-alternation
-alternations
-alternative
-alternatively
-alternatives
-alternator
-alternators
-alters
-although
-altimeter
-altimeters
-altitude
-altitudes
-alto
-altogether
-altruism
-altruist
-altruistic
-altruistically
-alts
-alum
-aluminium
-aluminum
-alumni
-alumnus
-alveolar
-alveoli
-always
-am
-amalgam
-amalgamate
-amalgamated
-amalgamates
-amalgamating
-amalgamation
-amalgamations
-amalgams
-amanuensis
-amass
-amassed
-amasses
-amassing
-amateur
-amateurish
-amateurishly
-amateurishness
-amateurism
-amateurs
-amatory
-amaze
-amazed
-amazement
-amazes
-amazing
-amazingly
-amazon
-amazons
-ambassador
-ambassadorial
-ambassadors
-amber
-ambergris
-ambiance
-ambidextrous
-ambience
-ambient
-ambiguities
-ambiguity
-ambiguous
-ambiguously
-ambit
-ambition
-ambitions
-ambitious
-ambitiously
-ambivalence
-ambivalent
-ambivalently
-amble
-ambled
-ambler
-ambles
-ambling
-ambrosia
-ambulance
-ambulances
-ambulant
-ambulate
-ambulatory
-ambuscade
-ambuscades
-ambush
-ambushed
-ambushers
-ambushes
-ambushing
-ameliorate
-ameliorated
-ameliorates
-ameliorating
-amelioration
-amen
-amenability
-amenable
-amend
-amendable
-amended
-amending
-amendment
-amendments
-amends
-amenities
-amenity
-amenorrhoea
-amens
-america
-american
-americans
-americium
-amethyst
-amethystine
-amethysts
-amiability
-amiable
-amiableness
-amiably
-amicability
-amicable
-amicably
-amid
-amide
-amidships
-amidst
-amigo
-amine
-amines
-amino
-amir
-amiss
-amity
-amman
-ammeter
-ammeters
-ammo
-ammonia
-ammonites
-ammonium
-ammunition
-amnesia
-amnesiac
-amnesic
-amnesties
-amnesty
-amniotic
-amoeba
-amoebae
-amoebic
-amok
-among
-amongst
-amoral
-amorality
-amorist
-amorous
-amorously
-amorphous
-amortisation
-amortise
-amortised
-amount
-amounted
-amounting
-amounts
-amour
-amours
-amp
-ampere
-amperes
-ampersand
-ampersands
-amphetamine
-amphetamines
-amphibia
-amphibian
-amphibians
-amphibious
-amphitheatre
-amphitheatres
-amphora
-ample
-ampler
-amplification
-amplifications
-amplified
-amplifier
-amplifiers
-amplifies
-amplify
-amplifying
-amplitude
-amplitudes
-amply
-ampoules
-amps
-ampule
-ampules
-ampuls
-amputate
-amputated
-amputating
-amputation
-amputations
-amputee
-amputees
-amuck
-amulet
-amulets
-amuse
-amused
-amusement
-amusements
-amuses
-amusing
-amusingly
-an
-ana
-anabolic
-anachronism
-anachronisms
-anachronistic
-anachronistically
-anaconda
-anacondas
-anaemia
-anaemic
-anaerobic
-anaerobically
-anaesthesia
-anaesthetic
-anaesthetics
-anaesthetise
-anaesthetised
-anaesthetising
-anaesthetist
-anaesthetists
-anagram
-anagrammatic
-anagrammatically
-anagrams
-anal
-analgesia
-analgesic
-analgesics
-anally
-analogical
-analogies
-analogise
-analogous
-analogously
-analogue
-analogues
-analogy
-analysable
-analyse
-analysed
-analyser
-analysers
-analyses
-analysing
-analysis
-analyst
-analysts
-analytic
-analytical
-analytically
-anamorphic
-ananas
-anaphora
-anaphoric
-anarchic
-anarchical
-anarchism
-anarchist
-anarchistic
-anarchists
-anarchy
-anathema
-anatomic
-anatomical
-anatomically
-anatomies
-anatomist
-anatomists
-anatomy
-ancestor
-ancestors
-ancestral
-ancestries
-ancestry
-anchor
-anchorage
-anchorages
-anchored
-anchoring
-anchorite
-anchors
-anchovies
-anchovy
-ancient
-anciently
-ancients
-ancillary
-and
-andante
-andes
-andrew
-androgynous
-android
-androids
-anecdotal
-anecdotally
-anecdote
-anecdotes
-anechoic
-anemia
-anemic
-anemone
-anemones
-anergy
-aneroid
-aneurysm
-aneurysms
-anew
-angel
-angelic
-angelica
-angels
-angelus
-anger
-angered
-angering
-angers
-angina
-anginal
-angioplasty
-angle
-angled
-anglepoise
-angler
-anglers
-angles
-anglian
-anglican
-angling
-angola
-angolan
-angolans
-angora
-angoras
-angrier
-angriest
-angrily
-angry
-angst
-angstroms
-anguish
-anguished
-anguishes
-angular
-angularity
-anhydrous
-anil
-aniline
-animal
-animals
-animate
-animated
-animatedly
-animates
-animating
-animation
-animations
-animator
-animators
-animism
-animist
-animists
-animosities
-animosity
-animus
-anion
-anionic
-anions
-anise
-aniseed
-aniseeds
-anisotropic
-anisotropies
-anisotropy
-ankara
-ankle
-ankles
-anklet
-anklets
-anna
-annal
-annals
-anneal
-annealed
-annealer
-annealing
-annex
-annexation
-annexations
-annexe
-annexed
-annexes
-annexing
-annihilate
-annihilated
-annihilates
-annihilating
-annihilation
-anniversaries
-anniversary
-annotate
-annotated
-annotates
-annotating
-annotation
-annotations
-announce
-announced
-announcement
-announcements
-announcer
-announcers
-announces
-announcing
-annoy
-annoyance
-annoyances
-annoyed
-annoyer
-annoyers
-annoying
-annoyingly
-annoys
-annual
-annualised
-annually
-annuals
-annuities
-annuity
-annul
-annular
-annuli
-annulled
-annulling
-annulment
-annuls
-annulus
-annunciation
-anode
-anodes
-anodised
-anodyne
-anoint
-anointed
-anointing
-anoints
-anomalies
-anomalous
-anomalously
-anomaly
-anomic
-anon
-anonym
-anonymity
-anonymous
-anonymously
-anonyms
-anorak
-anoraks
-anorexia
-anorexic
-another
-answer
-answerable
-answered
-answerer
-answering
-answers
-ant
-antacid
-antacids
-antagonise
-antagonised
-antagonises
-antagonising
-antagonism
-antagonisms
-antagonist
-antagonistic
-antagonists
-ante
-anteater
-anteaters
-antecedent
-antecedents
-antechamber
-antedate
-antedates
-antedating
-antediluvian
-antelope
-antelopes
-antenatal
-antenna
-antennae
-antennas
-anterior
-anteriorly
-anteroom
-anthem
-anthems
-anther
-anthologies
-anthologise
-anthologised
-anthology
-anthracite
-anthrax
-anthropic
-anthropocentric
-anthropogenic
-anthropogenically
-anthropoid
-anthropological
-anthropologist
-anthropologists
-anthropology
-anthropometric
-anthropomorphic
-anthropomorphising
-anthropomorphism
-anti
-antiabortionists
-antiaircraft
-antibiotic
-antibiotics
-antibodies
-antibody
-antic
-anticipate
-anticipated
-anticipates
-anticipating
-anticipation
-anticipations
-anticipative
-anticipatory
-anticlimax
-anticlockwise
-anticoagulants
-anticonstitutional
-antics
-anticyclone
-antidepressant
-antidepressants
-antidote
-antidotes
-antifreeze
-antigen
-antigenic
-antigens
-antihistamines
-antilope
-antimatter
-antimony
-antioxidants
-antiparticles
-antipathetic
-antipathies
-antipathy
-antipodes
-antiquarian
-antiquarianism
-antiquarians
-antiquaries
-antiquary
-antiquated
-antique
-antiques
-antiquities
-antiquity
-antiseptic
-antiseptics
-antisocial
-antistatic
-antisymmetric
-antisymmetry
-antitheses
-antithesis
-antithetic
-antithetical
-antithetically
-antitrust
-antiviral
-antler
-antlers
-antlion
-antlions
-antonym
-antonyms
-antral
-antrum
-ants
-antwerp
-anus
-anvil
-anvils
-anxieties
-anxiety
-anxious
-anxiously
-any
-anybody
-anyhow
-anymore
-anyone
-anyplace
-anything
-anyway
-anyways
-anywhere
-aorist
-aorta
-aortas
-aortic
-apace
-apache
-apaches
-apart
-apartment
-apartments
-apartness
-apathetic
-apathetically
-apathy
-ape
-aped
-apeman
-aperies
-aperiodic
-aperiodically
-aperitif
-aperitifs
-aperture
-apertures
-apery
-apes
-apex
-aphasia
-aphelion
-aphid
-aphids
-aphorism
-aphorisms
-aphorist
-aphoristic
-aphrodisiac
-aphrodisiacs
-apian
-apiaries
-apiarist
-apiary
-apiece
-aping
-apis
-apish
-aplenty
-aplomb
-apnea
-apnoea
-apocalypse
-apocalyptic
-apocryphal
-apogee
-apolitical
-apollo
-apologetic
-apologetically
-apologia
-apologies
-apologise
-apologised
-apologises
-apologising
-apologist
-apologists
-apology
-apoplectic
-apoplexy
-apostasy
-apostate
-apostates
-apostle
-apostles
-apostolate
-apostolic
-apostrophe
-apostrophes
-apostrophised
-apothecaries
-apothecary
-apotheosis
-appal
-appalled
-appalling
-appallingly
-appals
-apparatchik
-apparatchiks
-apparatus
-apparatuses
-apparel
-apparelled
-apparent
-apparently
-apparition
-apparitions
-appeal
-appealed
-appealing
-appealingly
-appeals
-appear
-appearance
-appearances
-appeared
-appearing
-appears
-appease
-appeased
-appeasement
-appeaser
-appeasers
-appeases
-appeasing
-appellant
-appellants
-appellate
-appellation
-appellations
-append
-appendage
-appendages
-appended
-appendices
-appendicitis
-appending
-appendix
-appends
-appertain
-appertained
-appertaining
-appetiser
-appetising
-appetite
-appetites
-applaud
-applauded
-applauding
-applauds
-applause
-apple
-applecart
-applepie
-apples
-applet
-appliance
-appliances
-applicability
-applicable
-applicant
-applicants
-application
-applications
-applicative
-applicator
-applicators
-applied
-applier
-applies
-applique
-apply
-applying
-appoint
-appointed
-appointee
-appointees
-appointing
-appointment
-appointments
-appoints
-apportion
-apportioned
-apportioning
-apportionment
-apportions
-apposite
-apposition
-appraisal
-appraisals
-appraise
-appraised
-appraisees
-appraiser
-appraisers
-appraises
-appraising
-appraisingly
-appreciable
-appreciably
-appreciate
-appreciated
-appreciates
-appreciating
-appreciation
-appreciations
-appreciative
-appreciatively
-apprehend
-apprehended
-apprehending
-apprehends
-apprehension
-apprehensions
-apprehensive
-apprehensively
-apprentice
-apprenticed
-apprentices
-apprenticeship
-apprenticeships
-apprise
-apprised
-apprising
-appro
-approach
-approachability
-approachable
-approached
-approaches
-approaching
-approbation
-appropriate
-appropriated
-appropriately
-appropriateness
-appropriates
-appropriating
-appropriation
-appropriations
-approval
-approvals
-approve
-approved
-approves
-approving
-approvingly
-approximate
-approximated
-approximately
-approximates
-approximating
-approximation
-approximations
-apricot
-apricots
-april
-apriori
-apron
-aprons
-apropos
-apse
-apses
-apsis
-apt
-aptest
-aptitude
-aptitudes
-aptly
-aptness
-aqua
-aqualung
-aquamarine
-aquanaut
-aquaria
-aquarium
-aquariums
-aquatic
-aquatics
-aqueduct
-aqueducts
-aqueous
-aquifer
-aquifers
-aquiline
-arab
-arabesque
-arabesques
-arabia
-arabian
-arabians
-arabic
-arable
-arabs
-arachnid
-arachnids
-arachnoid
-arachnophobia
-arak
-araks
-ararat
-arbiter
-arbiters
-arbitrage
-arbitrageur
-arbitrageurs
-arbitral
-arbitrarily
-arbitrariness
-arbitrary
-arbitrate
-arbitrated
-arbitrates
-arbitrating
-arbitration
-arbitrations
-arbitrator
-arbitrators
-arbor
-arboreal
-arboretum
-arbour
-arc
-arcade
-arcades
-arcadia
-arcading
-arcana
-arcane
-arcanely
-arcaneness
-arced
-arch
-archaeological
-archaeologically
-archaeologist
-archaeologists
-archaeology
-archaeopteryx
-archaic
-archaism
-archaisms
-archangel
-archangels
-archbishop
-archbishops
-archdeacon
-archdeaconry
-archdeacons
-archdiocese
-archduke
-archdukes
-arched
-archenemies
-archenemy
-archer
-archers
-archery
-arches
-archetypal
-archetype
-archetypes
-archetypical
-arching
-archipelago
-architect
-architectonic
-architects
-architectural
-architecturally
-architecture
-architectures
-architrave
-architraves
-archival
-archive
-archived
-archives
-archiving
-archivist
-archivists
-archly
-archness
-archway
-archways
-arcing
-arcs
-arctic
-ardency
-ardent
-ardently
-ardour
-arduous
-are
-area
-areal
-areas
-arena
-arenas
-arent
-argent
-argon
-argot
-arguable
-arguably
-argue
-argued
-arguer
-arguers
-argues
-arguing
-argument
-argumentation
-argumentative
-argumentatively
-arguments
-argus
-aria
-arias
-arid
-aridity
-aridness
-aright
-arise
-arisen
-arises
-arising
-aristocracies
-aristocracy
-aristocrat
-aristocratic
-aristocrats
-arithmetic
-arithmetical
-arithmetically
-arizona
-ark
-arkansas
-arks
-arm
-armada
-armadas
-armadillo
-armament
-armaments
-armature
-armatures
-armband
-armbands
-armchair
-armchairs
-armed
-armenia
-armful
-armfuls
-armhole
-armholes
-armies
-arming
-armistice
-armless
-armlet
-armlets
-armour
-armoured
-armourer
-armourers
-armouries
-armourplated
-armoury
-armpit
-armpits
-armrest
-arms
-army
-aroma
-aromas
-aromatherapist
-aromatherapy
-aromatic
-aromaticity
-aromatics
-arose
-around
-arousal
-arousals
-arouse
-aroused
-arouses
-arousing
-arrange
-arrangeable
-arranged
-arrangement
-arrangements
-arranger
-arranges
-arranging
-arrant
-arrases
-array
-arrayed
-arraying
-arrays
-arrears
-arrest
-arrestable
-arrested
-arrester
-arresting
-arrests
-arrhythmia
-arrival
-arrivals
-arrive
-arrived
-arriver
-arrives
-arriving
-arrogance
-arrogant
-arrogantly
-arrow
-arrowed
-arrowhead
-arrowheads
-arrowing
-arrowroot
-arrows
-arsenal
-arsenals
-arsenic
-arsenide
-arson
-arsonist
-arsonists
-art
-artefact
-artefacts
-artefactual
-arterial
-arteries
-artery
-artful
-artfully
-artfulness
-arthritic
-arthritis
-arthropod
-arthropods
-arthur
-artichoke
-artichokes
-article
-articled
-articles
-articulacy
-articular
-articulate
-articulated
-articulately
-articulates
-articulating
-articulation
-articulations
-articulatory
-artier
-artifice
-artificial
-artificiality
-artificially
-artillery
-artisan
-artisans
-artist
-artiste
-artistes
-artistic
-artistically
-artistry
-artists
-artless
-artlessly
-artlessness
-arts
-artwork
-artworks
-arty
-arum
-as
-asbestos
-asbestosis
-ascend
-ascendancy
-ascendant
-ascended
-ascendency
-ascender
-ascending
-ascends
-ascension
-ascensions
-ascent
-ascents
-ascertain
-ascertainable
-ascertained
-ascertaining
-ascertainment
-ascertains
-ascetic
-asceticism
-ascetics
-ascorbic
-ascribable
-ascribe
-ascribed
-ascribes
-ascribing
-ascription
-ascriptions
-aseptic
-asexual
-ash
-ashamed
-ashamedly
-ashbin
-ashbins
-ashcans
-ashen
-ashes
-ashore
-ashtray
-ashtrays
-ashy
-asia
-asian
-asians
-asiatic
-aside
-asides
-asinine
-ask
-askance
-asked
-askers
-askew
-asking
-asks
-aslant
-asleep
-asocial
-asp
-asparagus
-aspect
-aspects
-asperity
-aspersion
-aspersions
-asphalt
-asphyxia
-asphyxiate
-asphyxiated
-asphyxiation
-aspic
-aspidistra
-aspirant
-aspirants
-aspirate
-aspirated
-aspirates
-aspirating
-aspiration
-aspirational
-aspirations
-aspirators
-aspire
-aspired
-aspires
-aspirin
-aspiring
-aspirins
-asps
-ass
-assail
-assailable
-assailant
-assailants
-assailed
-assailing
-assails
-assassin
-assassinate
-assassinated
-assassinating
-assassination
-assassinations
-assassins
-assault
-assaulted
-assaulting
-assaults
-assay
-assayed
-assayer
-assays
-assegai
-assegais
-assemblage
-assemblages
-assemble
-assembled
-assembler
-assemblers
-assembles
-assemblies
-assembling
-assembly
-assent
-assented
-assenting
-assents
-assert
-asserted
-asserting
-assertion
-assertions
-assertive
-assertively
-assertiveness
-asserts
-asses
-assess
-assessable
-assessed
-assesses
-assessing
-assessment
-assessments
-assessor
-assessors
-asset
-assets
-assiduity
-assiduous
-assiduously
-assign
-assignable
-assignation
-assignations
-assigned
-assignees
-assigner
-assigning
-assignment
-assignments
-assigns
-assimilable
-assimilate
-assimilated
-assimilates
-assimilating
-assimilation
-assist
-assistance
-assistant
-assistants
-assisted
-assisting
-assists
-assizes
-associate
-associated
-associates
-associateship
-associating
-association
-associational
-associations
-associative
-associatively
-associativity
-assonance
-assort
-assorted
-assortment
-assortments
-assuage
-assuaged
-assuages
-assuaging
-assume
-assumed
-assumes
-assuming
-assumption
-assumptions
-assurance
-assurances
-assure
-assured
-assuredly
-assures
-assuring
-assyria
-assyrian
-aster
-asterisk
-asterisked
-asterisks
-astern
-asteroid
-asteroids
-asters
-asthma
-asthmatic
-asthmatics
-astigmatic
-astigmatism
-astir
-astonish
-astonished
-astonishes
-astonishing
-astonishingly
-astonishment
-astound
-astounded
-astounding
-astoundingly
-astounds
-astraddle
-astral
-astrally
-astray
-astride
-astringent
-astrolabe
-astrolabes
-astrologer
-astrologers
-astrological
-astrology
-astronaut
-astronautical
-astronautics
-astronauts
-astronomer
-astronomers
-astronomic
-astronomical
-astronomically
-astronomy
-astrophysical
-astrophysicist
-astrophysicists
-astrophysics
-astute
-astutely
-astuteness
-asunder
-aswan
-asylum
-asylums
-asymmetric
-asymmetrical
-asymmetrically
-asymmetries
-asymmetry
-asymptomatic
-asymptote
-asymptotes
-asymptotic
-asymptotically
-asynchronous
-asynchronously
-at
-atavism
-atavistic
-ate
-atelier
-atheism
-atheist
-atheistic
-atheistically
-atheists
-athena
-athens
-atherosclerosis
-athlete
-athletes
-athletic
-athletically
-athleticism
-athletics
-atlanta
-atlantic
-atlantis
-atlas
-atlases
-atmosphere
-atmospheres
-atmospheric
-atmospherically
-atmospherics
-atoll
-atolls
-atom
-atombomb
-atomic
-atomically
-atomicity
-atomisation
-atomised
-atomistic
-atoms
-atonal
-atonality
-atone
-atoned
-atonement
-atones
-atonic
-atoning
-atop
-atrial
-atrium
-atrocious
-atrociously
-atrocities
-atrocity
-atrophied
-atrophies
-atrophy
-atrophying
-atropine
-attach
-attachable
-attache
-attached
-attaches
-attaching
-attachment
-attachments
-attack
-attacked
-attacker
-attackers
-attacking
-attacks
-attain
-attainable
-attained
-attaining
-attainment
-attainments
-attains
-attempt
-attempted
-attempting
-attempts
-attend
-attendance
-attendances
-attendant
-attendants
-attended
-attendees
-attender
-attenders
-attending
-attends
-attention
-attentional
-attentions
-attentive
-attentively
-attentiveness
-attenuate
-attenuated
-attenuates
-attenuating
-attenuation
-attenuator
-attenuators
-attest
-attestation
-attested
-attesting
-attests
-attic
-attics
-attila
-attire
-attired
-attiring
-attitude
-attitudes
-attitudinal
-attorney
-attorneys
-attract
-attracted
-attracting
-attraction
-attractions
-attractive
-attractively
-attractiveness
-attractor
-attractors
-attracts
-attributable
-attribute
-attributed
-attributes
-attributing
-attribution
-attributions
-attributive
-attrition
-attritional
-attune
-attuned
-atypical
-atypically
-aubergine
-aubergines
-auburn
-auction
-auctioned
-auctioneer
-auctioneers
-auctioning
-auctions
-audacious
-audaciously
-audacity
-audibility
-audible
-audibly
-audience
-audiences
-audio
-audiovisual
-audit
-audited
-auditing
-audition
-auditioned
-auditioning
-auditions
-auditive
-auditor
-auditorium
-auditors
-auditory
-audits
-auger
-augers
-augite
-augment
-augmentation
-augmentations
-augmented
-augmenting
-augments
-augur
-augured
-augurs
-augury
-august
-augustus
-auk
-auks
-aunt
-auntie
-aunties
-aunts
-aupair
-aupairs
-aura
-aural
-aurally
-auras
-aurevoir
-auric
-auriculas
-aurora
-aurorae
-auroral
-auroras
-auspice
-auspices
-auspicious
-auspiciously
-aussie
-aussies
-austere
-austerely
-austerity
-austral
-australian
-austria
-autarchy
-auteur
-authentic
-authentically
-authenticate
-authenticated
-authenticates
-authenticating
-authentication
-authenticator
-authenticators
-authenticity
-author
-authored
-authoress
-authorial
-authoring
-authorisation
-authorisations
-authorise
-authorised
-authorises
-authorising
-authoritarian
-authoritarianism
-authoritarians
-authoritative
-authoritatively
-authorities
-authority
-authors
-authorship
-autism
-autistic
-auto
-autobahn
-autobahns
-autobiographical
-autobiographically
-autobiographies
-autobiography
-autocracies
-autocracy
-autocrat
-autocratic
-autocratically
-autocrats
-autocue
-autograph
-autographed
-autographing
-autographs
-autoignition
-autoimmune
-automat
-automata
-automate
-automated
-automates
-automatic
-automatically
-automatics
-automating
-automation
-automaton
-automats
-automobile
-automorphism
-automorphisms
-automotive
-autonomic
-autonomous
-autonomously
-autonomy
-autopilot
-autopsies
-autopsy
-autosuggestion
-autumn
-autumnal
-autumns
-auxiliaries
-auxiliary
-avail
-availabilities
-availability
-available
-availed
-availing
-avails
-avalanche
-avalanches
-avalanching
-avantgarde
-avarice
-avaricious
-avariciousness
-ave
-avenge
-avenged
-avenger
-avengers
-avenges
-avenging
-avens
-avenue
-avenues
-aver
-average
-averaged
-averagely
-averages
-averaging
-averred
-averring
-avers
-averse
-aversion
-aversions
-aversive
-avert
-averted
-averting
-averts
-avian
-aviaries
-aviary
-aviate
-aviation
-aviator
-aviators
-avid
-avidity
-avidly
-avionics
-avocado
-avoid
-avoidable
-avoidance
-avoided
-avoiding
-avoids
-avoirdupois
-avow
-avowal
-avowals
-avowed
-avowedly
-avowing
-avulsion
-avuncular
-await
-awaited
-awaiting
-awaits
-awake
-awaken
-awakened
-awakening
-awakenings
-awakens
-awakes
-awaking
-award
-awarded
-awarding
-awards
-aware
-awareness
-awash
-away
-awe
-awed
-aweless
-awesome
-awesomely
-awesomeness
-awestruck
-awful
-awfully
-awfulness
-awhile
-awkward
-awkwardest
-awkwardly
-awkwardness
-awls
-awn
-awning
-awnings
-awoke
-awoken
-awol
-awry
-axe
-axed
-axehead
-axeheads
-axeman
-axes
-axial
-axially
-axillary
-axing
-axiom
-axiomatic
-axiomatically
-axiomatising
-axioms
-axis
-axle
-axles
-axolotl
-axon
-axons
-aye
-ayurvedic
-azalea
-azaleas
-azimuth
-azimuthal
-azores
-aztec
-aztecs
-azure
-baa
-baaing
-baal
-babas
-babble
-babbled
-babbler
-babblers
-babbles
-babbling
-babe
-babel
-babes
-babies
-baboon
-baboons
-baby
-babyface
-babyhood
-babying
-babyish
-babylon
-babysit
-babysitter
-babysitters
-babysitting
-baccarat
-bacchus
-bach
-bachelor
-bachelors
-bacilli
-bacillus
-back
-backache
-backbench
-backbencher
-backbenchers
-backbone
-backbones
-backchat
-backdate
-backdated
-backdrop
-backed
-backer
-backers
-backfire
-backfired
-backfires
-backfiring
-backgammon
-background
-backgrounds
-backhand
-backhanded
-backing
-backlash
-backless
-backlight
-backlit
-backlog
-backlogs
-backpack
-backpacker
-backpackers
-backpacking
-backpacks
-backpedal
-backpedalled
-backpedalling
-backrest
-backs
-backseat
-backside
-backsides
-backslapping
-backslash
-backsliding
-backspace
-backspaces
-backspacing
-backstabbing
-backstage
-backstairs
-backstreet
-backstreets
-backstroke
-backtrack
-backtracked
-backtracking
-backtracks
-backup
-backups
-backward
-backwardness
-backwards
-backwash
-backwater
-backwaters
-backwoods
-backwoodsmen
-backyard
-bacon
-bacteria
-bacterial
-bactericidal
-bacteriological
-bacteriologist
-bacteriologists
-bacteriology
-bacteriophage
-bacterium
-bad
-baddy
-bade
-bader
-badge
-badged
-badger
-badgered
-badgering
-badgers
-badges
-badinage
-badlands
-badly
-badminton
-badness
-badtempered
-baffle
-baffled
-bafflement
-baffler
-baffles
-baffling
-bafflingly
-bag
-bagatelle
-bagdad
-bagels
-bagful
-bagfuls
-baggage
-baggages
-bagged
-bagger
-baggier
-baggiest
-bagging
-baggy
-baghdad
-bagman
-bagmen
-bagpipe
-bagpiper
-bagpipes
-bags
-baguette
-baguettes
-bah
-bahamas
-bail
-bailed
-bailiff
-bailiffs
-bailing
-bailiwick
-bailout
-bails
-bait
-baited
-baiters
-baiting
-baitings
-baits
-bake
-baked
-bakehouse
-baker
-bakeries
-bakers
-bakery
-bakes
-baking
-bakings
-baklavas
-balaclava
-balaclavas
-balalaika
-balance
-balanced
-balancer
-balances
-balancing
-balconies
-balcony
-bald
-balder
-balderdash
-baldest
-balding
-baldly
-baldness
-baldy
-bale
-baled
-baleen
-baleful
-balefully
-bales
-bali
-baling
-ball
-ballad
-ballade
-ballades
-ballads
-ballast
-ballasts
-ballbearing
-ballbearings
-ballerina
-ballerinas
-ballet
-balletic
-ballets
-ballistic
-ballistics
-balloon
-ballooned
-ballooning
-balloonist
-balloonists
-balloons
-ballot
-balloted
-balloting
-ballots
-ballpen
-ballpens
-ballpoint
-ballroom
-ballrooms
-balls
-ballyhoo
-balm
-balmier
-balmiest
-balmoral
-balms
-balmy
-baloney
-balsa
-balsam
-baltic
-baluster
-balusters
-balustrade
-balustraded
-balustrades
-bambino
-bamboo
-bamboos
-bamboozle
-bamboozled
-bamboozles
-ban
-banal
-banalities
-banality
-banana
-bananas
-band
-bandage
-bandaged
-bandages
-bandaging
-bandanna
-banded
-bandied
-bandier
-bandiest
-banding
-bandit
-banditry
-bandits
-bandpass
-bands
-bandstand
-bandwagon
-bandwagons
-bandwidth
-bandwidths
-bane
-bang
-banged
-banger
-bangers
-banging
-bangkok
-bangle
-bangles
-bangs
-banish
-banished
-banishes
-banishing
-banishment
-banister
-banisters
-banjo
-bank
-bankable
-banked
-banker
-bankers
-banking
-banknote
-banknotes
-bankrupt
-bankruptcies
-bankruptcy
-bankrupted
-bankrupting
-bankrupts
-banks
-banned
-banner
-banners
-banning
-bannister
-bannisters
-banns
-banquet
-banqueting
-banquets
-bans
-banshee
-banshees
-bantam
-bantams
-bantamweight
-banter
-bantered
-bantering
-baobab
-baobabs
-bap
-baptise
-baptised
-baptises
-baptising
-baptism
-baptismal
-baptisms
-baptist
-baptists
-bar
-barb
-barbarian
-barbarians
-barbaric
-barbarically
-barbarism
-barbarities
-barbarity
-barbarous
-barbarously
-barbecue
-barbecued
-barbecues
-barbed
-barbell
-barbels
-barber
-barbers
-barbie
-barbiturate
-barbiturates
-barbs
-barcode
-bard
-bards
-bare
-bareback
-bared
-barefaced
-barefoot
-barefooted
-barely
-bareness
-barer
-bares
-barest
-bargain
-bargained
-bargainers
-bargaining
-bargains
-barge
-barged
-bargepole
-barges
-barging
-baring
-baritone
-baritones
-barium
-bark
-barked
-barker
-barkers
-barking
-barks
-barky
-barley
-barleycorn
-barleycorns
-barmaid
-barmaids
-barman
-barmen
-barn
-barnacle
-barnacles
-barns
-barnstorming
-barnyard
-barometer
-barometers
-barometric
-baron
-baronage
-baroness
-baronesses
-baronet
-baronets
-baronial
-baronies
-barons
-barony
-baroque
-barrack
-barracking
-barracks
-barracuda
-barrage
-barrages
-barre
-barred
-barrel
-barrelled
-barrels
-barren
-barrenness
-barricade
-barricaded
-barricades
-barrier
-barriers
-barring
-barrister
-barristers
-barrow
-barrows
-bars
-bart
-bartender
-barter
-bartered
-barterer
-bartering
-basal
-basalt
-basaltic
-basalts
-base
-baseball
-baseballs
-based
-baseless
-baseline
-baselines
-basely
-basement
-basements
-baseness
-baser
-bases
-basest
-bash
-bashed
-bashes
-bashful
-bashfully
-bashfulness
-bashing
-basic
-basically
-basics
-basify
-basil
-basilica
-basilicas
-basilisk
-basilisks
-basin
-basinful
-basing
-basins
-basis
-bask
-basked
-basket
-basketball
-basketful
-basketry
-baskets
-basking
-basks
-basque
-basrelief
-basreliefs
-bass
-basses
-bassist
-bassoon
-bassoons
-bastard
-bastardisation
-bastardise
-bastardised
-bastards
-bastardy
-baste
-basted
-basting
-bastion
-bastions
-bat
-batch
-batched
-batches
-batching
-bate
-bated
-bates
-bath
-bathe
-bathed
-bather
-bathers
-bathes
-bathetic
-bathhouse
-bathing
-bathos
-bathrobe
-bathroom
-bathrooms
-baths
-bathtub
-bathtubs
-bathurst
-bathwater
-batik
-batiks
-bating
-batman
-batmen
-baton
-batons
-bats
-batsman
-batsmen
-battalion
-battalions
-batted
-batten
-battened
-battening
-battens
-batter
-battered
-batteries
-battering
-batters
-battery
-batting
-battle
-battleaxe
-battlecry
-battled
-battledress
-battlefield
-battlefields
-battleground
-battlegrounds
-battlement
-battlemented
-battlements
-battler
-battlers
-battles
-battleship
-battleships
-battling
-batty
-bauble
-baubles
-baud
-baulk
-baulked
-baulking
-baulks
-baulky
-bauxite
-bavaria
-bavarian
-bawdier
-bawdiest
-bawdy
-bawl
-bawled
-bawling
-bawls
-bay
-bayed
-baying
-bayonet
-bayonets
-bays
-bazaar
-bazaars
-bazooka
-bazookas
-be
-beach
-beachcomber
-beached
-beaches
-beachhead
-beaching
-beachside
-beachy
-beacon
-beaconed
-beacons
-bead
-beaded
-beadier
-beadiest
-beading
-beadings
-beadle
-beadles
-beads
-beadwork
-beady
-beadyeyed
-beagle
-beagles
-beak
-beaked
-beaker
-beakers
-beaks
-beam
-beamed
-beaming
-beams
-beamy
-bean
-beanbag
-beanery
-beanie
-beanpole
-beans
-beanstalk
-beanstalks
-beany
-bear
-bearable
-bearably
-beard
-bearded
-beardless
-beards
-bearer
-bearers
-bearing
-bearings
-bearish
-bears
-bearskin
-bearskins
-beast
-beastliest
-beastliness
-beastly
-beasts
-beat
-beaten
-beater
-beaters
-beatific
-beatification
-beatifications
-beatified
-beatifies
-beatify
-beating
-beatings
-beatitude
-beatitudes
-beatnik
-beatniks
-beats
-beatup
-beau
-beaus
-beauteous
-beautician
-beauties
-beautified
-beautifier
-beautifiers
-beautifies
-beautiful
-beautifully
-beautify
-beauts
-beauty
-beaux
-beaver
-beavering
-beavers
-bebop
-becalm
-becalmed
-became
-because
-beck
-beckon
-beckoned
-beckoning
-beckons
-becks
-become
-becomes
-becoming
-bed
-bedazzle
-bedazzled
-bedbug
-bedbugs
-bedchamber
-bedclothes
-bedcover
-bedded
-bedder
-bedding
-beddings
-bedecked
-bedecks
-bedevil
-bedevilled
-bedevilment
-bedevils
-bedfellow
-bedfellows
-bedlam
-bedlinen
-bedmaker
-bedmakers
-bedouin
-bedouins
-bedpan
-bedpans
-bedpost
-bedraggled
-bedridden
-bedrock
-bedroom
-bedrooms
-beds
-bedsheets
-bedside
-bedsit
-bedsitter
-bedsitters
-bedsore
-bedsores
-bedspread
-bedspreads
-bedstead
-bedsteads
-bedtime
-bedtimes
-bee
-beech
-beeches
-beechnut
-beechwood
-beef
-beefburger
-beefburgers
-beefcake
-beefeater
-beefier
-beefiest
-beefs
-beefy
-beehive
-beehives
-beekeepers
-beeline
-beelines
-been
-beep
-beeper
-beeping
-beeps
-beer
-beermat
-beermats
-beers
-beery
-bees
-beeswax
-beet
-beetle
-beetles
-beetroot
-beets
-befall
-befallen
-befalling
-befalls
-befell
-befit
-befits
-befitted
-befitting
-befog
-before
-beforehand
-befoul
-befriend
-befriended
-befriending
-befriends
-befuddle
-befuddled
-befuddling
-beg
-began
-begat
-beget
-begets
-begetting
-beggar
-beggared
-beggarly
-beggars
-beggary
-begged
-begging
-beggings
-begin
-beginner
-beginners
-beginning
-beginnings
-begins
-begone
-begonias
-begot
-begotten
-begrudge
-begrudged
-begrudgingly
-begs
-beguile
-beguiled
-beguilement
-beguiling
-begun
-behalf
-behave
-behaved
-behaves
-behaving
-behaviour
-behavioural
-behaviourally
-behaviourism
-behaviourist
-behaviourists
-behaviours
-behead
-beheaded
-beheading
-beheld
-behemoth
-behest
-behind
-behindhand
-behinds
-behold
-beholden
-beholder
-beholders
-beholding
-beholds
-behoved
-behoves
-beige
-beijing
-being
-beings
-beirut
-bejewel
-bejewelled
-bel
-belabour
-belated
-belatedly
-belatedness
-belay
-belayed
-belays
-belch
-belched
-belches
-belching
-beleaguered
-belfast
-belfries
-belfry
-belgian
-belgians
-belgium
-belgrade
-belie
-belied
-belief
-beliefs
-belies
-believability
-believable
-believably
-believe
-believed
-believer
-believers
-believes
-believing
-belike
-belittle
-belittled
-belittles
-belittling
-bell
-belladonna
-bellbottoms
-belle
-belled
-belles
-bellicose
-bellicosity
-bellies
-belligerence
-belligerent
-belligerently
-belligerents
-bellow
-bellowed
-bellowing
-bellows
-bells
-belly
-bellyful
-belong
-belonged
-belonging
-belongings
-belongs
-beloved
-below
-belt
-belted
-belting
-beltings
-belts
-belying
-bemoan
-bemoaned
-bemoaning
-bemoans
-bemuse
-bemused
-bemusedly
-bemusement
-ben
-bench
-benches
-benchmark
-benchmarking
-benchmarks
-bend
-bendable
-bended
-bender
-benders
-bending
-bendings
-bends
-beneath
-benediction
-benedictions
-benefaction
-benefactions
-benefactor
-benefactors
-benefactress
-benefice
-beneficence
-beneficent
-beneficial
-beneficially
-beneficiaries
-beneficiary
-benefit
-benefited
-benefiting
-benefits
-benelux
-benevolence
-benevolent
-benevolently
-bengal
-benighted
-benightedly
-benign
-benignity
-benignly
-benjamin
-bent
-benzene
-bequeath
-bequeathed
-bequeathing
-bequest
-bequests
-berate
-berated
-berating
-berber
-bereave
-bereaved
-bereavement
-bereavements
-bereaving
-bereft
-beret
-berets
-bergs
-berk
-berlin
-berliner
-bermuda
-bern
-berries
-berry
-berserk
-berth
-berthed
-berths
-beryl
-beryllium
-beseech
-beseeched
-beseeches
-beseeching
-beseechingly
-beset
-besets
-besetting
-beside
-besides
-besiege
-besieged
-besieging
-besmirch
-besot
-besotted
-bespattered
-bespeak
-bespeaking
-bespeaks
-bespectacled
-bespoke
-best
-bestial
-bestiality
-bestiary
-bestir
-bestirred
-bestirring
-bestknown
-bestow
-bestowal
-bestowals
-bestowed
-bestowing
-bestows
-bestride
-bestrode
-bests
-bestseller
-bestsellers
-bestselling
-bet
-beta
-betel
-betide
-betimes
-betoken
-betokened
-betokens
-betray
-betrayal
-betrayals
-betrayed
-betrayer
-betrayers
-betraying
-betrays
-betroth
-betrothal
-betrothed
-betroths
-bets
-betted
-better
-bettered
-bettering
-betterment
-betters
-betting
-between
-betwixt
-bevel
-bevelled
-bevelling
-bevels
-beverage
-beverages
-bevvy
-bevy
-bewail
-bewailed
-bewailing
-bewails
-beware
-bewhiskered
-bewilder
-bewildered
-bewildering
-bewilderingly
-bewilderment
-bewilders
-bewitch
-bewitched
-bewitching
-beyond
-biannual
-bias
-biased
-biases
-biasing
-biassed
-biasses
-biassing
-bib
-bible
-bibles
-biblical
-biblically
-biblicists
-bibliographic
-bibliographical
-bibliographies
-bibliography
-bibliophile
-bibs
-bicameral
-bicarb
-bicarbonate
-bicentenary
-bicentennial
-biceps
-bicker
-bickering
-bickerings
-bicycle
-bicycled
-bicycles
-bicycling
-bid
-bidden
-bidder
-bidders
-bidding
-biddings
-bide
-bided
-bides
-bidet
-biding
-bidirectional
-bids
-biennial
-biennials
-bier
-bifocal
-bifocals
-bifurcated
-bifurcation
-bifurcations
-big
-bigamist
-bigamists
-bigamous
-bigamy
-bigapple
-bigben
-bigger
-biggest
-biggish
-bigheads
-bigness
-bigot
-bigoted
-bigotry
-bigots
-bijou
-bijoux
-bike
-biker
-bikes
-biking
-bikini
-bikinis
-bilabial
-bilateral
-bilaterally
-bile
-biles
-bilge
-bilges
-bilharzia
-biliary
-bilingual
-bilingualism
-bilinguals
-bilious
-bill
-billable
-billboard
-billboards
-billed
-billet
-billeted
-billeting
-billets
-billiard
-billiards
-billing
-billings
-billion
-billionaire
-billionaires
-billions
-billionth
-billow
-billowed
-billowing
-billows
-billowy
-billposters
-bills
-billy
-biltong
-bimbo
-bimodal
-bimonthly
-bin
-binaries
-binary
-bind
-binder
-binders
-bindery
-binding
-bindings
-binds
-bindweed
-bing
-binge
-bingo
-binnacle
-binocular
-binoculars
-binodal
-binomial
-bins
-biochemical
-biochemically
-biochemist
-biochemistry
-biochemists
-biodegradable
-biodiversity
-bioengineering
-biofeedback
-biogeographical
-biographer
-biographers
-biographical
-biographically
-biographies
-biography
-biological
-biologically
-biologist
-biologists
-biology
-biomass
-biomedical
-biometric
-biometrics
-biometry
-biomorph
-bionic
-bionics
-biophysical
-biopsies
-biopsy
-biorhythm
-biorhythms
-bioscope
-biosphere
-biospheres
-biosynthesis
-biota
-biotechnological
-biotechnologist
-biotechnologists
-biotechnology
-biotic
-bipartisan
-bipartite
-biped
-bipedal
-bipedalism
-bipeds
-biplane
-biplanes
-bipolar
-birch
-birched
-birches
-bird
-birdbath
-birdbaths
-birdcage
-birdcages
-birdie
-birdies
-birds
-birdsong
-birdtables
-birdwatcher
-birdwatchers
-birdwatching
-birefringence
-birefringent
-birth
-birthday
-birthdays
-birthmark
-birthmarks
-birthplace
-birthrate
-birthright
-birthrights
-births
-biscuit
-biscuits
-biscuity
-bisect
-bisected
-bisecting
-bisects
-bisexual
-bisexuality
-bisexuals
-bishop
-bishopric
-bishoprics
-bishops
-bismarck
-bismuth
-bison
-bisons
-bissau
-bistable
-bistro
-bit
-bitch
-bitches
-bitchiness
-bitching
-bitchy
-bite
-biter
-biters
-bites
-biting
-bitingly
-bitmap
-bits
-bitten
-bitter
-bitterest
-bitterly
-bittern
-bitterness
-bitters
-bittersweet
-bittiness
-bitts
-bitty
-bitumen
-bituminous
-bivalve
-bivalves
-bivouac
-bivouacked
-bivouacs
-biweekly
-biz
-bizarre
-bizarrely
-bizarreness
-blab
-blabbed
-blabber
-blabbering
-blabs
-black
-blackball
-blackballed
-blackballing
-blackberries
-blackberry
-blackbird
-blackbirds
-blackboard
-blackboards
-blackcurrant
-blackcurrants
-blacked
-blacken
-blackened
-blackening
-blackens
-blacker
-blackest
-blackfly
-blackguard
-blackhead
-blackheads
-blacking
-blackish
-blackjack
-blackleg
-blacklist
-blacklisted
-blacklisting
-blacklists
-blackly
-blackmail
-blackmailed
-blackmailer
-blackmailers
-blackmailing
-blackmails
-blackness
-blackout
-blackouts
-blacks
-blacksea
-blackshirts
-blacksmith
-blacksmiths
-blackthorn
-bladder
-bladders
-blade
-bladed
-blades
-blah
-blame
-blameable
-blamed
-blameful
-blameless
-blamelessly
-blamelessness
-blames
-blameworthy
-blaming
-blanch
-blanched
-blanching
-blancmange
-bland
-blandest
-blandishments
-blandly
-blandness
-blank
-blanked
-blanker
-blanket
-blanketed
-blanketing
-blankets
-blanking
-blankly
-blankness
-blanks
-blare
-blared
-blares
-blaring
-blase
-blaspheme
-blasphemed
-blasphemer
-blasphemers
-blasphemies
-blaspheming
-blasphemous
-blasphemously
-blasphemy
-blast
-blasted
-blaster
-blasters
-blasting
-blasts
-blat
-blatancy
-blatant
-blatantly
-blaze
-blazed
-blazer
-blazers
-blazes
-blazing
-bleach
-bleached
-bleacher
-bleachers
-bleaches
-bleaching
-bleak
-bleaker
-bleakest
-bleakly
-bleakness
-blearily
-bleary
-blearyeyed
-bleat
-bleated
-bleating
-bleats
-bled
-bleed
-bleeder
-bleeders
-bleeding
-bleeds
-bleep
-bleeped
-bleeper
-bleeping
-bleeps
-blemish
-blemished
-blemishes
-blench
-blenched
-blend
-blended
-blender
-blenders
-blending
-blends
-blesbok
-bless
-blessed
-blessedness
-blesses
-blessing
-blessings
-blew
-blight
-blighted
-blighting
-blights
-blimp
-blimps
-blind
-blinded
-blinder
-blindest
-blindfold
-blindfolded
-blindfolds
-blinding
-blindingly
-blindly
-blindness
-blinds
-blink
-blinked
-blinker
-blinkered
-blinkering
-blinkers
-blinking
-blinks
-blip
-blips
-bliss
-blissful
-blissfully
-blister
-blistered
-blistering
-blisteringly
-blisters
-blithe
-blithely
-blithering
-blitz
-blitzkrieg
-blizzard
-blizzards
-bloat
-bloated
-bloating
-blob
-blobs
-bloc
-block
-blockade
-blockaded
-blockades
-blockading
-blockage
-blockages
-blockbuster
-blockbusters
-blockbusting
-blocked
-blockers
-blockhead
-blockheads
-blocking
-blockish
-blocks
-blocky
-blocs
-bloke
-blokes
-blond
-blonde
-blonder
-blondes
-blondest
-blondhaired
-blonds
-blood
-bloodbath
-bloodcurdling
-blooded
-bloodhound
-bloodhounds
-bloodied
-bloodier
-bloodies
-bloodiest
-bloodily
-bloodless
-bloodlessness
-bloodletting
-bloodline
-bloodlust
-bloodred
-bloods
-bloodshed
-bloodshot
-bloodsport
-bloodsports
-bloodstain
-bloodstained
-bloodstains
-bloodstock
-bloodstone
-bloodstream
-bloodsuckers
-bloodthirstier
-bloodthirstiest
-bloodthirsty
-bloodworm
-bloody
-bloodymindedness
-bloom
-bloomed
-bloomer
-bloomers
-blooming
-blooms
-bloomy
-blossom
-blossomed
-blossoming
-blossoms
-blot
-blotch
-blotched
-blotches
-blotchy
-blots
-blotted
-blotter
-blotting
-blouse
-blouses
-blow
-blowdried
-blowdrying
-blowed
-blower
-blowers
-blowfly
-blowing
-blowlamp
-blown
-blowpipe
-blowpipes
-blows
-blowtorch
-blowtorches
-blowup
-blubber
-blubbered
-blubbering
-bludgeon
-bludgeoned
-bludgeoning
-bludgeons
-blue
-bluebell
-bluebells
-blueberries
-blueberry
-bluebird
-bluebirds
-blueblooded
-bluebottle
-bluebottles
-bluecollar
-blueish
-bluemoon
-blueness
-bluenile
-blueprint
-blueprints
-bluer
-blues
-bluest
-bluesy
-bluff
-bluffed
-bluffer
-bluffers
-bluffing
-bluffs
-bluish
-blunder
-blunderbuss
-blundered
-blundering
-blunderings
-blunders
-blunt
-blunted
-blunter
-bluntest
-blunting
-bluntly
-bluntness
-blunts
-blur
-blurb
-blurbs
-blurred
-blurring
-blurry
-blurs
-blurt
-blurted
-blurting
-blurts
-blush
-blushed
-blusher
-blushers
-blushes
-blushing
-blushingly
-bluster
-blustered
-blustering
-blusters
-blustery
-bmus
-boa
-boar
-board
-boarded
-boarder
-boarders
-boardgames
-boarding
-boardings
-boardroom
-boardrooms
-boards
-boars
-boas
-boast
-boasted
-boaster
-boasters
-boastful
-boastfully
-boastfulness
-boasting
-boasts
-boat
-boated
-boater
-boaters
-boathouse
-boathouses
-boating
-boatload
-boatman
-boatmen
-boats
-boatswain
-bob
-bobbed
-bobbies
-bobbin
-bobbing
-bobbins
-bobble
-bobbles
-bobby
-bobcat
-bobs
-bobsled
-bobtail
-bobtails
-bode
-boded
-bodes
-bodice
-bodices
-bodied
-bodies
-bodiless
-bodily
-boding
-bodkin
-body
-bodybuilding
-bodyguard
-bodyguards
-bodywork
-boer
-boers
-boerwar
-boffin
-boffins
-bog
-bogey
-bogeyman
-bogeymen
-bogeys
-bogged
-boggiest
-bogging
-boggle
-boggled
-boggles
-boggling
-bogglingly
-boggy
-bogies
-bogs
-bogus
-bogy
-bohemian
-boil
-boiled
-boiler
-boilermakers
-boilers
-boiling
-boils
-boisterous
-boisterously
-bola
-bold
-bolder
-boldest
-boldface
-boldly
-boldness
-bole
-bolero
-boleyn
-bolivia
-bollard
-bollards
-bologna
-bolster
-bolstered
-bolstering
-bolsters
-bolt
-bolted
-bolting
-bolts
-bomb
-bombard
-bombarded
-bombardier
-bombarding
-bombardment
-bombardments
-bombards
-bombast
-bombastic
-bombasts
-bombay
-bombed
-bomber
-bombers
-bombing
-bombings
-bombs
-bombshell
-bonanza
-bonanzas
-bonbon
-bonbons
-bond
-bondage
-bonded
-bondholders
-bonding
-bondings
-bonds
-bone
-boned
-boneless
-bonemeal
-bones
-boney
-bonfire
-bonfires
-bong
-bongs
-bonier
-boniest
-bonn
-bonnet
-bonneted
-bonnets
-bonnie
-bonniest
-bonny
-bonobo
-bonsai
-bonus
-bonuses
-bony
-boo
-boobies
-booboo
-booby
-boobytrap
-boobytrapped
-boobytraps
-booed
-boohoo
-booing
-book
-bookable
-bookbinder
-bookbinders
-bookbinding
-bookcase
-bookcases
-booked
-bookends
-bookers
-bookie
-bookies
-booking
-bookings
-bookish
-bookkeeper
-bookkeeping
-booklet
-booklets
-bookmaker
-bookmakers
-bookmaking
-bookmark
-bookmarks
-books
-bookseller
-booksellers
-bookshelf
-bookshelves
-bookshop
-bookshops
-bookstall
-bookstalls
-bookwork
-bookworm
-bookworms
-boom
-boomed
-boomer
-boomerang
-boomeranging
-boomerangs
-booming
-booms
-boon
-boons
-boor
-boorish
-boorishly
-boorishness
-boors
-boos
-boost
-boosted
-booster
-boosters
-boosting
-boosts
-boot
-booted
-bootees
-booth
-booths
-booting
-bootlace
-bootlaces
-bootleg
-bootless
-bootprints
-boots
-bootstrap
-bootstraps
-booty
-booze
-boozed
-boozer
-boozers
-boozes
-bop
-bops
-boracic
-borate
-borates
-borax
-bordeaux
-border
-bordered
-borderer
-bordering
-borderline
-borders
-bore
-boreal
-bored
-boredom
-borehole
-boreholes
-borer
-borers
-bores
-boring
-boringly
-born
-bornagain
-borne
-borneo
-boron
-borough
-boroughs
-borrow
-borrowable
-borrowed
-borrower
-borrowers
-borrowing
-borrowings
-borrows
-borstal
-borstals
-bosnia
-bosom
-bosoms
-boson
-bosons
-boss
-bossed
-bosses
-bossier
-bossiest
-bossiness
-bossing
-bossy
-boston
-bosun
-botanic
-botanical
-botanically
-botanist
-botanists
-botany
-botch
-botched
-both
-bother
-bothered
-bothering
-bothers
-bothersome
-bothy
-botswana
-bottle
-bottled
-bottlefed
-bottlefeed
-bottleneck
-bottlenecks
-bottler
-bottles
-bottling
-bottom
-bottomed
-bottoming
-bottomless
-bottommost
-bottoms
-botulism
-boudoir
-boudoirs
-bouffant
-bougainvillea
-bough
-boughs
-bought
-boulder
-boulders
-boulevard
-boulevards
-bounce
-bounced
-bouncer
-bouncers
-bounces
-bouncier
-bounciest
-bouncing
-bouncy
-bound
-boundaries
-boundary
-bounded
-boundedness
-bounder
-bounders
-bounding
-boundless
-bounds
-bounteous
-bounties
-bountiful
-bountifully
-bounty
-bouquet
-bouquets
-bourbon
-bourbons
-bourgeois
-bourgeoisie
-bout
-boutique
-boutiques
-bouts
-bovine
-bow
-bowdlerisation
-bowdlerised
-bowdlerising
-bowed
-bowel
-bowels
-bower
-bowers
-bowie
-bowing
-bowl
-bowlder
-bowled
-bowler
-bowlers
-bowlines
-bowling
-bowls
-bowman
-bowmen
-bows
-bowsprit
-bowstring
-box
-boxed
-boxer
-boxers
-boxes
-boxful
-boxing
-boxoffice
-boxtops
-boxwood
-boxy
-boy
-boycott
-boycotted
-boycotting
-boycotts
-boyfriend
-boyfriends
-boyhood
-boyish
-boyishly
-boys
-boyscout
-bra
-brabble
-brabbled
-brabbles
-brace
-braced
-bracelet
-bracelets
-bracer
-braces
-brachiopods
-bracing
-bracingly
-bracken
-bracket
-bracketed
-bracketing
-brackets
-brackish
-bradawl
-bradycardia
-brag
-braggart
-braggarts
-bragged
-bragging
-brags
-brahman
-brahms
-braid
-braided
-braiding
-braids
-brail
-braille
-brain
-braincell
-braincells
-brainchild
-braindamaged
-braindead
-brainier
-brainless
-brainlessly
-brainlessness
-brainpower
-brains
-brainstorm
-brainstorming
-brainstorms
-brainteasers
-brainteasing
-brainwash
-brainwashed
-brainwashing
-brainwave
-brainwaves
-brainy
-braise
-braised
-brake
-brake
-braked
-brakes
-braking
-bramble
-brambles
-bran
-branch
-branched
-branches
-branching
-branchy
-brand
-branded
-brandies
-branding
-brandish
-brandished
-brandishes
-brandishing
-brands
-brandy
-brans
-bras
-brash
-brasher
-brashly
-brashness
-brasiers
-brasil
-brasilia
-brass
-brasserie
-brasses
-brassiere
-brassy
-brat
-brats
-bratty
-bravado
-brave
-braved
-bravely
-braver
-bravery
-braves
-bravest
-braving
-bravo
-braw
-brawl
-brawled
-brawler
-brawling
-brawls
-brawn
-brawnier
-brawniest
-brawny
-bray
-brayed
-braying
-brays
-braze
-brazen
-brazened
-brazenly
-brazenness
-brazier
-braziers
-brazil
-brazing
-breach
-breached
-breaches
-breaching
-bread
-breadandbutter
-breadboard
-breadboards
-breadcrumbs
-breaded
-breadfruit
-breadline
-breads
-breadth
-breadths
-breadwinner
-breadwinners
-break
-breakable
-breakage
-breakages
-breakaway
-breakaways
-breakdown
-breakdowns
-breaker
-breakers
-breakfast
-breakfasted
-breakfasting
-breakfasts
-breakin
-breaking
-breakins
-breakneck
-breakout
-breakpoint
-breakpoints
-breaks
-breakthrough
-breakthroughs
-breakup
-breakups
-breakwater
-breakwaters
-bream
-breast
-breastbone
-breasted
-breastfeed
-breastfeeding
-breasting
-breastplate
-breasts
-breaststroke
-breath
-breathable
-breathalysed
-breathalyser
-breathalysers
-breathe
-breathed
-breather
-breathes
-breathing
-breathings
-breathingspace
-breathless
-breathlessly
-breathlessness
-breaths
-breathtaking
-breathtakingly
-breathy
-breccias
-brecciated
-bred
-breech
-breeches
-breed
-breeder
-breeders
-breeding
-breeds
-breeze
-breezed
-breezes
-breezier
-breeziest
-breezily
-breezing
-breezy
-brethren
-breton
-breviary
-brevity
-brew
-brewage
-brewed
-brewer
-breweries
-brewers
-brewery
-brewing
-brews
-briar
-bribe
-bribed
-briber
-bribers
-bribery
-bribes
-bribing
-bricabrac
-brick
-brickbat
-brickbats
-bricked
-bricking
-bricklayer
-bricklayers
-bricklaying
-brickred
-bricks
-brickwork
-bridal
-bridals
-bride
-bridegroom
-bridegrooms
-brides
-bridesmaid
-bridesmaids
-bridge
-bridgebuilding
-bridged
-bridgehead
-bridges
-bridging
-bridle
-bridled
-bridles
-bridleway
-bridleways
-bridling
-brief
-briefcase
-briefcases
-briefed
-briefer
-briefest
-briefing
-briefings
-briefly
-briefs
-briers
-brig
-brigade
-brigades
-brigadier
-brigadiers
-brigand
-brigands
-bright
-brighten
-brightened
-brightening
-brightens
-brighter
-brightest
-brighteyed
-brightly
-brightness
-brightnesses
-brighton
-brilliance
-brilliancy
-brilliant
-brilliantly
-brim
-brimmed
-brimming
-brims
-brimstone
-brindled
-brine
-brines
-bring
-bringer
-bringing
-brings
-brink
-brinkmanship
-brinks
-briny
-brio
-brioche
-briquettes
-brisbane
-brisk
-brisker
-briskest
-briskly
-briskness
-bristle
-bristled
-bristles
-bristling
-bristly
-brit
-britain
-british
-britons
-brittle
-brittleness
-broach
-broached
-broaches
-broaching
-broad
-broadband
-broadcast
-broadcaster
-broadcasters
-broadcasting
-broadcasts
-broaden
-broadened
-broadening
-broadens
-broader
-broadest
-broadleaved
-broadloom
-broadly
-broadminded
-broadmindedness
-broadness
-broadsheet
-broadsheets
-broadside
-broadsides
-broadsword
-broadswords
-broadway
-brocade
-brocaded
-broccoli
-brochure
-brochures
-brogue
-brogues
-broil
-broiled
-broiler
-broiling
-broils
-broke
-broken
-brokenhearted
-brokenly
-broker
-brokerage
-brokered
-brokers
-broking
-bromide
-bromides
-bromine
-bronchi
-bronchial
-bronchitis
-bronco
-brontosaurus
-bronze
-bronzed
-bronzes
-brooch
-brooches
-brood
-brooded
-broodiness
-brooding
-broodingly
-broods
-broody
-brook
-brooklyn
-brooks
-broom
-brooms
-broomstick
-broomsticks
-broth
-brothel
-brothels
-brother
-brotherhood
-brotherinlaw
-brotherly
-brothers
-brothersinlaw
-broths
-brought
-brouhaha
-brow
-browbeat
-browbeaten
-browbeating
-brown
-browned
-browner
-brownest
-brownie
-brownies
-browning
-brownish
-brownness
-browns
-brows
-browse
-browsed
-browser
-browsers
-browses
-browsing
-bruise
-bruised
-bruiser
-bruisers
-bruises
-bruising
-brunch
-brunches
-brunei
-brunet
-brunets
-brunette
-brunettes
-brunt
-brunts
-brush
-brushed
-brushes
-brushing
-brushoff
-brushup
-brushwood
-brushwork
-brushy
-brusque
-brusquely
-brusqueness
-brussels
-brutal
-brutalisation
-brutalise
-brutalised
-brutalising
-brutalism
-brutalities
-brutality
-brutally
-brute
-brutes
-brutish
-brutishness
-brutus
-bub
-bubble
-bubbled
-bubblegum
-bubbles
-bubblier
-bubbliest
-bubbling
-bubbly
-bubonic
-buccaneer
-buccaneering
-buccaneers
-buck
-bucked
-bucket
-bucketful
-bucketfuls
-bucketing
-buckets
-bucking
-buckle
-buckled
-buckler
-bucklers
-buckles
-buckling
-buckminsterfullerene
-buckpassing
-bucks
-buckshot
-buckskin
-bucolic
-bud
-budapest
-budded
-buddhism
-buddhist
-buddies
-budding
-buddings
-buddy
-budge
-budged
-budgerigar
-budget
-budgetary
-budgeted
-budgeting
-budgets
-budgie
-budgies
-budging
-buds
-buff
-buffalo
-buffer
-buffered
-buffering
-buffers
-buffet
-buffeted
-buffeting
-buffetings
-buffets
-buffing
-buffoon
-buffoonery
-buffoons
-buffs
-bug
-bugbear
-bugbears
-bugeyed
-bugged
-bugger
-buggered
-buggering
-buggers
-buggery
-buggies
-bugging
-buggy
-bugle
-bugler
-buglers
-bugles
-bugs
-build
-builder
-builders
-building
-buildings
-builds
-buildup
-buildups
-built
-builtin
-builtup
-bulb
-bulbous
-bulbs
-bulgaria
-bulge
-bulged
-bulges
-bulging
-bulgy
-bulimia
-bulimic
-bulk
-bulkhead
-bulkheads
-bulkier
-bulkiest
-bulks
-bulky
-bull
-bulldog
-bulldogs
-bulldoze
-bulldozed
-bulldozer
-bulldozers
-bulldozing
-bullet
-bulletin
-bulletins
-bulletproof
-bullets
-bullfight
-bullfighting
-bullfinch
-bullfrog
-bullied
-bullies
-bullion
-bullish
-bullock
-bullocks
-bulls
-bully
-bullying
-bulrushes
-bulwark
-bulwarks
-bum
-bumble
-bumbled
-bumbler
-bumblers
-bumbles
-bumbling
-bump
-bumped
-bumper
-bumpers
-bumpier
-bumpiest
-bumping
-bumpkin
-bumpkins
-bumps
-bumptious
-bumpy
-bums
-bun
-bunch
-bunched
-bunches
-bunching
-bundle
-bundled
-bundles
-bundling
-bung
-bungalow
-bungalows
-bungee
-bungle
-bungled
-bungler
-bunglers
-bungles
-bungling
-bunion
-bunions
-bunk
-bunked
-bunker
-bunkered
-bunkers
-bunks
-bunkum
-bunnies
-bunny
-buns
-bunting
-bunyan
-buoy
-buoyancy
-buoyant
-buoyantly
-buoyed
-buoys
-bur
-burble
-burbled
-burbles
-burbling
-burden
-burdened
-burdening
-burdens
-burdensome
-burdock
-bureau
-bureaucracies
-bureaucracy
-bureaucrat
-bureaucratic
-bureaucratically
-bureaucratisation
-bureaucrats
-bureaus
-bureaux
-burette
-burg
-burgeon
-burgeoned
-burgeoning
-burgeons
-burger
-burgers
-burghers
-burglar
-burglaries
-burglars
-burglary
-burgle
-burgled
-burgles
-burgling
-burgundy
-burial
-burials
-buried
-buries
-burlesque
-burlesquing
-burlier
-burliest
-burly
-burma
-burmese
-burn
-burned
-burner
-burners
-burning
-burnings
-burnished
-burnishing
-burns
-burnt
-burp
-burped
-burping
-burps
-burr
-burrow
-burrowed
-burrowing
-burrows
-burs
-bursar
-bursaries
-bursars
-bursary
-burst
-bursted
-bursting
-bursts
-burundi
-bury
-burying
-bus
-buses
-bush
-bushel
-bushels
-bushes
-bushfire
-bushier
-bushiest
-bushiness
-bushing
-bushland
-bushman
-bushmen
-bushy
-busied
-busier
-busies
-busiest
-busily
-business
-businesses
-businesslike
-businessman
-businessmen
-businesswoman
-busk
-busker
-buskers
-busking
-busman
-busmen
-bussed
-bussing
-bust
-bustard
-bustards
-busted
-busters
-bustier
-busting
-bustle
-bustled
-bustles
-bustling
-busts
-busty
-busy
-busybodies
-busybody
-busying
-but
-butane
-butcher
-butchered
-butchering
-butchers
-butchery
-butler
-butlers
-buts
-butt
-butted
-butter
-buttercup
-buttercups
-buttered
-butterfat
-butterflies
-butterfly
-buttering
-buttermilk
-butters
-butterscotch
-buttery
-butting
-buttock
-buttocks
-button
-buttoned
-buttonhole
-buttonholed
-buttonholes
-buttoning
-buttons
-buttress
-buttressed
-buttresses
-buttressing
-butts
-buxom
-buy
-buyer
-buyers
-buying
-buyout
-buys
-buzz
-buzzard
-buzzards
-buzzed
-buzzer
-buzzers
-buzzes
-buzzing
-buzzwords
-by
-bye
-byebye
-byelaw
-byelaws
-byelection
-byelections
-byes
-bygone
-bygones
-bylaw
-bylaws
-byline
-bypass
-bypassed
-bypasses
-bypassing
-bypath
-bypaths
-byproduct
-byproducts
-bystander
-bystanders
-byte
-bytes
-byway
-byways
-byword
-cab
-cabal
-cabals
-cabaret
-cabarets
-cabbage
-cabbages
-cabby
-cabin
-cabinet
-cabinetmaker
-cabinets
-cabins
-cable
-cabled
-cables
-cableway
-cabling
-cabman
-cabmen
-caboodle
-caboose
-cabriolet
-cabs
-cacao
-cache
-cached
-caches
-cachet
-caching
-cackle
-cackled
-cackles
-cackling
-cacophonous
-cacophony
-cacti
-cactus
-cactuses
-cad
-cadaver
-cadaverous
-cadavers
-caddie
-caddied
-caddies
-caddy
-caddying
-cade
-cadence
-cadences
-cadenza
-cadenzas
-cadet
-cadets
-cadge
-cadged
-cadger
-cadges
-cadmium
-cads
-caesar
-cafe
-cafes
-cafeteria
-cafeterias
-caftan
-caftans
-cage
-caged
-cages
-cagey
-cagiest
-caging
-cagoule
-cagoules
-cagy
-cahoots
-caiman
-caimans
-cain
-cairn
-cairns
-cairo
-cajole
-cajoled
-cajoling
-cake
-caked
-cakes
-caking
-calamities
-calamitous
-calamitously
-calamity
-calcareous
-calcification
-calcified
-calcify
-calcite
-calcium
-calculable
-calculate
-calculated
-calculatedly
-calculates
-calculating
-calculation
-calculations
-calculative
-calculator
-calculators
-calculus
-calcutta
-caldera
-caldron
-caldrons
-calendar
-calendars
-calf
-calibrate
-calibrated
-calibrates
-calibrating
-calibration
-calibrations
-calibrator
-calibrators
-calibre
-calico
-calif
-california
-caliper
-calipers
-caliph
-call
-callable
-called
-caller
-callers
-callgirl
-callgirls
-calligrapher
-calligraphic
-calligraphy
-calling
-callings
-calliper
-callipers
-callisthenics
-callous
-calloused
-callously
-callousness
-callow
-callowness
-calls
-callup
-callus
-calm
-calmed
-calmer
-calmest
-calming
-calmly
-calmness
-calms
-calorie
-calories
-calorific
-calorimeter
-calorimeters
-calorimetry
-calory
-calumniate
-calumnies
-calumny
-calvary
-calve
-calves
-calvin
-calving
-calypso
-cam
-camaraderie
-camber
-cambodia
-camcorder
-camcorders
-came
-camel
-camelhair
-camelot
-camels
-cameo
-camera
-cameraman
-cameramen
-cameras
-camerawork
-camisole
-camomile
-camouflage
-camouflaged
-camouflages
-camouflaging
-camp
-campaign
-campaigned
-campaigner
-campaigners
-campaigning
-campaigns
-campanile
-campanological
-campanologist
-campanology
-camped
-camper
-campers
-campfire
-campfires
-camphor
-camping
-camps
-campsite
-campsites
-campus
-campuses
-cams
-camshaft
-can
-canaan
-canada
-canadian
-canal
-canalisation
-canals
-canape
-canapes
-canard
-canaries
-canary
-canberra
-cancan
-cancel
-cancellation
-cancellations
-cancelled
-cancelling
-cancels
-cancer
-cancerous
-cancers
-candelabra
-candelas
-candid
-candidacy
-candidate
-candidates
-candidature
-candidatures
-candidly
-candies
-candle
-candlelight
-candlelit
-candlepower
-candles
-candlestick
-candlesticks
-candour
-candy
-cane
-caned
-canes
-canine
-canines
-caning
-canings
-canister
-canisters
-cannabis
-canned
-cannel
-cannery
-cannes
-cannibal
-cannibalise
-cannibalised
-cannibalising
-cannibalism
-cannibalistic
-cannibals
-cannily
-canning
-cannon
-cannonball
-cannonballs
-cannoned
-cannoning
-cannons
-cannot
-cannula
-canny
-canoe
-canoed
-canoeing
-canoeist
-canoeists
-canoes
-canon
-canonic
-canonical
-canonically
-canonisation
-canonise
-canonised
-canonry
-canons
-canopener
-canopied
-canopies
-canopy
-cans
-cant
-cantaloupe
-cantankerous
-cantata
-cantatas
-canted
-canteen
-canteens
-canter
-cantered
-cantering
-canters
-canticle
-canticles
-cantilever
-cantilevered
-canton
-cantons
-cantor
-canvas
-canvased
-canvases
-canvass
-canvassed
-canvasser
-canvassers
-canvasses
-canvassing
-canyon
-canyons
-cap
-capabilities
-capability
-capable
-capably
-capacious
-capacitance
-capacities
-capacitive
-capacitor
-capacitors
-capacity
-caparisoned
-cape
-caped
-caper
-capered
-capering
-capers
-capes
-capetown
-capillaries
-capillary
-capita
-capital
-capitalisation
-capitalise
-capitalised
-capitalises
-capitalising
-capitalism
-capitalist
-capitalistic
-capitalists
-capitally
-capitals
-capitate
-capitation
-capitol
-capitulate
-capitulated
-capitulates
-capitulating
-capitulation
-capped
-capping
-cappuccino
-capri
-caprice
-caprices
-capricious
-capriciously
-capriciousness
-capriole
-capris
-caps
-capsize
-capsized
-capsizes
-capsizing
-capstan
-capstans
-capsule
-capsules
-captain
-captaincy
-captained
-captaining
-captains
-caption
-captioned
-captions
-captious
-captivate
-captivated
-captivating
-captivation
-captive
-captives
-captivity
-captor
-captors
-capture
-captured
-captures
-capturing
-capybara
-car
-carabinieri
-caracal
-caracals
-carafe
-caramel
-caramelised
-caramels
-carapace
-carat
-carats
-caravan
-caravanning
-caravans
-caravel
-caraway
-carbide
-carbine
-carbines
-carbohydrate
-carbohydrates
-carbolic
-carbon
-carbonaceous
-carbonate
-carbonated
-carbonates
-carbonic
-carboniferous
-carbonise
-carbons
-carbonyl
-carborundum
-carboxyl
-carbuncle
-carbuncles
-carburettor
-carburettors
-carcase
-carcases
-carcass
-carcasses
-carcinogen
-carcinogenesis
-carcinogenic
-carcinogens
-carcinoma
-carcinomas
-card
-cardboard
-carded
-cardholders
-cardiac
-cardiff
-cardigan
-cardigans
-cardinal
-cardinality
-cardinals
-carding
-cardioid
-cardiologist
-cardiology
-cardiopulmonary
-cardiovascular
-cards
-care
-cared
-career
-careered
-careering
-careerism
-careerist
-careerists
-careers
-carefree
-careful
-carefully
-carefulness
-careless
-carelessly
-carelessness
-carer
-carers
-cares
-caress
-caressed
-caresses
-caressing
-caressingly
-caretaker
-caretakers
-carets
-careworn
-cargo
-caribou
-caricature
-caricatured
-caricatures
-caricaturisation
-caries
-caring
-carmine
-carnage
-carnages
-carnal
-carnality
-carnally
-carnation
-carnations
-carnival
-carnivals
-carnivore
-carnivores
-carnivorous
-carnivorousness
-carol
-carols
-carotene
-carotid
-carotin
-carouse
-carousel
-carousing
-carp
-carpal
-carpenter
-carpenters
-carpentry
-carpet
-carpeted
-carpeting
-carpets
-carping
-carport
-carports
-carps
-carrel
-carriage
-carriages
-carriageway
-carriageways
-carried
-carrier
-carriers
-carries
-carrion
-carrot
-carrots
-carroty
-carry
-carrycot
-carrying
-cars
-carsick
-cart
-carted
-cartel
-cartels
-carter
-carthorses
-cartilage
-carting
-cartload
-cartloads
-cartographer
-cartographers
-cartographic
-cartography
-carton
-cartons
-cartoon
-cartoonist
-cartoonists
-cartoons
-cartouche
-cartridge
-cartridges
-carts
-cartwheel
-cartwheels
-carve
-carved
-carver
-carvers
-carvery
-carves
-carving
-carvings
-caryatids
-casanova
-cascade
-cascaded
-cascades
-cascading
-cascara
-case
-casebook
-cased
-caseload
-caseloads
-casement
-casements
-cases
-casework
-cash
-cashbox
-cashed
-cashes
-cashew
-cashier
-cashiers
-cashing
-cashless
-cashmere
-casing
-casings
-casino
-cask
-casket
-caskets
-casks
-cassava
-casserole
-casseroles
-cassette
-cassettes
-cassock
-cassocks
-cassowary
-cast
-castanet
-castanets
-castaway
-castaways
-caste
-castellated
-caster
-casters
-castes
-castigate
-castigated
-castigates
-castigating
-casting
-castings
-castiron
-castle
-castled
-castles
-castling
-castoff
-castoffs
-castor
-castors
-castrate
-castrated
-castrating
-castration
-castrato
-casts
-casual
-casually
-casualness
-casuals
-casualties
-casualty
-casuistry
-cat
-cataclysm
-cataclysmic
-catacomb
-catacombs
-catalepsy
-catalogue
-catalogued
-cataloguer
-cataloguers
-catalogues
-cataloguing
-catalyse
-catalysed
-catalyses
-catalysing
-catalysis
-catalyst
-catalysts
-catalytic
-catamaran
-catamarans
-catanddog
-catapult
-catapulted
-catapulting
-catapults
-cataract
-cataracts
-catarrh
-catastrophe
-catastrophes
-catastrophic
-catastrophically
-catatonic
-catcalls
-catch
-catched
-catcher
-catchers
-catches
-catchier
-catchiest
-catching
-catchment
-catchphrase
-catchphrases
-catchword
-catchwords
-catchy
-catechism
-catechisms
-catechist
-catechists
-categorical
-categorically
-categories
-categorisation
-categorisations
-categorise
-categorised
-categorises
-categorising
-category
-cater
-catered
-caterer
-caterers
-catering
-caterpillar
-caterpillars
-caters
-caterwaul
-caterwauls
-catfish
-catgut
-catguts
-catharsis
-cathartic
-cathedral
-cathedrals
-catheter
-catheterisation
-catheters
-cathode
-cathodes
-catholic
-cation
-cationic
-cations
-catlike
-catnap
-catnip
-cats
-catsuit
-cattery
-cattle
-catwalk
-catwalks
-caucus
-caucuses
-caudal
-caught
-cauldron
-cauldrons
-cauliflower
-cauliflowers
-caulking
-causal
-causality
-causally
-causation
-causative
-cause
-caused
-causes
-causeway
-causeways
-causing
-caustic
-caustically
-caustics
-cauterise
-cauterising
-caution
-cautionary
-cautioned
-cautioning
-cautions
-cautious
-cautiously
-cautiousness
-cavalcade
-cavalier
-cavalierly
-cavaliers
-cavalry
-cavalryman
-cavalrymen
-cave
-caveat
-caveats
-caved
-cavein
-caveman
-cavemen
-caver
-cavern
-cavernous
-caverns
-cavers
-caves
-caviar
-caviare
-caviars
-caving
-cavitation
-cavities
-cavity
-cavort
-cavorted
-cavorting
-cavorts
-caw
-cawing
-cayman
-caymans
-cease
-ceased
-ceasefire
-ceasefires
-ceaseless
-ceaselessly
-ceases
-ceasing
-cedar
-cedars
-cedarwood
-cede
-ceded
-cedilla
-ceding
-ceilidh
-ceilidhs
-ceiling
-ceilings
-celandine
-celeb
-celebrant
-celebrants
-celebrate
-celebrated
-celebrates
-celebrating
-celebration
-celebrations
-celebratory
-celebrities
-celebrity
-celeriac
-celery
-celestial
-celestially
-celibacy
-celibate
-cell
-cellar
-cellars
-cellist
-cellists
-cello
-cellophane
-cells
-cellular
-cellulite
-celluloid
-cellulose
-celsius
-celtic
-cement
-cemented
-cementing
-cements
-cemeteries
-cemetery
-cenotaph
-censer
-censor
-censored
-censorial
-censoring
-censorious
-censoriousness
-censors
-censorship
-censure
-censured
-censures
-censuring
-census
-censuses
-cent
-centaur
-centaurs
-centenarians
-centenary
-centennial
-centigrade
-centime
-centimes
-centimetre
-centimetres
-centipede
-centipedes
-central
-centralisation
-centralise
-centralised
-centraliser
-centralisers
-centralises
-centralising
-centralism
-centralist
-centrality
-centrally
-centre
-centred
-centrefold
-centrefolds
-centreing
-centrepiece
-centrepieces
-centres
-centric
-centrifugal
-centrifugally
-centrifugation
-centrifuge
-centrifuged
-centrifuges
-centrifuging
-centring
-centripetal
-centrist
-centrists
-centroid
-centroids
-cents
-centuries
-centurion
-centurions
-century
-cephalopods
-ceramic
-ceramics
-ceramist
-cereal
-cereals
-cerebellum
-cerebral
-cerebrum
-ceremonial
-ceremonially
-ceremonials
-ceremonies
-ceremonious
-ceremoniously
-ceremony
-ceres
-cerise
-certain
-certainly
-certainties
-certainty
-certifiable
-certifiably
-certificate
-certificated
-certificates
-certification
-certified
-certifies
-certify
-certifying
-certitude
-certitudes
-cervical
-cervix
-cess
-cessation
-cessations
-cession
-cesspit
-cesspool
-cesspools
-cetacean
-ceylon
-chacha
-chad
-chafe
-chafed
-chafes
-chaff
-chaffed
-chaffinch
-chaffinches
-chaffing
-chafing
-chagrin
-chagrined
-chain
-chained
-chaining
-chains
-chainsaw
-chainsaws
-chainsmoke
-chainsmoked
-chainsmoking
-chair
-chaired
-chairing
-chairlift
-chairman
-chairmanship
-chairmanships
-chairmen
-chairperson
-chairpersons
-chairs
-chairwoman
-chairwomen
-chaldronxxxxxxxxxxxxxx
-chalet
-chalets
-chalice
-chalices
-chalk
-chalked
-chalking
-chalks
-chalky
-challenge
-challenged
-challenger
-challengers
-challenges
-challenging
-challengingly
-chamber
-chambered
-chamberlain
-chamberlains
-chambermaid
-chambermaids
-chamberpot
-chamberpots
-chambers
-chameleon
-chameleons
-chamfer
-chamfered
-chamois
-chamomile
-champ
-champagne
-champagnes
-champing
-champion
-championed
-championing
-champions
-championship
-championships
-champs
-chance
-chanced
-chancel
-chancellery
-chancellor
-chancellors
-chancellorship
-chancer
-chancery
-chances
-chancier
-chanciest
-chancing
-chancy
-chandelier
-chandeliers
-chandler
-change
-changeability
-changeable
-changed
-changeless
-changeling
-changeover
-changeovers
-changer
-changers
-changes
-changing
-channel
-channelled
-channelling
-channels
-chant
-chanted
-chanter
-chanteuse
-chanting
-chantings
-chantries
-chantry
-chants
-chaos
-chaotic
-chaotically
-chap
-chapel
-chapels
-chaperon
-chaperone
-chaperoned
-chaperones
-chaplain
-chaplaincy
-chaplains
-chaplainxxxxxxxx
-chapman
-chapped
-chapping
-chaps
-chapter
-chapters
-char
-charabanc
-character
-characterful
-characterisation
-characterisations
-characterise
-characterised
-characterises
-characterising
-characteristic
-characteristically
-characteristics
-characterless
-characters
-charade
-charades
-charcoal
-charcuterie
-chared
-charge
-chargeable
-charged
-charger
-chargers
-charges
-charging
-chariot
-charioteer
-charioteers
-chariots
-charisma
-charismas
-charismatic
-charismatically
-charismatics
-charitable
-charitably
-charities
-charity
-charlady
-charlatan
-charlatans
-charles
-charlie
-charm
-charmed
-charmer
-charmers
-charming
-charmingly
-charmless
-charms
-charon
-charred
-charring
-chars
-chart
-charted
-charter
-chartered
-chartering
-charters
-charting
-chartists
-charts
-charwoman
-chary
-chase
-chased
-chaser
-chasers
-chases
-chasing
-chasm
-chasms
-chassis
-chaste
-chastely
-chastened
-chastening
-chastise
-chastised
-chastisement
-chastises
-chastising
-chastity
-chat
-chateau
-chats
-chatted
-chattel
-chattels
-chatter
-chatterbox
-chattered
-chatterer
-chattering
-chatters
-chattily
-chatting
-chatty
-chauffeur
-chauffeured
-chauffeurs
-chauvinism
-chauvinist
-chauvinistic
-chauvinists
-cheap
-cheapen
-cheapened
-cheapening
-cheapens
-cheaper
-cheapest
-cheapish
-cheaply
-cheapness
-cheapskates
-cheat
-cheated
-cheater
-cheaters
-cheating
-cheats
-check
-checked
-checker
-checkered
-checkering
-checkers
-checkin
-checking
-checklist
-checklists
-checkmate
-checkout
-checkouts
-checkpoint
-checkpoints
-checks
-checkup
-checkups
-cheddar
-cheek
-cheekbone
-cheekbones
-cheeked
-cheekier
-cheekiest
-cheekily
-cheeking
-cheeks
-cheeky
-cheep
-cheeping
-cheer
-cheered
-cheerful
-cheerfully
-cheerfulness
-cheerier
-cheeriest
-cheerily
-cheering
-cheerio
-cheerleader
-cheerleaders
-cheerless
-cheerlessness
-cheers
-cheery
-cheese
-cheeseboard
-cheeseburger
-cheeseburgers
-cheesecake
-cheesecloth
-cheesemaking
-cheeses
-cheesy
-cheetah
-cheetahs
-chef
-chefs
-chekov
-chemic
-chemical
-chemically
-chemicals
-chemiluminescence
-chemiluminescent
-chemise
-chemist
-chemistry
-chemists
-chemosynthesis
-chemotherapeutic
-chemotherapy
-cheque
-chequebook
-chequebooks
-chequer
-chequerboard
-chequered
-chequering
-chequers
-cheques
-cherish
-cherished
-cherishes
-cherishing
-cheroot
-cheroots
-cherries
-cherry
-cherryred
-cherub
-cherubic
-cherubim
-cherubs
-chess
-chessboard
-chessboards
-chessmen
-chest
-chested
-chester
-chesterfield
-chestnut
-chestnuts
-chests
-chesty
-chevalier
-chevron
-chevrons
-chew
-chewable
-chewed
-chewer
-chewier
-chewiest
-chewing
-chews
-chewy
-chic
-chicago
-chicane
-chicanery
-chick
-chicken
-chickens
-chicks
-chicory
-chide
-chided
-chides
-chiding
-chief
-chiefly
-chiefs
-chieftain
-chieftains
-chiffon
-chihuahua
-chihuahuas
-chilblain
-chilblains
-child
-childbearing
-childbirth
-childcare
-childhood
-childhoods
-childish
-childishly
-childishness
-childless
-childlessness
-childlike
-childly
-childminders
-childproof
-children
-chilean
-chili
-chill
-chilled
-chiller
-chillers
-chilli
-chillier
-chillies
-chilliest
-chilliness
-chilling
-chillingly
-chills
-chilly
-chimaera
-chimaerical
-chime
-chimed
-chimera
-chimeras
-chimerical
-chimes
-chiming
-chimney
-chimneys
-chimp
-chimpanzee
-chimpanzees
-chimps
-chin
-china
-chinese
-chink
-chinked
-chinking
-chinks
-chinless
-chinoiserie
-chins
-chintz
-chintzy
-chip
-chipboard
-chipmunk
-chipped
-chipping
-chippings
-chips
-chiral
-chiropodist
-chiropody
-chiropractic
-chiropractor
-chiropractors
-chirp
-chirped
-chirping
-chirps
-chirpy
-chirruped
-chisel
-chiseled
-chiselled
-chiselling
-chisels
-chit
-chits
-chivalric
-chivalrous
-chivalrously
-chivalry
-chives
-chivvied
-chivvy
-chivvying
-chlamydia
-chlorate
-chloride
-chlorinated
-chlorination
-chlorine
-chlorofluorocarbon
-chlorofluorocarbons
-chloroform
-chloroformed
-chloroforming
-chlorophyll
-chloroquine
-chock
-chockablock
-chockfull
-chocks
-chocolate
-chocolates
-choice
-choices
-choicest
-choir
-choirboy
-choirboys
-choirmaster
-choirs
-choke
-choked
-choker
-chokes
-choking
-cholera
-cholesterol
-choline
-chomp
-chomped
-chomping
-chomps
-choose
-chooser
-choosers
-chooses
-choosey
-choosier
-choosing
-choosy
-chop
-chopin
-chopped
-chopper
-choppers
-choppier
-choppiest
-chopping
-choppy
-chops
-chopsticks
-choral
-chorale
-chorales
-chorals
-chord
-chordal
-chords
-chore
-chorea
-choreographed
-choreographer
-choreographers
-choreographic
-choreographing
-choreography
-chores
-chorister
-choristers
-chortle
-chortled
-chortles
-chortling
-chorus
-chorused
-choruses
-chose
-chosen
-choughs
-chow
-christ
-christen
-christened
-christening
-christenings
-christian
-chroma
-chromatic
-chromaticism
-chromatograph
-chromatographic
-chromatography
-chrome
-chromed
-chromite
-chromium
-chromosomal
-chromosome
-chromosomes
-chronic
-chronically
-chronicle
-chronicled
-chronicler
-chroniclers
-chronicles
-chronicling
-chronograph
-chronological
-chronologically
-chronologies
-chronology
-chronometer
-chronometric
-chrysalis
-chrysanthemum
-chrysanthemums
-chubbiness
-chubby
-chuck
-chucked
-chucking
-chuckle
-chuckled
-chuckles
-chuckling
-chucks
-chuff
-chuffed
-chug
-chugged
-chugging
-chugs
-chum
-chump
-chums
-chunk
-chunkier
-chunks
-chunky
-chunnel
-chuntering
-church
-churches
-churchgoer
-churchgoers
-churchman
-churchmen
-churchwarden
-churchwardens
-churchyard
-churchyards
-churlish
-churlishly
-churlishness
-churn
-churned
-churning
-churns
-chute
-chutes
-chutney
-chutzpah
-cicada
-cicadas
-cicero
-cider
-ciders
-cigar
-cigaret
-cigarette
-cigarettes
-cigars
-cilia
-cilium
-cinch
-cinder
-cinders
-cine
-cinema
-cinemas
-cinematic
-cinematographer
-cinematography
-cinnamon
-cipher
-ciphered
-ciphers
-circa
-circadian
-circle
-circled
-circles
-circlet
-circlets
-circling
-circuit
-circuitous
-circuitry
-circuits
-circulant
-circular
-circularise
-circularised
-circularity
-circularly
-circulars
-circulate
-circulated
-circulates
-circulating
-circulation
-circulations
-circulatory
-circumcise
-circumcised
-circumcision
-circumference
-circumferences
-circumferential
-circumflex
-circumflexes
-circumlocution
-circumlocutions
-circumlocutory
-circumnavigate
-circumnavigated
-circumnavigates
-circumnavigation
-circumnavigational
-circumscribe
-circumscribed
-circumscribing
-circumspect
-circumspection
-circumspectly
-circumstance
-circumstances
-circumstantial
-circumstantially
-circumvent
-circumventable
-circumvented
-circumventing
-circumvention
-circumventions
-circumvents
-circus
-circuses
-cirrhosis
-cirrhotic
-cirrus
-cist
-cistern
-cisterns
-citadel
-citadels
-citation
-citations
-cite
-cited
-cites
-cithers
-cities
-citing
-citizen
-citizenry
-citizens
-citizenship
-citrate
-citrates
-citric
-citron
-citrons
-citrus
-citruses
-cittern
-city
-cityscape
-civic
-civics
-civies
-civil
-civilian
-civilians
-civilisation
-civilisations
-civilise
-civilised
-civilising
-civilities
-civility
-civilly
-clacking
-clad
-cladding
-claim
-claimable
-claimant
-claimants
-claimed
-claiming
-claims
-clairvoyance
-clairvoyant
-clairvoyants
-clam
-clamber
-clambered
-clambering
-clambers
-clammed
-clamming
-clammy
-clamorous
-clamorously
-clamour
-clamoured
-clamouring
-clamours
-clamp
-clampdown
-clamped
-clamping
-clamps
-clams
-clan
-clandestine
-clandestinely
-clang
-clanged
-clangers
-clanging
-clank
-clanked
-clanking
-clannish
-clans
-clansmen
-clap
-clapped
-clapper
-clappers
-clapping
-claps
-claptrap
-claret
-clarets
-clarification
-clarifications
-clarified
-clarifies
-clarify
-clarifying
-clarinet
-clarinets
-clarinettist
-clarion
-clarity
-clash
-clashed
-clashes
-clashing
-clasp
-clasped
-clasper
-clasping
-clasps
-class
-classed
-classes
-classic
-classical
-classically
-classicism
-classicist
-classicists
-classics
-classier
-classiest
-classifiable
-classification
-classifications
-classificatory
-classified
-classifier
-classifiers
-classifies
-classify
-classifying
-classing
-classless
-classlessness
-classmate
-classmates
-classroom
-classrooms
-classy
-clatter
-clattered
-clattering
-clatters
-clausal
-clause
-clauses
-claustrophobia
-claustrophobic
-clavichord
-clavicle
-claw
-clawed
-clawing
-claws
-clay
-clayey
-claymore
-claymores
-clays
-clean
-cleancut
-cleaned
-cleaner
-cleaners
-cleanest
-cleaning
-cleanliness
-cleanliving
-cleanly
-cleanness
-cleans
-cleanse
-cleansed
-cleanser
-cleanses
-cleanshaven
-cleansing
-cleanup
-clear
-clearance
-clearances
-clearcut
-cleared
-clearer
-clearest
-clearheaded
-clearing
-clearings
-clearly
-clearness
-clears
-clearsighted
-clearup
-clearups
-clearway
-cleat
-cleavage
-cleavages
-cleave
-cleaved
-cleaver
-cleavers
-cleaves
-cleaving
-clef
-cleft
-clefts
-cleg
-clematis
-clemency
-clement
-clench
-clenched
-clenches
-clenching
-clergies
-clergy
-clergyman
-clergymen
-cleric
-clerical
-clerically
-clerics
-clerk
-clerks
-clever
-cleverer
-cleverest
-cleverly
-cleverness
-cliche
-cliches
-click
-clicked
-clicking
-clicks
-client
-clientele
-clients
-cliff
-cliffhanger
-cliffs
-climactic
-climate
-climates
-climatic
-climatically
-climatological
-climatologists
-climatology
-climax
-climaxed
-climaxes
-climaxing
-climb
-climbable
-climbdown
-climbed
-climber
-climbers
-climbing
-climbs
-climes
-clinch
-clinched
-clinches
-clinching
-cling
-clingers
-clinging
-clings
-clinic
-clinical
-clinically
-clinician
-clinicians
-clinics
-clink
-clinked
-clinker
-clinking
-clip
-clipboard
-clipboards
-clipped
-clipper
-clippers
-clipping
-clippings
-clips
-clique
-cliques
-cliquey
-clitoral
-clitoris
-cloaca
-cloak
-cloakanddagger
-cloaked
-cloaking
-cloakroom
-cloakrooms
-cloaks
-clobber
-clock
-clocked
-clocking
-clockmaker
-clocks
-clockwise
-clockwork
-clod
-clods
-clog
-clogged
-clogging
-clogs
-cloister
-cloistered
-cloisters
-clonal
-clone
-cloned
-clones
-cloning
-closable
-close
-closed
-closedcircuit
-closeknit
-closely
-closeness
-closer
-closers
-closes
-closest
-closet
-closeted
-closets
-closeup
-closeups
-closing
-closings
-closure
-closures
-clot
-cloth
-clothe
-clothed
-clothes
-clothespeg
-clothespegs
-clothier
-clothiers
-clothing
-cloths
-clots
-clotted
-clotting
-cloud
-cloudburst
-cloudbursts
-clouded
-cloudier
-cloudiest
-cloudiness
-clouding
-cloudless
-clouds
-cloudscape
-cloudscapes
-cloudy
-clout
-clouted
-clouts
-clove
-cloven
-clover
-cloves
-clown
-clowned
-clowning
-clownish
-clowns
-cloying
-cloyingly
-club
-clubbed
-clubbing
-clubfooted
-clubhouse
-clubman
-clubroom
-clubs
-cluck
-clucked
-clucking
-clucks
-clue
-clued
-cluedup
-clueless
-clues
-clumber
-clump
-clumped
-clumping
-clumps
-clumpy
-clumsier
-clumsiest
-clumsily
-clumsiness
-clumsy
-clung
-cluster
-clustered
-clustering
-clusters
-clutch
-clutched
-clutches
-clutching
-clutter
-cluttered
-cluttering
-clutters
-coach
-coached
-coaches
-coaching
-coachload
-coachloads
-coachman
-coachmen
-coachwork
-coacted
-coaction
-coacts
-coagulate
-coagulated
-coagulation
-coal
-coalblack
-coalesce
-coalesced
-coalescence
-coalesces
-coalescing
-coalface
-coalfield
-coalfields
-coalition
-coalitions
-coalminers
-coals
-coapts
-coarse
-coarsely
-coarseness
-coarsens
-coarser
-coarsest
-coast
-coastal
-coasted
-coaster
-coasters
-coastguard
-coastguards
-coasting
-coastlands
-coastline
-coastlines
-coasts
-coat
-coated
-coathanger
-coating
-coatings
-coats
-coauthor
-coauthored
-coauthoring
-coauthors
-coax
-coaxed
-coaxes
-coaxial
-coaxing
-coaxingly
-cob
-cobalt
-cobble
-cobbled
-cobbler
-cobblers
-cobbles
-cobblestones
-cobbling
-coble
-cobra
-cobras
-cobs
-cobweb
-cobwebbed
-cobwebby
-cobwebs
-coca
-cocain
-cocaine
-cochlea
-cochlear
-cock
-cockatoo
-cockatoos
-cockatrice
-cockatrices
-cockcrow
-cocked
-cockerel
-cockerels
-cockeyed
-cockier
-cockiest
-cockiness
-cocking
-cockle
-cockles
-cockney
-cockneys
-cockpit
-cockpits
-cockroach
-cockroaches
-cocks
-cockshies
-cocksure
-cocktail
-cocktails
-cocky
-cocoa
-coconut
-coconuts
-cocoon
-cocooned
-cocoons
-cod
-coda
-coddle
-coddling
-code
-codebreaker
-coded
-codeine
-codename
-codenamed
-coder
-coders
-codes
-codeword
-codewords
-codex
-codfish
-codices
-codicil
-codicils
-codification
-codifications
-codified
-codifies
-codify
-codifying
-coding
-codling
-codpiece
-cods
-coefficient
-coefficients
-coelenterates
-coerce
-coerced
-coercer
-coerces
-coercible
-coercing
-coercion
-coercions
-coercive
-coercively
-coeval
-coexist
-coexisted
-coexistence
-coexistent
-coexisting
-coexists
-coextensive
-coffee
-coffees
-coffer
-cofferdam
-cofferdams
-coffers
-coffin
-coffins
-cog
-cogency
-cogent
-cogently
-cogitate
-cogitated
-cogitating
-cogitation
-cogitations
-cogitative
-cognac
-cognacs
-cognate
-cognates
-cognisance
-cognisant
-cognition
-cognitive
-cognitively
-cognizance
-cognizant
-cognoscenti
-cogs
-cohabit
-cohabitation
-cohabitees
-cohabiting
-cohere
-cohered
-coherence
-coherency
-coherent
-coherently
-coheres
-cohesion
-cohesive
-cohesively
-cohesiveness
-cohort
-cohorts
-coiffure
-coil
-coiled
-coiling
-coils
-coin
-coinage
-coinages
-coincide
-coincided
-coincidence
-coincidences
-coincident
-coincidental
-coincidentally
-coincides
-coinciding
-coined
-coiner
-coiners
-coining
-coins
-coital
-coitus
-coke
-col
-cola
-colander
-colas
-cold
-coldblooded
-coldbloodedly
-colder
-coldest
-coldhearted
-coldish
-coldly
-coldness
-colds
-coldwar
-cole
-coleslaw
-colitis
-collaborate
-collaborated
-collaborates
-collaborating
-collaboration
-collaborationist
-collaborations
-collaborative
-collaboratively
-collaborator
-collaborators
-collage
-collagen
-collages
-collapse
-collapsed
-collapses
-collapsible
-collapsing
-collar
-collarbone
-collared
-collaring
-collarless
-collars
-collate
-collated
-collateral
-collaterally
-collates
-collating
-collation
-colleague
-colleagues
-collect
-collectability
-collectable
-collectables
-collected
-collecting
-collection
-collections
-collective
-collectively
-collectives
-collectivisation
-collectivism
-collectivist
-collectivity
-collector
-collectors
-collects
-college
-colleges
-collegial
-collegiate
-collide
-collided
-collides
-colliding
-collie
-collier
-collieries
-colliers
-colliery
-collies
-collimation
-collimator
-collinear
-collins
-collision
-collisional
-collisions
-collocated
-collocation
-collocational
-collocations
-colloid
-colloidal
-colloids
-colloquia
-colloquial
-colloquialism
-colloquialisms
-colloquially
-colloquium
-collude
-colluded
-colluding
-collusion
-colobus
-cologne
-colon
-colonel
-colonels
-colonial
-colonialism
-colonialist
-colonialists
-colonials
-colonic
-colonies
-colonisation
-colonisations
-colonise
-colonised
-colonisers
-colonising
-colonist
-colonists
-colonnade
-colonnaded
-colonnades
-colons
-colony
-colossal
-colossally
-colossus
-colostomies
-colostomy
-colour
-colourant
-colourants
-colouration
-colourblind
-coloure
-colourful
-colourfully
-colouring
-colourings
-colourisation
-colourise
-colourised
-colourising
-colourless
-colours
-coloury
-cols
-colt
-colts
-columbus
-column
-columnar
-columned
-columnist
-columnists
-columns
-coma
-comas
-comatose
-comb
-combat
-combatant
-combatants
-combated
-combating
-combative
-combativeness
-combats
-combed
-comber
-combination
-combinations
-combinatorial
-combine
-combined
-combines
-combing
-combining
-combs
-combusted
-combustible
-combustibles
-combustion
-combusts
-come
-comeback
-comedian
-comedians
-comedies
-comedown
-comedy
-comeliness
-comely
-comer
-comers
-comes
-comestible
-comestibles
-comet
-cometary
-comets
-comfort
-comfortable
-comfortably
-comforted
-comforter
-comforters
-comforting
-comfortingly
-comforts
-comfy
-comic
-comical
-comically
-comics
-coming
-comings
-comity
-comma
-command
-commandant
-commanded
-commandeer
-commandeered
-commandeering
-commander
-commanders
-commanding
-commandingly
-commandment
-commandments
-commando
-commands
-commas
-commemorate
-commemorated
-commemorates
-commemorating
-commemoration
-commemorations
-commemorative
-commence
-commenced
-commencement
-commences
-commencing
-commend
-commendable
-commendably
-commendation
-commendations
-commended
-commending
-commends
-commensurate
-commensurately
-comment
-commentaries
-commentary
-commentate
-commentating
-commentator
-commentators
-commented
-commenter
-commenting
-comments
-commerce
-commercial
-commercialisation
-commercialise
-commercialised
-commercialism
-commercially
-commercials
-commiserate
-commiserated
-commiserating
-commiseration
-commiserations
-commissar
-commissariat
-commissars
-commission
-commissionaire
-commissioned
-commissioner
-commissioners
-commissioning
-commissions
-commit
-commitment
-commitments
-commits
-committal
-committed
-committee
-committees
-committing
-commode
-commodes
-commodious
-commodities
-commodity
-commodore
-commodores
-common
-commonalities
-commonality
-commoner
-commoners
-commonest
-commonlaw
-commonly
-commonness
-commonplace
-commonplaces
-commons
-commonsense
-commonsensical
-commonwealth
-commotion
-commotions
-communal
-communality
-communally
-commune
-communed
-communes
-communicable
-communicant
-communicants
-communicate
-communicated
-communicates
-communicating
-communication
-communications
-communicative
-communicativeness
-communicator
-communicators
-communing
-communion
-communions
-communique
-communiques
-communism
-communist
-communists
-communitarian
-communities
-community
-commutation
-commutative
-commutativity
-commutator
-commute
-commuted
-commuter
-commuters
-commutes
-commuting
-compact
-compacted
-compacting
-compaction
-compactions
-compactly
-compactness
-compacts
-companies
-companion
-companionable
-companionably
-companions
-companionship
-company
-comparability
-comparable
-comparably
-comparative
-comparatively
-comparatives
-comparator
-comparators
-compare
-compared
-compares
-comparing
-comparison
-comparisons
-compartment
-compartmentalisation
-compartmentalised
-compartmentalising
-compartments
-compass
-compassed
-compasses
-compassion
-compassionate
-compassionately
-compatibilities
-compatibility
-compatible
-compatibles
-compatibly
-compatriot
-compatriots
-compel
-compelled
-compelling
-compellingly
-compels
-compendia
-compendium
-compendiums
-compensate
-compensated
-compensates
-compensating
-compensation
-compensations
-compensator
-compensatory
-compere
-compete
-competed
-competence
-competences
-competencies
-competency
-competent
-competently
-competes
-competing
-competition
-competitions
-competitive
-competitively
-competitiveness
-competitor
-competitors
-compilable
-compilation
-compilations
-compile
-compiled
-compiler
-compilers
-compiles
-compiling
-complacency
-complacent
-complacently
-complain
-complainant
-complainants
-complained
-complainer
-complaining
-complainingly
-complains
-complaint
-complaints
-complaisant
-complement
-complementarity
-complementary
-complemented
-complementing
-complements
-completable
-complete
-completed
-completely
-completeness
-completes
-completing
-completion
-completions
-complex
-complexes
-complexion
-complexioned
-complexions
-complexities
-complexity
-complexly
-compliance
-compliant
-complicate
-complicated
-complicates
-complicating
-complication
-complications
-complicit
-complicity
-complied
-complies
-compliment
-complimentary
-complimented
-complimenting
-compliments
-complot
-comply
-complying
-component
-components
-comport
-compose
-composed
-composedly
-composer
-composers
-composes
-composing
-composite
-composites
-composition
-compositional
-compositions
-compositor
-compositors
-compost
-composts
-composure
-compound
-compounded
-compounding
-compounds
-comprehend
-comprehended
-comprehending
-comprehends
-comprehensibility
-comprehensible
-comprehensibly
-comprehension
-comprehensive
-comprehensively
-comprehensiveness
-comprehensives
-compress
-compressed
-compresses
-compressibility
-compressible
-compressing
-compression
-compressional
-compressions
-compressive
-compressor
-compressors
-comprise
-comprised
-comprises
-comprising
-compromise
-compromised
-compromises
-compromising
-comptroller
-compulsion
-compulsions
-compulsive
-compulsively
-compulsorily
-compulsory
-compunction
-computability
-computable
-computably
-computation
-computational
-computationally
-computations
-compute
-computed
-computer
-computerisation
-computerise
-computerised
-computerising
-computerliterate
-computers
-computes
-computing
-comrade
-comradeinarms
-comradely
-comrades
-comradeship
-con
-conakry
-concatenate
-concatenated
-concatenates
-concatenating
-concatenation
-concatenations
-concave
-concavity
-conceal
-concealed
-concealing
-concealment
-conceals
-concede
-conceded
-concedes
-conceding
-conceit
-conceited
-conceits
-conceivability
-conceivable
-conceivably
-conceive
-conceived
-conceives
-conceiving
-concentrate
-concentrated
-concentrates
-concentrating
-concentration
-concentrations
-concentrator
-concentrators
-concentric
-concept
-conception
-conceptions
-concepts
-conceptual
-conceptualisation
-conceptualisations
-conceptualise
-conceptualised
-conceptualising
-conceptually
-concern
-concerned
-concernedly
-concerning
-concerns
-concert
-concerted
-concertgoers
-concerti
-concertina
-concerto
-concerts
-concession
-concessional
-concessionary
-concessions
-concierge
-conciliar
-conciliate
-conciliating
-conciliation
-conciliator
-conciliatory
-concise
-concisely
-conciseness
-conclave
-conclaves
-conclude
-concluded
-concludes
-concluding
-conclusion
-conclusions
-conclusive
-conclusively
-concoct
-concocted
-concocting
-concoction
-concoctions
-concocts
-concomitant
-concomitantly
-concord
-concordance
-concordances
-concordant
-concordat
-concords
-concourse
-concourses
-concrete
-concreted
-concretely
-concreteness
-concretes
-concreting
-concretions
-concubine
-concubines
-concur
-concurred
-concurrence
-concurrency
-concurrent
-concurrently
-concurring
-concurs
-concuss
-concussed
-concussion
-condemn
-condemnable
-condemnation
-condemnations
-condemnatory
-condemned
-condemning
-condemns
-condensate
-condensation
-condensations
-condense
-condensed
-condenser
-condensers
-condenses
-condensing
-condescend
-condescended
-condescending
-condescendingly
-condescends
-condescension
-condiment
-condiments
-condition
-conditional
-conditionality
-conditionally
-conditionals
-conditioned
-conditioner
-conditioners
-conditioning
-conditions
-condole
-condoled
-condolence
-condolences
-condoles
-condonable
-condone
-condoned
-condones
-condoning
-condor
-condors
-conducive
-conduct
-conductance
-conducted
-conducting
-conduction
-conductive
-conductivities
-conductivity
-conductor
-conductors
-conductress
-conducts
-conduit
-conduits
-cone
-coned
-cones
-confabulate
-confection
-confectioner
-confectioners
-confectionery
-confectionist
-confections
-confederacy
-confederate
-confederates
-confederation
-confederations
-confer
-conference
-conferences
-conferencing
-conferment
-conferred
-conferring
-confers
-confess
-confessed
-confesses
-confessing
-confession
-confessional
-confessionals
-confessions
-confessor
-confessors
-confetti
-confidant
-confidante
-confidantes
-confidants
-confide
-confided
-confidence
-confidences
-confident
-confidential
-confidentiality
-confidentially
-confidently
-confides
-confiding
-confidingly
-configurable
-configuration
-configurations
-configure
-configured
-configures
-configuring
-confine
-confined
-confinement
-confinements
-confines
-confining
-confirm
-confirmation
-confirmations
-confirmatory
-confirmed
-confirming
-confirms
-confiscate
-confiscated
-confiscates
-confiscating
-confiscation
-confiscations
-confiscatory
-conflagration
-conflagrations
-conflated
-conflates
-conflating
-conflation
-conflict
-conflicted
-conflicting
-conflictingly
-conflicts
-conflictual
-confluence
-confluent
-confocal
-conform
-conformable
-conformal
-conformance
-conformation
-conformational
-conformed
-conforming
-conformism
-conformist
-conformists
-conformity
-conforms
-confound
-confounded
-confoundedly
-confounding
-confounds
-confront
-confrontation
-confrontational
-confrontations
-confronted
-confronting
-confronts
-confusable
-confuse
-confused
-confusedly
-confuser
-confuses
-confusing
-confusingly
-confusion
-confusions
-conga
-congeal
-congealed
-congealing
-congeals
-congenial
-congeniality
-congenital
-congenitally
-conger
-congest
-congested
-congesting
-congestion
-congestive
-conglomerate
-conglomerated
-conglomerates
-conglomeration
-congo
-congratulate
-congratulated
-congratulates
-congratulating
-congratulation
-congratulations
-congratulatory
-congregate
-congregated
-congregating
-congregation
-congregational
-congregations
-congress
-congresses
-congressional
-congressman
-congressmen
-congruence
-congruences
-congruency
-congruent
-congruential
-congruity
-conic
-conical
-conics
-conifer
-coniferous
-conifers
-conjectural
-conjecture
-conjectured
-conjectures
-conjecturing
-conjoin
-conjoined
-conjoining
-conjoint
-conjugacy
-conjugal
-conjugate
-conjugated
-conjugates
-conjugating
-conjugation
-conjugations
-conjunct
-conjunction
-conjunctions
-conjunctive
-conjunctivitis
-conjunctures
-conjure
-conjured
-conjurer
-conjurers
-conjures
-conjuring
-conjuror
-conjurors
-conjury
-conk
-conker
-conkers
-conman
-conmen
-connect
-connected
-connectedness
-connecting
-connection
-connectionless
-connections
-connective
-connectives
-connectivity
-connector
-connectors
-connects
-conned
-connexion
-connexions
-connivance
-connive
-connived
-conniving
-connoisseur
-connoisseurs
-connoisseurship
-connotation
-connotations
-connote
-connoted
-connotes
-connoting
-conquer
-conquerable
-conquered
-conquering
-conqueror
-conquerors
-conquers
-conquest
-conquests
-conquistador
-conquistadores
-cons
-consanguineous
-consanguinity
-conscience
-consciences
-consciencestricken
-conscientious
-conscientiously
-conscientiousness
-conscionable
-conscious
-consciously
-consciousness
-consciousnesses
-conscript
-conscripted
-conscripting
-conscription
-conscripts
-consecrate
-consecrated
-consecrating
-consecration
-consecutive
-consecutively
-consensual
-consensually
-consensus
-consent
-consented
-consenting
-consents
-consequence
-consequences
-consequent
-consequential
-consequentially
-consequently
-conservation
-conservationist
-conservationists
-conservations
-conservatism
-conservative
-conservatively
-conservativeness
-conservatives
-conservatoire
-conservator
-conservatories
-conservators
-conservatory
-conserve
-conserved
-conserves
-conserving
-consider
-considerable
-considerably
-considerate
-considerately
-consideration
-considerations
-considered
-considering
-considers
-consign
-consigned
-consignee
-consigning
-consignment
-consignments
-consigns
-consist
-consisted
-consistencies
-consistency
-consistent
-consistently
-consisting
-consists
-consolation
-consolations
-console
-consoled
-consoles
-consolidate
-consolidated
-consolidates
-consolidating
-consolidation
-consolidations
-consoling
-consolingly
-consonance
-consonant
-consonantal
-consonants
-consort
-consorted
-consortia
-consorting
-consortium
-consorts
-conspecific
-conspicuous
-conspicuously
-conspicuousness
-conspiracies
-conspiracy
-conspirator
-conspiratorial
-conspiratorially
-conspirators
-conspire
-conspired
-conspires
-conspiring
-constable
-constables
-constabularies
-constabulary
-constancy
-constant
-constantly
-constants
-constellation
-constellations
-consternating
-consternation
-constipated
-constipation
-constituencies
-constituency
-constituent
-constituents
-constitute
-constituted
-constitutes
-constituting
-constitution
-constitutional
-constitutionalism
-constitutionalists
-constitutionality
-constitutionally
-constitutions
-constitutive
-constitutively
-constrain
-constrained
-constraining
-constrains
-constraint
-constraints
-constrict
-constricted
-constricting
-constriction
-constrictions
-constrictive
-constrictor
-constrictors
-constricts
-construct
-constructable
-constructed
-constructing
-construction
-constructional
-constructions
-constructive
-constructively
-constructivism
-constructivist
-constructor
-constructors
-constructs
-construe
-construed
-construes
-construing
-consul
-consular
-consulate
-consulates
-consuls
-consult
-consultancies
-consultancy
-consultant
-consultants
-consultation
-consultations
-consultative
-consulted
-consulting
-consults
-consumable
-consumables
-consume
-consumed
-consumer
-consumerism
-consumerist
-consumers
-consumes
-consuming
-consummate
-consummated
-consummately
-consummation
-consumption
-consumptions
-consumptive
-contact
-contactable
-contacted
-contacting
-contacts
-contagion
-contagious
-contain
-containable
-contained
-container
-containers
-containing
-containment
-contains
-contaminant
-contaminants
-contaminate
-contaminated
-contaminates
-contaminating
-contamination
-contemplate
-contemplated
-contemplates
-contemplating
-contemplation
-contemplations
-contemplative
-contemporaneity
-contemporaneous
-contemporaneously
-contemporaries
-contemporary
-contempt
-contemptible
-contemptibly
-contemptuous
-contemptuously
-contend
-contended
-contender
-contenders
-contending
-contends
-content
-contented
-contentedly
-contenting
-contention
-contentions
-contentious
-contentiously
-contentment
-contents
-contest
-contestable
-contestant
-contestants
-contested
-contesting
-contests
-context
-contexts
-contextual
-contextualisation
-contextually
-contiguity
-contiguous
-contiguously
-continence
-continent
-continental
-continentals
-continents
-contingencies
-contingency
-contingent
-contingently
-contingents
-continua
-continuable
-continual
-continually
-continuance
-continuation
-continuations
-continue
-continued
-continues
-continuing
-continuities
-continuity
-continuous
-continuously
-continuum
-contort
-contorted
-contorting
-contortion
-contortionist
-contortions
-contorts
-contour
-contoured
-contouring
-contours
-contra
-contraband
-contraception
-contraceptive
-contraceptives
-contract
-contracted
-contractible
-contractile
-contracting
-contraction
-contractions
-contractor
-contractors
-contracts
-contractual
-contractually
-contradict
-contradicted
-contradicting
-contradiction
-contradictions
-contradictorily
-contradictory
-contradicts
-contradistinction
-contraflow
-contraflows
-contraindication
-contraindications
-contralto
-contraption
-contraptions
-contrapuntal
-contrarily
-contrariness
-contrariwise
-contrary
-contras
-contrast
-contrasted
-contrasting
-contrastingly
-contrastive
-contrasts
-contrasty
-contravene
-contravened
-contravenes
-contravening
-contravention
-contraventions
-contretemps
-contribute
-contributed
-contributes
-contributing
-contribution
-contributions
-contributor
-contributors
-contributory
-contrite
-contritely
-contrition
-contrivance
-contrivances
-contrive
-contrived
-contrives
-contriving
-control
-controllable
-controlled
-controller
-controllers
-controlling
-controls
-controversial
-controversially
-controversies
-controversy
-controvert
-controverted
-contumely
-contuse
-contusion
-contusions
-conundrum
-conundrums
-conurbation
-conurbations
-convalesce
-convalescence
-convalescent
-convalescing
-convect
-convected
-convecting
-convection
-convectional
-convective
-convector
-convects
-convene
-convened
-convener
-convenes
-convenience
-conveniences
-convenient
-conveniently
-convening
-convenor
-convenors
-convent
-conventicle
-convention
-conventional
-conventionalism
-conventionalist
-conventionality
-conventionally
-conventions
-convents
-converge
-converged
-convergence
-convergences
-convergent
-converges
-converging
-conversant
-conversation
-conversational
-conversationalist
-conversationalists
-conversationally
-conversations
-conversazione
-converse
-conversed
-conversely
-converses
-conversing
-conversion
-conversions
-convert
-converted
-converter
-converters
-convertibility
-convertible
-convertibles
-converting
-convertor
-convertors
-converts
-convex
-convexity
-convey
-conveyance
-conveyancing
-conveyed
-conveying
-conveyor
-conveyors
-conveys
-convict
-convicted
-convicting
-conviction
-convictions
-convicts
-convince
-convinced
-convinces
-convincing
-convincingly
-convivial
-conviviality
-convocation
-convocations
-convoluted
-convolution
-convolutions
-convolve
-convolved
-convoy
-convoys
-convulse
-convulsed
-convulses
-convulsing
-convulsion
-convulsions
-convulsive
-convulsively
-cony
-coo
-cooed
-cooing
-cook
-cookbook
-cookbooks
-cooked
-cooker
-cookers
-cookery
-cookies
-cooking
-cooks
-cookware
-cool
-coolant
-coolants
-cooled
-cooler
-coolers
-coolest
-cooling
-coolness
-cools
-coon
-coons
-coop
-cooped
-cooper
-cooperate
-cooperated
-cooperates
-cooperating
-cooperation
-cooperative
-cooperatively
-cooperatives
-coopers
-coops
-coordinate
-coordinated
-coordinates
-coordinating
-coordination
-coordinator
-coordinators
-coos
-cop
-cope
-coped
-copes
-copied
-copier
-copiers
-copies
-copilot
-coping
-copious
-copiously
-coplanar
-copout
-copouts
-copper
-copperplate
-coppers
-coppery
-coppice
-coppiced
-coppices
-coppicing
-copra
-coprocessor
-coprocessors
-coproduced
-coprolite
-coprophagous
-cops
-copse
-copses
-copulate
-copulating
-copulation
-copulations
-copulatory
-copy
-copyable
-copycat
-copycats
-copying
-copyist
-copyists
-copyright
-copyrightable
-copyrighted
-copyrighting
-copyrights
-copywriter
-coquette
-coquettes
-coquettish
-coquettishly
-cor
-coracle
-coral
-coralline
-corals
-cord
-cordage
-cordate
-corded
-cordial
-cordiality
-cordially
-cordials
-cordillera
-cordite
-cordless
-cordon
-cordoned
-cordons
-cords
-corduroy
-corduroys
-core
-cores
-corespondent
-corgi
-corgis
-coriander
-corinth
-cork
-corkage
-corked
-corks
-corkscrew
-corkscrews
-corky
-cormorant
-cormorants
-corn
-corncrake
-cornea
-corneal
-corneas
-corned
-corner
-cornered
-cornering
-corners
-cornerstone
-cornerstones
-cornet
-cornets
-cornfield
-cornfields
-cornflake
-cornflakes
-cornflour
-cornflower
-cornflowers
-cornice
-cornices
-cornish
-cornmeal
-corns
-cornucopia
-corny
-corollaries
-corollary
-corona
-coronal
-coronaries
-coronary
-coronas
-coronation
-coronations
-coroner
-coroners
-coronet
-coronets
-corpora
-corporal
-corporals
-corporate
-corporately
-corporates
-corporation
-corporations
-corporatism
-corporatist
-corporeal
-corporeally
-corps
-corpse
-corpses
-corpulent
-corpus
-corpuscle
-corpuscles
-corpuscular
-corral
-corralled
-corrals
-correct
-correctable
-corrected
-correcting
-correction
-correctional
-corrections
-corrective
-correctly
-correctness
-corrector
-correctors
-corrects
-correlate
-correlated
-correlates
-correlating
-correlation
-correlations
-correlative
-correspond
-corresponded
-correspondence
-correspondences
-correspondent
-correspondents
-corresponding
-correspondingly
-corresponds
-corridor
-corridors
-corrigenda
-corroborate
-corroborated
-corroborates
-corroborating
-corroboration
-corroborative
-corroboratory
-corrode
-corroded
-corrodes
-corroding
-corrosion
-corrosive
-corrugated
-corrugations
-corrupt
-corrupted
-corruptible
-corrupting
-corruption
-corruptions
-corruptly
-corrupts
-corsage
-corse
-corset
-corsets
-corsica
-corslet
-cortege
-cortex
-cortical
-corticosteroid
-corticosteroids
-cortisol
-cortisone
-coruscates
-corvette
-corvettes
-cosier
-cosiest
-cosily
-cosine
-cosines
-cosiness
-cosmetic
-cosmetically
-cosmetics
-cosmic
-cosmical
-cosmically
-cosmological
-cosmologically
-cosmologies
-cosmologist
-cosmologists
-cosmology
-cosmonaut
-cosmonauts
-cosmopolitan
-cosmopolitans
-cosmos
-cossacks
-cosset
-cosseted
-cossets
-cost
-costar
-costarred
-costarring
-costars
-costcutting
-costed
-costeffective
-costeffectiveness
-costefficient
-costing
-costings
-costive
-costless
-costlier
-costliest
-costliness
-costly
-costs
-costume
-costumed
-costumes
-cosy
-cot
-coterie
-coterminous
-cots
-cottage
-cottages
-cotton
-cottoned
-cottons
-couch
-couched
-couches
-couching
-cougar
-cougars
-cough
-coughed
-coughing
-coughs
-could
-couloir
-coulomb
-coulombs
-council
-councillor
-councillors
-councils
-counsel
-counselled
-counselling
-counsellor
-counsellors
-counsels
-count
-countability
-countable
-countably
-countdown
-counted
-countenance
-countenanced
-countenances
-countenancing
-counter
-counteract
-counteracted
-counteracting
-counteracts
-counterattack
-counterattacked
-counterattacks
-counterbalance
-counterbalanced
-counterbalancing
-countered
-counterfeit
-counterfeited
-counterfeiters
-counterfeiting
-counterfeits
-counterfoil
-counterfoils
-countering
-counterintelligence
-counterintuitive
-countermanded
-countermeasures
-counteroffensive
-counterpane
-counterpart
-counterparts
-counterpoint
-counterpointed
-counterpoints
-counterpoise
-counterproductive
-counterrevolution
-counterrevolutionaries
-counterrevolutionary
-counters
-countersign
-countersigned
-countersigns
-countess
-countesses
-counties
-counting
-countless
-countries
-country
-countryman
-countrymen
-countryside
-countrywide
-counts
-county
-coup
-coupe
-coupes
-couple
-coupled
-coupler
-couplers
-couples
-couplet
-couplets
-coupling
-couplings
-coupon
-coupons
-coups
-courage
-courageous
-courageously
-courgette
-courgettes
-courier
-couriers
-course
-coursebook
-coursed
-courses
-coursework
-coursing
-court
-courted
-courteous
-courteously
-courtesan
-courtesans
-courtesies
-courtesy
-courthouse
-courtier
-courtiers
-courting
-courtly
-courtmartial
-courtroom
-courtrooms
-courts
-courtship
-courtships
-courtyard
-courtyards
-couscous
-cousin
-cousinly
-cousins
-couther
-couture
-couturier
-couturiers
-covalent
-covalently
-covariance
-covariances
-cove
-coven
-covenant
-covenanted
-covenanters
-covenants
-covens
-cover
-coverage
-coverages
-coveralls
-covered
-covering
-coverings
-coverlet
-coverlets
-covers
-coversheet
-covert
-covertly
-coverts
-coverup
-coverups
-coves
-covet
-coveted
-coveting
-covetous
-covetousness
-covets
-cow
-coward
-cowardice
-cowardly
-cowards
-cowboy
-cowboys
-cowed
-cower
-cowered
-cowering
-cowers
-cowgirl
-cowgirls
-cowhand
-cowherd
-cowing
-cowl
-cowled
-cowling
-coworker
-coworkers
-cowriter
-cowritten
-cows
-cowshed
-cowsheds
-cowslip
-cowslips
-cox
-coxcomb
-coxcombs
-coxed
-coxes
-coxing
-coxswain
-coy
-coyly
-coyness
-coyote
-coyotes
-cozier
-crab
-crabby
-crabs
-crack
-crackable
-crackdown
-crackdowns
-cracked
-cracker
-crackers
-cracking
-crackle
-crackled
-crackles
-crackling
-crackly
-crackpot
-crackpots
-cracks
-cradle
-cradled
-cradles
-cradling
-craft
-crafted
-crafter
-craftier
-craftiest
-craftily
-crafting
-crafts
-craftsman
-craftsmanship
-craftsmen
-craftspeople
-crafty
-crag
-craggy
-crags
-cram
-crammed
-crammer
-cramming
-cramp
-cramped
-cramping
-crampon
-crampons
-cramps
-crams
-cran
-cranberries
-cranberry
-crane
-craned
-cranes
-cranial
-craning
-cranium
-crank
-cranked
-cranking
-cranks
-crankshaft
-cranky
-crannies
-cranny
-crap
-crash
-crashed
-crasher
-crashers
-crashes
-crashing
-crashingly
-crashland
-crashlanded
-crashlanding
-crass
-crasser
-crassly
-crassness
-crate
-crateful
-crater
-cratered
-craters
-crates
-cravat
-cravats
-crave
-craved
-craven
-cravenly
-craves
-craving
-cravings
-crawl
-crawled
-crawler
-crawlers
-crawling
-crawls
-craws
-crayfish
-crayon
-crayoned
-crayons
-craze
-crazed
-crazes
-crazier
-craziest
-crazily
-craziness
-crazy
-creak
-creaked
-creakier
-creakiest
-creaking
-creaks
-creaky
-cream
-creamed
-creamer
-creamery
-creamier
-creamiest
-creaming
-creams
-creamy
-crease
-creased
-creases
-creasing
-creatable
-create
-created
-creates
-creating
-creation
-creationism
-creationist
-creationists
-creations
-creative
-creatively
-creativeness
-creativity
-creator
-creators
-creature
-creatures
-creche
-creches
-credence
-credentials
-credibility
-credible
-credibly
-credit
-creditability
-creditable
-creditably
-credited
-crediting
-creditor
-creditors
-credits
-creditworthiness
-creditworthy
-credo
-credulity
-credulous
-creed
-creeds
-creek
-creeks
-creel
-creep
-creeper
-creepers
-creeping
-creeps
-creepy
-cremate
-cremated
-cremates
-cremation
-cremations
-crematoria
-crematorium
-creme
-crenellated
-crenellation
-crenellations
-creole
-creoles
-creosote
-crepe
-crept
-crepuscular
-crescendo
-crescent
-crescents
-cress
-crest
-crested
-crestfallen
-cresting
-crests
-cretaceous
-cretan
-cretans
-crete
-cretin
-cretinous
-cretins
-crevasse
-crevasses
-crevice
-crevices
-crew
-crewed
-crewing
-crewman
-crewmen
-crews
-crib
-cribbage
-cribbed
-cribbing
-cribs
-crick
-cricket
-cricketer
-cricketers
-cricketing
-crickets
-cried
-crier
-cries
-crim
-crime
-crimea
-crimes
-criminal
-criminalisation
-criminalise
-criminalised
-criminalising
-criminality
-criminally
-criminals
-criminological
-criminologist
-criminologists
-criminology
-crimp
-crimped
-crimping
-crimson
-cringe
-cringed
-cringes
-cringing
-crinkle
-crinkled
-crinkling
-crinkly
-crinoline
-cripple
-crippled
-cripples
-crippling
-cripplingly
-crises
-crisis
-crisp
-crisped
-crisper
-crispier
-crispiest
-crisply
-crispness
-crisps
-crispy
-crisscrossed
-crisscrosses
-criteria
-criterion
-critic
-critical
-critically
-criticise
-criticised
-criticises
-criticising
-criticism
-criticisms
-critics
-critique
-critiques
-critter
-croak
-croaked
-croakier
-croakiest
-croaking
-croaks
-croatia
-croatian
-crochet
-crocheted
-crochets
-crock
-crockery
-crocks
-crocodile
-crocodiles
-crocus
-crocuses
-croft
-crofter
-crofters
-crofting
-crofts
-croissant
-croissants
-crone
-crones
-cronies
-crony
-crook
-crooked
-crookedly
-crookedness
-crooking
-crooks
-croon
-crooned
-crooner
-crooners
-crooning
-croons
-crop
-cropped
-cropper
-croppers
-cropping
-crops
-croquet
-croqueted
-croqueting
-croquette
-crores
-crosier
-crosiers
-cross
-crossbar
-crossbars
-crossbones
-crossbow
-crossbows
-crossbred
-crosscheck
-crosschecked
-crosschecking
-crosschecks
-crosscountry
-crossed
-crosser
-crosses
-crossexamination
-crossexamine
-crossexamined
-crossexamines
-crossexamining
-crossfertilisation
-crossfire
-crossing
-crossings
-crossly
-crossness
-crossover
-crossovers
-crossreference
-crossreferenced
-crossreferences
-crossreferencing
-crossroads
-crosssection
-crosssectional
-crosssections
-crosstalk
-crossways
-crosswind
-crosswinds
-crossword
-crosswords
-crotch
-crotchet
-crotchetiness
-crotchety
-crotchless
-crouch
-crouched
-crouches
-crouching
-croup
-croupier
-croutons
-crow
-crowbar
-crowbars
-crowd
-crowded
-crowding
-crowds
-crowed
-crowing
-crown
-crowned
-crowning
-crowns
-crows
-crozier
-croziers
-crucial
-crucially
-cruciate
-crucible
-crucibles
-crucifiable
-crucified
-crucifix
-crucifixes
-crucifixion
-crucifixions
-cruciform
-crucify
-crucifying
-crude
-crudely
-crudeness
-cruder
-crudest
-crudities
-crudity
-cruel
-crueler
-cruelest
-crueller
-cruellest
-cruelly
-cruelness
-cruelties
-cruelty
-cruise
-cruised
-cruiser
-cruisers
-cruises
-cruising
-cruller
-crumb
-crumbing
-crumble
-crumbled
-crumbles
-crumblier
-crumbliest
-crumbling
-crumbly
-crumbs
-crumby
-crummy
-crumpet
-crumpets
-crumple
-crumpled
-crumples
-crumpling
-crunch
-crunched
-cruncher
-crunchers
-crunches
-crunchier
-crunchiest
-crunching
-crunchy
-crusade
-crusaded
-crusader
-crusaders
-crusades
-crusading
-crush
-crushed
-crusher
-crushers
-crushes
-crushing
-crushingly
-crust
-crustacean
-crustaceans
-crustal
-crusted
-crustier
-crustiest
-crusts
-crusty
-crutch
-crutches
-crux
-cruxes
-cry
-crying
-cryings
-cryogenic
-cryogenics
-cryostat
-crypt
-cryptanalysis
-cryptanalyst
-cryptanalytic
-cryptic
-cryptically
-cryptogram
-cryptographer
-cryptographers
-cryptographic
-cryptographically
-cryptography
-cryptology
-crypts
-crystal
-crystalclear
-crystalline
-crystallisation
-crystallise
-crystallised
-crystallises
-crystallising
-crystallographer
-crystallographers
-crystallographic
-crystallography
-crystals
-cub
-cuba
-cuban
-cubans
-cube
-cubed
-cubes
-cubic
-cubical
-cubically
-cubicle
-cubicles
-cubing
-cubism
-cubist
-cubistic
-cubists
-cubit
-cubits
-cuboid
-cubs
-cuckold
-cuckolded
-cuckoo
-cuckoos
-cucumber
-cucumbers
-cud
-cuddle
-cuddled
-cuddles
-cuddlier
-cuddliest
-cuddliness
-cuddling
-cuddly
-cudgel
-cudgels
-cuds
-cue
-cued
-cueing
-cues
-cuff
-cuffed
-cuffing
-cuffs
-cuing
-cuirass
-cuisine
-culdesac
-culinary
-cull
-culled
-culling
-culls
-culminate
-culminated
-culminates
-culminating
-culmination
-culpability
-culpable
-culpably
-culprit
-culprits
-cult
-cultivable
-cultivar
-cultivate
-cultivated
-cultivates
-cultivating
-cultivation
-cultivations
-cultivator
-cultivators
-cults
-cultural
-culturally
-culture
-cultured
-cultures
-culturing
-cultus
-culvert
-cumbersome
-cumbersomely
-cumlaude
-cummerbund
-cumulative
-cumulatively
-cumulus
-cuneiform
-cunnilingus
-cunning
-cunningly
-cup
-cupboard
-cupboards
-cupful
-cupid
-cupidinously
-cupidity
-cupola
-cupolas
-cupped
-cupping
-cuprous
-cups
-cur
-curable
-curare
-curate
-curated
-curates
-curative
-curator
-curatorial
-curators
-curatorships
-curb
-curbed
-curbing
-curbs
-curd
-curdle
-curdled
-curdles
-curdling
-curds
-cure
-cured
-curer
-cures
-curfew
-curfews
-curia
-curial
-curie
-curies
-curing
-curio
-curiosities
-curiosity
-curious
-curiously
-curl
-curled
-curlers
-curlew
-curlews
-curlicues
-curlier
-curliest
-curliness
-curling
-curls
-curly
-curmudgeons
-currant
-currants
-currencies
-currency
-current
-currently
-currents
-curricle
-curricula
-curricular
-curriculum
-curried
-curries
-curry
-currying
-curs
-curse
-cursed
-curses
-cursing
-cursive
-cursor
-cursorily
-cursors
-cursory
-curt
-curtail
-curtailed
-curtailing
-curtailment
-curtailments
-curtails
-curtain
-curtained
-curtaining
-curtains
-curtilage
-curtly
-curtness
-curtsey
-curtseyed
-curtseying
-curtseys
-curtsied
-curtsies
-curtsy
-curtsying
-curvaceous
-curvature
-curvatures
-curve
-curved
-curves
-curvilinear
-curving
-curvy
-cushion
-cushioned
-cushioning
-cushions
-cusp
-cusps
-cuss
-cussedness
-custard
-custards
-custodial
-custodian
-custodians
-custodianship
-custody
-custom
-customarily
-customary
-customer
-customers
-customisable
-customisation
-customisations
-customise
-customised
-customising
-customs
-cut
-cutback
-cutbacks
-cute
-cutely
-cuteness
-cutest
-cuticle
-cuticles
-cutlass
-cutlasses
-cutler
-cutlery
-cutlet
-cutlets
-cutout
-cutouts
-cutprice
-cutrate
-cuts
-cutter
-cutters
-cutthroat
-cutting
-cuttingly
-cuttings
-cuttle
-cuttlefish
-cyan
-cyanide
-cyanogen
-cybernetic
-cybernetics
-cyberpunk
-cyberspace
-cyborg
-cycad
-cycads
-cycle
-cycled
-cycles
-cycleway
-cycleways
-cyclic
-cyclical
-cyclically
-cycling
-cyclist
-cyclists
-cycloid
-cyclone
-cyclones
-cyclops
-cyclotron
-cyclotrons
-cygnet
-cygnets
-cylinder
-cylinders
-cylindrical
-cylindrically
-cymbal
-cymbals
-cynic
-cynical
-cynically
-cynicism
-cynics
-cypher
-cyphers
-cypress
-cypresses
-cyprian
-cyprians
-cypriot
-cypriots
-cyprus
-cyst
-cysteine
-cystic
-cystine
-cystitis
-cysts
-cytochrome
-cytogenetic
-cytological
-cytology
-cytoplasm
-cytoplasmic
-cytosine
-cytotoxic
-czar
-czars
-czech
-czechs
-dab
-dabbed
-dabbing
-dabble
-dabbled
-dabbler
-dabbles
-dabbling
-dabs
-dace
-dacha
-dachau
-dachshund
-dactyl
-dactylic
-dactyls
-dad
-daddies
-daddy
-daddylonglegs
-dado
-dads
-daemon
-daemonic
-daemons
-daffodil
-daffodils
-daffy
-daft
-dafter
-daftest
-daftness
-dagama
-dagga
-dagger
-daggers
-dahlia
-dahlias
-dahomey
-dailies
-daily
-daintier
-daintiest
-daintily
-daintiness
-dainty
-dairies
-dairy
-dairying
-dairyman
-dairymen
-dais
-daisies
-daisy
-dakar
-dakoits
-dale
-dales
-dallas
-dalliance
-dallied
-dally
-dallying
-dam
-damage
-damaged
-damages
-damaging
-damagingly
-damascus
-damask
-dame
-dames
-dammed
-damming
-damn
-damnable
-damnably
-damnation
-damned
-damnify
-damning
-damningly
-damns
-damp
-damped
-dampen
-dampened
-dampening
-dampens
-damper
-dampers
-dampest
-damping
-dampish
-damply
-dampness
-damps
-dams
-damsel
-damsels
-damson
-damsons
-dan
-dance
-danceable
-danced
-dancer
-dancers
-dances
-dancing
-dandelion
-dandelions
-dandies
-dandruff
-dandy
-dane
-danes
-danger
-dangerous
-dangerously
-dangerousness
-dangers
-dangle
-dangled
-dangles
-dangling
-daniel
-danish
-dank
-dankest
-dante
-danube
-danzig
-dapper
-dapple
-dappled
-dapples
-dare
-dared
-daredevil
-dares
-daring
-daringly
-dark
-darken
-darkened
-darkening
-darkens
-darker
-darkest
-darkish
-darkly
-darkness
-darkroom
-darkrooms
-darling
-darlings
-darn
-darned
-darning
-darns
-dart
-dartboard
-dartboards
-darted
-darter
-darters
-darting
-darts
-darwin
-dash
-dashboard
-dashed
-dashes
-dashing
-dassie
-dassies
-dastardly
-data
-database
-databases
-datable
-date
-dated
-dateline
-dates
-dating
-dative
-datum
-daub
-daubed
-dauber
-daubing
-daughter
-daughterinlaw
-daughters
-daughtersinlaw
-daunt
-daunted
-daunting
-dauntingly
-dauntless
-daunts
-dauphin
-dauphins
-david
-davinci
-dawdle
-dawdled
-dawdling
-dawn
-dawned
-dawning
-dawns
-day
-daybreak
-daycare
-daydream
-daydreaming
-daydreams
-daylight
-daylights
-daylong
-dayold
-days
-daytime
-daze
-dazed
-dazedly
-dazing
-dazzle
-dazzled
-dazzler
-dazzles
-dazzling
-dazzlingly
-dday
-deacon
-deaconess
-deaconesses
-deacons
-deactivate
-deactivated
-deactivates
-deactivating
-deactivation
-dead
-deadbeat
-deaden
-deadend
-deadened
-deadening
-deadens
-deader
-deadlier
-deadliest
-deadline
-deadlines
-deadlock
-deadlocked
-deadlocking
-deadlocks
-deadly
-deadness
-deadon
-deadpan
-deadsea
-deaf
-deafanddumb
-deafen
-deafened
-deafening
-deafeningly
-deafens
-deafer
-deafest
-deafness
-deal
-dealer
-dealers
-dealership
-dealerships
-dealing
-dealings
-deals
-dealt
-dean
-deanery
-deans
-dear
-dearer
-dearest
-dearie
-dearies
-dearly
-dearness
-dears
-dearth
-deary
-death
-deathbed
-deathless
-deathly
-deaths
-deb
-debacle
-debacles
-debar
-debark
-debarred
-debars
-debase
-debased
-debasement
-debaser
-debasing
-debatable
-debate
-debated
-debater
-debaters
-debates
-debating
-debauch
-debauched
-debauchery
-debenture
-debentures
-debilitate
-debilitated
-debilitating
-debility
-debit
-debited
-debiting
-debits
-debonair
-debone
-deboned
-debones
-debrief
-debriefed
-debriefing
-debris
-debt
-debtor
-debtors
-debts
-debug
-debugged
-debugger
-debuggers
-debugging
-debugs
-debunk
-debunks
-debut
-debutant
-debutante
-debutantes
-debutants
-debuts
-decade
-decadence
-decadent
-decades
-decaf
-decaffeinate
-decaffeinated
-decagon
-decagons
-decamp
-decamped
-decant
-decanted
-decanter
-decanters
-decanting
-decants
-decapitate
-decapitated
-decapitates
-decapitating
-decapitation
-decapitations
-decapod
-decathlon
-decay
-decayed
-decaying
-decays
-decease
-deceased
-deceases
-deceit
-deceitful
-deceitfulness
-deceits
-deceive
-deceived
-deceiver
-deceives
-deceiving
-decelerate
-decelerated
-decelerates
-decelerating
-deceleration
-decelerations
-december
-decency
-decent
-decently
-decentralisation
-decentralise
-decentralised
-decentralising
-deception
-deceptions
-deceptive
-deceptively
-decibel
-decibels
-decidability
-decidable
-decide
-decided
-decidedly
-decider
-decides
-deciding
-deciduous
-decile
-deciles
-decilitre
-decimal
-decimalisation
-decimalise
-decimals
-decimate
-decimated
-decimating
-decimation
-decimetres
-decipher
-decipherable
-deciphered
-deciphering
-decipherment
-decipherments
-decision
-decisions
-decisive
-decisively
-decisiveness
-deck
-deckchair
-deckchairs
-decked
-decker
-decking
-decks
-declaim
-declaimed
-declaiming
-declaims
-declamation
-declamatory
-declaration
-declarations
-declarative
-declaratory
-declare
-declared
-declarer
-declarers
-declares
-declaring
-declassification
-declassified
-declension
-declensions
-declination
-declinations
-decline
-declined
-declines
-declining
-declivity
-deco
-decode
-decoded
-decoder
-decoders
-decodes
-decoding
-decoke
-decolonisation
-decommission
-decommissioned
-decommissioning
-decomposable
-decompose
-decomposed
-decomposes
-decomposing
-decomposition
-decompositions
-decompress
-decompressed
-decompressing
-decompression
-decongestants
-deconstruct
-deconstructed
-deconstructing
-deconstruction
-deconstructionist
-deconstructive
-decontaminated
-decontaminating
-decontamination
-deconvolution
-deconvolve
-decor
-decorate
-decorated
-decorates
-decorating
-decoration
-decorations
-decorative
-decoratively
-decorator
-decorators
-decorous
-decorously
-decors
-decorum
-decouple
-decoupled
-decoupling
-decoy
-decoyed
-decoying
-decoys
-decrease
-decreased
-decreases
-decreasing
-decreasingly
-decree
-decreed
-decreeing
-decrees
-decrement
-decremental
-decremented
-decrementing
-decrements
-decrepit
-decrepitude
-decried
-decries
-decriminalisation
-decriminalise
-decriminalised
-decriminalising
-decry
-decrying
-decrypt
-decrypted
-decrypting
-decryption
-decrypts
-decustomised
-dedicate
-dedicated
-dedicates
-dedicating
-dedication
-dedications
-deduce
-deduced
-deduces
-deducible
-deducing
-deduct
-deducted
-deductible
-deducting
-deduction
-deductions
-deductive
-deductively
-deducts
-dee
-deed
-deeds
-deejay
-deem
-deemed
-deeming
-deems
-deep
-deepen
-deepened
-deepening
-deepens
-deeper
-deepest
-deepfreeze
-deepfreezing
-deepfried
-deepfrozen
-deepish
-deeply
-deepness
-deeprooted
-deeps
-deepsea
-deepseated
-deer
-deerstalker
-deerstalkers
-deerstalking
-deface
-defaced
-defaces
-defacing
-defacto
-defamation
-defamatory
-defame
-defamed
-defamer
-defames
-defaming
-default
-defaulted
-defaulter
-defaulters
-defaulting
-defaults
-defeat
-defeated
-defeater
-defeating
-defeatism
-defeatist
-defeats
-defecate
-defecating
-defect
-defected
-defecting
-defection
-defections
-defective
-defectiveness
-defectives
-defector
-defectors
-defects
-defence
-defenceless
-defencelessness
-defences
-defend
-defendant
-defendants
-defended
-defender
-defenders
-defending
-defends
-defenestrate
-defenestrated
-defenestration
-defenses
-defensibility
-defensible
-defensive
-defensively
-defensiveness
-defer
-deference
-deferential
-deferentially
-deferment
-deferral
-deferred
-deferring
-defers
-defiance
-defiant
-defiantly
-defibrillator
-defibrillators
-deficiencies
-deficiency
-deficient
-deficit
-deficits
-defied
-defier
-defies
-defile
-defiled
-defilement
-defiles
-defiling
-definable
-definably
-define
-defined
-definer
-defines
-defining
-definite
-definitely
-definiteness
-definition
-definitional
-definitions
-definitive
-definitively
-definitiveness
-deflatable
-deflate
-deflated
-deflates
-deflating
-deflation
-deflationary
-deflect
-deflected
-deflecting
-deflection
-deflections
-deflector
-deflectors
-deflects
-deflower
-deflowering
-defoliants
-defoliation
-deforestation
-deforested
-deform
-deformable
-deformation
-deformations
-deformed
-deforming
-deformities
-deformity
-deforms
-defragmentation
-defraud
-defrauded
-defrauding
-defrauds
-defray
-defrayed
-defrost
-defrosted
-defrosting
-defrosts
-deft
-defter
-deftly
-deftness
-defunct
-defuse
-defused
-defuses
-defusing
-defy
-defying
-degas
-degauss
-degaussed
-degaussing
-degeneracies
-degeneracy
-degenerate
-degenerated
-degenerates
-degenerating
-degeneration
-degenerative
-degradable
-degradation
-degradations
-degrade
-degraded
-degrades
-degrading
-degrease
-degree
-degrees
-dehorn
-dehumanised
-dehumanises
-dehumanising
-dehumidifier
-dehydrate
-dehydrated
-dehydrating
-dehydration
-deification
-deified
-deifies
-deify
-deifying
-deism
-deist
-deists
-deities
-deity
-deject
-dejected
-dejectedly
-dejection
-dejects
-deklerk
-delate
-delay
-delayed
-delaying
-delays
-delectable
-delectation
-delegate
-delegated
-delegates
-delegating
-delegation
-delegations
-deletable
-delete
-deleted
-deleter
-deleterious
-deleteriously
-deletes
-deleting
-deletion
-deletions
-delhi
-deli
-deliberate
-deliberated
-deliberately
-deliberating
-deliberation
-deliberations
-deliberative
-delible
-delicacies
-delicacy
-delicate
-delicately
-delicatessen
-delicatessens
-delicious
-deliciously
-delict
-delight
-delighted
-delightedly
-delightful
-delightfully
-delighting
-delights
-delilah
-delimit
-delimited
-delimiter
-delimiters
-delimiting
-delimits
-delineate
-delineated
-delineates
-delineating
-delineation
-delinquency
-delinquent
-delinquents
-deliquesced
-deliquescent
-delirious
-deliriously
-delirium
-deliver
-deliverable
-deliverance
-delivered
-deliverer
-deliverers
-deliveries
-delivering
-delivers
-delivery
-dell
-dells
-delphi
-delphiniums
-delta
-deltas
-deltoid
-deltoids
-delude
-deluded
-deludes
-deluding
-deluge
-deluged
-deluges
-deluging
-delusion
-delusional
-delusions
-delusive
-deluxe
-delve
-delved
-delves
-delving
-demagnetisation
-demagnetise
-demagog
-demagogic
-demagogue
-demagoguery
-demagogues
-demagogy
-demand
-demanded
-demander
-demanding
-demands
-demarcate
-demarcated
-demarcating
-demarcation
-demarcations
-dematerialise
-dematerialised
-dematerialises
-demean
-demeaned
-demeaning
-demeanour
-demeans
-dement
-demented
-dementedly
-dementia
-demerge
-demerit
-demigod
-demigods
-demijohns
-demilitarisation
-demilitarised
-demise
-demised
-demises
-demist
-demists
-demo
-demobilisation
-demobilised
-demobs
-democracies
-democracy
-democrat
-democratic
-democratically
-democratisation
-democratising
-democrats
-demodulator
-demographer
-demographers
-demographic
-demographically
-demographics
-demography
-demolish
-demolished
-demolisher
-demolishes
-demolishing
-demolition
-demolitions
-demon
-demonic
-demonise
-demonology
-demons
-demonstrable
-demonstrably
-demonstrate
-demonstrated
-demonstrates
-demonstrating
-demonstration
-demonstrations
-demonstrative
-demonstratively
-demonstratives
-demonstrator
-demonstrators
-demoralisation
-demoralise
-demoralised
-demoralising
-demote
-demoted
-demotes
-demotic
-demotion
-demount
-demountable
-demounted
-demounting
-demur
-demure
-demurely
-demurred
-demurring
-demurs
-demystification
-demystify
-demystifying
-den
-denationalisation
-denatured
-denaturing
-dendrites
-dendritic
-dendrochronological
-dendrochronology
-deniable
-denial
-denials
-denied
-denier
-deniers
-denies
-denigrate
-denigrated
-denigrates
-denigrating
-denigration
-denigrations
-denim
-denims
-denizen
-denizens
-denmark
-denominated
-denomination
-denominational
-denominations
-denominator
-denominators
-denotation
-denotational
-denotations
-denote
-denoted
-denotes
-denoting
-denouement
-denounce
-denounced
-denouncements
-denounces
-denouncing
-dens
-dense
-densely
-denseness
-denser
-densest
-densities
-densitometry
-density
-dent
-dental
-dented
-dentin
-dentine
-denting
-dentist
-dentistry
-dentists
-dentition
-dents
-denture
-dentures
-denudation
-denude
-denuded
-denudes
-denunciation
-denunciations
-denver
-deny
-denying
-deodorant
-deodorants
-deodorised
-depart
-departed
-departer
-departing
-department
-departmental
-departmentally
-departments
-departs
-departure
-departures
-depend
-dependability
-dependable
-dependant
-dependants
-depended
-dependence
-dependencies
-dependency
-dependent
-depending
-depends
-depersonalisation
-depersonalising
-depict
-depicted
-depicting
-depiction
-depictions
-depicts
-deplete
-depleted
-depleting
-depletion
-deplorable
-deplorably
-deplore
-deplored
-deplores
-deploring
-deploy
-deployed
-deploying
-deployment
-deployments
-deploys
-depolarisation
-depolarisations
-depoliticisation
-deponent
-depopulated
-depopulation
-deport
-deportation
-deportations
-deported
-deportee
-deportees
-deporting
-deportment
-deports
-depose
-deposed
-deposing
-deposit
-depositary
-deposited
-depositing
-deposition
-depositional
-depositions
-depositories
-depositors
-depository
-deposits
-depot
-depots
-deprave
-depraved
-depraves
-depraving
-depravity
-deprecate
-deprecated
-deprecates
-deprecating
-deprecatingly
-deprecation
-deprecations
-deprecatory
-depreciate
-depreciated
-depreciating
-depreciation
-depredation
-depredations
-depress
-depressant
-depressants
-depressed
-depresses
-depressing
-depressingly
-depression
-depressions
-depressive
-depressives
-deprivation
-deprivations
-deprive
-deprived
-deprives
-depriving
-depth
-depths
-deputation
-deputations
-depute
-deputed
-deputes
-deputies
-deputise
-deputised
-deputises
-deputising
-deputy
-derail
-derailed
-derailing
-derailment
-derails
-derange
-deranged
-derangement
-derate
-derated
-derates
-derbies
-derby
-deregulate
-deregulated
-deregulating
-deregulation
-derelict
-dereliction
-derelictions
-deride
-derided
-deriders
-derides
-deriding
-derision
-derisive
-derisively
-derisory
-derivable
-derivation
-derivations
-derivative
-derivatively
-derivatives
-derive
-derived
-derives
-deriving
-dermal
-dermatitis
-dermatological
-dermatologist
-dermatologists
-dermatology
-dermic
-dermis
-derogate
-derogation
-derogations
-derogatory
-derrick
-dervishes
-desalination
-desalt
-desaturated
-descant
-descend
-descendant
-descendants
-descended
-descendent
-descender
-descenders
-descending
-descends
-descent
-descents
-describable
-describe
-described
-describer
-describers
-describes
-describing
-description
-descriptions
-descriptive
-descriptively
-descriptiveness
-descriptivism
-descriptor
-descriptors
-desecrate
-desecrated
-desecrates
-desecrating
-desecration
-desegregation
-deselected
-desensitising
-desert
-deserted
-deserter
-deserters
-desertification
-deserting
-desertion
-desertions
-deserts
-deserve
-deserved
-deservedly
-deserves
-deserving
-desiccated
-desiccation
-desiccator
-desiderata
-desideratum
-design
-designable
-designate
-designated
-designates
-designating
-designation
-designational
-designations
-designator
-designators
-designed
-designedly
-designer
-designers
-designing
-designs
-desirabilia
-desirability
-desirable
-desirableness
-desirably
-desire
-desired
-desires
-desiring
-desirous
-desist
-desisted
-desisting
-desk
-deskilling
-desks
-desktop
-desktops
-desolate
-desolated
-desolating
-desolation
-desorption
-despair
-despaired
-despairing
-despairingly
-despairs
-despatch
-despatched
-despatches
-despatching
-desperado
-desperate
-desperately
-desperation
-despicable
-despicably
-despisal
-despise
-despised
-despises
-despising
-despite
-despoil
-despoiled
-despoiling
-despond
-despondency
-despondent
-despondently
-despot
-despotic
-despotism
-despots
-dessert
-desserts
-dessicated
-dessication
-destabilisation
-destabilise
-destabilised
-destabilising
-destination
-destinations
-destine
-destined
-destinies
-destiny
-destitute
-destitution
-destroy
-destroyable
-destroyed
-destroyer
-destroyers
-destroying
-destroys
-destruct
-destruction
-destructive
-destructively
-destructiveness
-desuetude
-desultorily
-desultoriness
-desultory
-detach
-detachable
-detached
-detaches
-detaching
-detachment
-detachments
-detail
-detailed
-detailing
-details
-detain
-detained
-detainee
-detainees
-detainer
-detaining
-detains
-detect
-detectability
-detectable
-detectably
-detected
-detecting
-detection
-detections
-detective
-detectives
-detector
-detectors
-detects
-detent
-detente
-detention
-detentions
-deter
-detergent
-detergents
-deteriorate
-deteriorated
-deteriorates
-deteriorating
-deterioration
-determinable
-determinacy
-determinant
-determinants
-determinate
-determinately
-determination
-determinations
-determinative
-determine
-determined
-determinedly
-determiner
-determines
-determining
-determinism
-determinist
-deterministic
-deterministically
-deterred
-deterrence
-deterrent
-deterrents
-deterring
-deters
-detest
-detestable
-detestably
-detestation
-detested
-detester
-detesters
-detesting
-detests
-dethrone
-dethroned
-detonate
-detonated
-detonates
-detonating
-detonation
-detonations
-detonator
-detonators
-detour
-detoured
-detours
-detox
-detoxification
-detoxify
-detract
-detracted
-detracting
-detraction
-detractor
-detractors
-detracts
-detriment
-detrimental
-detrimentally
-detrital
-detritus
-detroit
-deuce
-deuced
-deuces
-deuterium
-deuteron
-devaluation
-devaluations
-devalue
-devalued
-devalues
-devaluing
-devastate
-devastated
-devastating
-devastatingly
-devastation
-develop
-developed
-developer
-developers
-developing
-development
-developmental
-developmentally
-developments
-develops
-deviance
-deviancy
-deviant
-deviants
-deviate
-deviated
-deviates
-deviating
-deviation
-deviations
-device
-devices
-devil
-devilish
-devilishly
-devilled
-devilment
-devilry
-devils
-devious
-deviously
-deviousness
-devisal
-devise
-devised
-deviser
-devises
-devising
-devoice
-devoid
-devoir
-devolution
-devolve
-devolved
-devolving
-devote
-devoted
-devotedly
-devotedness
-devotee
-devotees
-devotes
-devoting
-devotion
-devotional
-devotions
-devour
-devoured
-devourer
-devourers
-devouring
-devours
-devout
-devoutly
-devoutness
-dew
-dewdrop
-dewdrops
-dews
-dewy
-dexterity
-dexterous
-dexterously
-dextral
-dextrose
-dextrous
-dextrously
-dhow
-diabetes
-diabetic
-diabetics
-diabolic
-diabolical
-diabolically
-diabolism
-diachronic
-diaconal
-diacritical
-diacriticals
-diacritics
-diadem
-diadems
-diagnosable
-diagnose
-diagnosed
-diagnoses
-diagnosing
-diagnosis
-diagnostic
-diagnostically
-diagnostician
-diagnostics
-diagonal
-diagonalise
-diagonalised
-diagonalises
-diagonalising
-diagonally
-diagonals
-diagram
-diagrammatic
-diagrammatically
-diagrams
-dial
-dialect
-dialectal
-dialectic
-dialectical
-dialectically
-dialectics
-dialects
-dialing
-dialled
-dialler
-dialling
-dialog
-dialogue
-dialogues
-dials
-dialysis
-diamante
-diameter
-diameters
-diametric
-diametrically
-diamond
-diamonds
-diana
-diapason
-diaper
-diapers
-diaphanous
-diaphragm
-diaphragmatic
-diaphragms
-diaries
-diarist
-diarrhea
-diarrhoea
-diarrhoeal
-diary
-diaspora
-diastolic
-diathermy
-diatom
-diatomic
-diatoms
-diatonic
-diatribe
-diatribes
-dice
-diced
-dices
-dicey
-dichloride
-dichotomies
-dichotomous
-dichotomy
-diciest
-dicing
-dickens
-dictate
-dictated
-dictates
-dictating
-dictation
-dictator
-dictatorial
-dictatorially
-dictators
-dictatorship
-dictatorships
-diction
-dictionaries
-dictionary
-dictions
-dictum
-did
-didactic
-didnt
-die
-died
-diehard
-diehards
-dielectric
-dielectrics
-dies
-diesel
-dieselelectric
-diesels
-diet
-dietary
-dieted
-dieter
-dietetic
-dietician
-dieticians
-dieting
-dietitian
-dietitians
-diets
-differ
-differed
-difference
-differences
-differencing
-different
-differentiability
-differentiable
-differential
-differentially
-differentials
-differentiate
-differentiated
-differentiates
-differentiating
-differentiation
-differentiations
-differentiators
-differently
-differing
-differs
-difficult
-difficulties
-difficulty
-diffidence
-diffident
-diffidently
-diffract
-diffracted
-diffracting
-diffraction
-diffracts
-diffuse
-diffused
-diffuser
-diffusers
-diffuses
-diffusing
-diffusion
-diffusional
-diffusive
-diffusivity
-dig
-digest
-digested
-digester
-digestible
-digesting
-digestion
-digestions
-digestive
-digestives
-digests
-digger
-diggers
-digging
-diggings
-digit
-digital
-digitalis
-digitally
-digitisation
-digitise
-digitised
-digitiser
-digitisers
-digitising
-digits
-dignified
-dignify
-dignifying
-dignitaries
-dignitary
-dignities
-dignity
-digraphs
-digress
-digressed
-digressing
-digression
-digressions
-digs
-dihedral
-dikes
-diktat
-diktats
-dilapidated
-dilapidation
-dilatation
-dilate
-dilated
-dilates
-dilating
-dilation
-dilator
-dilatory
-dildo
-dilemma
-dilemmas
-dilettante
-dilettantes
-diligence
-diligent
-diligently
-dill
-dilly
-diluent
-dilute
-diluted
-diluter
-dilutes
-diluting
-dilution
-dilutions
-dim
-dime
-dimension
-dimensional
-dimensionality
-dimensionally
-dimensioned
-dimensioning
-dimensionless
-dimensions
-dimer
-dimers
-dimes
-diminish
-diminishable
-diminished
-diminishes
-diminishing
-diminuendo
-diminution
-diminutive
-diminutives
-dimly
-dimmed
-dimmer
-dimmers
-dimmest
-dimming
-dimness
-dimorphic
-dimorphism
-dimple
-dimpled
-dimples
-dims
-dimwit
-din
-dinar
-dinars
-dine
-dined
-diner
-diners
-dines
-ding
-dingdong
-dinged
-dinghies
-dinghy
-dingier
-dingiest
-dinginess
-dingle
-dingo
-dingy
-dining
-dinky
-dinner
-dinners
-dinosaur
-dinosaurs
-dint
-dints
-diocesan
-diocese
-diode
-diodes
-dioptre
-dioptres
-dioxide
-dioxides
-dioxin
-dioxins
-dip
-diphtheria
-diphthong
-diphthongs
-diplexers
-diploid
-diploma
-diplomacy
-diplomas
-diplomat
-diplomatic
-diplomatically
-diplomats
-dipolar
-dipole
-dipoles
-dipped
-dipper
-dipping
-dips
-dipsomania
-dipsomaniac
-dipsomaniacs
-dipstick
-dipsticks
-dire
-direct
-directed
-directing
-direction
-directional
-directionality
-directionally
-directionless
-directions
-directive
-directives
-directly
-directness
-director
-directorate
-directorates
-directorial
-directories
-directors
-directorship
-directorships
-directory
-directs
-direly
-direness
-direst
-dirge
-dirges
-dirigible
-dirigiste
-dirt
-dirtied
-dirtier
-dirties
-dirtiest
-dirtily
-dirtiness
-dirts
-dirty
-dirtying
-disabilities
-disability
-disable
-disabled
-disablement
-disables
-disabling
-disabuse
-disabused
-disadvantage
-disadvantaged
-disadvantageous
-disadvantageously
-disadvantages
-disaffected
-disaffection
-disaffiliate
-disaffiliated
-disaffiliating
-disaffiliation
-disaggregate
-disaggregated
-disaggregation
-disagree
-disagreeable
-disagreeably
-disagreed
-disagreeing
-disagreement
-disagreements
-disagrees
-disallow
-disallowed
-disallowing
-disallows
-disambiguate
-disambiguated
-disambiguating
-disambiguation
-disappear
-disappearance
-disappearances
-disappeared
-disappearing
-disappears
-disappoint
-disappointed
-disappointing
-disappointingly
-disappointment
-disappointments
-disappoints
-disapprobation
-disapproval
-disapprove
-disapproved
-disapproves
-disapproving
-disapprovingly
-disarm
-disarmament
-disarmed
-disarmer
-disarming
-disarmingly
-disarms
-disarranging
-disarray
-disarrayed
-disassemble
-disassembled
-disassembler
-disassembles
-disassembling
-disassembly
-disassociate
-disassociated
-disassociating
-disassociation
-disaster
-disasters
-disastrous
-disastrously
-disavow
-disavowal
-disavowed
-disavowing
-disband
-disbanded
-disbanding
-disbandment
-disbands
-disbars
-disbelief
-disbelieve
-disbelieved
-disbeliever
-disbelievers
-disbelieving
-disbelievingly
-disburse
-disbursed
-disbursement
-disbursements
-disc
-discant
-discard
-discarded
-discarding
-discards
-discern
-discerned
-discernible
-discernibly
-discerning
-discernment
-discerns
-discharge
-discharged
-discharges
-discharging
-disciple
-disciples
-discipleship
-disciplinarian
-disciplinarians
-disciplinary
-discipline
-disciplined
-disciplines
-disciplining
-disclaim
-disclaimed
-disclaimer
-disclaimers
-disclaiming
-disclaims
-disclose
-disclosed
-discloses
-disclosing
-disclosure
-disclosures
-disco
-discography
-discolour
-discolouration
-discoloured
-discolours
-discomfit
-discomfited
-discomfiture
-discomfort
-discomforting
-discomforts
-disconcert
-disconcerted
-disconcerting
-disconcertingly
-disconnect
-disconnected
-disconnecting
-disconnection
-disconnections
-disconnects
-disconsolate
-disconsolately
-disconsolation
-discontent
-discontented
-discontentedly
-discontents
-discontinuance
-discontinuation
-discontinue
-discontinued
-discontinues
-discontinuing
-discontinuities
-discontinuity
-discontinuous
-discontinuously
-discord
-discordance
-discordant
-discords
-discotheque
-discotheques
-discount
-discountability
-discountable
-discounted
-discounting
-discounts
-discourage
-discouraged
-discouragement
-discouragements
-discourages
-discouraging
-discouragingly
-discourse
-discoursed
-discourses
-discoursing
-discourteous
-discourteously
-discourtesy
-discover
-discoverable
-discovered
-discoverer
-discoverers
-discoveries
-discovering
-discovers
-discovery
-discredit
-discreditable
-discredited
-discrediting
-discredits
-discreet
-discreetly
-discreetness
-discrepancies
-discrepancy
-discrepant
-discrete
-discretely
-discretion
-discretionary
-discriminant
-discriminants
-discriminate
-discriminated
-discriminates
-discriminating
-discrimination
-discriminative
-discriminator
-discriminators
-discriminatory
-discs
-discursive
-discursively
-discus
-discuss
-discussable
-discussed
-discusses
-discussing
-discussion
-discussions
-disdain
-disdained
-disdainful
-disdainfully
-disdaining
-disease
-diseased
-diseases
-disembark
-disembarkation
-disembarked
-disembarking
-disembodied
-disembodiment
-disembowel
-disembowelled
-disembowelment
-disembowels
-disenchanted
-disenchantment
-disenfranchise
-disenfranchised
-disenfranchisement
-disenfranchises
-disenfranchising
-disengage
-disengaged
-disengagement
-disengaging
-disentangle
-disentangled
-disentangles
-disentangling
-disequilibrium
-disestablish
-disestablished
-disestablishing
-disestablishment
-disfavour
-disfigure
-disfigured
-disfigurement
-disfigurements
-disfigures
-disfiguring
-disfranchise
-disgorge
-disgorged
-disgorging
-disgrace
-disgraced
-disgraceful
-disgracefully
-disgraces
-disgracing
-disgruntled
-disgruntlement
-disguise
-disguised
-disguises
-disguising
-disgust
-disgusted
-disgustedly
-disgusting
-disgustingly
-disgusts
-dish
-disharmonious
-disharmony
-dishcloth
-disheartened
-disheartening
-dished
-dishes
-dishevelled
-dishier
-dishing
-dishonest
-dishonestly
-dishonesty
-dishonour
-dishonourable
-dishonourably
-dishonoured
-dishpan
-dishwasher
-dishwashers
-dishwater
-dishy
-disillusion
-disillusioned
-disillusioning
-disillusionment
-disincentive
-disincentives
-disinclination
-disinclined
-disinfect
-disinfectant
-disinfectants
-disinfected
-disinfecting
-disinfection
-disinformation
-disingenuous
-disingenuously
-disinherit
-disinherited
-disintegrate
-disintegrated
-disintegrates
-disintegrating
-disintegration
-disinter
-disinterest
-disinterested
-disinterestedly
-disinterestedness
-disinterred
-disinvest
-disinvestment
-disjoin
-disjoint
-disjointed
-disjointedly
-disjointness
-disjunct
-disjunction
-disjunctions
-disjunctive
-diskette
-diskettes
-dislike
-disliked
-dislikes
-disliking
-dislocate
-dislocated
-dislocates
-dislocating
-dislocation
-dislocations
-dislodge
-dislodged
-dislodges
-dislodging
-disloyal
-disloyalty
-dismal
-dismally
-dismantle
-dismantled
-dismantles
-dismantling
-dismay
-dismayed
-dismaying
-dismays
-dismember
-dismembered
-dismembering
-dismemberment
-dismembers
-dismiss
-dismissal
-dismissals
-dismissed
-dismisses
-dismissible
-dismissing
-dismissive
-dismissively
-dismount
-dismounted
-dismounting
-dismounts
-disobedience
-disobedient
-disobey
-disobeyed
-disobeying
-disobeys
-disorder
-disordered
-disorderly
-disorders
-disorganisation
-disorganise
-disorganised
-disorganising
-disorient
-disorientated
-disorientating
-disorientation
-disoriented
-disown
-disowned
-disowning
-disowns
-disparage
-disparaged
-disparagement
-disparaging
-disparagingly
-disparate
-disparities
-disparity
-dispassionate
-dispassionately
-dispatch
-dispatched
-dispatcher
-dispatchers
-dispatches
-dispatching
-dispel
-dispelled
-dispelling
-dispels
-dispensable
-dispensaries
-dispensary
-dispensation
-dispensations
-dispense
-dispensed
-dispenser
-dispensers
-dispenses
-dispensing
-dispersal
-dispersant
-disperse
-dispersed
-disperser
-dispersers
-disperses
-dispersing
-dispersion
-dispersions
-dispersive
-dispersively
-dispirited
-dispiritedly
-dispiriting
-displace
-displaced
-displacement
-displacements
-displacer
-displaces
-displacing
-display
-displayable
-displayed
-displaying
-displays
-displease
-displeased
-displeasing
-displeasure
-disporting
-disposable
-disposables
-disposal
-disposals
-dispose
-disposed
-disposer
-disposers
-disposes
-disposing
-disposition
-dispositions
-dispossess
-dispossessed
-dispossession
-disproof
-disproofs
-disproportional
-disproportionally
-disproportionate
-disproportionately
-disprovable
-disprove
-disproved
-disproves
-disproving
-disputable
-disputant
-disputants
-disputation
-disputatious
-dispute
-disputed
-disputes
-disputing
-disqualification
-disqualifications
-disqualified
-disqualifies
-disqualify
-disqualifying
-disquiet
-disquieting
-disquietude
-disquisition
-disquisitions
-disregard
-disregarded
-disregarding
-disregards
-disrepair
-disreputable
-disrepute
-disrespect
-disrespectful
-disrespectfully
-disrespects
-disrobe
-disrobing
-disrupt
-disrupted
-disrupting
-disruption
-disruptions
-disruptive
-disruptively
-disruptor
-disrupts
-dissatisfaction
-dissatisfactions
-dissatisfied
-dissatisfies
-dissatisfy
-dissatisfying
-dissect
-dissected
-dissecting
-dissection
-dissections
-dissector
-dissects
-dissemble
-dissembled
-dissembling
-disseminate
-disseminated
-disseminating
-dissemination
-dissension
-dissensions
-dissent
-dissented
-dissenter
-dissenters
-dissenting
-dissertation
-dissertations
-disservice
-dissidence
-dissident
-dissidents
-dissimilar
-dissimilarities
-dissimilarity
-dissimulation
-dissipate
-dissipated
-dissipates
-dissipating
-dissipation
-dissipative
-dissociate
-dissociated
-dissociating
-dissociation
-dissociative
-dissociatively
-dissolute
-dissolution
-dissolve
-dissolved
-dissolves
-dissolving
-dissonance
-dissonances
-dissonant
-dissuade
-dissuaded
-dissuades
-dissuading
-distaff
-distal
-distally
-distance
-distanced
-distances
-distancing
-distant
-distantly
-distaste
-distasteful
-distastefully
-distemper
-distempered
-distempers
-distended
-distension
-distil
-distillate
-distillation
-distillations
-distilled
-distiller
-distilleries
-distillers
-distillery
-distilling
-distils
-distinct
-distinction
-distinctions
-distinctive
-distinctively
-distinctiveness
-distinctly
-distinctness
-distinguish
-distinguishable
-distinguishably
-distinguished
-distinguishes
-distinguishing
-distort
-distorted
-distorter
-distorting
-distortion
-distortions
-distorts
-distract
-distracted
-distractedly
-distractedness
-distracting
-distractingly
-distraction
-distractions
-distracts
-distraught
-distress
-distressed
-distresses
-distressing
-distressingly
-distributable
-distribute
-distributed
-distributes
-distributing
-distribution
-distributional
-distributions
-distributive
-distributivity
-distributor
-distributors
-district
-districts
-distrust
-distrusted
-distrustful
-distrustfully
-distrusting
-distrusts
-disturb
-disturbance
-disturbances
-disturbed
-disturbing
-disturbingly
-disturbs
-disulphide
-disunion
-disunite
-disunity
-disuse
-disused
-disyllabic
-disyllable
-ditch
-ditched
-ditches
-ditching
-dither
-dithered
-dithering
-dithers
-ditties
-ditto
-ditty
-diuresis
-diuretic
-diuretics
-diurnal
-diva
-divan
-divans
-divas
-dive
-divebombing
-dived
-diver
-diverge
-diverged
-divergence
-divergences
-divergent
-diverges
-diverging
-divers
-diverse
-diversely
-diversification
-diversified
-diversifies
-diversify
-diversifying
-diversion
-diversionary
-diversions
-diversities
-diversity
-divert
-diverted
-diverticular
-diverting
-diverts
-dives
-divest
-divested
-divesting
-divide
-divided
-dividend
-dividends
-divider
-dividers
-divides
-dividing
-divination
-divine
-divined
-divinely
-diviner
-divines
-divinest
-diving
-divining
-divinities
-divinity
-divisibility
-divisible
-division
-divisional
-divisions
-divisive
-divisiveness
-divisor
-divisors
-divorce
-divorced
-divorcee
-divorcees
-divorces
-divorcing
-divot
-divots
-divulge
-divulged
-divulges
-divulging
-dizzier
-dizziest
-dizzily
-dizziness
-dizzy
-dizzying
-dizzyingly
-do
-doberman
-doc
-docile
-docilely
-docility
-dock
-dockage
-docked
-docker
-dockers
-docket
-dockets
-docking
-dockland
-docklands
-docks
-dockside
-dockyard
-dockyards
-docs
-doctor
-doctoral
-doctorate
-doctorates
-doctored
-doctoring
-doctors
-doctrinaire
-doctrinal
-doctrinally
-doctrine
-doctrines
-document
-documentaries
-documentary
-documentation
-documented
-documenting
-documents
-dodecahedra
-dodecahedral
-dodecahedron
-dodge
-dodged
-dodgem
-dodgems
-dodger
-dodgers
-dodges
-dodgier
-dodging
-dodgy
-dodo
-doe
-doer
-doers
-does
-doesnt
-doffed
-doffing
-dog
-dogdays
-doge
-dogeared
-doges
-dogfight
-dogfights
-dogfish
-dogged
-doggedly
-doggedness
-doggerel
-dogging
-doggy
-doglike
-dogma
-dogmas
-dogmatic
-dogmatically
-dogmatism
-dogmatist
-dogmatists
-dogood
-dogooder
-dogooders
-dogs
-dogsbody
-dogtag
-dogy
-doh
-dohs
-doily
-doing
-doings
-doityourself
-doldrums
-dole
-doled
-doleful
-dolefully
-dolerite
-doles
-doling
-doll
-dollar
-dollars
-dolled
-dollies
-dollop
-dolls
-dolly
-dolman
-dolmen
-dolomite
-dolorous
-dolphin
-dolphinarium
-dolphins
-dolt
-domain
-domains
-dome
-domed
-domes
-domestic
-domestically
-domesticated
-domestication
-domesticity
-domestics
-domicile
-domiciled
-domiciliary
-dominance
-dominant
-dominantly
-dominate
-dominated
-dominates
-dominating
-domination
-domineer
-domineered
-domineering
-dominion
-dominions
-domino
-don
-donate
-donated
-donates
-donating
-donation
-donations
-done
-dong
-donga
-donjuan
-donkey
-donkeys
-donned
-donning
-donor
-donors
-dons
-dont
-donut
-doodle
-doodled
-doodles
-doodling
-doom
-doomed
-dooming
-dooms
-doomsday
-door
-doorbell
-doorbells
-doorhandles
-doorkeeper
-doorkeepers
-doorknob
-doorknobs
-doorman
-doormat
-doormats
-doormen
-doornail
-doorpost
-doors
-doorstep
-doorsteps
-doorstop
-doorstops
-doorway
-doorways
-dopamine
-dope
-doped
-dopes
-dopey
-dopier
-doping
-dopy
-dor
-dorado
-dormancy
-dormant
-dormer
-dormers
-dormice
-dormitories
-dormitory
-dormouse
-dorsal
-dorsally
-dosage
-dosages
-dose
-dosed
-doses
-dosing
-dossier
-dossiers
-dot
-dotage
-dote
-doted
-dotes
-doting
-dots
-dotted
-dottiness
-dotting
-dotty
-double
-doublebarrelled
-doublecross
-doublecrossing
-doubled
-doubledealing
-doubledecker
-doubledeckers
-doubles
-doublet
-doubletalk
-doublets
-doubling
-doubly
-doubt
-doubted
-doubter
-doubters
-doubtful
-doubtfully
-doubting
-doubtingly
-doubtless
-doubtlessly
-doubts
-douche
-douching
-dough
-doughnut
-doughnuts
-doughs
-doughty
-dour
-dourly
-dourness
-douse
-doused
-dousing
-dove
-dovecot
-dovecote
-dover
-doves
-dovetail
-dovetails
-dowager
-dowagers
-dowdier
-dowdiest
-dowdy
-dowel
-dowelling
-dowels
-down
-downbeat
-downcast
-downed
-downfall
-downgrade
-downgraded
-downgrades
-downgrading
-downhearted
-downhill
-downing
-downland
-downlands
-download
-downloaded
-downloading
-downloads
-downpipe
-downpipes
-downplay
-downplayed
-downpour
-downpours
-downright
-downs
-downside
-downsize
-downsized
-downsizing
-downstage
-downstairs
-downstream
-downswing
-downtoearth
-downtrodden
-downturn
-downturns
-downward
-downwardly
-downwards
-downwind
-downy
-dowries
-dowry
-dowse
-dowser
-dowsers
-dowsing
-doyen
-doyenne
-doyens
-doze
-dozed
-dozen
-dozens
-dozes
-dozier
-dozing
-dozy
-dr
-drab
-drabness
-drachm
-drachma
-drachmas
-dracone
-draconian
-dracula
-draft
-drafted
-draftee
-draftees
-drafter
-drafters
-draftier
-drafting
-drafts
-draftsman
-drafty
-drag
-dragged
-dragging
-dragnet
-dragon
-dragonflies
-dragonfly
-dragons
-dragoon
-dragooned
-dragoons
-drags
-drain
-drainage
-drained
-drainer
-draining
-drainpipe
-drainpipes
-drains
-drake
-drakes
-dram
-drama
-dramas
-dramatic
-dramatically
-dramatics
-dramatisation
-dramatisations
-dramatise
-dramatised
-dramatising
-dramatist
-dramatists
-dramaturgical
-drank
-drape
-draped
-draper
-draperies
-drapers
-drapery
-drapes
-draping
-drastic
-drastically
-drat
-draught
-draughtier
-draughtiest
-draughts
-draughtsman
-draughtsmanship
-draughtsmen
-draughty
-draw
-drawable
-drawback
-drawbacks
-drawbridge
-drawbridges
-drawcord
-drawees
-drawer
-drawers
-drawing
-drawings
-drawl
-drawled
-drawling
-drawls
-drawn
-draws
-dray
-drays
-dread
-dreaded
-dreadful
-dreadfully
-dreadfulness
-dreading
-dreadlocks
-dreadnought
-dreads
-dream
-dreamed
-dreamer
-dreamers
-dreamier
-dreamiest
-dreamily
-dreaming
-dreamland
-dreamless
-dreamlike
-dreams
-dreamt
-dreamy
-drear
-drearier
-dreariest
-drearily
-dreariness
-dreary
-dredge
-dredged
-dredger
-dredges
-dredging
-dregs
-drench
-drenched
-drenches
-drenching
-dress
-dressage
-dressed
-dresser
-dressers
-dresses
-dressing
-dressings
-dressmaker
-dressmakers
-dressmaking
-dressy
-drew
-dribble
-dribbled
-dribbler
-dribbles
-dribbling
-dried
-drier
-driers
-dries
-driest
-drift
-drifted
-drifter
-drifters
-drifting
-drifts
-driftwood
-drill
-drilled
-driller
-drilling
-drills
-drily
-drink
-drinkable
-drinker
-drinkers
-drinking
-drinks
-drip
-dripdry
-dripped
-dripping
-drippy
-drips
-drivable
-drive
-drive
-drivein
-driveins
-drivel
-drivelled
-drivelling
-drivels
-driven
-driver
-driverless
-drivers
-drives
-driveway
-driveways
-driving
-drizzle
-drizzled
-drizzles
-drizzling
-drizzly
-droll
-droller
-drollery
-drollest
-dromedaries
-dromedary
-drone
-droned
-drones
-droning
-drool
-drooled
-drooling
-drools
-droop
-drooped
-droopier
-droopiest
-drooping
-droopingly
-droops
-droopy
-drop
-droplet
-droplets
-dropout
-dropouts
-dropped
-dropper
-dropping
-droppings
-drops
-dropsy
-dross
-drought
-droughts
-drove
-drover
-drovers
-droves
-droving
-drown
-drowned
-drowning
-drownings
-drowns
-drowse
-drowsed
-drowses
-drowsier
-drowsiest
-drowsily
-drowsiness
-drowsy
-drub
-drubbed
-drubbing
-drudge
-drudgery
-drudges
-drug
-drugged
-drugging
-druggist
-drugs
-druid
-druids
-drum
-drumbeat
-drumbeats
-drummed
-drummer
-drummers
-drumming
-drums
-drumsticks
-drunk
-drunkard
-drunkards
-drunken
-drunkenly
-drunkenness
-drunker
-drunks
-dry
-drycleaned
-drycleaning
-dryer
-dryers
-dryeyed
-drying
-dryish
-dryly
-dryness
-drystone
-dual
-dualism
-dualisms
-dualist
-dualistic
-dualities
-duality
-dually
-duals
-dub
-dubbed
-dubbing
-dubious
-dubiously
-dubiousness
-dublin
-dubs
-duce
-duchess
-duchesses
-duchies
-duchy
-duck
-duckbill
-duckbilled
-duckboards
-ducked
-ducking
-duckings
-duckling
-ducklings
-duckpond
-ducks
-duct
-ducted
-ductile
-ducting
-ducts
-dud
-dude
-dudes
-dudgeon
-duds
-due
-duel
-duelled
-dueller
-duellers
-duelling
-duellist
-duels
-dues
-duet
-duets
-duff
-duffel
-dug
-dugout
-dugouts
-duiker
-duke
-dukedom
-dukedoms
-dukes
-dulcet
-dulcimer
-dull
-dullard
-dullards
-dulled
-duller
-dullest
-dulling
-dullness
-dulls
-dully
-dulness
-duly
-dumb
-dumbbell
-dumber
-dumbest
-dumbfound
-dumbfounded
-dumbfounding
-dumbfounds
-dumbly
-dumbness
-dumbstruck
-dumfound
-dumfounded
-dumfounding
-dumfounds
-dummied
-dummies
-dummy
-dump
-dumped
-dumper
-dumping
-dumpling
-dumplings
-dumps
-dumpy
-dun
-dunce
-dunces
-dune
-dunes
-dung
-dungarees
-dungbeetle
-dungeon
-dungeons
-dunghill
-dunked
-dunking
-dunkirk
-duo
-duodenal
-duodenum
-duologue
-duomo
-duopoly
-dupe
-duped
-dupes
-duplex
-duplicability
-duplicate
-duplicated
-duplicates
-duplicating
-duplication
-duplications
-duplicator
-duplicators
-duplicities
-duplicitous
-duplicity
-durability
-durable
-durables
-durance
-duration
-durations
-durban
-duress
-during
-dusk
-duskier
-dusky
-dust
-dustbin
-dustbins
-dustcart
-dusted
-duster
-dusters
-dustier
-dustily
-dusting
-dustman
-dustmen
-dustpan
-dusts
-dusty
-dutch
-dutchman
-dutchmen
-duties
-dutiful
-dutifully
-dutifulness
-duty
-dutyfree
-duvet
-duvets
-dux
-dwarf
-dwarfed
-dwarfing
-dwarfish
-dwarfs
-dwarves
-dwell
-dwelled
-dweller
-dwellers
-dwelling
-dwellings
-dwells
-dwelt
-dwindle
-dwindled
-dwindles
-dwindling
-dyad
-dyadic
-dye
-dyed
-dyeing
-dyeings
-dyer
-dyers
-dyes
-dyestuff
-dyestuffs
-dying
-dyke
-dykes
-dynamic
-dynamical
-dynamically
-dynamics
-dynamism
-dynamite
-dynamited
-dynamo
-dynast
-dynastic
-dynasties
-dynasts
-dynasty
-dyne
-dysentery
-dysfunction
-dysfunctional
-dysfunctions
-dyslexia
-dyslexic
-dyslexically
-dyslexics
-dyspepsia
-dyspeptic
-dystrophy
-each
-eager
-eagerly
-eagerness
-eagle
-eagles
-eaglet
-eaglets
-ear
-earache
-earaches
-eardrop
-eardrops
-eardrum
-eardrums
-eared
-earful
-earholes
-earl
-earldom
-earldoms
-earlier
-earliest
-earlobe
-earlobes
-earls
-early
-earmark
-earmarked
-earmarking
-earn
-earned
-earner
-earners
-earnest
-earnestly
-earnestness
-earning
-earnings
-earns
-earphone
-earphones
-earpiece
-earpieces
-earplug
-earplugs
-earring
-earrings
-ears
-earshot
-earsplitting
-earth
-earthbound
-earthed
-earthen
-earthenware
-earthiness
-earthing
-earthling
-earthlings
-earthly
-earthquake
-earthquakes
-earths
-earthshaking
-earthshattering
-earthwards
-earthwork
-earthworks
-earthworm
-earthworms
-earthy
-earwax
-earwig
-earwigs
-ease
-eased
-easel
-easels
-easement
-easements
-eases
-easier
-easiest
-easily
-easiness
-easing
-east
-eastbound
-easter
-easterly
-eastern
-easterners
-easternmost
-easting
-eastward
-eastwards
-easy
-easygoing
-eat
-eatable
-eatage
-eaten
-eater
-eaters
-eatery
-eating
-eatings
-eats
-eaves
-eavesdrop
-eavesdropped
-eavesdropper
-eavesdroppers
-eavesdropping
-eavesdrops
-ebb
-ebbed
-ebbing
-ebbs
-ebbtide
-ebony
-ebullience
-ebullient
-eccentric
-eccentrically
-eccentricities
-eccentricity
-eccentrics
-ecclesiastic
-ecclesiastical
-ecclesiastically
-echelon
-echelons
-echidna
-echidnas
-echinoderm
-echinoderms
-echo
-echoed
-echoic
-echoing
-eclair
-eclairs
-eclectic
-eclecticism
-eclipse
-eclipsed
-eclipses
-eclipsing
-ecliptic
-ecological
-ecologically
-ecologist
-ecologists
-ecology
-econometric
-econometrics
-economic
-economical
-economically
-economics
-economies
-economisation
-economise
-economised
-economises
-economising
-economist
-economists
-economy
-ecosystem
-ecosystems
-ecstasies
-ecstasy
-ecstatic
-ecstatically
-ectopic
-ectoplasm
-ecuador
-ecumenical
-ecumenically
-ecumenism
-eczema
-eddied
-eddies
-eddy
-eddying
-edema
-eden
-edge
-edged
-edgeless
-edges
-edgeways
-edgewise
-edgier
-edgily
-edginess
-edging
-edgings
-edgy
-edibility
-edible
-edibles
-edict
-edicts
-edification
-edifice
-edifices
-edified
-edifies
-edify
-edifying
-edison
-edit
-editable
-edited
-editing
-edition
-editions
-editor
-editorial
-editorialised
-editorially
-editorials
-editors
-editorship
-editorships
-edits
-educate
-educated
-educates
-educating
-education
-educational
-educationalist
-educationalists
-educationally
-educationist
-educationists
-educations
-educative
-educator
-educators
-eduction
-eel
-eels
-eelworm
-eelworms
-eerie
-eerier
-eeriest
-eerily
-eeriness
-eery
-efface
-effaced
-effacing
-effect
-effected
-effecting
-effective
-effectively
-effectiveness
-effector
-effectors
-effects
-effectual
-effectually
-effeminacy
-effeminate
-efferent
-effervescence
-effervescent
-effete
-efficacious
-efficacy
-efficiencies
-efficiency
-efficient
-efficiently
-effigies
-effigy
-effluent
-effluents
-effluvia
-effluxion
-effort
-effortless
-effortlessly
-efforts
-effrontery
-effulgence
-effulgent
-effusion
-effusions
-effusive
-effusively
-eg
-egalitarian
-egalitarianism
-egalitarians
-egg
-egged
-eggheads
-egging
-eggs
-eggshell
-eggshells
-ego
-egocentric
-egocentricity
-egoism
-egoist
-egoistic
-egoists
-egomania
-egomaniac
-egomaniacs
-egotism
-egotist
-egotistic
-egotistical
-egotistically
-egotists
-egregious
-egress
-egret
-egrets
-egypt
-egyptian
-eh
-eider
-eiderdown
-eidetic
-eigenfunction
-eigenfunctions
-eigenstate
-eigenstates
-eigenvalue
-eigenvalues
-eight
-eighteen
-eighteenth
-eightfold
-eighth
-eighties
-eightieth
-eightpence
-eights
-eighty
-einstein
-eire
-eisteddfod
-either
-eject
-ejected
-ejecting
-ejection
-ejections
-ejector
-ejectors
-ejects
-eke
-eked
-eking
-elaborate
-elaborated
-elaborately
-elaborateness
-elaborates
-elaborating
-elaboration
-elaborations
-elal
-elan
-eland
-elands
-elapse
-elapsed
-elapses
-elapsing
-elastic
-elastically
-elasticated
-elasticities
-elasticity
-elastics
-elastin
-elastodynamics
-elate
-elated
-elates
-elation
-elbe
-elbow
-elbowed
-elbowing
-elbows
-elder
-elderberries
-elderberry
-elderflower
-elderly
-elders
-eldest
-eldorado
-elect
-electability
-electable
-elected
-electing
-election
-electioneering
-elections
-elective
-elector
-electoral
-electorally
-electorate
-electorates
-electors
-electric
-electrical
-electrically
-electrician
-electricians
-electricity
-electrics
-electrification
-electrified
-electrify
-electrifying
-electro
-electrocardiogram
-electrocardiographic
-electrochemical
-electrochemically
-electrocute
-electrocuted
-electrocutes
-electrocuting
-electrocution
-electrode
-electrodes
-electrodynamic
-electrodynamics
-electroencephalogram
-electroluminescent
-electrolyse
-electrolysed
-electrolysing
-electrolysis
-electrolyte
-electrolytes
-electrolytic
-electrolytically
-electromagnet
-electromagnetic
-electromagnetically
-electromagnetism
-electromechanical
-electromechanics
-electromotive
-electron
-electronegative
-electronic
-electronically
-electronics
-electrons
-electrophoresis
-electrostatic
-electrostatics
-electrotechnical
-elects
-elegance
-elegant
-elegantly
-elegiac
-elegies
-elegy
-element
-elemental
-elementally
-elementarily
-elementary
-elements
-elephant
-elephantiasis
-elephantine
-elephants
-elevate
-elevated
-elevates
-elevating
-elevation
-elevations
-elevator
-elevators
-eleven
-eleventh
-elf
-elfin
-elflike
-elgreco
-elicit
-elicitation
-elicited
-eliciting
-elicits
-elide
-elided
-elides
-eliding
-eligibility
-eligible
-eligibly
-elijah
-eliminate
-eliminated
-eliminates
-eliminating
-elimination
-eliminations
-eliminator
-elision
-elisions
-elite
-elites
-elitism
-elitist
-elitists
-elixir
-elixirs
-elk
-elks
-ell
-ellipse
-ellipses
-ellipsis
-ellipsoid
-ellipsoidal
-ellipsoids
-elliptic
-elliptical
-elliptically
-ells
-elm
-elms
-elnino
-elocution
-elongate
-elongated
-elongates
-elongating
-elongation
-elongations
-elope
-eloped
-elopement
-elopes
-eloping
-eloquence
-eloquent
-eloquently
-els
-else
-elsewhere
-elucidate
-elucidated
-elucidates
-elucidating
-elucidation
-elude
-eluded
-eludes
-eluding
-elusion
-elusions
-elusive
-elusively
-elusiveness
-eluted
-elution
-elven
-elves
-elvish
-elysee
-em
-emaciate
-emaciated
-emaciation
-email
-emailed
-emanate
-emanated
-emanates
-emanating
-emanation
-emanations
-emancipate
-emancipated
-emancipates
-emancipating
-emancipation
-emancipator
-emancipatory
-emasculate
-emasculated
-emasculating
-emasculation
-embalm
-embalmed
-embalmer
-embalmers
-embalming
-embalms
-embank
-embankment
-embankments
-embargo
-embargoed
-embark
-embarkation
-embarked
-embarking
-embarks
-embarrass
-embarrassed
-embarrassedly
-embarrasses
-embarrassing
-embarrassingly
-embarrassment
-embarrassments
-embassies
-embassy
-embattle
-embattled
-embed
-embeddable
-embedded
-embedding
-embeddings
-embeds
-embellish
-embellished
-embellishing
-embellishment
-embellishments
-ember
-embers
-embezzle
-embezzled
-embezzlement
-embezzler
-embezzlers
-embezzling
-embitter
-embittered
-embittering
-embitterment
-emblazoned
-emblem
-emblematic
-emblems
-embodied
-embodies
-embodiment
-embodiments
-embody
-embodying
-embolden
-emboldened
-emboldening
-emboldens
-embolism
-embosom
-emboss
-embossed
-embrace
-embraced
-embraces
-embracing
-embrasure
-embrocation
-embroider
-embroidered
-embroiderers
-embroideries
-embroidering
-embroidery
-embroil
-embroiled
-embroiling
-embryo
-embryological
-embryology
-embryonal
-embryonic
-emendation
-emendations
-emended
-emerald
-emeralds
-emerge
-emerged
-emergence
-emergencies
-emergency
-emergent
-emerges
-emerging
-emeritus
-emersion
-emery
-emetic
-emigrant
-emigrants
-emigrate
-emigrated
-emigrating
-emigration
-emigre
-emigres
-eminence
-eminences
-eminent
-eminently
-emir
-emirate
-emirates
-emirs
-emissaries
-emissary
-emission
-emissions
-emissivities
-emissivity
-emit
-emits
-emitted
-emitter
-emitters
-emitting
-emollient
-emolument
-emoluments
-emotion
-emotional
-emotionalism
-emotionality
-emotionally
-emotionless
-emotions
-emotive
-emotively
-empathetic
-empathetical
-empathic
-empathise
-empathising
-empathy
-emperor
-emperors
-emphases
-emphasis
-emphasise
-emphasised
-emphasises
-emphasising
-emphatic
-emphatically
-emphysema
-empire
-empires
-empiric
-empirical
-empirically
-empiricism
-empiricist
-empiricists
-emplacement
-emplacements
-employ
-employability
-employable
-employed
-employee
-employees
-employer
-employers
-employing
-employment
-employments
-employs
-emporia
-emporium
-empower
-empowered
-empowering
-empowerment
-empowers
-empress
-emptied
-emptier
-empties
-emptiest
-emptily
-emptiness
-empty
-emptyhanded
-emptying
-ems
-emu
-emulate
-emulated
-emulates
-emulating
-emulation
-emulations
-emulator
-emulators
-emulsifies
-emulsion
-emulsions
-emus
-enable
-enabled
-enables
-enabling
-enact
-enacted
-enacting
-enactment
-enactments
-enacts
-enamel
-enamelled
-enamels
-enamoured
-encage
-encamp
-encamped
-encampment
-encampments
-encapsulate
-encapsulated
-encapsulates
-encapsulating
-encapsulation
-encapsulations
-encase
-encased
-encases
-encashment
-encasing
-encephalitis
-encephalopathy
-enchain
-enchant
-enchanted
-enchanter
-enchanters
-enchanting
-enchantingly
-enchantment
-enchantments
-enchantress
-enchants
-enchiladas
-enciphering
-encircle
-encircled
-encirclement
-encirclements
-encircles
-encircling
-enclasp
-enclave
-enclaves
-enclose
-enclosed
-encloses
-enclosing
-enclosure
-enclosures
-encode
-encoded
-encoder
-encoders
-encodes
-encoding
-encomium
-encompass
-encompassed
-encompasses
-encompassing
-encore
-encored
-encores
-encounter
-encountered
-encountering
-encounters
-encourage
-encouraged
-encouragement
-encouragements
-encourager
-encourages
-encouraging
-encouragingly
-encroach
-encroached
-encroaches
-encroaching
-encroachment
-encroachments
-encrust
-encrustation
-encrusted
-encrusting
-encrypt
-encrypted
-encrypting
-encryption
-encrypts
-encumber
-encumbered
-encumbering
-encumbrance
-encumbrances
-encyclical
-encyclopaedia
-encyclopaedias
-encyclopaedic
-encyclopedia
-encyclopedias
-encyclopedic
-end
-endanger
-endangered
-endangering
-endangers
-endear
-endeared
-endearing
-endearingly
-endearment
-endearments
-endears
-endeavour
-endeavoured
-endeavouring
-endeavours
-ended
-endemic
-endemically
-endgame
-ending
-endings
-endive
-endless
-endlessly
-endlessness
-endocrine
-endogenous
-endogenously
-endometrial
-endometriosis
-endometrium
-endomorphism
-endomorphisms
-endoplasmic
-endorphins
-endorse
-endorsed
-endorsement
-endorsements
-endorser
-endorses
-endorsing
-endoscope
-endoscopic
-endoscopy
-endothermic
-endotoxin
-endow
-endowed
-endowing
-endowment
-endowments
-endows
-endpapers
-ends
-endued
-endues
-endungeoned
-endurable
-endurance
-endure
-endured
-endures
-enduring
-enema
-enemas
-enemies
-enemy
-energetic
-energetically
-energetics
-energies
-energise
-energised
-energiser
-energisers
-energising
-energy
-enervate
-enervated
-enervating
-enfeeble
-enfeebled
-enfeeblement
-enfold
-enfolded
-enfolding
-enfolds
-enforce
-enforceability
-enforceable
-enforced
-enforcement
-enforcements
-enforcer
-enforcers
-enforces
-enforcing
-enfranchise
-enfranchised
-enfranchisement
-enfranchiser
-enfranchising
-engage
-engaged
-engagement
-engagements
-engages
-engaging
-engagingly
-engarde
-engels
-engender
-engendered
-engendering
-engenders
-engine
-engined
-engineer
-engineered
-engineering
-engineers
-engines
-england
-english
-engorge
-engorged
-engrained
-engrave
-engraved
-engraver
-engravers
-engraves
-engraving
-engravings
-engross
-engrossed
-engrossing
-engulf
-engulfed
-engulfing
-engulfs
-enhance
-enhanceable
-enhanced
-enhancement
-enhancements
-enhancer
-enhancers
-enhances
-enhancing
-enharmonic
-enigma
-enigmas
-enigmatic
-enigmatically
-enjoin
-enjoined
-enjoining
-enjoins
-enjoy
-enjoyability
-enjoyable
-enjoyably
-enjoyed
-enjoyer
-enjoying
-enjoyment
-enjoyments
-enjoys
-enlace
-enlarge
-enlarged
-enlargement
-enlargements
-enlarger
-enlarges
-enlarging
-enlighten
-enlightened
-enlightening
-enlightenment
-enlightens
-enlist
-enlisted
-enlisting
-enlistment
-enlists
-enliven
-enlivened
-enlivening
-enlivens
-enmasse
-enmeshed
-enmities
-enmity
-enneads
-ennoble
-ennobled
-ennobles
-ennobling
-ennui
-enormities
-enormity
-enormous
-enormously
-enough
-enounced
-enounces
-enquire
-enquired
-enquirer
-enquirers
-enquires
-enquiries
-enquiring
-enquiringly
-enquiry
-enrage
-enraged
-enrages
-enraging
-enraptured
-enrich
-enriched
-enriches
-enriching
-enrichment
-enrichments
-enrobe
-enrobed
-enrol
-enroll
-enrolled
-enrolling
-enrolls
-enrolment
-enrolments
-enrols
-enroute
-ensconce
-ensconced
-ensemble
-ensembles
-enshrine
-enshrined
-enshrines
-enshrining
-enshroud
-enshrouded
-ensign
-ensigns
-enslave
-enslaved
-enslavement
-enslaves
-enslaving
-ensnare
-ensnared
-ensnaring
-ensnarl
-ensue
-ensued
-ensues
-ensuing
-ensure
-ensured
-ensures
-ensuring
-entablature
-entail
-entailed
-entailing
-entailment
-entails
-entangle
-entangled
-entanglement
-entanglements
-entangler
-entangles
-entangling
-entente
-enter
-entered
-entering
-enteritis
-enterprise
-enterprises
-enterprising
-enters
-entertain
-entertained
-entertainer
-entertainers
-entertaining
-entertainingly
-entertainment
-entertainments
-entertains
-enthalpies
-enthalpy
-enthralled
-enthralling
-enthrone
-enthroned
-enthronement
-enthuse
-enthused
-enthuses
-enthusiasm
-enthusiasms
-enthusiast
-enthusiastic
-enthusiastically
-enthusiasts
-enthusing
-entice
-enticed
-enticement
-enticements
-entices
-enticing
-enticingly
-entire
-entirely
-entires
-entirety
-entities
-entitle
-entitled
-entitlement
-entitlements
-entitles
-entitling
-entity
-entomb
-entombed
-entombment
-entombs
-entomological
-entomologist
-entomologists
-entomology
-entourage
-entrails
-entrain
-entrained
-entrainment
-entrance
-entranced
-entrances
-entrancing
-entrant
-entrants
-entrap
-entrapment
-entrapped
-entrapping
-entreat
-entreated
-entreaties
-entreating
-entreatingly
-entreats
-entreaty
-entree
-entrench
-entrenched
-entrenching
-entrenchment
-entrepreneur
-entrepreneurial
-entrepreneurs
-entrepreneurship
-entries
-entropic
-entropy
-entrust
-entrusted
-entrusting
-entrusts
-entry
-entwine
-entwined
-entwines
-entwining
-enumerable
-enumerate
-enumerated
-enumerates
-enumerating
-enumeration
-enumerations
-enumerator
-enumerators
-enunciate
-enunciated
-enunciating
-enunciation
-envelop
-envelope
-enveloped
-enveloper
-envelopers
-envelopes
-enveloping
-envelops
-enviable
-enviably
-envied
-envies
-envious
-enviously
-environ
-environment
-environmental
-environmentalism
-environmentalist
-environmentalists
-environmentally
-environments
-environs
-envisage
-envisaged
-envisages
-envisaging
-envision
-envisioned
-envoy
-envoys
-envy
-envying
-enwrap
-enzymatic
-enzyme
-enzymes
-eon
-eons
-eosin
-epaulettes
-ephemera
-ephemeral
-ephemeris
-ephor
-epic
-epically
-epicarp
-epicentre
-epics
-epicure
-epicurean
-epicycles
-epicycloid
-epidemic
-epidemics
-epidemiological
-epidemiologist
-epidemiologists
-epidemiology
-epidermal
-epidermis
-epidural
-epigenetic
-epigon
-epigones
-epigram
-epigrammatic
-epigrams
-epigraph
-epigraphical
-epigraphy
-epilepsy
-epileptic
-epileptics
-epilogue
-epinephrine
-epiphanies
-epiphenomena
-epiphenomenon
-episcopacy
-episcopal
-episcopalian
-episcopate
-episode
-episodes
-episodic
-episodically
-epistemic
-epistemological
-epistemology
-epistle
-epistles
-epistolary
-epitap
-epitaph
-epitaphs
-epitaxial
-epitaxy
-epithelial
-epithelium
-epithet
-epithetic
-epithets
-epitome
-epitomise
-epitomised
-epitomises
-epoch
-epochal
-epochs
-epoxies
-epoxy
-epsilon
-equable
-equably
-equal
-equalisation
-equalise
-equalised
-equaliser
-equalisers
-equalising
-equalities
-equality
-equalled
-equalling
-equally
-equals
-equanimity
-equate
-equated
-equates
-equating
-equation
-equations
-equator
-equatorial
-equerry
-equestrian
-equestrianism
-equiangular
-equidistant
-equilateral
-equilibrating
-equilibration
-equilibria
-equilibrium
-equine
-equinoctial
-equinox
-equinoxes
-equip
-equipartition
-equipment
-equipments
-equipped
-equipping
-equips
-equitable
-equitably
-equities
-equity
-equivalence
-equivalences
-equivalent
-equivalently
-equivalents
-equivocal
-equivocated
-equivocating
-equivocation
-equivocations
-era
-eradicate
-eradicated
-eradicating
-eradication
-eras
-erasable
-erase
-erased
-eraser
-erasers
-erases
-erasing
-erasure
-erasures
-erbium
-ere
-erect
-erected
-erecter
-erectile
-erecting
-erection
-erections
-erectly
-erects
-erg
-ergo
-ergodic
-ergonomic
-ergonomically
-ergonomics
-ergophobia
-ergot
-ergs
-erica
-ericas
-eritrea
-ermine
-erode
-eroded
-erodes
-eroding
-erogenous
-eros
-erose
-erosion
-erosional
-erosions
-erosive
-erotic
-erotica
-erotically
-eroticism
-err
-errand
-errands
-errant
-errata
-erratic
-erratically
-erratum
-erred
-erring
-erroneous
-erroneously
-error
-errors
-errs
-ersatz
-erst
-erstwhile
-erudite
-erudition
-erupt
-erupted
-erupting
-eruption
-eruptions
-eruptive
-erupts
-erysipelas
-esau
-escalade
-escalate
-escalated
-escalates
-escalating
-escalation
-escalator
-escalators
-escapade
-escapades
-escape
-escaped
-escapee
-escapees
-escapement
-escapes
-escaping
-escapism
-escapist
-escapology
-escarp
-escarpment
-escarpments
-escarps
-eschatological
-eschatology
-eschew
-eschewed
-eschewing
-eschews
-escort
-escorted
-escorting
-escorts
-escudo
-eskimo
-esoteric
-esoterica
-esoterically
-espadrilles
-especial
-especially
-espied
-espionage
-esplanade
-espousal
-espouse
-espoused
-espouses
-espousing
-espresso
-esprit
-espy
-espying
-esquire
-esquires
-essay
-essayed
-essayist
-essayists
-essays
-essen
-essence
-essences
-essential
-essentialism
-essentialist
-essentially
-essentials
-est
-establish
-established
-establishes
-establishing
-establishment
-establishments
-estate
-estates
-esteem
-esteemed
-esteems
-ester
-esters
-esthete
-esthetic
-estimable
-estimate
-estimated
-estimates
-estimating
-estimation
-estimations
-estimator
-estimators
-estonia
-estranged
-estrangement
-estrangements
-estuaries
-estuarine
-estuary
-eta
-etal
-etcetera
-etch
-etched
-etcher
-etchers
-etches
-etching
-etchings
-eternal
-eternally
-eternity
-ethane
-ethanol
-ether
-ethereal
-ethereally
-etherised
-ethic
-ethical
-ethically
-ethicist
-ethics
-ethiopia
-ethnic
-ethnical
-ethnically
-ethnicity
-ethnocentric
-ethnographer
-ethnographers
-ethnographic
-ethnography
-ethnological
-ethnology
-ethological
-ethologist
-ethologists
-ethology
-ethos
-ethyl
-ethylene
-etiquette
-etna
-etudes
-etui
-etymological
-etymologically
-etymologies
-etymologist
-etymologists
-etymology
-eucalyptus
-eugenic
-eugenics
-eukaryote
-eukaryotes
-eukaryotic
-eulogies
-eulogise
-eulogises
-eulogising
-eulogistic
-eulogy
-eunuch
-eunuchs
-euphemism
-euphemisms
-euphemistic
-euphemistically
-euphonious
-euphonium
-euphoniums
-euphony
-euphoria
-euphoric
-eurasia
-eurasian
-eureka
-eurekas
-euro
-europe
-european
-eurydice
-eutectic
-euthanasia
-evacuate
-evacuated
-evacuating
-evacuation
-evacuations
-evacuee
-evacuees
-evadable
-evade
-evaded
-evader
-evaders
-evades
-evading
-evaluable
-evaluate
-evaluated
-evaluates
-evaluating
-evaluation
-evaluational
-evaluations
-evaluative
-evaluator
-evaluators
-evanescent
-evangelical
-evangelicalism
-evangelicals
-evangelisation
-evangelise
-evangelising
-evangelism
-evangelist
-evangelistic
-evangelists
-evaporate
-evaporated
-evaporates
-evaporating
-evaporation
-evaporator
-evasion
-evasions
-evasive
-evasively
-evasiveness
-eve
-even
-evened
-evener
-evenhanded
-evening
-evenings
-evenly
-evenness
-evens
-evensong
-event
-eventful
-eventide
-eventing
-events
-eventual
-eventualities
-eventuality
-eventually
-ever
-everchanging
-everest
-evergreen
-evergreens
-everincreasing
-everlasting
-everlastingly
-everliving
-evermore
-everpresent
-eversion
-everting
-every
-everybody
-everyday
-everyone
-everything
-everywhere
-eves
-evict
-evicted
-evicting
-eviction
-evictions
-evicts
-evidence
-evidenced
-evidences
-evident
-evidential
-evidently
-evil
-evildoer
-evilly
-evilness
-evils
-evince
-evinced
-evinces
-evincing
-eviscerate
-evocation
-evocations
-evocative
-evocatively
-evoke
-evoked
-evokes
-evoking
-evolute
-evolution
-evolutionarily
-evolutionary
-evolutionism
-evolutionist
-evolutionists
-evolutions
-evolve
-evolved
-evolves
-evolving
-ewe
-ewes
-exacerbate
-exacerbated
-exacerbates
-exacerbating
-exacerbation
-exact
-exacted
-exacting
-exaction
-exactitude
-exactly
-exactness
-exacts
-exaggerate
-exaggerated
-exaggeratedly
-exaggerates
-exaggerating
-exaggeration
-exaggerations
-exalt
-exaltation
-exalted
-exalting
-exalts
-exam
-examinable
-examination
-examinations
-examine
-examined
-examinees
-examiner
-examiners
-examines
-examining
-example
-examples
-exams
-exasperate
-exasperated
-exasperatedly
-exasperating
-exasperation
-excavate
-excavated
-excavating
-excavation
-excavations
-excavator
-excavators
-exceed
-exceeded
-exceeding
-exceedingly
-exceeds
-excel
-excelled
-excellence
-excellencies
-excellency
-excellent
-excellently
-excelling
-excels
-excelsior
-except
-excepted
-excepting
-exception
-exceptionable
-exceptional
-exceptionally
-exceptions
-excepts
-excerpt
-excerpted
-excerpts
-excess
-excesses
-excessive
-excessively
-exchange
-exchangeable
-exchanged
-exchanger
-exchangers
-exchanges
-exchanging
-exchequer
-excise
-excised
-excising
-excision
-excitability
-excitable
-excitation
-excitations
-excite
-excited
-excitedly
-excitement
-excitements
-excites
-exciting
-excitingly
-exciton
-exclaim
-exclaimed
-exclaiming
-exclaims
-exclamation
-exclamations
-exclamatory
-exclude
-excluded
-excludes
-excluding
-exclusion
-exclusionary
-exclusions
-exclusive
-exclusively
-exclusiveness
-exclusivist
-exclusivity
-excommunicate
-excommunicated
-excommunicating
-excommunication
-excrete
-excruciating
-excruciatingly
-excruciation
-excursion
-excursionists
-excursions
-excursus
-excusable
-excuse
-excused
-excuses
-excusing
-executable
-execute
-executed
-executes
-executing
-execution
-executioner
-executioners
-executions
-executive
-executives
-executor
-executors
-exegesis
-exegetical
-exemplar
-exemplars
-exemplary
-exemplification
-exemplified
-exemplifies
-exemplify
-exemplifying
-exempt
-exempted
-exempting
-exemption
-exemptions
-exempts
-exercisable
-exercise
-exercised
-exerciser
-exercises
-exercising
-exert
-exerted
-exerting
-exertion
-exertions
-exerts
-exes
-exeunt
-exfoliation
-exhalation
-exhalations
-exhale
-exhaled
-exhales
-exhaling
-exhaust
-exhausted
-exhaustible
-exhausting
-exhaustion
-exhaustive
-exhaustively
-exhausts
-exhibit
-exhibited
-exhibiting
-exhibition
-exhibitioner
-exhibitioners
-exhibitionism
-exhibitionist
-exhibitionists
-exhibitions
-exhibitor
-exhibitors
-exhibits
-exhilarate
-exhilarated
-exhilarating
-exhilaration
-exhort
-exhortation
-exhortations
-exhorted
-exhorting
-exhorts
-exhumation
-exhume
-exhumed
-exhumes
-exhuming
-exhusband
-exigencies
-exigency
-exigent
-exiguous
-exile
-exiled
-exiles
-exiling
-exist
-existed
-existence
-existences
-existent
-existential
-existentialism
-existentialist
-existentialistic
-existentially
-existing
-exists
-exit
-exited
-exiting
-exits
-exmember
-exmembers
-exocrine
-exoderm
-exodus
-exogenous
-exogenously
-exonerate
-exonerated
-exonerates
-exonerating
-exoneration
-exorbitant
-exorbitantly
-exorcise
-exorcised
-exorcising
-exorcism
-exorcisms
-exorcist
-exoskeleton
-exothermic
-exothermically
-exotic
-exotica
-exotically
-exoticism
-expand
-expandability
-expandable
-expanded
-expander
-expanding
-expands
-expanse
-expanses
-expansible
-expansion
-expansionary
-expansionism
-expansionist
-expansions
-expansive
-expansively
-expansiveness
-expatriate
-expatriated
-expatriates
-expect
-expectancies
-expectancy
-expectant
-expectantly
-expectation
-expectational
-expectations
-expected
-expecting
-expectorate
-expectorated
-expectoration
-expects
-expedience
-expediency
-expedient
-expedients
-expedite
-expedited
-expedites
-expediting
-expedition
-expeditionary
-expeditions
-expeditious
-expeditiously
-expel
-expelled
-expelling
-expels
-expend
-expendable
-expended
-expending
-expenditure
-expenditures
-expends
-expense
-expenses
-expensive
-expensively
-experience
-experienced
-experiences
-experiencing
-experiential
-experiment
-experimental
-experimentalist
-experimentalists
-experimentally
-experimentation
-experimented
-experimenter
-experimenters
-experimenting
-experiments
-expert
-expertise
-expertly
-expertness
-experts
-expiate
-expiation
-expiatory
-expiration
-expiratory
-expire
-expired
-expires
-expiring
-expiry
-explain
-explainable
-explained
-explaining
-explains
-explanation
-explanations
-explanatory
-expletive
-expletives
-explicable
-explicate
-explicated
-explication
-explicative
-explicit
-explicitly
-explicitness
-explode
-exploded
-exploder
-exploders
-explodes
-exploding
-exploit
-exploitable
-exploitation
-exploitations
-exploitative
-exploited
-exploiter
-exploiters
-exploiting
-exploits
-explorable
-exploration
-explorations
-exploratory
-explore
-explored
-explorer
-explorers
-explores
-exploring
-explosion
-explosions
-explosive
-explosively
-explosiveness
-explosives
-expo
-exponent
-exponential
-exponentially
-exponentiation
-exponents
-export
-exportability
-exportable
-exported
-exporter
-exporters
-exporting
-exports
-expose
-exposed
-exposes
-exposing
-exposition
-expositions
-expository
-expostulate
-expostulated
-expostulating
-expostulation
-expostulations
-exposure
-exposures
-expound
-expounded
-expounding
-expounds
-express
-expressed
-expresses
-expressible
-expressing
-expression
-expressionism
-expressionist
-expressionistic
-expressionists
-expressionless
-expressionlessly
-expressions
-expressive
-expressively
-expressiveness
-expressly
-expropriate
-expropriated
-expropriation
-expropriations
-expulsion
-expulsions
-expunge
-expunged
-expunges
-expunging
-expurgate
-expurgated
-expurgating
-exquisite
-exquisitely
-exquisiteness
-ext
-extend
-extendability
-extendable
-extended
-extender
-extenders
-extendible
-extending
-extends
-extensibility
-extensible
-extension
-extensional
-extensionally
-extensions
-extensive
-extensively
-extensiveness
-extensors
-extent
-extents
-extenuate
-extenuated
-extenuating
-extenuation
-exterior
-exteriors
-exterminate
-exterminated
-exterminates
-exterminating
-extermination
-exterminations
-exterminator
-exterminators
-extern
-external
-externalised
-externally
-externals
-externs
-extinct
-extinction
-extinctions
-extinguish
-extinguished
-extinguisher
-extinguishers
-extinguishes
-extinguishing
-extinguishment
-extirpate
-extirpation
-extol
-extolled
-extolling
-extols
-extort
-extorted
-extorting
-extortion
-extortionate
-extortionately
-extortionists
-extorts
-extra
-extracellular
-extract
-extractable
-extracted
-extracting
-extraction
-extractions
-extractive
-extractor
-extracts
-extraditable
-extradite
-extradited
-extraditing
-extradition
-extragalactic
-extrajudicial
-extralinguistic
-extramarital
-extramural
-extraneous
-extraordinarily
-extraordinary
-extrapolate
-extrapolated
-extrapolating
-extrapolation
-extrapolations
-extras
-extrasolar
-extraterrestrial
-extraterrestrials
-extraterritorial
-extravagance
-extravagances
-extravagant
-extravagantly
-extravaganza
-extravaganzas
-extrema
-extremal
-extreme
-extremely
-extremes
-extremest
-extremism
-extremist
-extremists
-extremities
-extremity
-extricate
-extricated
-extricating
-extrication
-extrinsic
-extrinsically
-extroversion
-extrovert
-extroverts
-extrude
-extruded
-extrusion
-extrusions
-exuberance
-exuberant
-exuberantly
-exudate
-exude
-exuded
-exudes
-exuding
-exult
-exultant
-exultantly
-exultation
-exulted
-exulting
-exultingly
-exults
-exwife
-exwives
-eye
-eyeball
-eyeballs
-eyebrow
-eyebrows
-eyecatching
-eyed
-eyeful
-eyeglass
-eyeglasses
-eyeing
-eyelash
-eyelashes
-eyeless
-eyelet
-eyelets
-eyelevel
-eyelid
-eyelids
-eyelike
-eyeliner
-eyepatch
-eyepiece
-eyes
-eyeshadow
-eyesight
-eyesore
-eyesores
-eyeteeth
-eyetooth
-eyewash
-eyewitness
-eyewitnesses
-fab
-fable
-fabled
-fables
-fabric
-fabricate
-fabricated
-fabricates
-fabricating
-fabrication
-fabrications
-fabricator
-fabrics
-fabulists
-fabulous
-fabulously
-facade
-facades
-face
-faced
-faceless
-facelift
-faceplate
-facer
-facers
-faces
-facet
-faceted
-faceting
-facetious
-facetiously
-facetiousness
-facets
-facia
-facial
-facials
-facile
-facilitate
-facilitated
-facilitates
-facilitating
-facilitation
-facilitative
-facilitator
-facilitators
-facilities
-facility
-facing
-facings
-facsimile
-facsimiles
-fact
-faction
-factional
-factionalism
-factions
-factious
-factitious
-factor
-factored
-factorial
-factorials
-factories
-factoring
-factorisable
-factorisation
-factorisations
-factorise
-factorised
-factorises
-factorising
-factors
-factory
-factotum
-facts
-factual
-factually
-faculties
-faculty
-fad
-fade
-faded
-fadeout
-fades
-fading
-fads
-faecal
-faeces
-fag
-faggot
-faggots
-fagot
-fags
-fail
-failed
-failing
-failings
-fails
-failure
-failures
-faint
-fainted
-fainter
-faintest
-fainthearted
-fainting
-faintly
-faintness
-faints
-fair
-fairer
-fairest
-fairground
-fairgrounds
-fairies
-fairing
-fairish
-fairly
-fairness
-fairs
-fairsex
-fairway
-fairways
-fairy
-fairytale
-faith
-faithful
-faithfully
-faithfulness
-faithless
-faithlessness
-faiths
-fake
-faked
-fakers
-fakery
-fakes
-faking
-falcon
-falconer
-falconry
-falcons
-fall
-fallacies
-fallacious
-fallacy
-fallen
-faller
-fallers
-fallguy
-fallibility
-fallible
-falling
-fallopian
-fallout
-fallow
-falls
-false
-falsebay
-falsehood
-falsehoods
-falsely
-falseness
-falser
-falsetto
-falsifiability
-falsifiable
-falsification
-falsifications
-falsified
-falsifier
-falsifiers
-falsifies
-falsify
-falsifying
-falsities
-falsity
-falter
-faltered
-faltering
-falteringly
-falters
-fame
-famed
-familial
-familiar
-familiarisation
-familiarise
-familiarised
-familiarising
-familiarities
-familiarity
-familiarly
-families
-family
-famine
-famines
-famish
-famished
-famous
-famously
-fan
-fanatic
-fanatical
-fanatically
-fanaticism
-fanatics
-fanbelt
-fanciable
-fancied
-fancier
-fanciers
-fancies
-fanciest
-fanciful
-fancifully
-fancy
-fancying
-fandango
-fanfare
-fanfares
-fang
-fangs
-fanlight
-fanned
-fanning
-fanny
-fans
-fantail
-fantails
-fantasia
-fantastic
-far
-farad
-faraday
-faraway
-farce
-farces
-farcical
-fare
-fared
-fares
-farewell
-farewells
-farfetched
-farflung
-faring
-farm
-farmed
-farmer
-farmers
-farmhouse
-farmhouses
-farming
-farmings
-farmland
-farms
-farmstead
-farmsteads
-farmyard
-farmyards
-faroff
-farout
-farrago
-farreaching
-farrier
-farriers
-farrow
-farseeing
-farsighted
-farther
-farthest
-farthing
-farthings
-fascia
-fascias
-fascinate
-fascinated
-fascinates
-fascinating
-fascinatingly
-fascination
-fascinations
-fascism
-fascist
-fascists
-fashion
-fashionable
-fashionably
-fashioned
-fashioning
-fashions
-fast
-fasted
-fasten
-fastened
-fastener
-fasteners
-fastening
-fastenings
-fastens
-faster
-fastest
-fastidious
-fastidiously
-fastidiousness
-fasting
-fastings
-fastness
-fastnesses
-fasts
-fat
-fatal
-fatalism
-fatalist
-fatalistic
-fatalistically
-fatalities
-fatality
-fatally
-fatcat
-fate
-fated
-fateful
-fates
-fatheadedness
-father
-fathered
-fatherhood
-fathering
-fatherinlaw
-fatherland
-fatherless
-fatherly
-fathers
-fathersinlaw
-fathom
-fathomed
-fathoming
-fathomless
-fathoms
-fatigue
-fatigued
-fatigues
-fatiguing
-fatless
-fatness
-fats
-fatted
-fatten
-fattened
-fattening
-fattens
-fatter
-fattest
-fattier
-fattiest
-fatty
-fatuity
-fatuous
-fatuously
-fatwa
-faucet
-faucets
-fault
-faulted
-faulting
-faultless
-faultlessly
-faults
-faulty
-faun
-fauna
-faunal
-faunas
-fauns
-faust
-faustus
-favour
-favourable
-favourably
-favoured
-favouring
-favourite
-favourites
-favouritism
-favours
-fawn
-fawned
-fawning
-fawningly
-fawns
-fax
-faxed
-faxes
-faxing
-fealty
-fear
-feared
-fearful
-fearfully
-fearfulness
-fearing
-fearless
-fearlessly
-fearlessness
-fears
-fearsome
-fearsomely
-fearsomeness
-feasibility
-feasible
-feasibly
-feast
-feasted
-feasting
-feasts
-feat
-feather
-feathered
-feathering
-featherlight
-feathers
-featherweight
-feathery
-feats
-feature
-featured
-featureless
-features
-featuring
-febrile
-february
-feckless
-fecklessness
-fecund
-fecundity
-fed
-federal
-federalism
-federalist
-federalists
-federally
-federate
-federated
-federation
-federations
-fedora
-feds
-fedup
-fee
-feeble
-feebleminded
-feebleness
-feebler
-feeblest
-feebly
-feed
-feedback
-feeder
-feeders
-feeding
-feedings
-feeds
-feedstock
-feedstuffs
-feel
-feeler
-feelers
-feeling
-feelingly
-feelings
-feels
-fees
-feet
-feign
-feigned
-feigning
-feigns
-feint
-feinted
-feinting
-feints
-feldspar
-feldspars
-felicia
-felicitation
-felicitations
-felicities
-felicitous
-felicity
-feline
-felines
-fell
-fellatio
-felled
-feller
-felling
-fellow
-fellows
-fellowship
-fellowships
-fells
-felon
-felonious
-felons
-felony
-felt
-feltpen
-female
-femaleness
-females
-feminine
-femininely
-femininity
-feminism
-feminist
-feminists
-femur
-femurs
-fen
-fence
-fenced
-fencepost
-fencer
-fencers
-fences
-fencing
-fencings
-fend
-fended
-fender
-fenders
-fending
-fends
-fenland
-fennel
-fens
-feral
-ferment
-fermentation
-fermented
-fermenting
-ferments
-fermion
-fermions
-fern
-ferns
-ferny
-ferocious
-ferociously
-ferociousness
-ferocity
-ferret
-ferreted
-ferreting
-ferrets
-ferric
-ferried
-ferries
-ferrite
-ferromagnetic
-ferrous
-ferrule
-ferry
-ferrying
-ferryman
-fertile
-fertilisation
-fertilise
-fertilised
-fertiliser
-fertilisers
-fertilises
-fertilising
-fertility
-fervent
-fervently
-fervid
-fervidly
-fervour
-fescue
-fest
-festal
-fester
-festered
-festering
-festers
-festival
-festivals
-festive
-festivities
-festivity
-festoon
-festooned
-festooning
-festoons
-fetal
-fetch
-fetched
-fetches
-fetching
-fete
-feted
-fetes
-fetid
-fetish
-fetishes
-fetishism
-fetishist
-fetishistic
-fetishists
-fetlock
-fetlocks
-fetter
-fettered
-fetters
-fettle
-fetus
-feud
-feudal
-feudalism
-feuded
-feuding
-feudist
-feuds
-fever
-fevered
-feverish
-feverishly
-fevers
-few
-fewer
-fewest
-fewness
-fez
-fiance
-fiancee
-fiasco
-fiat
-fib
-fibbed
-fibber
-fibbers
-fibbing
-fibers
-fibre
-fibreboard
-fibred
-fibreglass
-fibres
-fibrillating
-fibrillation
-fibroblast
-fibroblasts
-fibrosis
-fibrous
-fibs
-fibula
-fiche
-fiches
-fickle
-fickleness
-fiction
-fictional
-fictions
-fictitious
-fictive
-ficus
-fiddle
-fiddled
-fiddler
-fiddlers
-fiddles
-fiddlesticks
-fiddling
-fiddlings
-fiddly
-fidelity
-fidget
-fidgeted
-fidgeting
-fidgets
-fidgety
-fiduciary
-fief
-fiefdom
-fiefdoms
-fiefs
-field
-fielded
-fielder
-fielders
-fielding
-fields
-fieldwork
-fieldworker
-fieldworkers
-fiend
-fiendish
-fiendishly
-fiends
-fierce
-fiercely
-fierceness
-fiercer
-fiercest
-fierier
-fieriest
-fierily
-fiery
-fiesta
-fiestas
-fife
-fifes
-fifteen
-fifteenth
-fifth
-fifthly
-fifths
-fifties
-fiftieth
-fifty
-fig
-fight
-fightback
-fighter
-fighters
-fighting
-fights
-figleaf
-figment
-figments
-figs
-figtree
-figural
-figuration
-figurative
-figuratively
-figure
-figured
-figurehead
-figureheads
-figurer
-figures
-figurine
-figurines
-figuring
-fiji
-fijians
-filament
-filamentary
-filamentous
-filaments
-filch
-filched
-file
-filed
-filer
-filers
-files
-filet
-filial
-filibuster
-filigree
-filing
-filings
-fill
-filled
-filler
-fillers
-fillet
-fillets
-fillies
-filling
-fillings
-fillip
-fills
-filly
-film
-filmed
-filmic
-filming
-filmmakers
-films
-filmset
-filmy
-filter
-filtered
-filtering
-filters
-filth
-filthier
-filthiest
-filthily
-filthy
-filtrate
-filtration
-fin
-final
-finale
-finales
-finalisation
-finalise
-finalised
-finalising
-finalist
-finalists
-finality
-finally
-finals
-finance
-financed
-finances
-financial
-financially
-financier
-financiers
-financing
-finch
-finches
-find
-findable
-finder
-finders
-finding
-findings
-finds
-fine
-fined
-finely
-fineness
-finer
-finery
-fines
-finesse
-finest
-finetune
-finetuned
-finetunes
-finetuning
-finger
-fingerboard
-fingered
-fingering
-fingerings
-fingerless
-fingermarks
-fingernail
-fingernails
-fingerprint
-fingerprinted
-fingerprinting
-fingerprints
-fingers
-fingertip
-fingertips
-finial
-finicky
-fining
-finis
-finish
-finished
-finisher
-finishers
-finishes
-finishing
-finite
-finitely
-finiteness
-finland
-finn
-finned
-finnish
-fins
-fiord
-fiords
-fir
-fire
-firearm
-firearms
-fireball
-fireballs
-firebomb
-firebombed
-firebombing
-firebombs
-firebox
-firebrand
-firecontrol
-fired
-firefight
-firefighter
-firefighters
-firefighting
-fireflies
-firefly
-fireguard
-firelight
-firelighters
-fireman
-firemen
-fireplace
-fireplaces
-firepower
-fireproof
-fireproofed
-firer
-fires
-fireside
-firesides
-firewood
-firework
-fireworks
-firing
-firings
-firkin
-firm
-firmament
-firmed
-firmer
-firmest
-firming
-firmly
-firmness
-firms
-firmware
-firs
-first
-firstaid
-firstborn
-firstborns
-firsthand
-firstly
-firsts
-firth
-fiscal
-fiscally
-fish
-fished
-fisher
-fisheries
-fisherman
-fishermen
-fishers
-fishery
-fishes
-fishhook
-fishhooks
-fishier
-fishiest
-fishing
-fishings
-fishlike
-fishmonger
-fishmongers
-fishnet
-fishwife
-fishy
-fissile
-fission
-fissions
-fissure
-fissured
-fissures
-fist
-fisted
-fistful
-fisticuffs
-fists
-fistula
-fit
-fitful
-fitfully
-fitfulness
-fitly
-fitment
-fitments
-fitness
-fits
-fitted
-fitter
-fitters
-fittest
-fitting
-fittingly
-fittings
-five
-fivefold
-fiver
-fivers
-fives
-fix
-fixable
-fixate
-fixated
-fixates
-fixation
-fixations
-fixative
-fixed
-fixedly
-fixer
-fixers
-fixes
-fixing
-fixings
-fixture
-fixtures
-fizz
-fizzed
-fizzes
-fizzier
-fizziest
-fizzing
-fizzle
-fizzled
-fizzles
-fizzy
-fjord
-fjords
-flab
-flabbergasted
-flabbier
-flabbiest
-flabby
-flabs
-flaccid
-flaccidity
-flack
-flag
-flagella
-flagellate
-flagellation
-flagged
-flagging
-flagon
-flagons
-flagpole
-flagrant
-flagrantly
-flags
-flagship
-flagships
-flair
-flak
-flake
-flaked
-flakes
-flakiest
-flaking
-flaky
-flamboyance
-flamboyant
-flamboyantly
-flame
-flamed
-flamenco
-flameproof
-flames
-flaming
-flamingo
-flammability
-flammable
-flan
-flange
-flanged
-flanges
-flank
-flanked
-flanker
-flanking
-flanks
-flannel
-flannelette
-flannels
-flans
-flap
-flapjack
-flapped
-flapper
-flappers
-flapping
-flaps
-flare
-flared
-flares
-flareup
-flareups
-flaring
-flash
-flashback
-flashbacks
-flashbulb
-flashed
-flasher
-flashes
-flashier
-flashiest
-flashily
-flashing
-flashlight
-flashlights
-flashpoint
-flashpoints
-flashy
-flask
-flasks
-flat
-flatfish
-flatly
-flatmate
-flatmates
-flatness
-flats
-flatten
-flattened
-flattening
-flattens
-flatter
-flattered
-flatterer
-flatterers
-flattering
-flatteringly
-flatters
-flattery
-flattest
-flattish
-flatulence
-flatulent
-flatus
-flatworms
-flaunt
-flaunted
-flaunting
-flaunts
-flautist
-flavour
-flavoured
-flavouring
-flavourings
-flavours
-flaw
-flawed
-flawless
-flawlessly
-flaws
-flax
-flaxen
-flay
-flayed
-flayer
-flayers
-flaying
-flea
-fleabites
-fleas
-fleck
-flecked
-flecks
-fled
-fledge
-fledged
-fledgeling
-fledges
-fledgling
-fledglings
-flee
-fleece
-fleeced
-fleeces
-fleecing
-fleecy
-fleeing
-flees
-fleet
-fleeted
-fleeter
-fleeting
-fleetingly
-fleetly
-fleets
-flemish
-flesh
-fleshed
-flesher
-fleshes
-fleshier
-fleshiest
-fleshing
-fleshless
-fleshly
-fleshpots
-fleshy
-flew
-flex
-flexed
-flexes
-flexibilities
-flexibility
-flexible
-flexibly
-flexile
-flexing
-flexion
-flexor
-flick
-flicked
-flicker
-flickered
-flickering
-flickers
-flickery
-flicking
-flicks
-flier
-fliers
-flies
-flight
-flighted
-flightless
-flightpath
-flights
-flighty
-flimsier
-flimsiest
-flimsily
-flimsiness
-flimsy
-flinch
-flinched
-flinching
-fling
-flinging
-flings
-flint
-flintlock
-flintlocks
-flints
-flinty
-flip
-flipflop
-flipflops
-flippable
-flippancy
-flippant
-flippantly
-flipped
-flipper
-flippers
-flipping
-flips
-flirt
-flirtation
-flirtations
-flirtatious
-flirtatiously
-flirted
-flirting
-flirts
-flit
-fliting
-flits
-flitted
-flitting
-float
-floated
-floater
-floaters
-floating
-floats
-floaty
-flock
-flocked
-flocking
-flocks
-floe
-flog
-flogged
-flogger
-floggers
-flogging
-floggings
-flogs
-flood
-flooded
-floodgates
-flooding
-floodlight
-floodlighting
-floodlights
-floodlit
-floods
-floor
-floorboard
-floorboards
-floored
-flooring
-floors
-floorspace
-floozie
-floozies
-floozy
-flop
-flopped
-flopper
-floppier
-floppies
-floppiest
-flopping
-floppy
-flops
-flora
-floral
-floras
-floreat
-florence
-floret
-florid
-florida
-floridly
-florin
-florins
-florist
-florists
-floss
-flosses
-flossing
-flossy
-flotation
-flotations
-flotilla
-flotillas
-flotsam
-flounce
-flounced
-flounces
-flouncing
-flounder
-floundered
-floundering
-flounders
-flour
-floured
-flourish
-flourished
-flourishes
-flourishing
-flours
-floury
-flout
-flouted
-flouting
-flouts
-flow
-flowed
-flower
-flowered
-flowering
-flowerless
-flowerpot
-flowerpots
-flowers
-flowery
-flowing
-flown
-flows
-flub
-flubbed
-fluctuate
-fluctuated
-fluctuates
-fluctuating
-fluctuation
-fluctuations
-flue
-fluency
-fluent
-fluently
-flues
-fluff
-fluffed
-fluffier
-fluffiest
-fluffing
-fluffs
-fluffy
-fluid
-fluidised
-fluidity
-fluidly
-fluids
-fluke
-flukes
-flukey
-flukier
-flukiest
-flumes
-flumped
-flung
-flunked
-fluor
-fluoresce
-fluorescence
-fluorescent
-fluoresces
-fluorescing
-fluoridation
-fluoride
-fluorine
-fluorocarbon
-fluorocarbons
-flurried
-flurries
-flurry
-flush
-flushed
-flusher
-flushes
-flushing
-fluster
-flustered
-flute
-fluted
-flutes
-fluting
-flutist
-flutter
-fluttered
-fluttering
-flutters
-fluttery
-fluvial
-flux
-fluxes
-fly
-flyaway
-flyer
-flyers
-flyhalf
-flying
-flyover
-flyovers
-flypaper
-flypast
-flyway
-flyways
-flyweight
-flywheel
-foal
-foaled
-foaling
-foals
-foam
-foamed
-foamier
-foamiest
-foaming
-foams
-foamy
-fob
-fobbed
-fobbing
-fobs
-focal
-focally
-foci
-focus
-focused
-focuses
-focusing
-focussed
-focusses
-focussing
-fodder
-fodders
-foe
-foehns
-foes
-foetal
-foetid
-foetus
-foetuses
-fog
-fogbank
-fogey
-fogged
-foggier
-foggiest
-fogging
-foggy
-foghorn
-foghorns
-fogs
-fogy
-foible
-foibles
-foil
-foiled
-foiling
-foils
-foist
-foisted
-foisting
-fold
-folded
-folder
-folders
-folding
-folds
-foliage
-foliate
-foliated
-folio
-folk
-folkart
-folkish
-folklore
-folklorist
-folklorists
-folks
-folktale
-follicle
-follicles
-follicular
-follies
-follow
-followable
-followed
-follower
-followers
-following
-followings
-follows
-folly
-foment
-fomented
-fomenting
-fond
-fondant
-fonder
-fondest
-fondle
-fondled
-fondles
-fondling
-fondly
-fondness
-fondue
-fondues
-font
-fontanel
-fonts
-food
-foodless
-foods
-foodstuff
-foodstuffs
-fool
-fooled
-foolery
-foolhardily
-foolhardiness
-foolhardy
-fooling
-foolish
-foolishly
-foolishness
-foolproof
-fools
-foolscap
-foot
-footage
-footages
-football
-footballer
-footballers
-footballing
-footballs
-footbath
-footbridge
-footed
-footfall
-footfalls
-footgear
-foothill
-foothills
-foothold
-footholds
-footing
-footings
-footless
-footlights
-footloose
-footman
-footmarks
-footmen
-footnote
-footnotes
-footpads
-footpath
-footpaths
-footplate
-footprint
-footprints
-footrest
-foots
-footsie
-footsore
-footstep
-footsteps
-footstool
-footstools
-footway
-footwear
-footwork
-fop
-fops
-for
-forage
-foraged
-foragers
-forages
-foraging
-foramen
-foray
-forays
-forbad
-forbade
-forbear
-forbearance
-forbearing
-forbears
-forbid
-forbidden
-forbidding
-forbiddingly
-forbids
-forbore
-force
-forced
-forcefeed
-forcefeeding
-forceful
-forcefully
-forcefulness
-forceps
-forces
-forcible
-forcibly
-forcing
-ford
-forded
-fording
-fords
-fore
-forearm
-forearmed
-forearms
-forebear
-forebears
-foreboded
-foreboding
-forebodings
-forebrain
-forecast
-forecaster
-forecasters
-forecasting
-forecasts
-foreclose
-foreclosed
-foreclosure
-forecourt
-forecourts
-foredeck
-forefather
-forefathers
-forefinger
-forefingers
-forefront
-foregather
-foregathered
-forego
-foregoing
-foregone
-foreground
-foregrounded
-foregrounding
-foregrounds
-forehand
-forehead
-foreheads
-foreign
-foreigner
-foreigners
-foreignness
-foreknowledge
-foreland
-foreleg
-forelegs
-forelimbs
-forelock
-foreman
-foremen
-foremost
-forename
-forenames
-forensic
-forensically
-forepaw
-forepaws
-foreplay
-forerunner
-forerunners
-foresail
-foresaw
-foresee
-foreseeability
-foreseeable
-foreseeing
-foreseen
-foresees
-foreshadow
-foreshadowed
-foreshadowing
-foreshadows
-foreshore
-foreshores
-foreshortened
-foreshortening
-foresight
-foreskin
-foreskins
-forest
-forestall
-forestalled
-forestalling
-forestalls
-forested
-forester
-foresters
-forestry
-forests
-foretaste
-foretastes
-foretell
-foretelling
-forethought
-foretold
-forever
-forewarn
-forewarned
-forewarning
-foreword
-forewords
-forfeit
-forfeited
-forfeiting
-forfeits
-forfeiture
-forgave
-forge
-forged
-forger
-forgeries
-forgers
-forgery
-forges
-forget
-forgetful
-forgetfulness
-forgetmenot
-forgetmenots
-forgets
-forgettable
-forgetting
-forging
-forgings
-forgivable
-forgive
-forgiven
-forgiveness
-forgives
-forgiving
-forgo
-forgoing
-forgone
-forgot
-forgotten
-fork
-forked
-forking
-forks
-forlorn
-forlornly
-forlornness
-form
-formal
-formaldehyde
-formalin
-formalisation
-formalisations
-formalise
-formalised
-formalises
-formalising
-formalism
-formalisms
-formalist
-formalistic
-formalities
-formality
-formally
-formant
-format
-formated
-formation
-formations
-formative
-formats
-formatted
-formatting
-formed
-former
-formerly
-formers
-formic
-formidable
-formidably
-forming
-formless
-formlessness
-formosa
-forms
-formula
-formulae
-formulaic
-formulary
-formulas
-formulate
-formulated
-formulates
-formulating
-formulation
-formulations
-formulator
-fornicate
-fornicated
-fornicates
-fornicating
-fornication
-fornicator
-fornicators
-forsake
-forsaken
-forsakes
-forsaking
-forsook
-forswear
-forswearing
-forswore
-forsworn
-forsythia
-fort
-forte
-forth
-forthcoming
-forthright
-forthrightly
-forthrightness
-forthwith
-forties
-fortieth
-fortification
-fortifications
-fortified
-fortify
-fortifying
-fortissimo
-fortitude
-fortknox
-fortnight
-fortnightly
-fortnights
-fortress
-fortresses
-forts
-fortuitous
-fortuitously
-fortunate
-fortunately
-fortune
-fortunes
-fortuneteller
-fortunetellers
-fortunetelling
-forty
-forum
-forums
-forward
-forwarded
-forwarder
-forwarding
-forwardlooking
-forwardly
-forwardness
-forwards
-fossa
-fossil
-fossiliferous
-fossilise
-fossilised
-fossilising
-fossils
-foster
-fostered
-fostering
-fosters
-fought
-foul
-fouled
-fouler
-foulest
-fouling
-foully
-foulmouthed
-foulness
-fouls
-foulup
-foulups
-found
-foundation
-foundational
-foundations
-founded
-founder
-foundered
-foundering
-founders
-founding
-foundling
-foundries
-foundry
-founds
-fount
-fountain
-fountains
-founts
-four
-fourfold
-fours
-foursome
-fourteen
-fourteenth
-fourth
-fourthly
-fourths
-fowl
-fowls
-fox
-foxed
-foxes
-foxhole
-foxholes
-foxhounds
-foxhunt
-foxhunting
-foxhunts
-foxier
-foxiest
-foxily
-foxiness
-foxing
-foxtrot
-foxtrots
-foxy
-foyer
-foyers
-fracas
-fractal
-fractals
-fraction
-fractional
-fractionally
-fractionate
-fractionated
-fractionating
-fractionation
-fractions
-fractious
-fracture
-fractured
-fractures
-fracturing
-fragile
-fragility
-fragment
-fragmentary
-fragmentation
-fragmented
-fragmenting
-fragments
-fragrance
-fragrances
-fragrant
-frail
-frailer
-frailest
-frailly
-frailties
-frailty
-frame
-framed
-framer
-framers
-frames
-frameup
-framework
-frameworks
-framing
-franc
-france
-franchise
-franchised
-franchisee
-franchisees
-franchises
-franchising
-franchisor
-francophone
-francs
-frangipani
-frank
-franked
-franker
-frankest
-frankfurter
-frankincense
-franking
-frankly
-frankness
-franks
-frantic
-frantically
-fraternal
-fraternise
-fraternising
-fraternities
-fraternity
-fratricidal
-fratricide
-fraud
-frauds
-fraudster
-fraudsters
-fraudulent
-fraudulently
-fraught
-fray
-frayed
-fraying
-frays
-frazzle
-frazzled
-freak
-freaked
-freakish
-freaks
-freaky
-freckle
-freckled
-freckles
-free
-freebie
-freebooters
-freed
-freedom
-freedoms
-freefall
-freefalling
-freeforall
-freehand
-freehold
-freeholder
-freeholders
-freeholds
-freeing
-freelance
-freelancer
-freelancers
-freelances
-freelancing
-freely
-freeman
-freemasonry
-freemen
-freer
-freerange
-frees
-freesia
-freesias
-freestanding
-freestyle
-freeway
-freewheeling
-freewheels
-freeze
-freezer
-freezers
-freezes
-freezing
-freight
-freighted
-freighter
-freighters
-freights
-french
-frenetic
-frenetically
-frenzied
-frenziedly
-frenzies
-frenzy
-freon
-freons
-frequencies
-frequency
-frequent
-frequented
-frequenting
-frequently
-frequents
-fresco
-fresh
-freshen
-freshened
-freshener
-fresheners
-freshening
-freshens
-fresher
-freshers
-freshest
-freshly
-freshman
-freshmen
-freshness
-freshwater
-fret
-fretboard
-fretful
-fretfully
-fretfulness
-fretless
-frets
-fretsaw
-fretsaws
-fretted
-fretting
-fretwork
-freud
-freya
-friable
-friar
-friars
-friary
-fricative
-fricatives
-friction
-frictional
-frictionless
-frictions
-friday
-fridays
-fridge
-fridges
-fried
-friend
-friendless
-friendlessness
-friendlier
-friendlies
-friendliest
-friendlily
-friendliness
-friendly
-friends
-friendship
-friendships
-friers
-fries
-frieze
-friezes
-frigate
-frigates
-fright
-frighted
-frighten
-frightened
-frighteners
-frightening
-frighteningly
-frightens
-frightful
-frightfully
-frights
-frigid
-frigidity
-frigidly
-frijole
-frill
-frilled
-frillier
-frilliest
-frills
-frilly
-fringe
-fringed
-fringes
-fringing
-fringy
-frippery
-frisk
-frisked
-friskier
-friskiest
-friskily
-frisking
-frisks
-frisky
-frisson
-fritter
-frittered
-frittering
-fritters
-frivol
-frivolities
-frivolity
-frivolous
-frivolously
-frivols
-frizzle
-frizzles
-frizzy
-fro
-frock
-frocks
-frog
-froggy
-frogman
-frogmarched
-frogmen
-frogs
-frolic
-frolicked
-frolicking
-frolics
-frolicsome
-from
-frond
-fronds
-front
-frontage
-frontages
-frontal
-frontally
-frontals
-fronted
-frontier
-frontiers
-fronting
-frontispiece
-frontispieces
-frontline
-frontpage
-fronts
-frost
-frostbite
-frostbitten
-frosted
-frostier
-frostiest
-frostily
-frosting
-frosts
-frosty
-froth
-frothed
-frothier
-frothiest
-frothing
-froths
-frothy
-froward
-frown
-frowned
-frowning
-frowningly
-frowns
-froze
-frozen
-fructose
-frugal
-frugality
-frugally
-fruit
-fruitcake
-fruitcakes
-fruited
-fruiter
-fruitful
-fruitfully
-fruitfulness
-fruitier
-fruitiest
-fruitiness
-fruiting
-fruition
-fruitless
-fruitlessly
-fruitlessness
-fruits
-fruity
-frumps
-frumpy
-frustrate
-frustrated
-frustratedly
-frustrates
-frustrating
-frustratingly
-frustration
-frustrations
-frustum
-fry
-fryer
-fryers
-frying
-fryings
-fuchsia
-fuchsias
-fuddle
-fuddled
-fuddles
-fudge
-fudged
-fudges
-fudging
-fuel
-fuelled
-fuelling
-fuels
-fug
-fugal
-fugitive
-fugitives
-fugue
-fugues
-fuhrer
-fulcrum
-fulfil
-fulfilled
-fulfilling
-fulfilment
-fulfils
-full
-fullback
-fullbacks
-fullblooded
-fullblown
-fullbodied
-fullcolour
-fuller
-fullest
-fullgrown
-fulling
-fullish
-fulllength
-fullmoon
-fullness
-fullpage
-fullscale
-fullstop
-fullstops
-fulltime
-fulltimer
-fulltimers
-fully
-fulminant
-fulminate
-fulminating
-fulmination
-fulminations
-fulsome
-fulsomely
-fumarole
-fumaroles
-fumble
-fumbled
-fumbles
-fumbling
-fume
-fumed
-fumes
-fumigate
-fumigating
-fumigation
-fuming
-fumingly
-fun
-function
-functional
-functionalism
-functionalist
-functionalities
-functionality
-functionally
-functionaries
-functionary
-functioned
-functioning
-functionless
-functions
-fund
-fundamental
-fundamentalism
-fundamentalist
-fundamentalists
-fundamentally
-fundamentals
-funded
-fundholders
-fundholding
-funding
-fundings
-fundraiser
-fundraisers
-fundraising
-funds
-funeral
-funerals
-funerary
-funereal
-funfair
-fungal
-fungi
-fungicidal
-fungicide
-fungicides
-fungoid
-fungous
-fungus
-funguses
-funicular
-funk
-funked
-funkier
-funky
-funnel
-funnelled
-funnelling
-funnels
-funnier
-funnies
-funniest
-funnily
-funny
-fur
-furbished
-furbishing
-furies
-furious
-furiously
-furled
-furling
-furlong
-furlongs
-furlough
-furls
-furnace
-furnaces
-furnish
-furnished
-furnishers
-furnishes
-furnishing
-furnishings
-furniture
-furore
-furores
-furred
-furrier
-furriers
-furriest
-furriness
-furring
-furrow
-furrowed
-furrows
-furry
-furs
-further
-furtherance
-furthered
-furthering
-furthermore
-furthers
-furthest
-furtive
-furtively
-furtiveness
-fury
-furze
-fuse
-fused
-fuselage
-fuses
-fusible
-fusilier
-fusiliers
-fusillade
-fusing
-fusion
-fusions
-fuss
-fussed
-fusses
-fussier
-fussiest
-fussily
-fussiness
-fussing
-fussy
-fustian
-fusty
-futile
-futilely
-futility
-futon
-future
-futures
-futurism
-futurist
-futuristic
-futurists
-futurity
-futurologists
-fuzz
-fuzzed
-fuzzes
-fuzzier
-fuzziest
-fuzzily
-fuzziness
-fuzzy
-gab
-gabble
-gabbled
-gabbles
-gabbling
-gaberdine
-gable
-gabled
-gables
-gabon
-gad
-gadded
-gadding
-gadfly
-gadget
-gadgetry
-gadgets
-gaff
-gaffe
-gaffes
-gag
-gaga
-gage
-gagged
-gagging
-gaggle
-gaggled
-gaging
-gags
-gagster
-gaiety
-gaijin
-gaily
-gain
-gained
-gainer
-gainers
-gainful
-gainfully
-gaining
-gainly
-gains
-gainsay
-gainsaying
-gait
-gaiter
-gaiters
-gaits
-gal
-gala
-galactic
-galas
-galaxies
-galaxy
-gale
-galena
-gales
-galilean
-galileo
-gall
-gallant
-gallantly
-gallantries
-gallantry
-gallants
-galled
-galleon
-galleons
-galleried
-galleries
-gallery
-galley
-galleys
-gallic
-galling
-gallium
-gallivanted
-gallivanting
-gallon
-gallons
-gallop
-galloped
-galloping
-gallops
-gallows
-galls
-gallstones
-galop
-galore
-galoshes
-gals
-galvanic
-galvanise
-galvanised
-galvanising
-galvanometer
-galvanometric
-gambia
-gambian
-gambit
-gambits
-gamble
-gambled
-gambler
-gamblers
-gambles
-gambling
-gambol
-gambolling
-gambols
-game
-gamed
-gamekeeper
-gamekeepers
-gamely
-gamers
-games
-gamesmanship
-gamesmen
-gamete
-gametes
-gaming
-gamma
-gammon
-gamut
-gamy
-gander
-ganders
-gandhi
-gang
-ganged
-ganger
-gangers
-ganges
-ganging
-gangland
-ganglia
-gangling
-ganglion
-ganglionic
-gangly
-gangplank
-gangrene
-gangrenous
-gangs
-gangster
-gangsterism
-gangsters
-gangway
-gangways
-gannet
-gannets
-gantries
-gantry
-gaol
-gaoled
-gaoler
-gaolers
-gaols
-gap
-gape
-gaped
-gapes
-gaping
-gapingly
-gaps
-garage
-garaged
-garages
-garb
-garbage
-garbed
-garble
-garbled
-garbles
-garbling
-garbs
-garden
-gardener
-gardeners
-gardening
-gardens
-gargantuan
-gargle
-gargled
-gargles
-gargling
-gargoyle
-gargoyles
-garish
-garishly
-garland
-garlanded
-garlands
-garlic
-garment
-garments
-garner
-garnered
-garnering
-garnet
-garnets
-garnish
-garnished
-garnishing
-garotte
-garotted
-garottes
-garotting
-garret
-garrets
-garrison
-garrisoned
-garrisons
-garrotte
-garrotted
-garrottes
-garrotting
-garrulous
-garter
-garters
-gas
-gaseous
-gases
-gash
-gashed
-gashes
-gashing
-gasholder
-gasify
-gasket
-gaskets
-gaslight
-gasometer
-gasp
-gasped
-gasper
-gasping
-gasps
-gassed
-gasses
-gassier
-gassiest
-gassing
-gassy
-gastrectomy
-gastric
-gastritis
-gastroenteritis
-gastrointestinal
-gastronomic
-gastronomy
-gastropod
-gastropods
-gasworks
-gate
-gateau
-gateaus
-gateaux
-gatecrash
-gatecrashed
-gatecrasher
-gatecrashers
-gatecrashing
-gated
-gatehouse
-gatehouses
-gatekeeper
-gatekeepers
-gatepost
-gateposts
-gates
-gateway
-gateways
-gather
-gathered
-gatherer
-gatherers
-gathering
-gatherings
-gathers
-gating
-gauche
-gaucheness
-gaucherie
-gaud
-gaudiest
-gaudily
-gaudiness
-gaudy
-gauge
-gauged
-gauges
-gauging
-gaul
-gauls
-gaunt
-gaunter
-gauntlet
-gauntlets
-gauntly
-gauze
-gave
-gavel
-gavial
-gavials
-gavotte
-gawk
-gawking
-gawky
-gawpin
-gay
-gayest
-gays
-gaze
-gazebo
-gazed
-gazelle
-gazelles
-gazes
-gazette
-gazetteer
-gazettes
-gazing
-gdansk
-gear
-gearbox
-gearboxes
-geared
-gearing
-gears
-gearstick
-gecko
-geek
-geeks
-geese
-geezer
-geiger
-geisha
-geishas
-gel
-gelatin
-gelatine
-gelatinous
-gelding
-geldings
-gelignite
-gelled
-gels
-gem
-gemini
-gemmed
-gems
-gemsbok
-gemstone
-gemstones
-gen
-gender
-gendered
-genderless
-genders
-gene
-genealogical
-genealogies
-genealogist
-genealogy
-genera
-general
-generalisable
-generalisation
-generalisations
-generalise
-generalised
-generalises
-generalising
-generalist
-generalists
-generalities
-generality
-generally
-generals
-generalship
-generate
-generated
-generates
-generating
-generation
-generational
-generations
-generative
-generator
-generators
-generic
-generically
-generosities
-generosity
-generous
-generously
-genes
-genesis
-genetic
-genetically
-geneticist
-geneticists
-genetics
-genets
-geneva
-genial
-geniality
-genially
-genie
-genii
-genital
-genitalia
-genitals
-genitive
-genitives
-genius
-geniuses
-genoa
-genocidal
-genocide
-genome
-genomes
-genomic
-genotype
-genotypes
-genre
-genres
-gent
-genteel
-genteelest
-genteelly
-gentians
-gentile
-gentiles
-gentility
-gentle
-gentlefolk
-gentleman
-gentlemanly
-gentlemen
-gentleness
-gentler
-gentlest
-gentling
-gently
-gentrification
-gentrified
-gentrifying
-gentry
-gents
-genuflect
-genuflections
-genuine
-genuinely
-genuineness
-genus
-geocentric
-geochemical
-geochemistry
-geodesic
-geodesics
-geographer
-geographers
-geographic
-geographical
-geographically
-geography
-geologic
-geological
-geologically
-geologist
-geologists
-geology
-geomagnetic
-geomagnetically
-geomagnetism
-geometer
-geometers
-geometric
-geometrical
-geometrically
-geometries
-geometry
-geomorphological
-geomorphologists
-geomorphology
-geophysical
-geophysicist
-geophysicists
-geophysics
-geopolitical
-george
-georgia
-geoscientific
-geostationary
-geosynchronous
-geothermal
-geranium
-geraniums
-gerbil
-gerbils
-geriatric
-geriatrics
-germ
-german
-germane
-germanic
-germanium
-germans
-germany
-germicidal
-germicides
-germinal
-germinate
-germinated
-germinating
-germination
-germs
-gerontocracy
-gerontologist
-gerontology
-gerrymander
-gerrymandered
-gerund
-gerundive
-gestalt
-gestapo
-gestate
-gestating
-gestation
-gestational
-gesticulate
-gesticulated
-gesticulating
-gesticulation
-gesticulations
-gestural
-gesture
-gestured
-gestures
-gesturing
-get
-getable
-getaway
-getrichquick
-gets
-gettable
-getter
-getting
-geyser
-geysers
-ghana
-ghanian
-ghastlier
-ghastliest
-ghastliness
-ghastly
-gherkin
-gherkins
-ghetto
-ghost
-ghosted
-ghosting
-ghostlier
-ghostliest
-ghostlike
-ghostly
-ghosts
-ghoul
-ghoulish
-ghouls
-giant
-giantess
-giantism
-giantkiller
-giantkillers
-giants
-gibber
-gibbered
-gibbering
-gibberish
-gibbet
-gibbets
-gibbon
-gibbons
-gibbous
-gibed
-gibes
-giblets
-giddier
-giddiest
-giddily
-giddiness
-giddy
-gift
-gifted
-gifting
-gifts
-giftware
-gig
-gigabytes
-gigantic
-gigantically
-gigavolt
-giggle
-giggled
-giggles
-giggling
-giggly
-gigolo
-gilded
-gilders
-gilding
-gilds
-gill
-gillie
-gills
-gilt
-giltedged
-gilts
-gimcrack
-gimlet
-gimlets
-gimmick
-gimmickry
-gimmicks
-gimmicky
-gin
-ginger
-gingerbread
-gingerly
-gingers
-gingery
-gingham
-gingivitis
-gins
-ginseng
-gipsies
-gipsy
-giraffe
-giraffes
-gird
-girded
-girder
-girders
-girding
-girdle
-girdled
-girdles
-girdling
-girl
-girlfriend
-girlfriends
-girlhood
-girlie
-girlish
-girlishly
-girlishness
-girls
-giro
-girt
-girth
-girths
-gist
-give
-giveaway
-given
-giver
-givers
-gives
-giving
-givings
-gizzard
-glace
-glacial
-glacially
-glaciated
-glaciation
-glaciations
-glacier
-glaciers
-glaciological
-glaciologist
-glaciologists
-glaciology
-glad
-gladden
-gladdened
-gladdening
-gladdens
-gladder
-gladdest
-glade
-glades
-gladiator
-gladiatorial
-gladiators
-gladioli
-gladiolus
-gladly
-gladness
-glamorous
-glamour
-glance
-glanced
-glances
-glancing
-gland
-glands
-glandular
-glans
-glare
-glared
-glares
-glaring
-glaringly
-glasgow
-glasnost
-glass
-glassed
-glasses
-glassful
-glasshouse
-glasshouses
-glassier
-glassiest
-glassless
-glassware
-glassy
-glaucoma
-glaucous
-glaze
-glazed
-glazer
-glazes
-glazier
-glaziers
-glazing
-gleam
-gleamed
-gleaming
-gleams
-glean
-gleaned
-gleaning
-gleanings
-gleans
-glebe
-glee
-gleeful
-gleefully
-gleefulness
-glen
-glenn
-glens
-glia
-glib
-glibly
-glibness
-glide
-glided
-glider
-gliders
-glides
-gliding
-glim
-glimmer
-glimmered
-glimmering
-glimmerings
-glimmers
-glimpse
-glimpsed
-glimpses
-glimpsing
-glint
-glinted
-glinting
-glints
-glisten
-glistened
-glistening
-glistens
-glitter
-glittered
-glittering
-glitters
-glittery
-glitzy
-gloaming
-gloat
-gloated
-gloating
-glob
-global
-globalisation
-globally
-globe
-globed
-globes
-globetrotters
-globetrotting
-globose
-globular
-globule
-globules
-gloom
-gloomful
-gloomier
-gloomiest
-gloomily
-gloominess
-glooms
-gloomy
-gloried
-glories
-glorification
-glorified
-glorifies
-glorify
-glorifying
-glorious
-gloriously
-glory
-glorying
-gloss
-glossaries
-glossary
-glossed
-glosses
-glossier
-glossiest
-glossily
-glossing
-glossy
-glottal
-glove
-gloved
-gloves
-glow
-glowed
-glower
-glowered
-glowering
-glowers
-glowing
-glowingly
-glows
-glowworm
-glowworms
-glucose
-glue
-glued
-glueing
-glues
-gluey
-gluing
-glum
-glumly
-gluon
-glut
-glutamate
-gluten
-glutinous
-glutted
-glutton
-gluttonous
-gluttons
-gluttony
-glycerine
-glycerol
-glycine
-glycol
-glyph
-glyphs
-gnarl
-gnarled
-gnarling
-gnarls
-gnash
-gnashed
-gnashes
-gnashing
-gnat
-gnats
-gnaw
-gnawed
-gnawer
-gnawers
-gnawing
-gnaws
-gneiss
-gnome
-gnomes
-gnomic
-gnostic
-gnosticism
-gnu
-gnus
-go
-goad
-goaded
-goading
-goads
-goahead
-goal
-goalies
-goalkeeper
-goalkeepers
-goalkeeping
-goalless
-goalmouth
-goalpost
-goalposts
-goals
-goalscorer
-goalscorers
-goalscoring
-goat
-goatee
-goatees
-goats
-goatskin
-gobbet
-gobbets
-gobble
-gobbled
-gobbledegook
-gobbledygook
-gobbler
-gobbles
-gobbling
-gobetween
-gobi
-gobies
-goblet
-goblets
-goblin
-goblins
-god
-godchild
-goddess
-goddesses
-godfather
-godfathers
-godforsaken
-godhead
-godless
-godlessness
-godlier
-godlike
-godliness
-godly
-godmother
-godmothers
-godparents
-gods
-godsend
-godson
-godsons
-goer
-goers
-goes
-goethe
-gofer
-goggled
-goggles
-goggling
-going
-goings
-goitre
-goitres
-gold
-golden
-goldfish
-golds
-goldsmith
-goldsmiths
-golf
-golfer
-golfers
-golfing
-golgotha
-goliath
-golliwog
-golly
-gonad
-gonads
-gondola
-gondolas
-gondolier
-gondoliers
-gone
-gong
-gongs
-gonorrhoea
-goo
-good
-goodbye
-goodbyes
-goodfornothing
-goodfornothings
-goodhope
-goodhumoured
-goodhumouredly
-goodies
-goodish
-goodlooking
-goodly
-goodnatured
-goodnaturedly
-goodness
-goodnight
-goods
-goodtempered
-goodwill
-goody
-gooey
-goof
-goofed
-goofing
-goofs
-goofy
-googlies
-googly
-goon
-goons
-goose
-gooseberries
-gooseberry
-goosestep
-goosestepping
-gopher
-gophers
-gordian
-gore
-gored
-gores
-gorge
-gorged
-gorgeous
-gorgeously
-gorgeousness
-gorges
-gorging
-gorgon
-gorgons
-gorier
-goriest
-gorilla
-gorillas
-goring
-gormless
-gorse
-gory
-gosh
-gosling
-goslings
-goslow
-goslows
-gospel
-gospels
-gossamer
-gossip
-gossiped
-gossiping
-gossips
-gossipy
-got
-goth
-gothic
-goths
-gotten
-gouda
-gouge
-gouged
-gouges
-gouging
-goulash
-gourd
-gourds
-gourmand
-gourmet
-gourmets
-gout
-govern
-governance
-governed
-governess
-governesses
-governing
-government
-governmental
-governments
-governor
-governors
-governorship
-governorships
-governs
-gown
-gowned
-gowns
-grab
-grabbed
-grabber
-grabbers
-grabbing
-grabs
-grace
-graced
-graceful
-gracefully
-gracefulness
-graceless
-gracelessly
-graces
-gracing
-gracious
-graciously
-graciousness
-gradation
-gradations
-grade
-graded
-grader
-graders
-grades
-gradient
-gradients
-grading
-gradings
-gradual
-gradualism
-gradualist
-gradually
-graduand
-graduands
-graduate
-graduated
-graduates
-graduating
-graduation
-graduations
-graffiti
-graffito
-graft
-grafted
-grafting
-grafts
-graham
-grail
-grails
-grain
-grained
-grainier
-grainiest
-graininess
-grains
-grainy
-gram
-grammar
-grammarian
-grammarians
-grammars
-grammatical
-grammatically
-gramme
-grammes
-gramophone
-gramophones
-grams
-granaries
-granary
-grand
-grandads
-grandchild
-grandchildren
-granddad
-granddaughter
-granddaughters
-grandee
-grandees
-grander
-grandest
-grandeur
-grandfather
-grandfathers
-grandiloquent
-grandiose
-grandiosity
-grandly
-grandma
-grandmas
-grandmaster
-grandmasters
-grandmother
-grandmothers
-grandpa
-grandparent
-grandparents
-grandpas
-grands
-grandson
-grandsons
-grandstand
-grange
-granite
-granites
-granitic
-grannie
-grannies
-granny
-grant
-granted
-grantee
-granting
-grants
-granular
-granularity
-granulated
-granulation
-granule
-granules
-granulocyte
-grape
-grapefruit
-grapes
-grapeshot
-grapevine
-graph
-graphed
-graphic
-graphical
-graphically
-graphics
-graphite
-graphologist
-graphologists
-graphology
-graphs
-grapnel
-grapple
-grappled
-grapples
-grappling
-graptolites
-grasp
-grasped
-grasper
-grasping
-grasps
-grass
-grassed
-grasses
-grasshopper
-grasshoppers
-grassier
-grassiest
-grassland
-grasslands
-grassroots
-grassy
-grate
-grated
-grateful
-gratefully
-grater
-graters
-grates
-graticule
-gratification
-gratifications
-gratified
-gratifies
-gratify
-gratifying
-gratifyingly
-grating
-gratings
-gratis
-gratitude
-gratuities
-gratuitous
-gratuitously
-gratuitousness
-gratuity
-grave
-gravedigger
-gravediggers
-gravel
-gravelled
-gravelly
-gravels
-gravely
-graven
-graver
-graves
-graveside
-gravest
-gravestone
-gravestones
-graveyard
-graveyards
-gravies
-gravitas
-gravitate
-gravitated
-gravitating
-gravitation
-gravitational
-gravitationally
-gravities
-graviton
-gravitons
-gravity
-gravures
-gravy
-graze
-grazed
-grazer
-grazes
-grazing
-grease
-greased
-greasepaint
-greaseproof
-greasers
-greases
-greasier
-greasiest
-greasing
-greasy
-great
-greataunt
-greataunts
-greatcoat
-greatcoats
-greater
-greatest
-greatgrandchildren
-greatgranddaughter
-greatgrandfather
-greatgrandmother
-greatgrandmothers
-greatgrandson
-greatly
-greatness
-grecian
-greece
-greed
-greedier
-greediest
-greedily
-greediness
-greeds
-greedy
-greek
-greeks
-green
-greened
-greener
-greenery
-greenest
-greeneyed
-greenfield
-greenfly
-greengages
-greengrocer
-greengrocers
-greengrocery
-greenhorn
-greenhorns
-greenhouse
-greenhouses
-greenie
-greening
-greenish
-greenly
-greenness
-greens
-greenstone
-greensward
-greenwich
-greet
-greeted
-greeting
-greetings
-greets
-gregarious
-gregariously
-gregariousness
-gremlin
-gremlins
-grenade
-grenades
-grenadier
-grenadiers
-grew
-grey
-greybeard
-greyed
-greyer
-greyest
-greyhound
-greyhounds
-greying
-greyish
-greyness
-greys
-grid
-gridded
-gridiron
-gridlock
-grids
-grief
-griefs
-grievance
-grievances
-grieve
-grieved
-griever
-grievers
-grieves
-grieving
-grievous
-grievously
-griffin
-griffins
-griffon
-grill
-grille
-grilled
-grilles
-grilling
-grills
-grim
-grimace
-grimaced
-grimaces
-grimacing
-grime
-grimiest
-grimly
-grimm
-grimmer
-grimmest
-grimness
-grimy
-grin
-grind
-grinded
-grinder
-grinders
-grinding
-grinds
-grindstone
-grinned
-grinner
-grinning
-grins
-grip
-gripe
-griped
-gripes
-griping
-gripped
-gripper
-grippers
-gripping
-grips
-grislier
-grisliest
-grisly
-grist
-gristle
-grit
-grits
-gritted
-grittier
-grittiest
-gritting
-gritty
-grizzled
-grizzlier
-grizzliest
-grizzly
-groan
-groaned
-groaner
-groaners
-groaning
-groans
-groat
-groats
-grocer
-groceries
-grocers
-grocery
-grog
-groggiest
-groggily
-groggy
-groin
-groins
-grommet
-grommets
-groom
-groomed
-groomer
-groomers
-grooming
-grooms
-groove
-grooved
-grooves
-groovier
-grooving
-groovy
-grope
-groped
-groper
-gropers
-gropes
-groping
-gropingly
-gropings
-gross
-grossed
-grosser
-grossest
-grossly
-grossness
-grotesque
-grotesquely
-grotesqueness
-grotto
-grouch
-grouchy
-ground
-grounded
-grounding
-groundless
-groundnut
-groundnuts
-grounds
-groundsheet
-groundsman
-groundswell
-groundwater
-groundwork
-group
-grouped
-grouper
-groupie
-groupies
-grouping
-groupings
-groups
-grouse
-grouses
-grout
-grouting
-grove
-grovel
-grovelled
-groveller
-grovelling
-grovels
-groves
-grow
-grower
-growers
-growing
-growl
-growled
-growler
-growling
-growls
-grown
-grownup
-grownups
-grows
-growth
-growths
-grub
-grubbed
-grubbier
-grubbiest
-grubbing
-grubby
-grubs
-grudge
-grudges
-grudging
-grudgingly
-gruel
-grueling
-gruelling
-gruesome
-gruesomely
-gruesomeness
-gruff
-gruffly
-gruffness
-grumble
-grumbled
-grumbler
-grumbles
-grumbling
-grumblings
-grumpier
-grumpiest
-grumpily
-grumps
-grumpy
-grunge
-grunt
-grunted
-grunter
-grunting
-grunts
-guacamole
-guanaco
-guanine
-guano
-guarantee
-guaranteed
-guaranteeing
-guarantees
-guarantor
-guarantors
-guard
-guarded
-guardedly
-guardedness
-guardhouse
-guardian
-guardians
-guardianship
-guarding
-guardroom
-guards
-guardsman
-guardsmen
-guava
-guavas
-gubernatorial
-gudgeon
-guerilla
-guerillas
-guerrilla
-guerrillas
-guess
-guessable
-guessed
-guesses
-guessing
-guesswork
-guest
-guesting
-guests
-guffaw
-guffawed
-guffaws
-guidance
-guide
-guidebook
-guidebooks
-guided
-guideline
-guidelines
-guider
-guiders
-guides
-guiding
-guidings
-guild
-guilder
-guilders
-guilds
-guile
-guileless
-guilelessness
-guillemot
-guillemots
-guillotine
-guillotined
-guillotines
-guillotining
-guilt
-guiltier
-guiltiest
-guiltily
-guiltiness
-guiltless
-guilts
-guilty
-guinea
-guineas
-guise
-guises
-guitar
-guitarist
-guitarists
-guitars
-gulf
-gulfs
-gulfwar
-gull
-gullet
-gullets
-gulley
-gulleys
-gullibility
-gullible
-gullies
-gulls
-gully
-gulp
-gulped
-gulping
-gulps
-gum
-gumboil
-gumboils
-gumboots
-gumdrop
-gumdrops
-gummed
-gumming
-gums
-gumshoe
-gumtree
-gumtrees
-gun
-gunboat
-gunboats
-gunfight
-gunfire
-gunfires
-gunite
-gunk
-gunman
-gunmen
-gunmetal
-gunned
-gunner
-gunners
-gunnery
-gunning
-gunpoint
-gunpowder
-guns
-gunship
-gunships
-gunshot
-gunshots
-gunsight
-gunsmith
-gunsmiths
-gunwale
-gunwales
-guppies
-guppy
-gurgle
-gurgled
-gurgles
-gurgling
-guru
-gurus
-gush
-gushed
-gusher
-gushes
-gushing
-gusset
-gust
-gusted
-gustier
-gustiest
-gusting
-gusto
-gusts
-gusty
-gut
-gutless
-guts
-gutsier
-gutsy
-gutted
-gutter
-guttered
-guttering
-gutters
-guttersnipe
-guttersnipes
-gutting
-guttural
-gutturally
-guy
-guys
-guzzle
-guzzled
-guzzler
-guzzlers
-guzzling
-gym
-gymkhana
-gymnasia
-gymnasium
-gymnasiums
-gymnast
-gymnastic
-gymnastics
-gymnasts
-gyms
-gynaecological
-gynaecologist
-gynaecologists
-gynaecology
-gypsies
-gypsum
-gypsy
-gyrate
-gyrated
-gyrates
-gyrating
-gyration
-gyrations
-gyro
-gyromagnetic
-gyroscope
-gyroscopes
-gyroscopic
-ha
-haberdasher
-haberdashers
-haberdashery
-habit
-habitability
-habitable
-habitat
-habitation
-habitations
-habitats
-habitforming
-habits
-habitual
-habitually
-habituate
-habituated
-habituation
-hacienda
-hack
-hackable
-hacked
-hacker
-hackers
-hacking
-hackle
-hackles
-hackling
-hackney
-hackneyed
-hacks
-hacksaw
-had
-haddock
-haddocks
-hades
-hadnt
-hadron
-hadrons
-haematological
-haematologist
-haematology
-haematoma
-haematuria
-haemoglobin
-haemolytic
-haemophilia
-haemophiliac
-haemophiliacs
-haemorrhage
-haemorrhages
-haemorrhagic
-haemorrhaging
-haemorrhoid
-haemorrhoids
-haft
-hafts
-hag
-haggard
-haggardness
-haggis
-haggle
-haggled
-haggler
-haggling
-hagiography
-hags
-haha
-haiku
-hail
-hailed
-hailing
-hails
-hailstone
-hailstones
-hailstorm
-hailstorms
-hair
-hairbrush
-haircare
-haircut
-haircuts
-hairdo
-hairdresser
-hairdressers
-hairdressing
-haired
-hairier
-hairiest
-hairiness
-hairless
-hairline
-hairnet
-hairpiece
-hairpin
-hairpins
-hairraising
-hairs
-hairsplitting
-hairspray
-hairsprays
-hairstyle
-hairstyles
-hairstyling
-hairy
-haiti
-haitian
-hake
-hakea
-hale
-half
-halfhearted
-halfheartedly
-halfheartedness
-halfhour
-halfhourly
-halfhours
-halfsister
-halftruth
-halftruths
-halfway
-halibut
-halifax
-halite
-halitosis
-hall
-hallelujah
-hallmark
-hallmarks
-hallo
-hallow
-hallowed
-hallows
-halls
-hallucinate
-hallucinated
-hallucinating
-hallucination
-hallucinations
-hallucinatory
-hallway
-hallways
-halo
-haloed
-halogen
-halogenated
-halogens
-halon
-halons
-halt
-halted
-halter
-haltered
-halters
-halting
-haltingly
-halts
-halve
-halved
-halves
-halving
-ham
-hamburg
-hamburger
-hamburgers
-hamitic
-hamlet
-hamlets
-hammer
-hammered
-hammerhead
-hammering
-hammers
-hammock
-hammocks
-hamper
-hampered
-hampering
-hampers
-hams
-hamster
-hamsters
-hamstring
-hamstrings
-hamstrung
-hand
-handbag
-handbags
-handball
-handbasin
-handbell
-handbill
-handbills
-handbook
-handbooks
-handbrake
-handbrakes
-handcar
-handcart
-handcuff
-handcuffed
-handcuffing
-handcuffs
-handed
-handedness
-handel
-handful
-handfuls
-handgun
-handguns
-handhold
-handholds
-handicap
-handicapped
-handicapping
-handicaps
-handicraft
-handicrafts
-handier
-handiest
-handily
-handing
-handiwork
-handkerchief
-handkerchiefs
-handle
-handlebar
-handlebars
-handled
-handler
-handlers
-handles
-handling
-handmade
-handmaiden
-handmaidens
-handout
-handouts
-handover
-handovers
-handpicked
-handrail
-handrails
-hands
-handset
-handsets
-handshake
-handshakes
-handshaking
-handsome
-handsomely
-handsomeness
-handsomer
-handsomest
-handstand
-handstands
-handwriting
-handwritten
-handy
-handyman
-handymen
-hang
-hangar
-hangars
-hangdog
-hanged
-hanger
-hangers
-hangglide
-hangglided
-hangglider
-hanggliders
-hangglides
-hanggliding
-hanging
-hangings
-hangman
-hangmen
-hangouts
-hangover
-hangovers
-hangs
-hangup
-hanker
-hankered
-hankering
-hankers
-hankie
-hankies
-hanoi
-hanover
-hansard
-hansom
-haphazard
-haphazardly
-hapless
-happen
-happened
-happening
-happenings
-happens
-happier
-happiest
-happily
-happiness
-happy
-happygolucky
-harangue
-harangued
-harangues
-haranguing
-harare
-harass
-harassed
-harassers
-harasses
-harassing
-harassment
-harbinger
-harbingers
-harbour
-harboured
-harbouring
-harbours
-hard
-hardback
-hardbacks
-hardboard
-hardboiled
-hardcore
-hardearned
-harden
-hardened
-hardener
-hardeners
-hardening
-hardens
-harder
-hardest
-hardheaded
-hardhearted
-hardheartedness
-hardhit
-hardhitting
-hardier
-hardiest
-hardily
-hardiness
-hardline
-hardliner
-hardliners
-hardly
-hardness
-hardpressed
-hardship
-hardships
-hardup
-hardware
-hardwood
-hardwoods
-hardworking
-hardy
-hare
-harebell
-harebells
-harebrained
-hared
-harem
-harems
-hares
-hark
-harked
-harken
-harkened
-harkens
-harking
-harks
-harlequin
-harlequins
-harlot
-harlots
-harm
-harmed
-harmer
-harmful
-harmfully
-harmfulness
-harming
-harmless
-harmlessly
-harmlessness
-harmonic
-harmonica
-harmonically
-harmonics
-harmonies
-harmonious
-harmoniously
-harmonisation
-harmonise
-harmonised
-harmonising
-harmonium
-harmony
-harms
-harness
-harnessed
-harnesses
-harnessing
-harp
-harped
-harping
-harpist
-harpists
-harpoon
-harpoons
-harps
-harpsichord
-harpsichords
-harridan
-harried
-harrier
-harriers
-harrow
-harrowed
-harrowing
-harrows
-harry
-harrying
-harsh
-harshen
-harshens
-harsher
-harshest
-harshly
-harshness
-hart
-harts
-harvard
-harvest
-harvested
-harvester
-harvesters
-harvesting
-harvests
-has
-hasbeen
-hasbeens
-hash
-hashed
-hashes
-hashing
-hashish
-hasnt
-hasp
-hassle
-haste
-hasted
-hasten
-hastened
-hastening
-hastens
-hastes
-hastier
-hastiest
-hastily
-hastiness
-hasty
-hat
-hatch
-hatchback
-hatchbacks
-hatched
-hatcheries
-hatchery
-hatches
-hatchet
-hatchets
-hatching
-hatchway
-hate
-hated
-hateful
-hatefully
-hater
-haters
-hates
-hatful
-hating
-hatless
-hatrack
-hatracks
-hatred
-hatreds
-hats
-hatstands
-hatted
-hatter
-hatters
-hattrick
-hattricks
-haughtier
-haughtiest
-haughtily
-haughtiness
-haughty
-haul
-haulage
-haulages
-hauled
-hauler
-haulers
-haulier
-hauliers
-hauling
-haulms
-hauls
-haunch
-haunches
-haunt
-haunted
-haunting
-hauntingly
-haunts
-hauteur
-havana
-have
-haven
-havenots
-havens
-havent
-havering
-haversack
-haves
-having
-havoc
-hawaii
-hawaiian
-hawk
-hawked
-hawker
-hawkers
-hawking
-hawkish
-hawks
-hawser
-hawsers
-hawthorn
-hawthorns
-hay
-haydn
-hayfever
-hayfield
-hayloft
-haystack
-haystacks
-haywain
-haywire
-hazard
-hazarded
-hazarding
-hazardous
-hazards
-haze
-hazel
-hazelnut
-hazelnuts
-hazier
-haziest
-hazily
-haziness
-hazy
-he
-head
-headache
-headaches
-headband
-headbands
-headboard
-headboards
-headcount
-headdress
-headdresses
-headed
-header
-headers
-headfast
-headgear
-headhunted
-headhunters
-headier
-headiest
-heading
-headings
-headlamp
-headlamps
-headland
-headlands
-headless
-headlight
-headlights
-headline
-headlined
-headlines
-headlining
-headlock
-headlong
-headman
-headmaster
-headmasters
-headmastership
-headmen
-headmistress
-headmistresses
-headnote
-headon
-headphone
-headphones
-headpiece
-headquarters
-headrest
-headroom
-heads
-headscarf
-headscarves
-headset
-headsets
-headship
-headstand
-headstock
-headstone
-headstones
-headstrong
-headwaters
-headway
-headwind
-headwinds
-headword
-headwords
-headwork
-heady
-heal
-healed
-healer
-healers
-healing
-heals
-health
-healthful
-healthier
-healthiest
-healthily
-healthiness
-healths
-healthy
-heap
-heaped
-heaping
-heaps
-hear
-hearable
-heard
-hearer
-hearers
-hearing
-hearings
-hearken
-hearkened
-hearkening
-hearkens
-hears
-hearsay
-hearse
-hearses
-heart
-heartache
-heartbeat
-heartbeats
-heartbreak
-heartbreaking
-heartbreaks
-heartbroken
-heartburn
-hearten
-heartened
-heartening
-heartfelt
-hearth
-hearthrug
-hearths
-hearties
-heartiest
-heartily
-heartiness
-heartland
-heartlands
-heartless
-heartlessly
-heartlessness
-heartrending
-hearts
-heartsearching
-heartstrings
-hearttoheart
-heartwarming
-heartwood
-hearty
-heat
-heated
-heatedly
-heater
-heaters
-heath
-heathen
-heathenish
-heathenism
-heathens
-heather
-heathers
-heathery
-heathland
-heaths
-heating
-heatresistant
-heats
-heatwave
-heave
-heaved
-heaveho
-heaven
-heavenly
-heavens
-heavensent
-heavenward
-heavenwards
-heaves
-heavier
-heavies
-heaviest
-heavily
-heaviness
-heaving
-heavings
-heavy
-heavyduty
-heavyweight
-heavyweights
-hebrew
-hebrews
-heck
-heckle
-heckled
-heckler
-hecklers
-heckles
-heckling
-hectare
-hectares
-hectic
-hectically
-hectolitres
-hector
-hectoring
-hedge
-hedged
-hedgehog
-hedgehogs
-hedgerow
-hedgerows
-hedges
-hedging
-hedonism
-hedonist
-hedonistic
-hedonists
-heed
-heeded
-heedful
-heeding
-heedless
-heedlessly
-heedlessness
-heeds
-heel
-heeled
-heels
-heft
-hefted
-heftier
-hefting
-hefty
-hegemonic
-hegemony
-heifer
-heifers
-height
-heighten
-heightened
-heightening
-heightens
-heights
-heinous
-heir
-heiress
-heiresses
-heirloom
-heirlooms
-heirs
-heist
-heists
-held
-helen
-helical
-helices
-helicopter
-helicopters
-heliocentric
-heliography
-heliosphere
-heliotrope
-helipad
-helium
-helix
-helixes
-hell
-hellenic
-hellfire
-hellish
-hellishly
-hello
-hellraiser
-hells
-helm
-helmet
-helmeted
-helmets
-helms
-helmsman
-helots
-help
-helped
-helper
-helpers
-helpful
-helpfully
-helpfulness
-helping
-helpings
-helpless
-helplessly
-helplessness
-helpline
-helplines
-helpmate
-helpmates
-helps
-helsinki
-helterskelter
-hem
-heman
-hemen
-hemisphere
-hemispheres
-hemispheric
-hemispherical
-hemline
-hemlines
-hemlock
-hemmed
-hemming
-hemp
-hems
-hen
-hence
-henceforth
-henceforward
-henchman
-henchmen
-henge
-henna
-henpeck
-henry
-hens
-hepatic
-hepatitis
-heptagon
-heptagonal
-heptagons
-heptane
-her
-herald
-heralded
-heraldic
-heralding
-heraldry
-heralds
-herb
-herbaceous
-herbage
-herbal
-herbalism
-herbalist
-herbalists
-herbicide
-herbicides
-herbivore
-herbivores
-herbivorous
-herbs
-herd
-herded
-herding
-herds
-herdsman
-herdsmen
-here
-hereabouts
-hereafter
-hereby
-hereditary
-heredity
-herein
-hereinafter
-hereof
-heresies
-heresy
-heretic
-heretical
-heretics
-hereto
-heretofore
-hereunder
-hereupon
-herewith
-heritability
-heritable
-heritage
-heritors
-herm
-hermaphrodite
-hermaphrodites
-hermaphroditic
-hermeneutic
-hermeneutics
-hermetic
-hermetically
-hermit
-hermitage
-hermits
-hernia
-hernias
-hero
-herod
-heroic
-heroical
-heroically
-heroics
-heroin
-heroine
-heroines
-heroism
-heron
-heronry
-herons
-herpes
-herring
-herringbone
-herrings
-hers
-herself
-hertz
-hesitancy
-hesitant
-hesitantly
-hesitate
-hesitated
-hesitates
-hesitating
-hesitatingly
-hesitation
-hesitations
-heterodox
-heterodoxy
-heterogeneity
-heterogeneous
-heterologous
-heterosexist
-heterosexual
-heterosexuality
-heterosexually
-heterosexuals
-heterozygous
-heuristic
-heuristically
-heuristics
-hew
-hewed
-hewer
-hewing
-hewn
-hex
-hexadecimal
-hexagon
-hexagonal
-hexagons
-hexagram
-hexagrams
-hexameter
-hexane
-hexed
-hey
-heyday
-heydays
-hi
-hiatus
-hiatuses
-hibernal
-hibernate
-hibernating
-hibernation
-hibiscus
-hic
-hiccough
-hiccup
-hiccups
-hickory
-hid
-hidden
-hide
-hideandseek
-hideaway
-hideaways
-hidebound
-hideous
-hideously
-hideousness
-hideout
-hideouts
-hider
-hides
-hiding
-hidings
-hierarch
-hierarchic
-hierarchical
-hierarchically
-hierarchies
-hierarchy
-hieratic
-hieroglyph
-hieroglyphic
-hieroglyphics
-hieroglyphs
-higgledypiggledy
-high
-highbrow
-higher
-highest
-highhandedness
-highheeled
-highish
-highjack
-highland
-highlander
-highlanders
-highlands
-highlight
-highlighted
-highlighter
-highlighting
-highlights
-highly
-highness
-highpitched
-highpoint
-highranking
-highs
-highspirited
-hight
-highway
-highwayman
-highwaymen
-highways
-hijack
-hijacked
-hijacker
-hijackers
-hijacking
-hijackings
-hijacks
-hike
-hiked
-hiker
-hikers
-hikes
-hiking
-hilarious
-hilariously
-hilarity
-hill
-hilled
-hillier
-hilliest
-hillman
-hillock
-hillocks
-hillocky
-hills
-hillside
-hillsides
-hilltop
-hilltops
-hillwalking
-hilly
-hilt
-hilts
-him
-himself
-hind
-hindbrain
-hinder
-hindered
-hinderer
-hindering
-hinders
-hindmost
-hindquarters
-hindrance
-hindrances
-hindsight
-hindu
-hinduism
-hinge
-hinged
-hinges
-hinnies
-hinny
-hint
-hinted
-hinterland
-hinterlands
-hinting
-hints
-hip
-hipbone
-hippie
-hippies
-hippo
-hippocampus
-hippodrome
-hippopotamus
-hippy
-hips
-hipster
-hipsters
-hire
-hired
-hireling
-hirer
-hires
-hiring
-hirings
-hirsute
-hirsuteness
-his
-hispanic
-hiss
-hissed
-hisses
-hissing
-hissings
-histamine
-histogram
-histograms
-histological
-histologically
-histologists
-histology
-historian
-historians
-historic
-historical
-historically
-historicist
-histories
-historiographical
-historiography
-history
-histrionic
-histrionics
-hit
-hitandrun
-hitch
-hitched
-hitcher
-hitches
-hitchhike
-hitchhiked
-hitchhiker
-hitchhikers
-hitchhiking
-hitching
-hither
-hitherto
-hitler
-hits
-hittable
-hitters
-hitting
-hive
-hived
-hives
-hiving
-hmm
-ho
-hoar
-hoard
-hoarded
-hoarder
-hoarders
-hoarding
-hoardings
-hoards
-hoarfrost
-hoarse
-hoarsely
-hoarseness
-hoarser
-hoary
-hoax
-hoaxed
-hoaxer
-hoaxers
-hoaxes
-hoaxing
-hob
-hobbies
-hobbit
-hobble
-hobbled
-hobbles
-hobbling
-hobby
-hobbyist
-hobbyists
-hobgoblin
-hobgoblins
-hobnailed
-hobnails
-hobo
-hobs
-hock
-hockey
-hocks
-hocus
-hocuspocus
-hod
-hoe
-hoed
-hoeing
-hoes
-hog
-hogg
-hogged
-hogger
-hogging
-hoggs
-hogs
-hogwash
-hoist
-hoisted
-hoisting
-hoists
-hold
-holdable
-holdall
-holdalls
-holder
-holders
-holding
-holdings
-holdout
-holds
-holdup
-holdups
-hole
-holed
-holeinone
-holes
-holiday
-holidaying
-holidaymaker
-holidaymakers
-holidays
-holier
-holies
-holiest
-holily
-holiness
-holing
-holism
-holistic
-holistically
-holland
-holler
-hollered
-hollies
-hollow
-hollowed
-hollowly
-hollowness
-hollows
-holly
-hollyhocks
-holmes
-holocaust
-holocausts
-hologram
-holograms
-holographic
-holography
-holster
-holsters
-holy
-homage
-homages
-hombre
-home
-homecoming
-homecomings
-homed
-homeland
-homelands
-homeless
-homelessness
-homelier
-homeliness
-homely
-homemade
-homeowner
-homeowners
-homes
-homesick
-homesickness
-homespun
-homestead
-homesteads
-homeward
-homewardbound
-homewards
-homework
-homicidal
-homicide
-homicides
-homiest
-homilies
-homily
-homing
-hominid
-hominids
-homoeopathic
-homoeopathy
-homogenates
-homogeneity
-homogeneous
-homogeneously
-homogenisation
-homogenise
-homogenised
-homogenising
-homological
-homologies
-homologous
-homologue
-homologues
-homology
-homomorphism
-homomorphisms
-homonym
-homonyms
-homophobes
-homophobia
-homophobic
-homophones
-homophony
-homosexual
-homosexuality
-homosexually
-homosexuals
-homotopy
-homozygous
-homunculus
-homy
-hone
-honed
-hones
-honest
-honestly
-honesty
-honey
-honeybee
-honeycomb
-honeycombed
-honeycombing
-honeydew
-honeyed
-honeymoon
-honeymooners
-honeymoons
-honeysuckle
-honeysuckles
-honing
-honk
-honking
-honks
-honorarium
-honorary
-honorific
-honors
-honour
-honourable
-honourably
-honoured
-honouring
-honours
-honshu
-hood
-hooded
-hoodlum
-hoodlums
-hoods
-hoodwink
-hoodwinked
-hoodwinking
-hoof
-hoofs
-hook
-hookah
-hooked
-hooker
-hookers
-hooking
-hooknosed
-hooks
-hooky
-hooligan
-hooliganism
-hooligans
-hoop
-hooped
-hoops
-hooray
-hoot
-hooted
-hooter
-hooters
-hooting
-hoots
-hoover
-hoovered
-hoovering
-hooves
-hop
-hope
-hoped
-hopeful
-hopefully
-hopefulness
-hopefuls
-hopeless
-hopelessly
-hopelessness
-hopes
-hoping
-hopped
-hopper
-hoppers
-hopping
-hops
-horde
-hordes
-horizon
-horizons
-horizontal
-horizontally
-horizontals
-hormonal
-hormonally
-hormone
-hormones
-horn
-hornbeam
-hornbills
-horned
-hornet
-hornets
-hornpipe
-hornpipes
-horns
-horny
-horoscope
-horoscopes
-horrendous
-horrendously
-horrible
-horribly
-horrid
-horridly
-horrific
-horrifically
-horrified
-horrifies
-horrify
-horrifying
-horrifyingly
-horror
-horrors
-horrorstricken
-horse
-horseback
-horsebox
-horseflesh
-horsefly
-horsehair
-horseless
-horseman
-horsemen
-horseplay
-horsepower
-horseradish
-horses
-horseshoe
-horseshoes
-horsewhip
-horsewhipped
-horsey
-horsing
-horticultural
-horticulture
-horticulturist
-horticulturists
-hosanna
-hosannas
-hose
-hosed
-hosepipe
-hoses
-hosier
-hosiery
-hosing
-hospice
-hospices
-hospitable
-hospitably
-hospital
-hospitalisation
-hospitalised
-hospitality
-hospitals
-host
-hosta
-hostage
-hostages
-hosted
-hostel
-hostelries
-hostelry
-hostels
-hostess
-hostesses
-hostile
-hostilely
-hostilities
-hostility
-hosting
-hostler
-hosts
-hot
-hotair
-hotbed
-hotbeds
-hotblooded
-hotchpotch
-hotdog
-hotdogs
-hotel
-hotelier
-hoteliers
-hotels
-hotheaded
-hotheads
-hothouse
-hothouses
-hotline
-hotly
-hotness
-hotplate
-hotplates
-hotpot
-hotrod
-hotspot
-hotspots
-hottempered
-hotter
-hottest
-hotting
-hound
-hounded
-hounding
-hounds
-hour
-hourglass
-hourly
-hours
-house
-houseboat
-houseboats
-housebound
-housebreaker
-housebreakers
-housebreaking
-housebuilder
-housebuilders
-housebuilding
-housebuyers
-housed
-houseflies
-houseful
-household
-householder
-householders
-households
-househunting
-housekeeper
-housekeepers
-housekeeping
-housemaid
-housemaids
-houseroom
-houses
-housewife
-housewives
-housework
-housing
-housings
-houston
-hove
-hovel
-hovels
-hover
-hovercraft
-hovered
-hoverer
-hovering
-hovers
-how
-howdy
-however
-howitzer
-howitzers
-howl
-howled
-howler
-howlers
-howling
-howlings
-howls
-howsoever
-hub
-hubbies
-hubbub
-hubby
-hubcap
-hubcaps
-hubris
-hubristic
-hubs
-huckleberry
-huddle
-huddled
-huddles
-huddling
-hue
-hues
-huff
-huffed
-huffily
-huffing
-huffy
-hug
-huge
-hugely
-hugeness
-hugged
-hugging
-hugs
-huguenot
-huh
-hulk
-hulking
-hulks
-hull
-hullabaloo
-hulled
-hullo
-hulls
-hum
-human
-humane
-humanely
-humaner
-humanise
-humanised
-humanising
-humanism
-humanist
-humanistic
-humanists
-humanitarian
-humanitarianism
-humanities
-humanity
-humankind
-humanly
-humanness
-humanoid
-humanoids
-humans
-humble
-humbled
-humbleness
-humbler
-humbles
-humblest
-humbling
-humbly
-humbug
-humbugs
-humdrum
-humerus
-humid
-humidifier
-humidifiers
-humidity
-humify
-humiliate
-humiliated
-humiliates
-humiliating
-humiliatingly
-humiliation
-humiliations
-humility
-hummable
-hummed
-hummer
-humming
-hummingbird
-hummingbirds
-hummock
-hummocks
-hummocky
-humorist
-humorous
-humorously
-humour
-humoured
-humouring
-humourless
-humours
-hump
-humpback
-humped
-humping
-humps
-hums
-humus
-hunch
-hunchback
-hunchbacked
-hunched
-hunches
-hunching
-hundred
-hundredfold
-hundreds
-hundredth
-hundredths
-hundredweight
-hundredweights
-hung
-hungary
-hunger
-hungered
-hungering
-hungers
-hungrier
-hungriest
-hungrily
-hungry
-hunk
-hunkers
-hunks
-hunt
-hunted
-hunter
-huntergatherer
-huntergatherers
-hunters
-hunting
-hunts
-huntsman
-huntsmen
-hurdle
-hurdled
-hurdler
-hurdlers
-hurdles
-hurl
-hurled
-hurling
-hurls
-hurlyburly
-hurrah
-hurrahs
-hurray
-hurricane
-hurricanes
-hurried
-hurriedly
-hurries
-hurry
-hurrying
-hurt
-hurtful
-hurting
-hurtle
-hurtled
-hurtles
-hurtling
-hurts
-husband
-husbandman
-husbandmen
-husbandry
-husbands
-hush
-hushed
-hushes
-hushhush
-hushing
-husk
-husked
-huskier
-huskies
-huskiest
-huskily
-husks
-husky
-hussies
-hussy
-hustings
-hustle
-hustled
-hustler
-hustlers
-hustles
-hustling
-hut
-hutch
-hutches
-huts
-hyacinth
-hyacinths
-hyaena
-hyaenas
-hybrid
-hybridisation
-hybridised
-hybrids
-hydra
-hydrangea
-hydrangeas
-hydrant
-hydrants
-hydrate
-hydrated
-hydration
-hydraulic
-hydraulically
-hydraulics
-hydrazine
-hydride
-hydro
-hydrocarbon
-hydrocarbons
-hydrochloric
-hydrochloride
-hydrodynamic
-hydrodynamical
-hydrodynamics
-hydroelectric
-hydroelectricity
-hydrofluoric
-hydrofoil
-hydrofoils
-hydrogen
-hydrogenated
-hydrogenation
-hydrographer
-hydrographic
-hydrological
-hydrologically
-hydrologists
-hydrology
-hydrolysis
-hydromagnetic
-hydromechanics
-hydrophobia
-hydrophobic
-hydroponically
-hydrosphere
-hydrostatic
-hydrostatics
-hydrothermal
-hydrous
-hydroxide
-hydroxides
-hyena
-hyenas
-hygiene
-hygienic
-hygienically
-hygienist
-hygienists
-hygroscopic
-hymen
-hymens
-hymn
-hymnal
-hymnbook
-hymns
-hype
-hyperactive
-hyperactivity
-hyperbola
-hyperbolas
-hyperbole
-hyperbolic
-hyperboloid
-hyperboloids
-hypercholesterolaemia
-hypercube
-hypercubes
-hyperfine
-hyperinflation
-hypermarket
-hypermarkets
-hyperplane
-hyperplanes
-hypersensitive
-hypersensitiveness
-hypersensitivity
-hypersonic
-hyperspace
-hypersphere
-hypertension
-hypertext
-hypertonic
-hyperventilated
-hyperventilating
-hyperventilation
-hyphen
-hyphenate
-hyphenated
-hyphenates
-hyphenating
-hyphenation
-hyphenations
-hyphened
-hyphens
-hypnosis
-hypnotherapists
-hypnotherapy
-hypnotic
-hypnotically
-hypnotise
-hypnotised
-hypnotises
-hypnotising
-hypnotism
-hypnotist
-hypochondria
-hypochondriac
-hypochondriacal
-hypochondriacs
-hypocrisies
-hypocrisy
-hypocrite
-hypocrites
-hypocritical
-hypocritically
-hypodermic
-hypoglycaemia
-hypoglycaemic
-hypotension
-hypothalamus
-hypothermia
-hypotheses
-hypothesis
-hypothesise
-hypothesised
-hypothesiser
-hypothesises
-hypothesising
-hypothetical
-hypothetically
-hypoxia
-hyssop
-hysterectomy
-hysteresis
-hysteria
-hysteric
-hysterical
-hysterically
-hysterics
-iambic
-iambus
-iatrogenic
-iberia
-iberian
-ibex
-ibexes
-ibis
-ibises
-ibsen
-icarus
-ice
-iceage
-iceberg
-icebergs
-icebox
-icecap
-icecold
-icecream
-iced
-iceland
-iceman
-icepack
-icepick
-icepicks
-ices
-iceskate
-iceskating
-ichneumon
-icicle
-icicles
-icier
-iciest
-icily
-iciness
-icing
-icings
-icon
-iconic
-iconoclasm
-iconoclast
-iconoclastic
-iconoclasts
-iconographic
-iconographical
-iconography
-icons
-icosahedra
-icosahedral
-icosahedron
-icy
-id
-idaho
-idea
-ideal
-idealisation
-idealisations
-idealise
-idealised
-idealises
-idealising
-idealism
-idealist
-idealistic
-idealistically
-idealists
-ideality
-ideally
-ideals
-ideas
-idem
-identical
-identically
-identifiable
-identifiably
-identification
-identifications
-identified
-identifier
-identifiers
-identifies
-identify
-identifying
-identities
-identity
-ideograms
-ideographic
-ideographs
-ideological
-ideologically
-ideologies
-ideologist
-ideologists
-ideologue
-ideologues
-ideology
-ides
-idiocies
-idiocy
-idiolect
-idiom
-idiomatic
-idiomatically
-idioms
-idiopathic
-idiosyncrasies
-idiosyncrasy
-idiosyncratic
-idiosyncratically
-idiot
-idiotic
-idiotically
-idiots
-idle
-idled
-idleness
-idler
-idlers
-idles
-idlest
-idling
-idly
-idol
-idolaters
-idolatrous
-idolatry
-idolisation
-idolise
-idolised
-idols
-ids
-idyll
-idyllic
-idyllically
-if
-ifs
-igloo
-igloos
-iglu
-igneous
-ignite
-ignited
-igniter
-ignites
-igniting
-ignition
-ignoble
-ignobly
-ignominious
-ignominiously
-ignominy
-ignorable
-ignoramus
-ignoramuses
-ignorance
-ignorant
-ignorantly
-ignore
-ignored
-ignores
-ignoring
-iguana
-iguanas
-ileum
-iliad
-ilk
-ill
-illadvised
-illbehaved
-illconceived
-illdefined
-illegal
-illegalities
-illegality
-illegally
-illegibility
-illegible
-illegibly
-illegitimacy
-illegitimate
-illegitimately
-illequipped
-illfated
-illfavoured
-illhumoured
-illiberal
-illicit
-illicitly
-illimitable
-illinformed
-illinois
-illiquid
-illiteracy
-illiterate
-illiterates
-illmannered
-illness
-illnesses
-illogic
-illogical
-illogicality
-illogically
-ills
-illtempered
-illtreated
-illuminant
-illuminate
-illuminated
-illuminates
-illuminating
-illumination
-illuminations
-illumine
-illusion
-illusionist
-illusionists
-illusions
-illusive
-illusory
-illustrate
-illustrated
-illustrates
-illustrating
-illustration
-illustrations
-illustrative
-illustrator
-illustrators
-illustrious
-ilmenite
-im
-image
-imaged
-imagery
-images
-imaginable
-imaginary
-imagination
-imaginations
-imaginative
-imaginatively
-imagine
-imagined
-imagines
-imaging
-imagining
-imaginings
-imago
-imam
-imams
-imbalance
-imbalanced
-imbalances
-imbecile
-imbeciles
-imbecilic
-imbecilities
-imbecility
-imbedded
-imbeds
-imbibe
-imbibed
-imbiber
-imbibers
-imbibing
-imbroglio
-imbue
-imbued
-imitate
-imitated
-imitates
-imitating
-imitation
-imitations
-imitative
-imitator
-imitators
-immaculate
-immaculately
-immanence
-immanent
-immanently
-immaterial
-immature
-immaturely
-immaturity
-immeasurable
-immeasurably
-immediacy
-immediate
-immediately
-immediateness
-immemorial
-immense
-immensely
-immenseness
-immensities
-immensity
-immerse
-immersed
-immerses
-immersing
-immersion
-immigrant
-immigrants
-immigrate
-immigrated
-immigrating
-immigration
-immigrations
-imminence
-imminent
-imminently
-immiscible
-immobile
-immobilisation
-immobilise
-immobilised
-immobiliser
-immobilises
-immobilising
-immobility
-immoderate
-immoderately
-immodest
-immolate
-immolated
-immolation
-immoral
-immorality
-immorally
-immortal
-immortalised
-immortality
-immortally
-immortals
-immovability
-immovable
-immoveable
-immune
-immunisation
-immunisations
-immunise
-immunised
-immunises
-immunities
-immunity
-immunoassay
-immunocompromised
-immunodeficiency
-immunological
-immunologically
-immunologist
-immunologists
-immunology
-immunosuppression
-immunosuppressive
-immured
-immutability
-immutable
-immutably
-imp
-impact
-impacted
-impacting
-impaction
-impacts
-impair
-impaired
-impairing
-impairment
-impairments
-impairs
-impala
-impalas
-impale
-impaled
-impaler
-impales
-impaling
-impalpable
-impart
-imparted
-impartial
-impartiality
-impartially
-imparting
-imparts
-impassable
-impasse
-impassioned
-impassive
-impassively
-impassiveness
-impassivity
-impatience
-impatient
-impatiently
-impeach
-impeached
-impeaches
-impeachment
-impeachments
-impeccable
-impeccably
-impecunious
-impedance
-impede
-impeded
-impedes
-impediment
-impedimenta
-impediments
-impeding
-impel
-impelled
-impelling
-impels
-impend
-impending
-impenetrability
-impenetrable
-impenetrably
-imperative
-imperatively
-imperatives
-imperceptible
-imperceptibly
-imperfect
-imperfection
-imperfections
-imperfectly
-imperial
-imperialism
-imperialist
-imperialistic
-imperialists
-imperially
-imperil
-imperilled
-imperious
-imperiously
-imperiousness
-imperishable
-imperium
-impermanence
-impermanent
-impermeability
-impermeable
-impermissible
-impersonal
-impersonality
-impersonally
-impersonate
-impersonated
-impersonates
-impersonating
-impersonation
-impersonations
-impersonator
-impersonators
-impertinence
-impertinent
-impertinently
-imperturbability
-imperturbable
-imperturbably
-impervious
-impetuosity
-impetuous
-impetuously
-impetus
-impi
-impiety
-impinge
-impinged
-impingement
-impinges
-impinging
-impious
-impish
-impishly
-impishness
-implacable
-implacably
-implant
-implantation
-implanted
-implanting
-implants
-implausibility
-implausible
-implausibly
-implement
-implementable
-implementation
-implementations
-implemented
-implementer
-implementers
-implementing
-implements
-implicate
-implicated
-implicates
-implicating
-implication
-implications
-implicit
-implicitly
-implied
-impliedly
-implies
-implode
-imploded
-implodes
-imploding
-implore
-implored
-implores
-imploring
-imploringly
-implosion
-imply
-implying
-impolite
-impoliteness
-impolitic
-imponderable
-imponderables
-import
-importable
-importance
-important
-importantly
-importation
-imported
-importer
-importers
-importing
-imports
-importunate
-importunately
-importune
-importuned
-importunity
-imposable
-impose
-imposed
-imposes
-imposing
-imposition
-impositions
-impossibilities
-impossibility
-impossible
-impossibly
-imposter
-imposters
-impostor
-impostors
-impotence
-impotency
-impotent
-impotently
-impound
-impounded
-impounding
-impoverish
-impoverished
-impoverishing
-impoverishment
-impracticability
-impracticable
-impractical
-impracticalities
-impracticality
-impractically
-imprecation
-imprecations
-imprecise
-imprecisely
-impreciseness
-imprecision
-impregnable
-impregnably
-impregnate
-impregnated
-impregnating
-impregnation
-impresario
-impress
-impressed
-impresses
-impressing
-impression
-impressionable
-impressionism
-impressionist
-impressionistic
-impressionists
-impressions
-impressive
-impressively
-impressiveness
-imprimatur
-imprint
-imprinted
-imprinting
-imprints
-imprison
-imprisoned
-imprisoning
-imprisonment
-imprisonments
-imprisons
-improbabilities
-improbability
-improbable
-improbably
-impromptu
-improper
-improperly
-improprieties
-impropriety
-improvable
-improve
-improved
-improvement
-improvements
-improver
-improves
-improvidence
-improvident
-improving
-improvisation
-improvisational
-improvisations
-improvisatory
-improvise
-improvised
-improvises
-improvising
-imprudence
-imprudent
-imprudently
-imps
-impudence
-impudent
-impudently
-impugn
-impugnable
-impugned
-impugning
-impulse
-impulses
-impulsion
-impulsive
-impulsively
-impulsiveness
-impunity
-impure
-impurities
-impurity
-imputation
-imputations
-impute
-imputed
-imputing
-in
-inabilities
-inability
-inaccessibility
-inaccessible
-inaccuracies
-inaccuracy
-inaccurate
-inaccurately
-inaction
-inactivated
-inactivating
-inactivation
-inactive
-inactivity
-inadequacies
-inadequacy
-inadequate
-inadequately
-inadmissible
-inadvertence
-inadvertent
-inadvertently
-inadvisability
-inadvisable
-inadvisedly
-inalienable
-inane
-inanely
-inanimate
-inanities
-inanity
-inapplicability
-inapplicable
-inappropriate
-inappropriately
-inappropriateness
-inaptly
-inarticulacy
-inarticulate
-inarticulateness
-inasmuch
-inattention
-inattentive
-inattentively
-inaudibility
-inaudible
-inaudibly
-inaugural
-inaugurate
-inaugurated
-inaugurates
-inaugurating
-inauguration
-inauspicious
-inauspiciously
-inauthenticity
-inboard
-inborn
-inbound
-inbred
-inbreeding
-inbuilt
-inca
-incalculable
-incalculably
-incandescence
-incandescent
-incandescently
-incant
-incantation
-incantations
-incantatory
-incapability
-incapable
-incapacitate
-incapacitated
-incapacitates
-incapacitating
-incapacitation
-incapacity
-incarcerated
-incarcerating
-incarceration
-incarnate
-incarnated
-incarnation
-incarnations
-incas
-incased
-incautious
-incautiously
-incendiaries
-incendiary
-incense
-incensed
-incenses
-incensing
-incentive
-incentives
-inception
-incessant
-incessantly
-incest
-incests
-incestuous
-incestuousness
-inch
-inched
-inches
-inching
-inchoate
-incidence
-incidences
-incident
-incidental
-incidentally
-incidents
-incinerate
-incinerated
-incinerates
-incinerating
-incineration
-incinerator
-incinerators
-incipient
-incised
-incision
-incisions
-incisive
-incisively
-incisiveness
-incisor
-incisors
-incite
-incited
-incitement
-incitements
-inciter
-inciters
-incites
-inciting
-inclemency
-inclement
-inclination
-inclinations
-incline
-inclined
-inclines
-inclining
-include
-included
-includes
-including
-inclusion
-inclusions
-inclusive
-inclusively
-inclusiveness
-incognito
-incoherence
-incoherency
-incoherent
-incoherently
-incombustible
-income
-incomer
-incomers
-incomes
-incoming
-incommensurable
-incommoding
-incommunicable
-incommunicado
-incomparable
-incomparably
-incompatibilities
-incompatibility
-incompatible
-incompatibly
-incompetence
-incompetent
-incompetently
-incompetents
-incomplete
-incompletely
-incompleteness
-incomprehensibility
-incomprehensible
-incomprehensibly
-incomprehension
-incompressible
-inconceivable
-inconceivably
-inconclusive
-inconclusively
-incongruities
-incongruity
-incongruous
-incongruously
-inconsequential
-inconsequentially
-inconsiderable
-inconsiderate
-inconsiderately
-inconsiderateness
-inconsistencies
-inconsistency
-inconsistent
-inconsistently
-inconsolable
-inconsolably
-inconspicuous
-inconspicuously
-inconspicuousness
-inconstancy
-inconstant
-incontestable
-incontestably
-incontinence
-incontinent
-incontinently
-incontrovertible
-incontrovertibly
-inconvenience
-inconvenienced
-inconveniences
-inconveniencing
-inconvenient
-inconveniently
-incorporable
-incorporate
-incorporated
-incorporates
-incorporating
-incorporation
-incorrect
-incorrectly
-incorrectness
-incorrigible
-incorrigibly
-incorruptible
-increase
-increased
-increases
-increasing
-increasingly
-incredible
-incredibly
-incredulity
-incredulous
-incredulously
-increment
-incremental
-incrementally
-incrementation
-incremented
-incrementing
-increments
-incriminate
-incriminated
-incriminates
-incriminating
-incrimination
-incubate
-incubated
-incubating
-incubation
-incubations
-incubator
-incubators
-inculcate
-inculcated
-inculcating
-inculcation
-incumbency
-incumbent
-incumbents
-incur
-incurable
-incurably
-incuriously
-incurred
-incurring
-incurs
-incursion
-incursions
-indaba
-indebted
-indebtedness
-indecency
-indecent
-indecently
-indecipherable
-indecision
-indecisive
-indecisively
-indecisiveness
-indeclinable
-indecorous
-indeed
-indefatigable
-indefeasible
-indefensible
-indefinable
-indefinably
-indefinite
-indefinitely
-indelible
-indelibly
-indelicacy
-indelicate
-indemnified
-indemnify
-indemnities
-indemnity
-indent
-indentation
-indentations
-indented
-indenting
-indents
-indentures
-independence
-independent
-independently
-independents
-indepth
-indescribable
-indescribably
-indestructibility
-indestructible
-indeterminable
-indeterminacy
-indeterminate
-index
-indexation
-indexed
-indexer
-indexers
-indexes
-indexing
-india
-indian
-indiana
-indians
-indicant
-indicants
-indicate
-indicated
-indicates
-indicating
-indication
-indications
-indicative
-indicator
-indicators
-indices
-indict
-indictable
-indicted
-indicting
-indictment
-indictments
-indicts
-indifference
-indifferent
-indifferently
-indigenous
-indigestible
-indigestion
-indignant
-indignantly
-indignation
-indignities
-indignity
-indigo
-indirect
-indirection
-indirections
-indirectly
-indirectness
-indiscipline
-indiscreet
-indiscreetly
-indiscretion
-indiscretions
-indiscriminate
-indiscriminately
-indispensability
-indispensable
-indispensably
-indispose
-indisposed
-indisposition
-indisputable
-indisputably
-indissoluble
-indissolubly
-indistinct
-indistinctly
-indistinctness
-indistinguishable
-indistinguishably
-indite
-individual
-individualised
-individualism
-individualist
-individualistic
-individualists
-individuality
-individually
-individuals
-individuation
-indivisibility
-indivisible
-indivisibly
-indoctrinate
-indoctrinated
-indoctrinates
-indoctrinating
-indoctrination
-indoctrinations
-indoctrinator
-indoctrinators
-indole
-indolence
-indolent
-indolently
-indomitable
-indoor
-indoors
-indorsed
-indorses
-indrawn
-indubitable
-indubitably
-induce
-induced
-inducement
-inducements
-induces
-inducible
-inducing
-induct
-inductance
-inducted
-induction
-inductions
-inductive
-inductively
-inductor
-inductors
-inducts
-indulge
-indulged
-indulgence
-indulgences
-indulgent
-indulgently
-indulger
-indulges
-indulging
-induna
-industrial
-industrialisation
-industrialise
-industrialised
-industrialising
-industrialism
-industrialist
-industrialists
-industrially
-industries
-industrious
-industriously
-industriousness
-industry
-inebriate
-inebriated
-inebriation
-inedible
-ineffable
-ineffective
-ineffectively
-ineffectiveness
-ineffectual
-ineffectually
-ineffectualness
-inefficiencies
-inefficiency
-inefficient
-inefficiently
-inelastic
-inelegance
-inelegant
-inelegantly
-ineligibility
-ineligible
-ineluctable
-ineluctably
-inept
-ineptitude
-ineptly
-ineptness
-inequalities
-inequality
-inequitable
-inequities
-inequity
-ineradicable
-ineradicably
-inert
-inertia
-inertial
-inertness
-inescapable
-inescapably
-inessential
-inestimable
-inestimably
-inevitability
-inevitable
-inevitably
-inexact
-inexactitude
-inexactitudes
-inexcusable
-inexcusably
-inexhaustible
-inexhaustibly
-inexorability
-inexorable
-inexorably
-inexpedient
-inexpensive
-inexpensively
-inexperience
-inexperienced
-inexpert
-inexpertly
-inexplicable
-inexplicably
-inexpressibility
-inexpressible
-inexpressibly
-inextensible
-inextinguishable
-inextricable
-inextricably
-infallibility
-infallible
-infallibly
-infamous
-infamously
-infamy
-infancy
-infant
-infanta
-infante
-infanticide
-infantile
-infantry
-infantryman
-infantrymen
-infants
-infarct
-infarction
-infarctions
-infatuate
-infatuated
-infatuation
-infatuations
-infeasibility
-infeasible
-infect
-infected
-infecting
-infection
-infections
-infectious
-infectiously
-infective
-infects
-infelicities
-infelicitous
-infelicitously
-infelicity
-infer
-inference
-inferences
-inferential
-inferentially
-inferior
-inferiority
-inferiors
-infernal
-infernally
-inferno
-inferred
-inferring
-infers
-infertile
-infertility
-infest
-infestation
-infestations
-infested
-infesting
-infests
-infidel
-infidelities
-infidelity
-infidels
-infield
-infighting
-infill
-infilling
-infiltrate
-infiltrated
-infiltrates
-infiltrating
-infiltration
-infiltrations
-infiltrator
-infiltrators
-infinite
-infinitely
-infinitesimal
-infinitesimally
-infinitesimals
-infinities
-infinitive
-infinitives
-infinitude
-infinity
-infirm
-infirmaries
-infirmary
-infirmities
-infirmity
-infix
-inflame
-inflamed
-inflames
-inflaming
-inflammable
-inflammation
-inflammatory
-inflatable
-inflate
-inflated
-inflates
-inflating
-inflation
-inflationary
-inflect
-inflected
-inflecting
-inflection
-inflectional
-inflections
-inflects
-inflexibility
-inflexible
-inflexibly
-inflexion
-inflexions
-inflict
-inflicted
-inflicter
-inflicting
-infliction
-inflictions
-inflicts
-inflow
-inflowing
-inflows
-influence
-influenced
-influences
-influencing
-influential
-influenza
-influx
-influxes
-info
-inform
-informal
-informality
-informally
-informant
-informants
-informatics
-information
-informational
-informative
-informatively
-informativeness
-informatory
-informed
-informer
-informers
-informing
-informs
-infra
-infraction
-infractions
-infrared
-infrastructural
-infrastructure
-infrastructures
-infrequency
-infrequent
-infrequently
-infringe
-infringed
-infringement
-infringements
-infringes
-infringing
-infuriate
-infuriated
-infuriates
-infuriating
-infuriatingly
-infuse
-infused
-infuses
-infusing
-infusion
-infusions
-ingathered
-ingenious
-ingeniously
-ingenuity
-ingenuous
-ingenuously
-ingenuousness
-ingest
-ingested
-ingesting
-ingestion
-inglorious
-ingoing
-ingot
-ingots
-ingrained
-ingrate
-ingratiate
-ingratiated
-ingratiating
-ingratiatingly
-ingratitude
-ingredient
-ingredients
-ingress
-ingression
-ingrown
-inhabit
-inhabitable
-inhabitant
-inhabitants
-inhabited
-inhabiting
-inhabits
-inhalant
-inhalation
-inhalations
-inhale
-inhaled
-inhaler
-inhalers
-inhales
-inhaling
-inherent
-inherently
-inherit
-inheritable
-inheritance
-inheritances
-inherited
-inheriting
-inheritor
-inheritors
-inherits
-inhibit
-inhibited
-inhibiting
-inhibition
-inhibitions
-inhibitor
-inhibitors
-inhibitory
-inhibits
-inhomogeneities
-inhomogeneity
-inhomogeneous
-inhospitable
-inhouse
-inhuman
-inhumane
-inhumanely
-inhumanities
-inhumanity
-inhumanly
-inimical
-inimitable
-inimitably
-iniquities
-iniquitous
-iniquitously
-iniquity
-initial
-initialisation
-initialisations
-initialise
-initialised
-initialises
-initialising
-initialled
-initially
-initials
-initiate
-initiated
-initiates
-initiating
-initiation
-initiations
-initiative
-initiatives
-initiator
-initiators
-inject
-injectable
-injected
-injecting
-injection
-injections
-injector
-injects
-injoke
-injokes
-injudicious
-injudiciously
-injunction
-injunctions
-injure
-injured
-injures
-injuries
-injuring
-injurious
-injuriously
-injury
-injustice
-injustices
-ink
-inked
-inkier
-inkiest
-inking
-inkling
-inklings
-inkpad
-inkpot
-inkpots
-inks
-inkstand
-inkstands
-inkwell
-inkwells
-inky
-inlaid
-inland
-inlaw
-inlaws
-inlay
-inlays
-inlet
-inlets
-inmate
-inmates
-inmost
-inn
-innards
-innate
-innately
-inner
-innermost
-innervation
-innings
-innkeeper
-innkeepers
-innocence
-innocent
-innocently
-innocents
-innocuous
-innocuousness
-innovate
-innovated
-innovating
-innovation
-innovations
-innovative
-innovatively
-innovator
-innovators
-innovatory
-inns
-innuendo
-innumerable
-innumerably
-innumeracy
-innumerate
-inoculate
-inoculated
-inoculates
-inoculating
-inoculation
-inoculations
-inoffensive
-inoperable
-inoperative
-inopportune
-inordinate
-inordinately
-inorganic
-input
-inputs
-inputting
-inquest
-inquests
-inquire
-inquired
-inquirer
-inquirers
-inquires
-inquiries
-inquiring
-inquiringly
-inquiry
-inquisition
-inquisitional
-inquisitions
-inquisitive
-inquisitively
-inquisitiveness
-inquisitor
-inquisitorial
-inquisitorially
-inquisitors
-inquorate
-inroad
-inroads
-inrush
-ins
-insalubrious
-insane
-insanely
-insanitary
-insanities
-insanity
-insatiable
-insatiably
-inscribe
-inscribed
-inscribing
-inscription
-inscriptions
-inscrutability
-inscrutable
-inscrutably
-insect
-insecticidal
-insecticide
-insecticides
-insectivores
-insectivorous
-insects
-insecure
-insecurely
-insecurities
-insecurity
-insemination
-insensibility
-insensible
-insensibly
-insensitive
-insensitively
-insensitivity
-inseparable
-inseparably
-insert
-inserted
-inserting
-insertion
-insertions
-inserts
-inset
-insets
-inshore
-inside
-insideout
-insider
-insiders
-insides
-insidious
-insidiously
-insight
-insightful
-insights
-insignia
-insignificance
-insignificant
-insignificantly
-insincere
-insincerely
-insincerity
-insinuate
-insinuated
-insinuating
-insinuatingly
-insinuation
-insinuations
-insipid
-insist
-insisted
-insistence
-insistent
-insistently
-insisting
-insists
-insofar
-insole
-insolence
-insolent
-insolently
-insolubility
-insoluble
-insolvencies
-insolvency
-insolvent
-insomnia
-insomniac
-insomniacs
-insouciance
-insouciant
-inspect
-inspected
-inspecting
-inspection
-inspections
-inspector
-inspectorate
-inspectorates
-inspectors
-inspects
-inspiration
-inspirational
-inspirations
-inspire
-inspired
-inspires
-inspiring
-instabilities
-instability
-install
-installable
-installation
-installations
-installed
-installer
-installers
-installing
-installs
-instalment
-instalments
-instance
-instanced
-instances
-instancy
-instant
-instantaneous
-instantaneously
-instantiate
-instantiated
-instantiates
-instantiating
-instantiation
-instantiations
-instantly
-instants
-instated
-instead
-instep
-insteps
-instigate
-instigated
-instigates
-instigating
-instigation
-instigator
-instigators
-instil
-instillation
-instilled
-instilling
-instills
-instils
-instinct
-instinctive
-instinctively
-instincts
-instinctual
-institute
-instituted
-institutes
-instituting
-institution
-institutional
-institutionalisation
-institutionalise
-institutionalised
-institutionalising
-institutionalism
-institutionally
-institutions
-instruct
-instructed
-instructing
-instruction
-instructional
-instructions
-instructive
-instructor
-instructors
-instructs
-instrument
-instrumental
-instrumentalist
-instrumentalists
-instrumentality
-instrumentally
-instrumentals
-instrumentation
-instrumented
-instruments
-insubordinate
-insubordination
-insubstantial
-insufferable
-insufferably
-insufficiency
-insufficient
-insufficiently
-insulant
-insular
-insularity
-insulate
-insulated
-insulates
-insulating
-insulation
-insulator
-insulators
-insulin
-insult
-insulted
-insulter
-insulting
-insultingly
-insults
-insuperable
-insupportable
-insurance
-insurances
-insure
-insured
-insurer
-insurers
-insures
-insurgency
-insurgent
-insurgents
-insuring
-insurmountable
-insurmountably
-insurrection
-insurrectionary
-insurrections
-intact
-intaglio
-intake
-intakes
-intangible
-intangibles
-integer
-integers
-integrability
-integrable
-integral
-integrally
-integrals
-integrand
-integrands
-integrate
-integrated
-integrates
-integrating
-integration
-integrationist
-integrations
-integrative
-integrator
-integrators
-integrity
-intellect
-intellects
-intellectual
-intellectualism
-intellectuality
-intellectually
-intellectuals
-intelligence
-intelligences
-intelligent
-intelligently
-intelligentsia
-intelligibility
-intelligible
-intelligibly
-intemperance
-intemperate
-intend
-intended
-intending
-intends
-intense
-intensely
-intensification
-intensified
-intensifies
-intensify
-intensifying
-intensities
-intensity
-intensive
-intensively
-intent
-intention
-intentional
-intentionality
-intentionally
-intentioned
-intentions
-intently
-intentness
-intents
-inter
-interact
-interacted
-interacting
-interaction
-interactional
-interactions
-interactive
-interactively
-interactiveness
-interacts
-interatomic
-interbank
-interbred
-interbreed
-interbreeding
-intercede
-interceded
-interceding
-intercept
-intercepted
-intercepting
-interception
-interceptions
-interceptor
-interceptors
-intercepts
-intercession
-intercessions
-interchange
-interchangeability
-interchangeable
-interchangeably
-interchanged
-interchanges
-interchanging
-intercity
-intercollegiate
-intercom
-intercommunicate
-intercommunication
-interconnect
-interconnected
-interconnectedness
-interconnecting
-interconnection
-interconnections
-interconnects
-intercontinental
-interconversion
-intercountry
-intercourse
-intercut
-interdenominational
-interdepartmental
-interdependence
-interdependency
-interdependent
-interdict
-interdicted
-interdisciplinary
-interest
-interested
-interestedly
-interesting
-interestingly
-interests
-interface
-interfaced
-interfaces
-interfacing
-interfere
-interfered
-interference
-interferences
-interferer
-interferes
-interfering
-interferometer
-interferometers
-interferometric
-interferometry
-interferon
-intergalactic
-interglacial
-intergovernmental
-interim
-interims
-interior
-interiors
-interject
-interjected
-interjecting
-interjection
-interjectional
-interjections
-interjects
-interlace
-interlaced
-interlacing
-interlap
-interleave
-interleaved
-interleaves
-interleaving
-interlingual
-interlinked
-interlock
-interlocked
-interlocking
-interlocks
-interlocutor
-interlocutors
-interlocutory
-interloper
-interlopers
-interlude
-interludes
-intermarriage
-intermarriages
-intermediaries
-intermediary
-intermediate
-intermediates
-interment
-interments
-interminable
-interminably
-intermingled
-intermingling
-intermission
-intermissions
-intermittent
-intermittently
-intermix
-intermixed
-intermixing
-intermolecular
-intern
-internal
-internalisation
-internalise
-internalised
-internalises
-internalising
-internally
-internals
-international
-internationalisation
-internationalised
-internationalism
-internationalist
-internationalists
-internationally
-internationals
-interned
-internees
-internet
-interning
-internment
-internments
-interns
-internuclear
-interocular
-interoperability
-interoperable
-interpellation
-interpenetration
-interpersonal
-interplanetary
-interplay
-interplays
-interpolatable
-interpolate
-interpolated
-interpolates
-interpolating
-interpolation
-interpolations
-interpose
-interposed
-interposes
-interposing
-interposition
-interpret
-interpretable
-interpretation
-interpretational
-interpretations
-interpretative
-interpreted
-interpreter
-interpreters
-interpreting
-interpretive
-interpretively
-interprets
-interracial
-interred
-interregnum
-interrelate
-interrelated
-interrelatedness
-interrelation
-interrelations
-interrelationship
-interrelationships
-interrogate
-interrogated
-interrogates
-interrogating
-interrogation
-interrogations
-interrogative
-interrogatively
-interrogatives
-interrogator
-interrogators
-interrogatory
-interrupt
-interrupted
-interruptibility
-interrupting
-interruption
-interruptions
-interrupts
-intersect
-intersected
-intersecting
-intersection
-intersections
-intersects
-intersperse
-interspersed
-intersperses
-interspersing
-interstellar
-interstices
-interstitial
-interstitially
-intertidal
-intertwine
-intertwined
-intertwining
-interval
-intervals
-intervene
-intervened
-intervenes
-intervening
-intervention
-interventionism
-interventionist
-interventions
-interview
-interviewed
-interviewee
-interviewees
-interviewer
-interviewers
-interviewing
-interviews
-interweaving
-interwoven
-intestacy
-intestate
-intestinal
-intestine
-intestines
-intifada
-intimacies
-intimacy
-intimate
-intimated
-intimately
-intimates
-intimating
-intimation
-intimations
-intimidate
-intimidated
-intimidates
-intimidating
-intimidation
-intimidatory
-into
-intolerable
-intolerably
-intolerance
-intolerant
-intonation
-intonational
-intonations
-intone
-intoned
-intones
-intoning
-intoxicant
-intoxicants
-intoxicate
-intoxicated
-intoxicating
-intoxication
-intracellular
-intractability
-intractable
-intractably
-intramural
-intramuscular
-intransigence
-intransigent
-intransitive
-intrauterine
-intravenous
-intravenously
-intrepid
-intrepidly
-intricacies
-intricacy
-intricate
-intricately
-intrigue
-intrigued
-intrigues
-intriguing
-intriguingly
-intrinsic
-intrinsically
-intro
-introduce
-introduced
-introduces
-introducing
-introduction
-introductions
-introductory
-introspection
-introspective
-introspectively
-introversion
-introvert
-introverted
-introverts
-intrude
-intruded
-intruder
-intruders
-intrudes
-intruding
-intrusion
-intrusions
-intrusive
-intrusiveness
-intuited
-intuition
-intuitionist
-intuitions
-intuitive
-intuitively
-intuitiveness
-inuit
-inuits
-inundate
-inundated
-inundation
-inure
-inured
-invade
-invaded
-invader
-invaders
-invades
-invading
-invalid
-invalidate
-invalidated
-invalidates
-invalidating
-invalidation
-invalided
-invalidity
-invalids
-invaluable
-invariable
-invariably
-invariance
-invariant
-invariants
-invasion
-invasions
-invasive
-invective
-invectives
-inveigh
-inveighing
-inveigle
-inveigled
-inveigler
-inveiglers
-inveigling
-invent
-invented
-inventing
-invention
-inventions
-inventive
-inventively
-inventiveness
-inventor
-inventories
-inventors
-inventory
-invents
-inverse
-inversely
-inverses
-inversion
-inversions
-invert
-invertebrate
-invertebrates
-inverted
-inverter
-inverters
-invertible
-inverting
-inverts
-invest
-invested
-investigate
-investigated
-investigates
-investigating
-investigation
-investigations
-investigative
-investigator
-investigators
-investigatory
-investing
-investiture
-investment
-investments
-investor
-investors
-invests
-inveterate
-invidious
-invigilate
-invigilated
-invigilating
-invigilator
-invigilators
-invigorate
-invigorated
-invigorating
-invigoratingly
-invincibility
-invincible
-inviolability
-inviolable
-inviolate
-inviscid
-invisibilities
-invisibility
-invisible
-invisibles
-invisibly
-invitation
-invitations
-invite
-invited
-invites
-inviting
-invitingly
-invocation
-invocations
-invoice
-invoiced
-invoices
-invoicing
-invokable
-invoke
-invoked
-invoker
-invokers
-invokes
-invoking
-involuntarily
-involuntary
-involute
-involution
-involutions
-involve
-involved
-involvement
-involvements
-involves
-involving
-invulnerability
-invulnerable
-inward
-inwardly
-inwardness
-inwards
-iodide
-iodine
-ion
-ionian
-ionic
-ionisation
-ionise
-ionised
-ionising
-ionosphere
-ionospheric
-ions
-iota
-iotas
-iran
-iranian
-iranians
-iraq
-iraqi
-iraqis
-irascibility
-irascible
-irascibly
-irate
-ire
-ireland
-iridescence
-iridescent
-iridium
-iris
-irises
-irish
-irishman
-irishmen
-irk
-irked
-irking
-irks
-irksome
-irksomeness
-iron
-ironage
-ironed
-ironic
-ironical
-ironically
-ironies
-ironing
-ironlady
-ironmonger
-ironmongers
-ironmongery
-irons
-ironstone
-ironwork
-ironworks
-irony
-irradiate
-irradiated
-irradiating
-irradiation
-irrational
-irrationalities
-irrationality
-irrationally
-irreconcilable
-irrecoverable
-irrecoverably
-irredeemable
-irredeemably
-irreducibility
-irreducible
-irreducibly
-irrefutable
-irregular
-irregularities
-irregularity
-irregularly
-irregulars
-irrelevance
-irrelevances
-irrelevancy
-irrelevant
-irrelevantly
-irreligious
-irremediable
-irremovable
-irreparable
-irreparably
-irreplaceable
-irrepressible
-irrepressibly
-irreproachable
-irreproachably
-irresistible
-irresistibly
-irresolute
-irresolutely
-irresolution
-irresolvable
-irrespective
-irrespectively
-irresponsibility
-irresponsible
-irresponsibly
-irretrievable
-irretrievably
-irreverence
-irreverent
-irreverently
-irreversibility
-irreversible
-irreversibly
-irrevocable
-irrevocably
-irrigate
-irrigated
-irrigating
-irrigation
-irritability
-irritable
-irritably
-irritant
-irritants
-irritate
-irritated
-irritatedly
-irritates
-irritating
-irritatingly
-irritation
-irritations
-irrupted
-irruption
-is
-isis
-islam
-islamic
-island
-islander
-islanders
-islands
-isle
-isles
-islet
-islets
-isms
-isnt
-isobar
-isobars
-isogram
-isolate
-isolated
-isolates
-isolating
-isolation
-isolationism
-isolationist
-isolator
-isolators
-isomer
-isomeric
-isomers
-isometric
-isometrically
-isometry
-isomorph
-isomorphic
-isomorphism
-isomorphisms
-isoperimetrical
-isosceles
-isostatic
-isothermal
-isothermally
-isotonic
-isotope
-isotopes
-isotopic
-isotropic
-isotropically
-isotropy
-israel
-israeli
-israelis
-issuable
-issuance
-issue
-issued
-issuer
-issuers
-issues
-issuing
-istanbul
-isthmus
-it
-italian
-italians
-italic
-italicisation
-italicise
-italicised
-italics
-italy
-itch
-itched
-itches
-itchier
-itchiest
-itching
-itchy
-item
-itemise
-itemised
-itemises
-itemising
-items
-iterate
-iterated
-iterates
-iterating
-iteration
-iterations
-iterative
-iteratively
-iterators
-itinerant
-itinerants
-itineraries
-itinerary
-itll
-its
-itself
-ive
-ivies
-ivories
-ivory
-ivy
-jab
-jabbed
-jabber
-jabbered
-jabbering
-jabbers
-jabbing
-jabs
-jack
-jackal
-jackals
-jackass
-jackasses
-jackboot
-jackbooted
-jackboots
-jackdaw
-jackdaws
-jacked
-jacket
-jackets
-jacking
-jackinthebox
-jackpot
-jackpots
-jacks
-jacob
-jacuzzi
-jade
-jaded
-jadedly
-jadedness
-jades
-jag
-jagged
-jaggedly
-jaguar
-jaguars
-jahweh
-jail
-jailbird
-jailed
-jailer
-jailers
-jailing
-jails
-jakarta
-jalopy
-jam
-jamaica
-jamaican
-jamb
-jamboree
-jambs
-james
-jammed
-jamming
-jams
-jangle
-jangled
-jangling
-jangly
-janitor
-janitors
-january
-janus
-jap
-japan
-jape
-japes
-japonica
-jar
-jargon
-jargons
-jarl
-jarred
-jarring
-jars
-jasmine
-jaundice
-jaundiced
-jaunt
-jaunted
-jauntier
-jauntiest
-jauntily
-jaunting
-jaunts
-jaunty
-java
-javelin
-javelins
-jaw
-jawbone
-jawbones
-jawed
-jawing
-jawline
-jaws
-jay
-jays
-jaywalk
-jaywalker
-jaywalking
-jazz
-jazzed
-jazzier
-jazziest
-jazzy
-jealous
-jealousies
-jealously
-jealousy
-jeans
-jeep
-jeeps
-jeer
-jeered
-jeering
-jeeringly
-jeerings
-jeers
-jehad
-jejune
-jejunum
-jell
-jellied
-jellies
-jellify
-jelly
-jellyfish
-jemmy
-jennets
-jeopardise
-jeopardised
-jeopardises
-jeopardising
-jeopardy
-jerboas
-jeremiah
-jericho
-jerk
-jerked
-jerkier
-jerkiest
-jerkily
-jerkin
-jerking
-jerkings
-jerkins
-jerks
-jerky
-jersey
-jerseys
-jest
-jested
-jester
-jesters
-jesting
-jestingly
-jests
-jesuit
-jesus
-jet
-jetlagged
-jetplane
-jetpropelled
-jets
-jetsam
-jetsetting
-jetted
-jetties
-jetting
-jettison
-jettisoned
-jettisoning
-jetty
-jew
-jewel
-jewelled
-jeweller
-jewellers
-jewellery
-jewelry
-jewels
-jewess
-jewish
-jews
-jewsharp
-jezebel
-jiffy
-jiggle
-jiggling
-jigs
-jigsaw
-jigsaws
-jihad
-jilt
-jilted
-jilting
-jilts
-jimmy
-jingle
-jingled
-jingles
-jingling
-jingo
-jingoism
-jingoistic
-jinked
-jinks
-jinx
-jinxed
-jinxes
-jitter
-jitters
-jittery
-jiujitsu
-jive
-jived
-jives
-job
-jobbing
-jobless
-joblessness
-jobs
-jock
-jockey
-jockeying
-jockeys
-jocular
-jocularity
-jocularly
-joey
-jog
-jogged
-jogger
-joggers
-jogging
-jogs
-john
-join
-joined
-joiner
-joiners
-joinery
-joining
-joins
-joint
-jointed
-jointing
-jointly
-joints
-jointures
-joist
-joists
-joke
-joked
-joker
-jokers
-jokes
-jokey
-jokier
-jokily
-joking
-jokingly
-jollier
-jolliest
-jollify
-jollily
-jollity
-jolly
-jolt
-jolted
-jolting
-jolts
-jonah
-jonathan
-joseph
-joshua
-jostle
-jostled
-jostles
-jostling
-jot
-jots
-jotted
-jotter
-jotting
-jottings
-joule
-joules
-journal
-journalese
-journalism
-journalist
-journalistic
-journalists
-journalled
-journalling
-journals
-journey
-journeyed
-journeyer
-journeying
-journeyman
-journeys
-joust
-jouster
-jousting
-jousts
-jovial
-joviality
-jovially
-jovian
-jowl
-jowls
-joy
-joyed
-joyful
-joyfully
-joyfulness
-joyless
-joylessness
-joyous
-joyously
-joyousness
-joyride
-joyrider
-joyriders
-joyriding
-joys
-joystick
-joysticks
-jubilant
-jubilantly
-jubilate
-jubilation
-jubilee
-jubilees
-judaic
-judaism
-judas
-judder
-juddered
-juddering
-judders
-judge
-judged
-judgement
-judgemental
-judgements
-judges
-judging
-judgment
-judgmental
-judgments
-judicature
-judicial
-judicially
-judiciaries
-judiciary
-judicious
-judiciously
-judo
-jug
-jugged
-juggernaut
-juggernauts
-juggle
-juggled
-juggler
-jugglers
-juggles
-juggling
-jugs
-jugular
-juice
-juices
-juicier
-juiciest
-juiciness
-juicy
-jukebox
-jukeboxes
-julep
-juleps
-july
-jumble
-jumbled
-jumbles
-jumbo
-jump
-jumped
-jumper
-jumpers
-jumpier
-jumpiest
-jumpiness
-jumping
-jumps
-jumpstart
-jumpstarting
-jumpsuit
-jumpy
-junction
-junctions
-juncture
-june
-jungle
-jungles
-junior
-juniority
-juniors
-juniper
-junk
-junker
-junket
-junkie
-junkies
-junkmail
-junks
-junkyard
-juno
-junta
-juntas
-jupiter
-jurassic
-juridic
-juridical
-juries
-jurisdiction
-jurisdictional
-jurisdictions
-jurisprudence
-jurisprudential
-jurist
-juristic
-jurists
-juror
-jurors
-jury
-juryman
-jurymen
-jussive
-just
-justice
-justices
-justifiability
-justifiable
-justifiably
-justification
-justifications
-justificatory
-justified
-justifies
-justify
-justifying
-justly
-justness
-jut
-jute
-juts
-jutted
-jutting
-juvenile
-juveniles
-juxtapose
-juxtaposed
-juxtaposes
-juxtaposing
-juxtaposition
-juxtapositions
-kaftan
-kaftans
-kaiser
-kalahari
-kale
-kaleidoscope
-kaleidoscopic
-kalif
-kamikaze
-kampala
-kampong
-kangaroo
-kangaroos
-kaolin
-karakul
-karaoke
-karate
-karma
-karst
-katydid
-kayak
-kayaks
-kebab
-kebabs
-kedgeree
-keel
-keeled
-keelhaul
-keeling
-keels
-keen
-keener
-keenest
-keening
-keenly
-keenness
-keep
-keeper
-keepers
-keeping
-keeps
-keepsake
-keepsakes
-keg
-kegs
-kelp
-kelpers
-kelt
-kelts
-kelvin
-ken
-kennedy
-kennel
-kennelled
-kennels
-kent
-kentucky
-kenya
-kenyan
-kept
-keratin
-kerb
-kerbs
-kerbside
-kerchief
-kerned
-kernel
-kernels
-kerning
-kerosene
-kestrel
-kestrels
-ketch
-ketchup
-kettle
-kettleful
-kettles
-key
-keyboard
-keyboardist
-keyboards
-keyed
-keyhole
-keyholes
-keying
-keynote
-keynotes
-keypad
-keypads
-keyring
-keys
-keystone
-keystones
-keystroke
-keystrokes
-keyword
-keywords
-khaki
-khalif
-khan
-khans
-khoikhoi
-khoisan
-kibbutz
-kick
-kickback
-kicked
-kicker
-kicking
-kicks
-kickstart
-kickstarted
-kickstarting
-kickstarts
-kid
-kidded
-kiddie
-kidding
-kidnap
-kidnapped
-kidnapper
-kidnappers
-kidnapping
-kidnappings
-kidnaps
-kidney
-kidneys
-kidneyshaped
-kids
-kiev
-kill
-killed
-killer
-killers
-killing
-killings
-killjoy
-killjoys
-kills
-kiln
-kilns
-kilo
-kilobits
-kilobyte
-kilobytes
-kilohertz
-kilojoules
-kilometre
-kilometres
-kiloton
-kilotons
-kilovolt
-kilowatt
-kilowatts
-kilt
-kilted
-kilter
-kilts
-kimono
-kin
-kina
-kinase
-kind
-kinder
-kindergarten
-kindergartens
-kindest
-kindhearted
-kindheartedness
-kindle
-kindled
-kindles
-kindlier
-kindliest
-kindliness
-kindling
-kindly
-kindness
-kindnesses
-kindred
-kinds
-kinematic
-kinematics
-kinetic
-kinetically
-kinetics
-kinfolk
-king
-kingdom
-kingdoms
-kingfisher
-kingfishers
-kingly
-kingpin
-kings
-kingship
-kingsize
-kingsized
-kink
-kinked
-kinks
-kinky
-kinsfolk
-kinshasa
-kinship
-kinsman
-kinsmen
-kinswoman
-kiosk
-kiosks
-kipper
-kippers
-kirk
-kismet
-kiss
-kissed
-kisser
-kisses
-kissing
-kit
-kitbag
-kitbags
-kitchen
-kitchenette
-kitchens
-kitchenware
-kite
-kites
-kith
-kits
-kitsch
-kitted
-kitten
-kittenish
-kittens
-kitting
-kittiwakes
-kitty
-kiwi
-kiwis
-klaxon
-klaxons
-kleptomania
-kleptomaniac
-kleptomaniacs
-klick
-kloof
-knack
-knacker
-knackers
-knacks
-knapsack
-knapsacks
-knave
-knavery
-knaves
-knavish
-knead
-kneaded
-kneading
-kneads
-knee
-kneecap
-kneecaps
-kneed
-kneedeep
-kneel
-kneeled
-kneeler
-kneeling
-kneels
-knees
-knell
-knelt
-knesset
-knew
-knickers
-knife
-knifed
-knifepoint
-knifes
-knifing
-knight
-knighted
-knighthood
-knighthoods
-knightly
-knights
-knit
-knits
-knitted
-knitter
-knitters
-knitting
-knitwear
-knives
-knob
-knobbly
-knobs
-knock
-knocked
-knocker
-knockers
-knocking
-knockings
-knockout
-knocks
-knoll
-knolls
-knot
-knots
-knotted
-knottier
-knottiest
-knotting
-knotty
-know
-knowable
-knowhow
-knowing
-knowingly
-knowledge
-knowledgeable
-knowledgeably
-known
-knows
-knuckle
-knuckled
-knuckleduster
-knuckledusters
-knuckles
-knuckling
-koala
-koalas
-kongo
-kookaburra
-koran
-korea
-korean
-koreans
-kosher
-kraal
-kraals
-kraft
-kremlin
-kriegspiel
-krill
-krypton
-kudu
-kudus
-kungfu
-kuwait
-kwacha
-kwachas
-laager
-lab
-label
-labelled
-labelling
-labellings
-labels
-labia
-labial
-labials
-labile
-labium
-laboratories
-laboratory
-laborious
-laboriously
-laboriousness
-labour
-laboured
-labourer
-labourers
-labouring
-labourintensive
-labours
-laboursaving
-labs
-laburnum
-labyrinth
-labyrinthine
-labyrinths
-lace
-laced
-lacerate
-lacerated
-lacerating
-laceration
-lacerations
-laces
-lacework
-laches
-lachrymal
-lachrymose
-lacier
-lacing
-lacings
-lack
-lackadaisical
-lacked
-lackey
-lackeys
-lacking
-lacklustre
-lacks
-laconic
-laconically
-lacquer
-lacquered
-lacquers
-lacrosse
-lacs
-lactate
-lactation
-lacteal
-lactic
-lactose
-lacuna
-lacunae
-lacunas
-lacy
-lad
-ladder
-laddered
-ladders
-laddie
-laddies
-lade
-laden
-ladies
-lading
-ladle
-ladled
-ladles
-ladling
-lads
-lady
-ladybird
-ladybirds
-ladybug
-ladylike
-ladyship
-ladyships
-lag
-lager
-lagers
-laggard
-laggards
-lagged
-lagging
-lagoon
-lagoons
-lagos
-lags
-lagune
-laid
-lain
-lair
-laird
-lairds
-lairs
-laissezfaire
-laity
-lake
-lakes
-lakeside
-lam
-lama
-lamas
-lamb
-lambasted
-lambasting
-lambda
-lambent
-lambing
-lambs
-lambskin
-lambswool
-lame
-lamed
-lamely
-lameness
-lament
-lamentable
-lamentably
-lamentation
-lamentations
-lamented
-lamenter
-lamenting
-laments
-lamest
-lamina
-laminar
-laminate
-laminated
-laminates
-lamination
-lamp
-lamplight
-lamplighter
-lamplit
-lampoon
-lampooned
-lampoonery
-lampooning
-lampoons
-lamppost
-lampposts
-lamprey
-lampreys
-lamps
-lampshade
-lampshades
-lance
-lanced
-lancelot
-lancer
-lancers
-lances
-lancet
-lancets
-lancing
-land
-landed
-lander
-landfall
-landfill
-landform
-landforms
-landholders
-landholding
-landholdings
-landing
-landings
-landladies
-landlady
-landless
-landlines
-landlocked
-landlord
-landlords
-landman
-landmark
-landmarks
-landmass
-landmine
-landowner
-landowners
-landowning
-lands
-landscape
-landscaped
-landscapes
-landscaping
-landside
-landslide
-landslides
-landslip
-landslips
-landward
-lane
-lanes
-language
-languages
-languid
-languidly
-languish
-languished
-languishes
-languishing
-languor
-languorous
-languorously
-lank
-lankier
-lankiest
-lanky
-lanolin
-lantern
-lanterns
-lanyard
-laos
-lap
-lapdog
-lapdogs
-lapel
-lapels
-lapful
-lapidary
-lapland
-lapp
-lapped
-lapping
-laps
-lapse
-lapsed
-lapses
-lapsing
-laptop
-laptops
-lapwing
-lapwings
-larceny
-larch
-larches
-lard
-larder
-larders
-lards
-large
-largely
-largeness
-larger
-largest
-largish
-largo
-lark
-larking
-larks
-larva
-larvae
-larval
-laryngeal
-laryngitis
-larynx
-larynxes
-las
-lasagne
-lascivious
-lasciviously
-lasciviousness
-lase
-laser
-lasers
-lash
-lashed
-lashers
-lashes
-lashing
-lashings
-lasing
-lass
-lasses
-lassie
-lassies
-lassitude
-lasso
-lassoed
-lassoing
-last
-lasted
-lasting
-lastly
-lasts
-latch
-latched
-latches
-latching
-late
-latecomer
-latecomers
-lately
-latencies
-latency
-lateness
-latent
-later
-lateral
-lateralisation
-laterally
-laterals
-latest
-latex
-lath
-lathe
-lather
-lathered
-lathers
-lathes
-laths
-latices
-latin
-latino
-latitude
-latitudes
-latitudinal
-latrine
-latrines
-latter
-lattice
-latticed
-lattices
-latvia
-latvian
-laud
-laudable
-laudatory
-lauded
-lauders
-lauding
-lauds
-laugh
-laughable
-laughably
-laughed
-laugher
-laughing
-laughingly
-laughs
-laughter
-launch
-launched
-launcher
-launchers
-launches
-launching
-launder
-laundered
-launderette
-launderettes
-laundering
-laundress
-laundrette
-laundrettes
-laundries
-laundry
-laureate
-laurel
-laurels
-lava
-lavas
-lavatorial
-lavatories
-lavatory
-lavender
-lavish
-lavished
-lavishes
-lavishing
-lavishly
-lavishness
-law
-lawabiding
-lawbreaker
-lawbreakers
-lawbreaking
-lawful
-lawfully
-lawfulness
-lawless
-lawlessness
-lawmaker
-lawmakers
-lawman
-lawmen
-lawn
-lawnmower
-lawnmowers
-lawns
-laws
-lawsuit
-lawsuits
-lawyer
-lawyers
-lax
-laxative
-laxatives
-laxer
-laxity
-laxness
-lay
-layabout
-layabouts
-layby
-laybys
-layer
-layered
-layering
-layers
-laying
-layman
-laymen
-layoff
-layoffs
-layout
-layouts
-layperson
-lays
-lazaret
-lazarus
-laze
-lazed
-lazier
-laziest
-lazily
-laziness
-lazing
-lazuli
-lazy
-lazybones
-lea
-leach
-leached
-leaches
-leaching
-lead
-leaded
-leaden
-leader
-leaderless
-leaders
-leadership
-leaderships
-leadfree
-leading
-leads
-leaf
-leafed
-leafier
-leafiest
-leafiness
-leafing
-leafless
-leaflet
-leaflets
-leafy
-league
-leagues
-leak
-leakage
-leakages
-leaked
-leakier
-leakiest
-leakiness
-leaking
-leaks
-leaky
-lean
-leaned
-leaner
-leanest
-leaning
-leanings
-leanness
-leans
-leant
-leap
-leaped
-leaper
-leapfrog
-leapfrogging
-leaping
-leaps
-leapt
-leapyear
-learn
-learnable
-learned
-learnedly
-learner
-learners
-learning
-learns
-learnt
-lease
-leased
-leasehold
-leaseholder
-leaseholders
-leases
-leash
-leashed
-leashes
-leashing
-leasing
-least
-leat
-leather
-leathers
-leathery
-leave
-leaved
-leaven
-leavened
-leavening
-leaver
-leavers
-leaves
-leaving
-leavings
-lebanon
-lebensraum
-lecher
-lecherous
-lecherousness
-lechery
-lectern
-lector
-lectors
-lecture
-lectured
-lecturer
-lecturers
-lectures
-lectureship
-lectureships
-lecturing
-led
-ledge
-ledger
-ledgers
-ledges
-lee
-leech
-leeches
-leeching
-leeds
-leek
-leeks
-leer
-leered
-leering
-leeringly
-leers
-lees
-leeward
-leeway
-left
-lefthanded
-lefthandedly
-lefthandedness
-lefthander
-lefthanders
-lefties
-leftish
-leftist
-leftists
-leftmost
-leftover
-leftovers
-lefts
-leftward
-leftwards
-lefty
-leg
-legacies
-legacy
-legal
-legalese
-legalisation
-legalise
-legalised
-legalising
-legalism
-legalistic
-legalities
-legality
-legally
-legate
-legatee
-legatees
-legates
-legation
-legato
-legator
-legend
-legendary
-legends
-legerdemain
-legged
-legging
-leggings
-leggy
-leghorn
-leghorns
-legibility
-legible
-legibly
-legion
-legionaries
-legionary
-legionnaires
-legions
-legislate
-legislated
-legislating
-legislation
-legislative
-legislatively
-legislator
-legislators
-legislature
-legislatures
-legitimacy
-legitimate
-legitimated
-legitimately
-legitimating
-legitimation
-legitimisation
-legitimise
-legitimised
-legitimising
-legless
-legman
-legroom
-legs
-legume
-legumes
-leguminous
-legwork
-leipzig
-leisure
-leisured
-leisurely
-leisurewear
-leitmotif
-leitmotifs
-leitmotiv
-leitmotivs
-lemma
-lemmas
-lemming
-lemmings
-lemon
-lemonade
-lemons
-lemur
-lemurs
-lend
-lender
-lenders
-lending
-lends
-length
-lengthen
-lengthened
-lengthening
-lengthens
-lengthier
-lengthiest
-lengthily
-lengths
-lengthways
-lengthwise
-lengthy
-leniency
-lenient
-leniently
-lenin
-lens
-lenses
-lensing
-lent
-lentil
-lentils
-lento
-leonardo
-leone
-leopard
-leopards
-leopardskin
-leotard
-leotards
-leper
-lepers
-leprechaun
-leprechauns
-leprose
-leprosy
-leprous
-lepton
-leptons
-lesbian
-lesbianism
-lesbians
-lesion
-lesions
-lesotho
-less
-lessee
-lessees
-lessen
-lessened
-lessening
-lessens
-lesser
-lesson
-lessons
-lessor
-lessors
-lest
-let
-lethal
-lethality
-lethally
-lethargic
-lethargically
-lethargy
-lets
-letter
-letterbox
-letterboxes
-lettered
-letterhead
-letterheads
-lettering
-letterpress
-letters
-letterwriter
-letting
-lettings
-lettish
-lettuce
-lettuces
-leucine
-leukaemia
-leukemia
-level
-levelheaded
-levelled
-leveller
-levelling
-levelly
-levels
-lever
-leverage
-leveraged
-levered
-levering
-levers
-levi
-leviathan
-levied
-levies
-levitate
-levitated
-levitates
-levitating
-levitation
-levity
-levy
-levying
-lewd
-lewdness
-lexeme
-lexemes
-lexical
-lexically
-lexicographer
-lexicographers
-lexicographic
-lexicographical
-lexicographically
-lexicography
-lexicon
-lexicons
-leyden
-liabilities
-liability
-liable
-liaise
-liaised
-liaises
-liaising
-liaison
-liaisons
-liar
-liars
-libation
-libations
-libel
-libeled
-libeler
-libelled
-libeller
-libelling
-libellous
-libels
-liberal
-liberalisation
-liberalise
-liberalised
-liberalising
-liberalism
-liberality
-liberally
-liberals
-liberate
-liberated
-liberates
-liberating
-liberation
-liberationists
-liberator
-liberators
-liberia
-libero
-libertarian
-libertarianism
-libertarians
-liberties
-libertine
-libertines
-liberty
-libidinous
-libido
-librarian
-librarians
-librarianship
-libraries
-library
-librate
-librated
-librates
-libretti
-librettist
-librettists
-libretto
-libya
-libyan
-libyans
-lice
-licence
-licences
-license
-licensed
-licensee
-licensees
-licenses
-licensing
-licentiate
-licentious
-licentiousness
-lichee
-lichen
-lichened
-lichens
-lichi
-lichis
-lick
-licked
-lickerish
-licking
-licks
-licorice
-lid
-lidded
-lidless
-lido
-lids
-lie
-lied
-lieder
-lien
-liens
-lies
-lieu
-lieutenancy
-lieutenant
-lieutenants
-life
-lifeanddeath
-lifebelt
-lifeblood
-lifeboat
-lifeboatmen
-lifeboats
-lifeforms
-lifegiving
-lifeguard
-lifeguards
-lifeless
-lifelessly
-lifelessness
-lifelike
-lifeline
-lifelines
-lifelong
-liferaft
-liferafts
-lifesaving
-lifesize
-lifesized
-lifespan
-lifespans
-lifestyle
-lifestyles
-lifetaking
-lifethreatening
-lifetime
-lifetimes
-lifework
-lift
-lifted
-lifter
-lifters
-lifting
-liftman
-liftmen
-liftoff
-lifts
-ligament
-ligaments
-ligand
-ligands
-ligature
-ligatured
-ligatures
-ligaturing
-light
-lighted
-lighten
-lightened
-lightening
-lightens
-lighter
-lighters
-lightest
-lightheaded
-lightheadedness
-lighthearted
-lightheartedly
-lightheartedness
-lighthouse
-lighthouses
-lighting
-lightless
-lightly
-lightness
-lightning
-lights
-lightship
-lightweight
-lightweights
-lignite
-likable
-like
-likeability
-likeable
-liked
-likelier
-likeliest
-likelihood
-likely
-likeminded
-liken
-likened
-likeness
-likenesses
-likening
-likens
-likes
-likewise
-liking
-likings
-lilac
-lilacs
-lilies
-lilliput
-lilliputian
-lilongwe
-lilt
-lilting
-lily
-lilylivered
-lilywhite
-lima
-limb
-limber
-limbering
-limbers
-limbless
-limbo
-limbs
-lime
-limekiln
-limelight
-limerick
-limericks
-limes
-limestone
-limestones
-limeys
-liminal
-liming
-limit
-limitation
-limitations
-limited
-limiter
-limiters
-limiting
-limitless
-limits
-limo
-limousin
-limousine
-limousines
-limp
-limped
-limpet
-limpets
-limpid
-limping
-limply
-limpopo
-limps
-linage
-linchpin
-lincoln
-linden
-line
-lineage
-lineages
-lineally
-lineaments
-linear
-linearised
-linearity
-linearly
-lined
-linefeed
-lineman
-linemen
-linen
-linens
-lineout
-lineouts
-liner
-liners
-lines
-linesman
-linesmen
-lineup
-lineups
-linger
-lingered
-lingerer
-lingerie
-lingering
-lingeringly
-lingers
-lingua
-lingual
-linguist
-linguistic
-linguistically
-linguistics
-linguists
-liniment
-liniments
-lining
-linings
-link
-linkable
-linkage
-linkages
-linked
-linker
-linkers
-linking
-links
-linkup
-linkups
-linnet
-linnets
-lino
-linoleum
-linseed
-lint
-lintel
-lintels
-liny
-lion
-lioness
-lionesses
-lionise
-lionised
-lions
-lip
-lipase
-lipid
-lipids
-lipped
-lipread
-lipreading
-lips
-lipservice
-lipstick
-lipsticks
-liquefaction
-liquefied
-liquefy
-liqueur
-liqueurs
-liquid
-liquidate
-liquidated
-liquidating
-liquidation
-liquidations
-liquidator
-liquidators
-liquidise
-liquidised
-liquidiser
-liquidising
-liquidity
-liquids
-liquify
-liquor
-liquorice
-liquorish
-liquors
-lira
-lire
-lisbon
-lisp
-lisped
-lisping
-lisps
-lissom
-lissome
-lissomeness
-lissomness
-list
-listed
-listen
-listened
-listener
-listeners
-listening
-listens
-listeria
-listing
-listings
-listless
-listlessly
-listlessness
-lists
-lit
-litanies
-litany
-litchi
-literacy
-literal
-literalism
-literalistic
-literally
-literals
-literary
-literate
-literati
-literature
-literatures
-lithe
-lithely
-lithium
-lithograph
-lithographic
-lithographs
-lithography
-lithological
-lithologies
-lithology
-lithosphere
-litigant
-litigants
-litigate
-litigating
-litigation
-litigious
-litigiousness
-litmus
-litotes
-litre
-litres
-litter
-littered
-littering
-litters
-little
-littleness
-littler
-littlest
-littoral
-liturgical
-liturgies
-liturgy
-livable
-live
-liveable
-lived
-livelier
-liveliest
-livelihood
-livelihoods
-liveliness
-lively
-liven
-livened
-livening
-livens
-liver
-liveried
-liveries
-liverish
-livers
-liverworts
-livery
-lives
-livestock
-livewire
-livid
-lividly
-living
-livings
-lizard
-lizards
-llama
-llamas
-lls
-load
-loadable
-loaded
-loader
-loaders
-loading
-loadings
-loads
-loaf
-loafed
-loafer
-loafers
-loafing
-loafs
-loam
-loams
-loamy
-loan
-loanable
-loaned
-loaner
-loaning
-loans
-loanword
-loanwords
-loath
-loathe
-loathed
-loathes
-loathing
-loathsome
-loathsomely
-loathsomeness
-loaves
-lob
-lobbed
-lobbied
-lobbies
-lobbing
-lobby
-lobbying
-lobbyist
-lobbyists
-lobe
-lobed
-lobelia
-lobes
-lobotomies
-lobotomised
-lobotomising
-lobotomist
-lobotomy
-lobs
-lobster
-lobsters
-lobular
-local
-locale
-locales
-localisation
-localisations
-localise
-localised
-localises
-localising
-localities
-locality
-locally
-locals
-locatable
-locate
-located
-locates
-locating
-location
-locational
-locations
-locative
-locator
-locators
-loch
-lochness
-lochs
-loci
-lock
-lockable
-lockage
-locked
-locker
-lockers
-locket
-locking
-lockjaw
-lockout
-lockouts
-locks
-locksmith
-loco
-locomote
-locomotion
-locomotive
-locomotives
-locus
-locust
-locusts
-lode
-lodestar
-lodestone
-lodge
-lodged
-lodgement
-lodger
-lodgers
-lodges
-lodging
-lodgings
-loess
-loft
-lofted
-loftier
-loftiest
-loftily
-loftiness
-lofts
-lofty
-log
-loganberries
-loganberry
-logarithm
-logarithmic
-logarithmically
-logarithms
-logbook
-logbooks
-logged
-logger
-loggerheads
-loggers
-logging
-logic
-logical
-logicality
-logically
-logician
-logicians
-logics
-logistic
-logistical
-logistically
-logistics
-logjam
-logo
-logoff
-logos
-logs
-loin
-loincloth
-loins
-loire
-loiter
-loitered
-loiterer
-loiterers
-loitering
-loiters
-loll
-lolled
-lollies
-lolling
-lollipop
-lollipops
-lolly
-london
-londoner
-lone
-lonelier
-loneliest
-loneliness
-lonely
-loner
-loners
-lonesome
-lonesomeness
-long
-longawaited
-longed
-longer
-longest
-longevity
-longfaced
-longhand
-longing
-longingly
-longings
-longish
-longitude
-longitudes
-longitudinal
-longitudinally
-longlasting
-longlived
-longlost
-longs
-longstanding
-longsuffering
-longwinded
-longwindedness
-loo
-look
-lookalike
-lookalikes
-looked
-looker
-lookers
-looking
-lookingglass
-lookingglasses
-lookout
-lookouts
-looks
-loom
-loomed
-looming
-looms
-loon
-looney
-loony
-loop
-looped
-loophole
-loopholes
-looping
-loops
-loopy
-loose
-loosed
-loosely
-loosen
-loosened
-looseness
-loosening
-loosens
-looser
-looses
-loosest
-loosing
-loot
-looted
-looter
-looters
-looting
-loots
-lop
-lope
-loped
-lopes
-loping
-lopped
-lopper
-loppers
-lopping
-lopsided
-lopsidedly
-loquacious
-loquacity
-lord
-lording
-lordly
-lords
-lordship
-lordships
-lore
-lorelei
-lorries
-lorry
-lorryload
-lorryloads
-losable
-lose
-loser
-losers
-loses
-losing
-losings
-loss
-losses
-lost
-lot
-loth
-lotion
-lotions
-lots
-lotteries
-lottery
-lotto
-lotus
-louche
-loud
-louder
-loudest
-loudhailer
-loudhailers
-loudly
-loudmouthed
-loudness
-loudspeaker
-loudspeakers
-louis
-lounge
-lounged
-lounger
-loungers
-lounges
-lounging
-louse
-lousiest
-lousily
-lousy
-lout
-loutish
-loutishness
-louts
-louver
-louvers
-louvre
-louvred
-louvres
-lovable
-love
-loveable
-lovebirds
-loved
-loveless
-lovelier
-lovelies
-loveliest
-loveliness
-lovelorn
-lovely
-lovemaking
-lover
-lovers
-loves
-lovesick
-lovestruck
-loving
-lovingly
-low
-lower
-lowercase
-lowered
-lowering
-lowers
-lowest
-lowing
-lowish
-lowkey
-lowland
-lowlanders
-lowlands
-lowlier
-lowliest
-lowly
-lowlying
-lowness
-lowpitched
-lows
-lowspirited
-loyal
-loyalist
-loyalists
-loyally
-loyalties
-loyalty
-lozenge
-lozenges
-luanda
-lubber
-lubbers
-lubricant
-lubricants
-lubricate
-lubricated
-lubricates
-lubricating
-lubrication
-lubricious
-lucid
-lucidity
-lucidly
-lucifer
-luck
-luckier
-luckiest
-luckily
-luckless
-lucky
-lucrative
-lucre
-ludicrous
-ludicrously
-ludicrousness
-ludo
-lug
-luggage
-lugged
-lugging
-lugs
-lugubrious
-lugubriously
-luke
-lukewarm
-lull
-lullabies
-lullaby
-lulled
-lulling
-lulls
-lulu
-lumbago
-lumbar
-lumber
-lumbered
-lumbering
-lumberjack
-lumberjacks
-lumbers
-lumen
-luminal
-luminance
-luminaries
-luminary
-luminescence
-luminescent
-luminosities
-luminosity
-luminous
-luminously
-lump
-lumped
-lumpen
-lumpier
-lumpiest
-lumpiness
-lumping
-lumpish
-lumps
-lumpy
-luna
-lunacies
-lunacy
-lunar
-lunate
-lunatic
-lunatics
-lunch
-lunched
-luncheon
-luncheons
-lunchers
-lunches
-lunching
-lunchpack
-lunchtime
-lunchtimes
-lune
-lung
-lunge
-lunged
-lunges
-lungfish
-lungful
-lungfuls
-lunging
-lungs
-lupin
-lupines
-lupins
-lur
-lurch
-lurched
-lurchers
-lurches
-lurching
-lure
-lured
-lures
-lurex
-lurid
-luridly
-luring
-lurk
-lurked
-lurker
-lurkers
-lurking
-lurks
-lusaka
-luscious
-lusciously
-lush
-lusher
-lushest
-lushness
-lust
-lusted
-lustful
-lustfully
-lustier
-lustiest
-lustily
-lusting
-lustre
-lustreless
-lustrous
-lusts
-lusty
-lute
-lutes
-luther
-lux
-luxor
-luxuriance
-luxuriant
-luxuriantly
-luxuriate
-luxuriating
-luxuries
-luxurious
-luxuriously
-luxury
-lychee
-lychees
-lye
-lying
-lymph
-lymphatic
-lymphocyte
-lymphocytes
-lymphocytic
-lymphoid
-lymphoma
-lymphomas
-lynch
-lynched
-lynches
-lynching
-lynchpin
-lynx
-lynxes
-lyon
-lyons
-lyra
-lyre
-lyres
-lyric
-lyrical
-lyrically
-lyricism
-lyricist
-lyricists
-lyrics
-lyrist
-lysine
-mac
-macabre
-macaque
-macaques
-macaroni
-macaroon
-macaroons
-macaw
-macaws
-mace
-maces
-machete
-machetes
-machination
-machinations
-machine
-machined
-machinegun
-machineguns
-machinery
-machines
-machinist
-machinists
-machismo
-macho
-macintosh
-macintoshes
-mackerel
-mackintosh
-mackintoshes
-macro
-macrobiotic
-macrocosm
-macroeconomic
-macroeconomics
-macromolecular
-macromolecules
-macron
-macrophage
-macrophages
-macroscopic
-macroscopically
-mad
-madam
-madame
-madams
-madcap
-madden
-maddened
-maddening
-maddeningly
-maddens
-madder
-maddest
-made
-madeira
-mademoiselle
-madhouse
-madly
-madman
-madmen
-madness
-madras
-madrid
-madrigal
-madrigals
-madwoman
-maelstrom
-maestro
-mafia
-mafiosi
-mag
-magazine
-magazines
-magenta
-maggot
-maggots
-magi
-magic
-magical
-magically
-magician
-magicians
-magics
-magisterial
-magisterially
-magistrate
-magistrates
-magma
-magmas
-magmatic
-magnanimity
-magnanimosity
-magnanimous
-magnanimously
-magnate
-magnates
-magnesia
-magnesium
-magnet
-magnetic
-magnetically
-magnetisation
-magnetise
-magnetised
-magnetism
-magnetite
-magneto
-magnetodynamics
-magnetohydrodynamical
-magnetohydrodynamics
-magnetometer
-magnetometers
-magnetosphere
-magnetron
-magnets
-magnification
-magnifications
-magnificence
-magnificent
-magnificently
-magnified
-magnifier
-magnifies
-magnify
-magnifying
-magniloquent
-magnitude
-magnitudes
-magnolia
-magnolias
-magnum
-magnums
-magpie
-magpies
-mags
-mahatma
-mahogany
-maid
-maiden
-maidenly
-maidens
-maids
-maidservant
-maidservants
-mail
-mailable
-mailbox
-mailed
-mailer
-mailing
-mailings
-mailman
-mailmen
-mailorder
-mails
-mailshot
-mailshots
-maim
-maimed
-maiming
-maimings
-maims
-main
-mainbrace
-maine
-mainframe
-mainframes
-mainland
-mainline
-mainly
-mains
-mainsail
-mainspring
-mainstay
-mainstays
-mainstream
-maintain
-maintainability
-maintainable
-maintained
-maintainer
-maintainers
-maintaining
-maintains
-maintenance
-maisonette
-maisonettes
-maize
-maizes
-majestic
-majestically
-majesties
-majesty
-majolica
-major
-majorette
-majorettes
-majorities
-majority
-majors
-make
-makeover
-maker
-makers
-makes
-makeshift
-makeup
-makeweight
-making
-makings
-malachite
-maladaptive
-maladies
-maladjusted
-maladjustment
-maladministration
-maladroit
-malady
-malaise
-malaria
-malarial
-malathion
-malawi
-malay
-malayan
-malays
-malaysia
-malcontent
-malcontents
-maldives
-male
-malefaction
-malefactions
-malefactor
-malefactors
-maleness
-males
-malevolence
-malevolent
-malevolently
-malformation
-malformations
-malformed
-malfunction
-malfunctioned
-malfunctioning
-malfunctions
-malice
-malices
-malicious
-maliciously
-maliciousness
-malign
-malignancies
-malignancy
-malignant
-malignantly
-maligned
-maligners
-maligning
-malignity
-maligns
-malingerers
-malingering
-mall
-mallard
-mallards
-malleability
-malleable
-mallet
-mallets
-mallow
-malls
-malnourished
-malnourishment
-malnutrition
-malodorous
-malpractice
-malpractices
-malt
-malta
-malted
-maltese
-malting
-maltreat
-maltreated
-maltreatment
-malts
-malty
-malva
-mama
-mamas
-mamba
-mambas
-mammal
-mammalia
-mammalian
-mammals
-mammary
-mammoth
-mammoths
-mammy
-man
-manacle
-manacled
-manacles
-manage
-manageability
-manageable
-managed
-management
-managements
-manager
-manageress
-manageresses
-managerial
-managerially
-managers
-managership
-manages
-managing
-manatee
-manciple
-mandarin
-mandarins
-mandate
-mandated
-mandates
-mandating
-mandatory
-mandela
-mandible
-mandibles
-mandibular
-mandolin
-mandolins
-mandrake
-mandril
-mandrill
-mane
-maned
-manes
-maneuver
-manfully
-manganese
-mange
-manger
-mangers
-mangle
-mangled
-mangler
-mangles
-mangling
-mango
-mangrove
-mangroves
-manhandle
-manhandled
-manhandling
-manhole
-manholes
-manhood
-manhunt
-manhunts
-mania
-maniac
-maniacal
-maniacally
-maniacs
-manias
-manic
-manically
-manicdepressive
-manicure
-manicured
-manifest
-manifestation
-manifestations
-manifested
-manifesting
-manifestly
-manifesto
-manifests
-manifold
-manifolds
-manikin
-manila
-manipulable
-manipulate
-manipulated
-manipulates
-manipulating
-manipulation
-manipulations
-manipulative
-manipulator
-manipulators
-mankind
-manliest
-manliness
-manly
-manmade
-manna
-manned
-mannequin
-mannequins
-manner
-mannered
-mannerism
-mannerisms
-mannerist
-mannerliness
-mannerly
-manners
-manning
-manoeuvrability
-manoeuvrable
-manoeuvre
-manoeuvred
-manoeuvres
-manoeuvring
-manoeuvrings
-manometer
-manor
-manorial
-manors
-manpower
-manse
-manservant
-mansion
-mansions
-mansized
-manslaughter
-mantel
-mantelpiece
-mantelpieces
-mantelshelf
-mantids
-mantis
-mantissa
-mantissas
-mantle
-mantled
-mantles
-mantling
-mantra
-mantrap
-mantraps
-mantras
-manual
-manually
-manuals
-manufacture
-manufactured
-manufacturer
-manufacturers
-manufactures
-manufacturing
-manure
-manured
-manures
-manuring
-manuscript
-manuscripts
-many
-maoism
-maoist
-maoists
-maori
-map
-maple
-maples
-mappable
-mapped
-mapper
-mappers
-mapping
-mappings
-maps
-maputo
-maquettes
-mar
-mara
-marathon
-marathons
-marauders
-marauding
-marble
-marbled
-marbles
-march
-marched
-marcher
-marchers
-marches
-marching
-marchioness
-mare
-mares
-margarine
-margarines
-margate
-margin
-marginal
-marginalia
-marginalisation
-marginalise
-marginalised
-marginalises
-marginalising
-marginality
-marginally
-marginals
-margins
-maria
-marigold
-marigolds
-marijuana
-marina
-marinade
-marinas
-marinate
-marinated
-marine
-mariner
-mariners
-marines
-marionette
-marionettes
-marital
-maritime
-mark
-marked
-markedly
-marker
-markers
-market
-marketability
-marketable
-marketed
-marketeer
-marketeers
-marketer
-marketing
-marketplace
-markets
-marking
-markings
-marks
-marksman
-marksmanship
-marksmen
-markup
-markups
-marl
-marls
-marmalade
-marmoset
-marmosets
-marmot
-marmots
-maroon
-marooned
-marooning
-maroons
-marque
-marquee
-marquees
-marques
-marquess
-marquetry
-marquis
-marred
-marriage
-marriageable
-marriages
-married
-marries
-marring
-marrow
-marrows
-marry
-marrying
-mars
-marsala
-marsh
-marshal
-marshalled
-marshaller
-marshalling
-marshals
-marshes
-marshgas
-marshier
-marshiest
-marshiness
-marshland
-marshmallow
-marshmallows
-marshy
-marsupial
-marsupials
-mart
-marten
-martens
-martial
-martian
-martians
-martin
-martinet
-martingale
-martingales
-martini
-martins
-martyr
-martyrdom
-martyred
-martyrs
-martyry
-marvel
-marvelled
-marvelling
-marvellous
-marvellously
-marvels
-marx
-marxism
-marxist
-marxists
-mary
-marzipan
-mas
-mascara
-mascot
-mascots
-masculine
-masculinity
-maser
-maseru
-mash
-mashed
-masher
-mashing
-mask
-masked
-masking
-masks
-masochism
-masochist
-masochistic
-masochistically
-masochists
-mason
-masonic
-masonry
-masons
-masque
-masquerade
-masqueraded
-masquerades
-masquerading
-masques
-mass
-massacre
-massacred
-massacres
-massacring
-massage
-massaged
-massager
-massages
-massaging
-massed
-masses
-masseur
-masseurs
-masseuse
-masseuses
-massif
-massing
-massive
-massively
-massless
-massproduced
-massproducing
-mast
-mastectomy
-masted
-master
-masterclass
-mastered
-masterful
-masterfully
-mastering
-masterly
-mastermind
-masterminded
-masterminding
-masterpiece
-masterpieces
-masters
-mastership
-masterwork
-masterworks
-mastery
-masthead
-masticating
-mastication
-mastiff
-mastitis
-mastodon
-mastodons
-mastoid
-mastoids
-masts
-mat
-matador
-matadors
-match
-matchable
-matchbox
-matchboxes
-matched
-matcher
-matches
-matching
-matchless
-matchmaker
-matchmaking
-matchplay
-matchstick
-matchsticks
-mate
-mated
-mater
-material
-materialisation
-materialise
-materialised
-materialises
-materialising
-materialism
-materialist
-materialistic
-materialistically
-materialists
-materiality
-materially
-materials
-maternal
-maternally
-maternity
-mates
-math
-mathematical
-mathematically
-mathematician
-mathematicians
-mathematics
-maths
-matinee
-matinees
-mating
-matings
-matins
-matriarch
-matriarchal
-matriarchies
-matriarchy
-matrices
-matriculate
-matriculated
-matriculating
-matriculation
-matrilineal
-matrimonial
-matrimonially
-matrimony
-matrix
-matrixes
-matron
-matronly
-matrons
-mats
-matt
-matte
-matted
-matter
-mattered
-mattering
-matteroffact
-matters
-matthew
-matting
-mattress
-mattresses
-maturation
-maturational
-mature
-matured
-maturely
-maturer
-matures
-maturing
-maturity
-maudlin
-maul
-mauled
-mauler
-maulers
-mauling
-mauls
-maumau
-mausoleum
-mausoleums
-mauve
-maverick
-mavericks
-maw
-mawkish
-mawkishness
-maxi
-maxim
-maxima
-maximal
-maximality
-maximally
-maximisation
-maximise
-maximised
-maximiser
-maximises
-maximising
-maxims
-maximum
-may
-maya
-mayas
-maybe
-mayday
-maydays
-mayflies
-mayflower
-mayfly
-mayhap
-mayhem
-mayonnaise
-mayor
-mayoral
-mayoralty
-mayoress
-mayors
-maypole
-maze
-mazes
-mazier
-maziest
-mazurka
-mazy
-mbabane
-me
-mead
-meadow
-meadowland
-meadows
-meagre
-meagrely
-meagreness
-meal
-mealie
-mealies
-meals
-mealtime
-mealtimes
-mealy
-mean
-meander
-meandered
-meandering
-meanderings
-meanders
-meaner
-meanest
-meanie
-meanies
-meaning
-meaningful
-meaningfully
-meaningfulness
-meaningless
-meaninglessly
-meaninglessness
-meanings
-meanly
-meanness
-means
-meant
-meantime
-meanwhile
-meany
-measles
-measly
-measurable
-measurably
-measure
-measured
-measureless
-measurement
-measurements
-measures
-measuring
-meat
-meataxe
-meatball
-meatballs
-meatier
-meatiest
-meatless
-meatpie
-meats
-meaty
-mecca
-mechanic
-mechanical
-mechanically
-mechanicals
-mechanics
-mechanisable
-mechanisation
-mechanise
-mechanised
-mechanising
-mechanism
-mechanisms
-mechanist
-mechanistic
-mechanistically
-medal
-medallion
-medallions
-medallist
-medallists
-medals
-meddle
-meddled
-meddler
-meddlers
-meddles
-meddlesome
-meddling
-media
-mediaeval
-medial
-medially
-median
-medians
-mediate
-mediated
-mediates
-mediating
-mediation
-mediator
-mediators
-mediatory
-medic
-medical
-medically
-medicals
-medicate
-medicated
-medication
-medications
-medicinal
-medicine
-medicines
-medics
-medieval
-medievalist
-medievalists
-mediocre
-mediocrity
-meditate
-meditated
-meditates
-meditating
-meditation
-meditations
-meditative
-meditatively
-meditator
-medium
-mediums
-mediumsized
-medlar
-medley
-medleys
-medulla
-medusa
-meek
-meeker
-meekest
-meekly
-meekness
-meet
-meeter
-meeting
-meetings
-meets
-mega
-megabyte
-megabytes
-megahertz
-megajoules
-megalith
-megalithic
-megalomania
-megalomaniac
-megalomaniacs
-megaparsec
-megaphone
-megastar
-megaton
-megatons
-megavolt
-megawatt
-megawatts
-meiosis
-meiotic
-melancholia
-melancholic
-melancholies
-melancholy
-melange
-melanin
-melanoma
-melanomas
-melatonin
-meld
-melee
-mellifluous
-mellifluously
-mellifluousness
-mellow
-mellowed
-mellower
-mellowing
-mellows
-melodic
-melodically
-melodies
-melodious
-melodiously
-melodrama
-melodramas
-melodramatic
-melodramatically
-melody
-melon
-melons
-melt
-meltdown
-melted
-melter
-melting
-melts
-member
-members
-membership
-memberships
-membrane
-membranes
-memento
-memo
-memoir
-memoirs
-memorabilia
-memorable
-memorably
-memoranda
-memorandum
-memorandums
-memorial
-memorials
-memories
-memorisation
-memorise
-memorised
-memorises
-memorising
-memory
-memphis
-men
-menace
-menaced
-menaces
-menacing
-menacingly
-menagerie
-menarche
-mend
-mendacious
-mendacity
-mended
-mendel
-mendelevium
-mender
-menders
-mendicant
-mending
-mends
-menfolk
-menhir
-menhirs
-menial
-meningitis
-meniscus
-menopausal
-menopause
-menorah
-menstrual
-menstruating
-menstruation
-menswear
-mental
-mentalistic
-mentalities
-mentality
-mentally
-menthol
-mention
-mentionable
-mentioned
-mentioning
-mentions
-mentor
-mentors
-menu
-menus
-meow
-meows
-mercantile
-mercenaries
-mercenary
-merchandise
-merchandising
-merchant
-merchantability
-merchantable
-merchantman
-merchantmen
-merchants
-mercies
-merciful
-mercifully
-merciless
-mercilessly
-mercurial
-mercuric
-mercury
-mercy
-mere
-merely
-merest
-meretricious
-merge
-merged
-merger
-mergers
-merges
-merging
-meridian
-meridians
-meridional
-meringue
-meringues
-merino
-merit
-merited
-meriting
-meritocracy
-meritocratic
-meritocrats
-meritorious
-merits
-mermaid
-mermaids
-merman
-mermen
-meromorphic
-merrier
-merriest
-merrily
-merriment
-merry
-merrygoround
-merrygorounds
-merrymaking
-mescaline
-mesh
-meshed
-meshes
-meshing
-mesmeric
-mesmerised
-mesmerising
-mesolithic
-meson
-mesons
-mesosphere
-mesozoic
-mess
-message
-messages
-messaging
-messed
-messenger
-messengers
-messes
-messiah
-messier
-messiest
-messily
-messiness
-messing
-messy
-mestizo
-met
-metabolic
-metabolically
-metabolise
-metabolised
-metabolises
-metabolism
-metabolisms
-metal
-metalanguage
-metalinguistic
-metalled
-metallic
-metallised
-metallurgical
-metallurgist
-metallurgy
-metals
-metalwork
-metalworking
-metamorphic
-metamorphism
-metamorphose
-metamorphosed
-metamorphoses
-metamorphosis
-metaphor
-metaphoric
-metaphorical
-metaphorically
-metaphors
-metaphysical
-metaphysically
-metaphysics
-metastability
-metastable
-metastases
-metastasis
-metastatic
-metatarsal
-meted
-metempsychosis
-meteor
-meteoric
-meteorite
-meteorites
-meteoritic
-meteorological
-meteorologist
-meteorologists
-meteorology
-meteors
-meter
-metered
-metering
-meters
-methadone
-methane
-methanol
-methionine
-method
-methodical
-methodically
-methodological
-methodologically
-methodologies
-methodology
-methods
-methyl
-methylated
-methylene
-meticulous
-meticulously
-metier
-metonymic
-metonymy
-metre
-metres
-metric
-metrical
-metrically
-metrication
-metrics
-metro
-metronome
-metronomes
-metronomic
-metropolis
-metropolises
-metropolitan
-mettle
-mew
-mewing
-mews
-mexican
-mexicans
-mexico
-mezzanine
-mezzosoprano
-miami
-miasma
-mica
-mice
-micelles
-michigan
-micro
-microanalyses
-microbe
-microbes
-microbial
-microbic
-microbiological
-microbiologist
-microbiologists
-microbiology
-microchip
-microchips
-microcode
-microcomputer
-microcomputers
-microcosm
-microcosmic
-microdensitometer
-microdot
-microelectronic
-microelectronics
-microfarad
-microfiche
-microfilm
-microfilming
-microgrammes
-micrograms
-micrograph
-micrographs
-microgravity
-microhydrodynamics
-microlight
-micrometer
-micrometers
-micrometres
-micron
-microns
-microorganism
-microorganisms
-microphone
-microphones
-microprocessor
-microprocessors
-microprogram
-microscope
-microscopes
-microscopic
-microscopically
-microscopist
-microscopy
-microsecond
-microseconds
-microsurgery
-microwave
-microwaveable
-microwaved
-microwaves
-micturition
-mid
-midafternoon
-midair
-midas
-midday
-middays
-midden
-middle
-middleage
-middleaged
-middleclass
-middleman
-middlemen
-middleoftheroad
-middles
-middlesized
-middleweight
-middling
-midevening
-midfield
-midfielder
-midfielders
-midflight
-midge
-midges
-midget
-midgets
-midi
-midland
-midlands
-midlife
-midline
-midmorning
-midmost
-midnight
-midnights
-midribs
-midriff
-midship
-midshipman
-midships
-midst
-midstream
-midsummer
-midway
-midweek
-midwicket
-midwife
-midwifery
-midwinter
-midwives
-mien
-might
-mightier
-mightiest
-mightily
-mights
-mighty
-migraine
-migraines
-migrant
-migrants
-migrate
-migrated
-migrates
-migrating
-migration
-migrations
-migratory
-mike
-mikes
-milady
-milan
-mild
-milder
-mildest
-mildew
-mildewed
-mildews
-mildewy
-mildly
-mildmannered
-mildness
-mile
-mileage
-mileages
-milepost
-mileposts
-miler
-miles
-milestone
-milestones
-milieu
-milieus
-milieux
-militancy
-militant
-militantly
-militants
-militarily
-militarisation
-militarised
-militarism
-militarist
-militaristic
-military
-militate
-militated
-militates
-militating
-militia
-militiaman
-militiamen
-militias
-milk
-milked
-milker
-milkers
-milkier
-milkiest
-milking
-milkmaid
-milkmaids
-milkman
-milkmen
-milks
-milkshake
-milkshakes
-milky
-milkyway
-mill
-milled
-millenarian
-millenarianism
-millennia
-millennial
-millennium
-miller
-millers
-millet
-millibars
-milligram
-milligrams
-millilitres
-millimetre
-millimetres
-milliner
-milliners
-millinery
-milling
-million
-millionaire
-millionaires
-millions
-millionth
-millionths
-millipede
-millipedes
-millisecond
-milliseconds
-millpond
-mills
-millstone
-millstones
-milord
-milt
-mime
-mimed
-mimeographed
-mimes
-mimetic
-mimic
-mimicked
-mimicker
-mimicking
-mimicry
-mimics
-miming
-mimosa
-minaret
-minarets
-mince
-minced
-mincemeat
-mincer
-mincers
-minces
-mincing
-mind
-mindboggling
-mindbogglingly
-minded
-mindedness
-minder
-minders
-mindful
-minding
-mindless
-mindlessly
-mindlessness
-mindreader
-minds
-mindset
-mine
-mined
-minedetector
-minefield
-minefields
-miner
-mineral
-mineralisation
-mineralised
-mineralogical
-mineralogy
-minerals
-miners
-mines
-mineshaft
-minestrone
-minesweeper
-minesweepers
-mineworkers
-mingle
-mingled
-mingles
-mingling
-mini
-miniature
-miniatures
-miniaturisation
-miniaturise
-miniaturised
-miniaturises
-miniaturising
-miniaturist
-minibar
-minibus
-minibuses
-minicab
-minicomputer
-minicomputers
-minify
-minim
-minima
-minimal
-minimalism
-minimalist
-minimalistic
-minimalists
-minimality
-minimally
-minimisation
-minimise
-minimised
-minimiser
-minimises
-minimising
-minimum
-mining
-minings
-minion
-minions
-miniskirt
-minister
-ministered
-ministerial
-ministerially
-ministering
-ministers
-ministration
-ministrations
-ministries
-ministry
-mink
-minke
-minks
-minnow
-minnows
-minor
-minorities
-minority
-minors
-minster
-minstrel
-minstrels
-mint
-minted
-mintier
-mintiest
-minting
-mints
-minty
-minuet
-minuets
-minus
-minuscule
-minuses
-minute
-minuted
-minutely
-minuteness
-minutes
-minutest
-minutiae
-minx
-minxes
-miosis
-miracle
-miracles
-miraculous
-miraculously
-miraculousness
-mirage
-mirages
-mire
-mired
-mires
-mirror
-mirrored
-mirroring
-mirrors
-mirth
-mirthful
-mirthless
-mirthlessly
-misadventure
-misaligned
-misalignment
-misanalysed
-misanthrope
-misanthropes
-misanthropic
-misanthropists
-misanthropy
-misapplication
-misapply
-misapprehension
-misapprehensions
-misappropriated
-misappropriation
-misbegotten
-misbehave
-misbehaved
-misbehaves
-misbehaving
-misbehaviour
-miscalculate
-miscalculated
-miscalculation
-miscalculations
-miscarriage
-miscarriages
-miscarried
-miscarry
-miscarrying
-miscast
-miscasting
-miscegenation
-miscellanea
-miscellaneous
-miscellanies
-miscellany
-mischance
-mischief
-mischiefmakers
-mischiefmaking
-mischievous
-mischievously
-miscible
-misclassified
-miscomprehended
-misconceived
-misconception
-misconceptions
-misconduct
-misconfiguration
-misconstrued
-miscopying
-miscount
-miscounted
-miscounting
-miscreant
-miscreants
-miscue
-miscues
-misdate
-misdeal
-misdealing
-misdeed
-misdeeds
-misdemeanour
-misdemeanours
-misdiagnosis
-misdirect
-misdirected
-misdirecting
-misdirection
-misdirections
-misdoing
-miser
-miserable
-miserably
-miseries
-miserliness
-miserly
-misers
-misery
-misfield
-misfiled
-misfire
-misfired
-misfires
-misfit
-misfits
-misfortune
-misfortunes
-misgive
-misgiving
-misgivings
-misgovernment
-misguide
-misguided
-misguidedly
-mishandle
-mishandled
-mishandles
-mishandling
-mishap
-mishaps
-mishear
-misheard
-mishearing
-mishears
-mishitting
-misidentification
-misinform
-misinformation
-misinformed
-misinterpret
-misinterpretation
-misinterpretations
-misinterpreted
-misinterpreting
-misinterprets
-misjudge
-misjudged
-misjudgement
-misjudgements
-misjudging
-misjudgment
-mislabelled
-mislaid
-mislay
-mislead
-misleading
-misleadingly
-misleads
-misled
-mismanage
-mismanaged
-mismanagement
-mismatch
-mismatched
-mismatches
-mismatching
-misname
-misnamed
-misnomer
-misnomers
-misogynist
-misogynistic
-misogynists
-misogyny
-misplace
-misplaced
-misplacement
-misplaces
-misplacing
-mispositioned
-misprint
-misprinted
-misprinting
-misprints
-mispronounced
-mispronouncing
-mispronunciation
-mispronunciations
-misquotation
-misquote
-misquoted
-misquotes
-misquoting
-misread
-misreading
-misremember
-misremembered
-misremembering
-misrepresent
-misrepresentation
-misrepresentations
-misrepresented
-misrepresenting
-misrepresents
-misrule
-miss
-missal
-missals
-missed
-misses
-misshapen
-missile
-missiles
-missing
-mission
-missionaries
-missionary
-missions
-missive
-missives
-missouri
-misspell
-misspelled
-misspelling
-misspellings
-misspells
-misspelt
-misspend
-misspent
-misstatement
-missteps
-missus
-missuses
-missy
-mist
-mistake
-mistaken
-mistakenly
-mistakes
-mistaking
-misted
-mister
-misters
-mistier
-mistiest
-mistily
-mistime
-mistimed
-mistiness
-misting
-mistletoe
-mistook
-mistranslated
-mistranslates
-mistranslating
-mistranslation
-mistranslations
-mistreat
-mistreated
-mistreating
-mistreatment
-mistress
-mistresses
-mistrust
-mistrusted
-mistrustful
-mistrustfully
-mistrusting
-mistrusts
-mists
-misty
-mistype
-mistyped
-mistypes
-mistyping
-mistypings
-misunderstand
-misunderstanding
-misunderstandings
-misunderstands
-misunderstood
-misuse
-misused
-misuser
-misuses
-misusing
-mite
-mites
-mitigate
-mitigated
-mitigates
-mitigating
-mitigation
-mitigatory
-mitochondria
-mitochondrial
-mitosis
-mitre
-mitred
-mitres
-mitt
-mitten
-mittens
-mitts
-mix
-mixable
-mixed
-mixer
-mixers
-mixes
-mixing
-mixture
-mixtures
-mixup
-mixups
-mnemonic
-mnemonically
-mnemonics
-moan
-moaned
-moaner
-moaners
-moaning
-moans
-moas
-moat
-moated
-moats
-mob
-mobbed
-mobbing
-mobbish
-mobile
-mobiles
-mobilisable
-mobilisation
-mobilise
-mobilised
-mobilises
-mobilising
-mobilities
-mobility
-mobs
-mobster
-mobsters
-moccasin
-moccasins
-mock
-mocked
-mocker
-mockeries
-mockers
-mockery
-mocking
-mockingbird
-mockingly
-mocks
-mockup
-mockups
-mod
-modal
-modalities
-modality
-mode
-model
-modelled
-modeller
-modellers
-modelling
-models
-modem
-modems
-moderate
-moderated
-moderately
-moderates
-moderating
-moderation
-moderations
-moderator
-moderators
-modern
-moderner
-modernisation
-modernisations
-modernise
-modernised
-modernising
-modernism
-modernist
-modernistic
-modernists
-modernity
-modes
-modest
-modestly
-modesty
-modicum
-modifiable
-modification
-modifications
-modified
-modifier
-modifiers
-modifies
-modify
-modifying
-modish
-modishly
-modular
-modularisation
-modularise
-modularised
-modularising
-modularity
-modulate
-modulated
-modulates
-modulating
-modulation
-modulations
-modulator
-module
-modules
-moduli
-modulus
-mogul
-moguls
-mohair
-mohairs
-moiety
-moist
-moisten
-moistened
-moistening
-moistens
-moister
-moistness
-moisture
-moisturise
-moisturiser
-moisturisers
-moisturising
-molar
-molarities
-molarity
-molars
-molasses
-mold
-molds
-moldy
-mole
-molecular
-molecule
-molecules
-molehill
-molehills
-moles
-moleskin
-molest
-molestation
-molestations
-molested
-molester
-molesters
-molesting
-molests
-mollified
-mollifies
-mollify
-mollusc
-molluscan
-molluscs
-molten
-molts
-molybdenum
-mom
-moment
-momentarily
-momentary
-momentous
-moments
-momentum
-moms
-monaco
-monadic
-monalisa
-monarch
-monarchic
-monarchical
-monarchies
-monarchist
-monarchists
-monarchs
-monarchy
-monasteries
-monastery
-monastic
-monasticism
-monaural
-monday
-mondays
-monetarism
-monetarist
-monetarists
-monetary
-money
-moneyed
-moneylender
-moneylenders
-moneyless
-moneys
-monger
-mongers
-mongol
-mongols
-mongoose
-mongrel
-mongrels
-monies
-monition
-monitor
-monitored
-monitoring
-monitors
-monk
-monkey
-monkeyed
-monkeying
-monkeys
-monkfish
-monkish
-monks
-mono
-monochromatic
-monochrome
-monocle
-monocled
-monoclonal
-monocular
-monoculture
-monocytes
-monogamous
-monogamously
-monogamy
-monogram
-monogrammed
-monograph
-monographic
-monographs
-monolayer
-monolayers
-monolingual
-monolith
-monolithic
-monoliths
-monologue
-monologues
-monomania
-monomer
-monomeric
-monomers
-monomial
-monomials
-monomolecular
-monophonic
-monophthongs
-monoplane
-monopole
-monopoles
-monopolies
-monopolisation
-monopolise
-monopolised
-monopolises
-monopolising
-monopolist
-monopolistic
-monopolists
-monopoly
-monorail
-monostable
-monosyllabic
-monosyllable
-monosyllables
-monotheism
-monotheist
-monotheistic
-monotheists
-monotone
-monotonic
-monotonically
-monotonicity
-monotonous
-monotonously
-monotony
-monoxide
-monroe
-monsieur
-monsoon
-monsoons
-monster
-monsters
-monstrosities
-monstrosity
-monstrous
-monstrously
-montage
-montages
-month
-monthlies
-monthly
-months
-montreal
-monument
-monumental
-monumentally
-monuments
-moo
-mood
-moodiest
-moodily
-moodiness
-moods
-moody
-mooed
-mooing
-moon
-moonbeam
-moonbeams
-mooning
-moonless
-moonlight
-moonlighting
-moonlit
-moonrise
-moons
-moonshine
-moonshot
-moonshots
-moonstones
-moor
-moored
-moorhen
-moorhens
-mooring
-moorings
-moorland
-moorlands
-moors
-moos
-moose
-moot
-mooted
-mop
-mope
-moped
-mopeds
-mopes
-moping
-mopped
-mopping
-mops
-moraine
-moraines
-moral
-morale
-morales
-moralise
-moralised
-moralising
-moralism
-moralist
-moralistic
-moralists
-moralities
-morality
-morally
-morals
-morass
-morasses
-moratorium
-moray
-morays
-morbid
-morbidity
-morbidly
-mordant
-more
-moreover
-mores
-morgue
-moribund
-moribundity
-moribundly
-mormon
-mormons
-morn
-morning
-mornings
-morns
-moroccan
-morocco
-moron
-moronic
-morons
-morose
-morosely
-moroseness
-morph
-morpheme
-morphemes
-morpheus
-morphia
-morphine
-morphism
-morphisms
-morphogenesis
-morphogenetic
-morphological
-morphologically
-morphologies
-morphology
-morrow
-morse
-morsel
-morsels
-mort
-mortal
-mortalities
-mortality
-mortally
-mortals
-mortar
-mortars
-mortgage
-mortgageable
-mortgaged
-mortgagee
-mortgagees
-mortgages
-mortgaging
-mortgagor
-mortice
-mortices
-mortification
-mortified
-mortify
-mortifying
-mortise
-mortises
-mortuary
-mosaic
-mosaics
-moscow
-moses
-mosque
-mosques
-mosquito
-moss
-mosses
-mossier
-mossiest
-mossy
-most
-mostly
-motel
-motels
-motes
-motet
-motets
-moth
-mothball
-mothballed
-mothballs
-motheaten
-mother
-motherboard
-motherboards
-mothered
-motherhood
-mothering
-motherinlaw
-motherland
-motherless
-motherly
-motherofpearl
-mothers
-mothersinlaw
-motherstobe
-moths
-motif
-motifs
-motile
-motility
-motion
-motional
-motioned
-motioning
-motionless
-motionlessly
-motions
-motivate
-motivated
-motivates
-motivating
-motivation
-motivational
-motivations
-motivator
-motivators
-motive
-motiveless
-motives
-motley
-motlier
-motliest
-motocross
-motor
-motorbike
-motorbikes
-motorcade
-motorcar
-motorcars
-motorcycle
-motorcycles
-motorcycling
-motorcyclist
-motorcyclists
-motored
-motoring
-motorised
-motorist
-motorists
-motors
-motorway
-motorways
-mottled
-motto
-mould
-moulded
-moulder
-mouldering
-moulders
-mouldier
-mouldiest
-moulding
-mouldings
-moulds
-mouldy
-moult
-moulted
-moulting
-moults
-mound
-mounded
-mounds
-mount
-mountable
-mountain
-mountaineer
-mountaineering
-mountaineers
-mountainous
-mountains
-mountainside
-mountainsides
-mounted
-mountie
-mounties
-mounting
-mountings
-mounts
-mourn
-mourned
-mourner
-mourners
-mournful
-mournfully
-mournfulness
-mourning
-mourns
-mouse
-mouselike
-mousetrap
-mousetraps
-mousey
-moussaka
-mousse
-mousses
-moustache
-moustached
-moustaches
-mousy
-mouth
-mouthed
-mouthful
-mouthfuls
-mouthing
-mouthorgan
-mouthparts
-mouthpiece
-mouthpieces
-mouths
-mouthtomouth
-mouthwash
-mouthwatering
-movable
-move
-moveable
-moved
-movement
-movements
-mover
-movers
-moves
-movie
-movies
-moving
-movingly
-mow
-mowed
-mower
-mowers
-mowing
-mown
-mows
-mozart
-mr
-mrs
-ms
-mu
-much
-muchness
-muck
-mucked
-mucking
-mucks
-mucky
-mucosa
-mucous
-mucus
-mud
-muddied
-muddier
-muddies
-muddiest
-muddle
-muddled
-muddles
-muddling
-muddy
-muddying
-mudflats
-mudflow
-mudflows
-mudguard
-mudguards
-mudlarks
-muds
-muesli
-muff
-muffed
-muffin
-muffins
-muffle
-muffled
-muffler
-mufflers
-muffling
-muffs
-mufti
-mug
-mugged
-mugger
-muggers
-muggier
-mugging
-muggings
-muggy
-mugs
-mugshots
-mulberries
-mulberry
-mulch
-mulches
-mulching
-mule
-mules
-mull
-mullah
-mullahs
-mulled
-mullet
-mulling
-mullioned
-mullions
-multichannel
-multicolour
-multicoloured
-multicultural
-multiculturalism
-multidimensional
-multifarious
-multiform
-multifunction
-multifunctional
-multilateral
-multilateralism
-multilayer
-multilevel
-multilingual
-multimedia
-multimeter
-multimillion
-multinational
-multinationals
-multiphase
-multiple
-multiples
-multiplex
-multiplexed
-multiplexer
-multiplexers
-multiplexes
-multiplexing
-multiplexor
-multiplexors
-multiplication
-multiplications
-multiplicative
-multiplicities
-multiplicity
-multiplied
-multiplier
-multipliers
-multiplies
-multiply
-multiplying
-multiprocessing
-multiprocessor
-multiprocessors
-multiprogramming
-multiracial
-multitude
-multitudes
-mum
-mumble
-mumbled
-mumbler
-mumbles
-mumbling
-mumblings
-mumbojumbo
-mummies
-mummification
-mummified
-mummify
-mummy
-mumps
-mums
-munch
-munched
-muncher
-munchers
-munches
-munching
-mundane
-mundanely
-munich
-municipal
-municipalities
-municipality
-munificence
-munificent
-munificently
-munition
-munitions
-muons
-mural
-murals
-murder
-murdered
-murderer
-murderers
-murderess
-murdering
-murderous
-murderously
-murders
-murk
-murkier
-murkiest
-murkiness
-murky
-murmur
-murmured
-murmurer
-murmuring
-murmurings
-murmurs
-murray
-muscadel
-muscat
-muscle
-muscled
-muscles
-muscling
-muscular
-muscularity
-musculature
-musculoskeletal
-muse
-mused
-muses
-museum
-museums
-mush
-mushes
-mushroom
-mushroomed
-mushrooming
-mushrooms
-mushy
-music
-musical
-musicality
-musically
-musicals
-musician
-musicians
-musicianship
-musicologist
-musicologists
-musicology
-musing
-musingly
-musings
-musk
-musket
-musketeer
-musketeers
-muskets
-muskier
-muskiest
-musks
-musky
-muslim
-muslims
-muslin
-mussel
-mussels
-must
-mustache
-mustang
-mustangs
-mustard
-muster
-mustered
-mustering
-musters
-mustier
-mustiest
-mustily
-mustiness
-musts
-musty
-mutability
-mutable
-mutagens
-mutant
-mutants
-mutate
-mutated
-mutates
-mutating
-mutation
-mutational
-mutations
-mute
-muted
-mutely
-muteness
-mutes
-mutilate
-mutilated
-mutilates
-mutilating
-mutilation
-mutilations
-mutineer
-mutineers
-muting
-mutinied
-mutinies
-mutinous
-mutinously
-mutiny
-mutt
-mutter
-muttered
-mutterer
-mutterers
-muttering
-mutterings
-mutters
-mutton
-muttons
-mutts
-mutual
-mutuality
-mutually
-muzak
-muzzle
-muzzled
-muzzles
-muzzling
-my
-myalgic
-myelin
-myna
-mynahs
-myocardial
-myope
-myopia
-myopic
-myopically
-myriad
-myriads
-myrrh
-myself
-mysteries
-mysterious
-mysteriously
-mystery
-mystic
-mystical
-mystically
-mysticism
-mystics
-mystification
-mystified
-mystifies
-mystify
-mystifying
-mystique
-myth
-mythic
-mythical
-mythological
-mythologies
-mythologised
-mythology
-myths
-myxomatosis
-nab
-nabbed
-nabs
-nadir
-nag
-nagasaki
-nagged
-nagger
-nagging
-nags
-naiad
-naiads
-nail
-nailbiting
-nailed
-nailing
-nails
-nairobi
-naive
-naively
-naivete
-naivety
-naked
-nakedly
-nakedness
-name
-nameable
-namecalling
-named
-namedropping
-nameless
-namely
-nameplate
-nameplates
-names
-namesake
-namesakes
-namibia
-namibian
-naming
-namings
-nannies
-nanny
-nanometre
-nanometres
-nanosecond
-nanoseconds
-nanotechnology
-naomi
-nap
-napalm
-nape
-naphtha
-napkin
-napkins
-naples
-napoleon
-napped
-nappies
-napping
-nappy
-naps
-narcissism
-narcissistic
-narcoleptic
-narcosis
-narcotic
-narcotics
-narrate
-narrated
-narrates
-narrating
-narration
-narrations
-narrative
-narratives
-narratology
-narrator
-narrators
-narrow
-narrowed
-narrower
-narrowest
-narrowing
-narrowly
-narrowminded
-narrowmindedness
-narrowness
-narrows
-narwhal
-nasal
-nasalised
-nasally
-nascent
-nastier
-nastiest
-nastily
-nastiness
-nasturtium
-nasturtiums
-nasty
-natal
-nation
-national
-nationalisation
-nationalisations
-nationalise
-nationalised
-nationalising
-nationalism
-nationalist
-nationalistic
-nationalists
-nationalities
-nationality
-nationally
-nationals
-nationhood
-nations
-nationwide
-native
-natives
-nativity
-nato
-nattering
-natural
-naturalisation
-naturalise
-naturalised
-naturalism
-naturalist
-naturalistic
-naturalists
-naturally
-naturalness
-nature
-natures
-naturist
-naturists
-naught
-naughtiest
-naughtily
-naughtiness
-naughts
-naughty
-nausea
-nauseate
-nauseated
-nauseates
-nauseating
-nauseatingly
-nauseous
-nauseousness
-nautical
-nautili
-nautilus
-naval
-nave
-navel
-navels
-navies
-navigable
-navigate
-navigated
-navigating
-navigation
-navigational
-navigator
-navigators
-navvies
-navvy
-navy
-nay
-nazi
-naziism
-nazis
-nazism
-ndebele
-ne
-near
-nearby
-neared
-nearer
-nearest
-nearing
-nearly
-nearness
-nears
-nearside
-nearsighted
-neat
-neaten
-neatening
-neatens
-neater
-neatest
-neatly
-neatness
-nebula
-nebulae
-nebular
-nebulas
-nebulosity
-nebulous
-nebulously
-nebulousness
-necessaries
-necessarily
-necessary
-necessitate
-necessitated
-necessitates
-necessitating
-necessities
-necessity
-neck
-neckband
-necked
-necking
-necklace
-necklaces
-neckline
-necklines
-necks
-necktie
-necromancer
-necromancers
-necromancy
-necromantic
-necrophilia
-necrophiliac
-necrophiliacs
-necropolis
-necropsy
-necrosis
-necrotic
-nectar
-nectarines
-nectars
-nee
-need
-needed
-needful
-needier
-neediest
-neediness
-needing
-needle
-needlecraft
-needled
-needles
-needless
-needlessly
-needlework
-needling
-needs
-needy
-negate
-negated
-negates
-negating
-negation
-negations
-negative
-negatively
-negativeness
-negatives
-negativism
-negativity
-negev
-neglect
-neglected
-neglectful
-neglecting
-neglects
-negligee
-negligees
-negligence
-negligent
-negligently
-negligibility
-negligible
-negligibly
-negotiable
-negotiate
-negotiated
-negotiates
-negotiating
-negotiation
-negotiations
-negotiator
-negotiators
-negroid
-neigh
-neighbour
-neighbourhood
-neighbourhoods
-neighbouring
-neighbourliness
-neighbourly
-neighbours
-neighed
-neighing
-neither
-nematode
-nematodes
-nemesis
-neolithic
-neologism
-neologisms
-neon
-neonatal
-neonate
-neonates
-neophyte
-neophytes
-neoplasm
-neoplasms
-neoprene
-nepal
-nephew
-nephews
-nephritis
-nepotism
-neptune
-neptunium
-nerd
-nerds
-nerve
-nerveless
-nervelessness
-nerves
-nervous
-nervously
-nervousness
-nervy
-nest
-nestable
-nested
-nestegg
-nesting
-nestle
-nestled
-nestles
-nestling
-nests
-net
-netball
-nether
-nethermost
-nets
-nett
-netted
-netting
-nettle
-nettled
-nettles
-netts
-network
-networked
-networking
-networks
-neural
-neuralgia
-neurobiology
-neurological
-neurologically
-neurologist
-neurologists
-neurology
-neuron
-neuronal
-neurone
-neurones
-neurons
-neurophysiology
-neuroscience
-neuroscientists
-neuroses
-neurosis
-neurosurgeon
-neurosurgeons
-neurosurgery
-neurotic
-neurotically
-neurotics
-neurotransmitter
-neurotransmitters
-neuter
-neutered
-neutering
-neuters
-neutral
-neutralisation
-neutralise
-neutralised
-neutraliser
-neutralises
-neutralising
-neutralism
-neutralist
-neutrality
-neutrally
-neutrals
-neutrino
-neutron
-neutrons
-never
-neverending
-nevertheless
-new
-newborn
-newcomer
-newcomers
-newer
-newest
-newfangled
-newfound
-newish
-newlook
-newly
-newlywed
-newlyweds
-newness
-news
-newsagent
-newsagents
-newsboy
-newscast
-newscasters
-newsflash
-newsflashes
-newsletter
-newsletters
-newsman
-newsmen
-newspaper
-newspapermen
-newspapers
-newsprint
-newsreader
-newsreaders
-newsreel
-newsreels
-newsroom
-newsstand
-newsstands
-newsworthy
-newsy
-newt
-newton
-newts
-next
-ngoing
-nguni
-ngunis
-niagara
-nib
-nibble
-nibbled
-nibbler
-nibblers
-nibbles
-nibbling
-nibs
-nice
-nicely
-niceness
-nicer
-nicest
-niceties
-nicety
-niche
-niches
-nick
-nicked
-nickel
-nicking
-nickname
-nicknamed
-nicknames
-nicks
-nicotine
-niece
-nieces
-niftily
-nifty
-niger
-nigeria
-niggardly
-niggle
-niggled
-niggles
-niggling
-nigh
-night
-nightcap
-nightcaps
-nightclothes
-nightclub
-nightclubs
-nightdress
-nightdresses
-nightfall
-nightgown
-nightie
-nighties
-nightingale
-nightingales
-nightlife
-nightly
-nightmare
-nightmares
-nightmarish
-nights
-nightwatchman
-nightwear
-nihilism
-nihilist
-nihilistic
-nil
-nile
-nils
-nimble
-nimbleness
-nimbly
-nimbus
-nincompoop
-nine
-ninefold
-nines
-nineteen
-nineteenth
-nineties
-ninetieth
-ninety
-nineveh
-ninny
-ninth
-ninths
-nip
-nipped
-nipper
-nipping
-nipple
-nipples
-nippon
-nips
-nirvana
-nit
-nitpicking
-nitrate
-nitrates
-nitric
-nitrogen
-nitrogenous
-nitroglycerine
-nitrous
-nits
-nitwit
-nixon
-no
-noah
-nobility
-noble
-nobleman
-noblemen
-nobleness
-nobler
-nobles
-noblest
-nobly
-nobodies
-nobody
-noctuids
-nocturnal
-nocturnally
-nocturne
-nocturnes
-nod
-nodal
-nodded
-nodding
-noddle
-noddy
-node
-nodes
-nods
-nodular
-nodule
-noduled
-nodules
-noel
-noggin
-nogging
-nohow
-noise
-noiseless
-noiselessly
-noises
-noisier
-noisiest
-noisily
-noisiness
-noisome
-noisy
-nomad
-nomadic
-nomads
-nomenclature
-nomenclatures
-nominal
-nominally
-nominate
-nominated
-nominates
-nominating
-nomination
-nominations
-nominative
-nominator
-nominee
-nominees
-non
-nonbeliever
-nonbelievers
-nonchalance
-nonchalant
-nonchalantly
-nonconformist
-nonconformists
-nonconformity
-nondrinkers
-none
-nonentities
-nonentity
-nonessential
-nonessentials
-nonetheless
-nonevent
-nonexistence
-nonexistent
-nonfunctional
-noninterference
-nonintervention
-nonparticipation
-nonpayment
-nonplussed
-nonsense
-nonsenses
-nonsensical
-nonsmoker
-nonsmokers
-nonsmoking
-nonviolence
-nonviolent
-noodle
-noodles
-nook
-nooks
-noon
-noonday
-noons
-noontide
-noose
-noosed
-nooses
-nor
-noradrenalin
-noradrenaline
-nordic
-norm
-normal
-normalcy
-normalisable
-normalisation
-normalisations
-normalise
-normalised
-normaliser
-normalisers
-normalises
-normalising
-normality
-normally
-normals
-norman
-normandy
-normans
-normative
-normed
-norms
-norsemen
-north
-northbound
-northerly
-northern
-northerner
-northerners
-northernmost
-northmen
-northward
-northwards
-norway
-nose
-nosed
-nosedive
-noses
-nosey
-nosier
-nosiest
-nosily
-nosiness
-nosing
-nostalgia
-nostalgic
-nostalgically
-nostril
-nostrils
-nostrum
-nosy
-not
-notable
-notables
-notably
-notaries
-notary
-notation
-notational
-notationally
-notations
-notch
-notched
-notches
-notching
-note
-notebook
-notebooks
-noted
-notepad
-notepads
-notepaper
-notes
-noteworthy
-nothing
-nothingness
-nothings
-notice
-noticeable
-noticeably
-noticeboard
-noticeboards
-noticed
-notices
-noticing
-notifiable
-notification
-notifications
-notified
-notifies
-notify
-notifying
-noting
-notion
-notional
-notionally
-notions
-notoriety
-notorious
-notoriously
-notwithstanding
-nougat
-nougats
-nought
-noughts
-noun
-nounal
-nouns
-nourish
-nourished
-nourishes
-nourishing
-nourishment
-novel
-novelette
-novelist
-novelistic
-novelists
-novelle
-novels
-novelties
-novelty
-november
-novice
-novices
-now
-nowadays
-nowhere
-noxious
-noxiously
-noxiousness
-nozzle
-nozzles
-nu
-nuance
-nuances
-nuclear
-nuclei
-nucleic
-nucleus
-nude
-nudeness
-nudes
-nudge
-nudged
-nudges
-nudging
-nudism
-nudist
-nudists
-nudities
-nudity
-nugget
-nuggets
-nuisance
-nuisances
-nuke
-null
-nullification
-nullified
-nullifies
-nullify
-nullifying
-nullity
-nulls
-numb
-numbed
-number
-numbered
-numbering
-numberings
-numberless
-numberplate
-numbers
-numbing
-numbingly
-numbly
-numbness
-numbs
-numbskull
-numeracy
-numeral
-numerals
-numerate
-numerator
-numerators
-numeric
-numerical
-numerically
-numerological
-numerologist
-numerologists
-numerology
-numerous
-numismatic
-numismatics
-numskull
-nun
-nunneries
-nunnery
-nuns
-nuptial
-nuptials
-nurse
-nursed
-nursemaid
-nursemaids
-nurseries
-nursery
-nurseryman
-nurserymen
-nurses
-nursing
-nurture
-nurtured
-nurtures
-nurturing
-nut
-nutation
-nutcracker
-nutcrackers
-nutmeg
-nutmegs
-nutrient
-nutrients
-nutriment
-nutrition
-nutritional
-nutritionally
-nutritionist
-nutritionists
-nutritious
-nutritive
-nuts
-nutshell
-nuttier
-nutty
-nuzzle
-nuzzled
-nuzzles
-nuzzling
-nyala
-nylon
-nylons
-nymph
-nympholepsy
-nymphomania
-nymphomaniac
-nymphs
-oaf
-oafish
-oafs
-oak
-oaken
-oaks
-oakum
-oar
-oars
-oarsman
-oarsmen
-oases
-oasis
-oast
-oat
-oatcakes
-oath
-oaths
-oatmeal
-oats
-obduracy
-obdurate
-obdurately
-obedience
-obedient
-obediently
-obeisance
-obelisk
-obelisks
-obese
-obesity
-obey
-obeyed
-obeying
-obeys
-obfuscate
-obfuscated
-obfuscates
-obfuscation
-obfuscatory
-obituaries
-obituary
-object
-objected
-objectified
-objecting
-objection
-objectionable
-objectionableness
-objectionably
-objections
-objective
-objectively
-objectives
-objectivity
-objectless
-objector
-objectors
-objects
-oblate
-obligate
-obligated
-obligation
-obligations
-obligatorily
-obligatory
-oblige
-obliged
-obliges
-obliging
-obligingly
-oblique
-obliqued
-obliquely
-obliqueness
-obliquity
-obliterate
-obliterated
-obliterates
-obliterating
-obliteration
-oblivion
-oblivious
-obliviousness
-oblong
-oblongs
-obloquy
-obnoxious
-obnoxiously
-obnoxiousness
-oboe
-oboes
-oboist
-obscene
-obscenely
-obscenities
-obscenity
-obscurantism
-obscurantist
-obscuration
-obscure
-obscured
-obscurely
-obscureness
-obscurer
-obscures
-obscurest
-obscuring
-obscurities
-obscurity
-obsequious
-obsequiously
-obsequiousness
-observability
-observable
-observables
-observably
-observance
-observances
-observant
-observation
-observational
-observationally
-observations
-observatories
-observatory
-observe
-observed
-observer
-observers
-observes
-observing
-obsess
-obsessed
-obsesses
-obsessing
-obsession
-obsessional
-obsessions
-obsessive
-obsessively
-obsessiveness
-obsidian
-obsolescence
-obsolescent
-obsolete
-obstacle
-obstacles
-obstetric
-obstetrician
-obstetricians
-obstetrics
-obstinacy
-obstinate
-obstinately
-obstreperous
-obstruct
-obstructed
-obstructing
-obstruction
-obstructionism
-obstructions
-obstructive
-obstructively
-obstructiveness
-obstructs
-obtain
-obtainable
-obtained
-obtaining
-obtains
-obtrude
-obtruded
-obtruding
-obtrusive
-obtrusiveness
-obtuse
-obtusely
-obtuseness
-obverse
-obviate
-obviated
-obviates
-obviating
-obvious
-obviously
-obviousness
-occasion
-occasional
-occasionally
-occasioned
-occasioning
-occasions
-occident
-occidental
-occipital
-occluded
-occludes
-occlusion
-occult
-occultism
-occults
-occupancies
-occupancy
-occupant
-occupants
-occupation
-occupational
-occupationally
-occupations
-occupied
-occupier
-occupiers
-occupies
-occupy
-occupying
-occur
-occurred
-occurrence
-occurrences
-occurring
-occurs
-ocean
-oceanic
-oceanographer
-oceanographers
-oceanographic
-oceanography
-oceans
-ocelot
-ocelots
-ochre
-ochres
-octagon
-octagonal
-octagons
-octahedral
-octahedron
-octal
-octane
-octanes
-octant
-octave
-octaves
-octavo
-octet
-octets
-october
-octogenarian
-octogenarians
-octopus
-octopuses
-ocular
-oculist
-odd
-odder
-oddest
-oddities
-oddity
-oddjob
-oddly
-oddment
-oddments
-oddness
-odds
-ode
-odes
-odin
-odious
-odiously
-odiousness
-odium
-odiums
-odometer
-odoriferous
-odorous
-odour
-odourless
-odours
-odyssey
-oedema
-oedipus
-oesophagus
-oestrogen
-oestrogens
-oestrus
-oeuvre
-oeuvres
-of
-off
-offal
-offbeat
-offcut
-offcuts
-offence
-offences
-offend
-offended
-offender
-offenders
-offending
-offends
-offensive
-offensively
-offensiveness
-offensives
-offer
-offered
-offering
-offerings
-offers
-offertory
-offhand
-office
-officer
-officers
-officership
-officerships
-offices
-official
-officialdom
-officially
-officialness
-officials
-officiate
-officiated
-officiating
-officious
-officiously
-officiousness
-offprint
-offset
-offshoot
-offshore
-oft
-often
-ogle
-ogled
-ogling
-ogre
-ogres
-ogrish
-oh
-ohio
-ohm
-ohmic
-ohms
-oil
-oilcloth
-oiled
-oiler
-oilers
-oilfield
-oilfields
-oilier
-oiliest
-oiliness
-oiling
-oilman
-oilmen
-oilrig
-oils
-oily
-oink
-oinked
-oinks
-ointment
-ointments
-ok
-okapi
-okapis
-okay
-okayed
-okays
-oklahoma
-old
-oldage
-olden
-older
-oldest
-oldfashioned
-oldie
-oldish
-oldmaids
-oldtimer
-oldtimers
-ole
-oleander
-oleanders
-olfactory
-olive
-oliveoil
-oliver
-olives
-olm
-olms
-olympia
-olympiad
-olympian
-olympic
-olympics
-olympus
-ombudsman
-ombudsmen
-omega
-omelette
-omelettes
-omen
-omens
-ominous
-ominously
-omission
-omissions
-omit
-omits
-omitted
-omitting
-omnibus
-omnibuses
-omnidirectional
-omnipotence
-omnipotent
-omnipresence
-omnipresent
-omniscience
-omniscient
-omnivore
-omnivores
-omnivorous
-on
-onager
-onagers
-once
-one
-oneness
-oner
-onerous
-ones
-oneself
-onesided
-onesidedly
-onesidedness
-ongoing
-onion
-onions
-onlooker
-onlookers
-onlooking
-only
-onlybegotten
-onset
-onshore
-onslaught
-onslaughts
-ontario
-onto
-ontogeny
-ontological
-ontologically
-ontology
-onus
-onuses
-onward
-onwards
-onyx
-onyxes
-oocytes
-oodles
-ooh
-oolitic
-oology
-oompah
-oops
-ooze
-oozed
-oozes
-oozing
-oozy
-opacity
-opal
-opalescent
-opals
-opaque
-open
-opened
-opener
-openers
-openhanded
-openhandedness
-openheart
-openhearted
-opening
-openings
-openly
-openminded
-openmindedness
-openness
-opens
-opera
-operable
-operand
-operands
-operas
-operate
-operated
-operates
-operatic
-operating
-operation
-operational
-operationally
-operations
-operative
-operatives
-operator
-operators
-operculum
-operetta
-operettas
-ophthalmic
-ophthalmics
-ophthalmologist
-ophthalmologists
-ophthalmology
-opiate
-opiates
-opine
-opined
-opines
-opining
-opinion
-opinionated
-opinions
-opioid
-opioids
-opium
-opossum
-opponent
-opponents
-opportune
-opportunely
-opportunism
-opportunist
-opportunistic
-opportunistically
-opportunists
-opportunities
-opportunity
-oppose
-opposed
-opposes
-opposing
-opposite
-oppositely
-opposites
-opposition
-oppositional
-oppositions
-oppress
-oppressed
-oppresses
-oppressing
-oppression
-oppressions
-oppressive
-oppressively
-oppressiveness
-oppressor
-oppressors
-opprobrious
-opprobrium
-opt
-opted
-optic
-optical
-optically
-optician
-opticians
-optics
-optima
-optimal
-optimality
-optimally
-optimisation
-optimisations
-optimise
-optimised
-optimiser
-optimisers
-optimises
-optimising
-optimism
-optimist
-optimistic
-optimistically
-optimists
-optimum
-opting
-option
-optional
-optionality
-optionally
-options
-optoelectronic
-opts
-opulence
-opulent
-opus
-opuses
-or
-oracle
-oracles
-oracular
-oral
-orally
-orang
-orange
-oranges
-orangs
-orangutan
-orangutans
-orate
-orated
-orates
-orating
-oration
-orations
-orator
-oratorical
-oratorio
-orators
-oratory
-orb
-orbit
-orbital
-orbitals
-orbited
-orbiter
-orbiting
-orbits
-orbs
-orca
-orchard
-orchards
-orchestra
-orchestral
-orchestras
-orchestrate
-orchestrated
-orchestrates
-orchestrating
-orchestration
-orchestrations
-orchestrator
-orchid
-orchids
-ordain
-ordained
-ordaining
-ordains
-ordeal
-ordeals
-order
-ordered
-ordering
-orderings
-orderless
-orderlies
-orderliness
-orderly
-orders
-ordinal
-ordinals
-ordinance
-ordinances
-ordinands
-ordinarily
-ordinariness
-ordinary
-ordinate
-ordinates
-ordination
-ordinations
-ordnance
-ordure
-ore
-ores
-organ
-organelles
-organic
-organically
-organics
-organisable
-organisation
-organisational
-organisationally
-organisations
-organise
-organised
-organiser
-organisers
-organises
-organising
-organism
-organisms
-organist
-organists
-organs
-organza
-orgies
-orgy
-orient
-orientable
-oriental
-orientalism
-orientals
-orientate
-orientated
-orientates
-orientation
-orientations
-oriented
-orienteering
-orienting
-orifice
-orifices
-origami
-origin
-original
-originality
-originally
-originals
-originate
-originated
-originates
-originating
-origination
-originator
-originators
-origins
-orimulsion
-ornament
-ornamental
-ornamentation
-ornamented
-ornamenting
-ornaments
-ornate
-ornately
-ornithological
-ornithologist
-ornithologists
-ornithology
-orphan
-orphanage
-orphanages
-orphaned
-orphans
-orpheus
-orthodontist
-orthodox
-orthodoxies
-orthodoxy
-orthogonal
-orthogonality
-orthogonally
-orthographic
-orthographical
-orthographically
-orthography
-orthonormal
-orthopaedic
-orthopaedics
-orthorhombic
-oryxes
-oscar
-oscars
-oscillate
-oscillated
-oscillates
-oscillating
-oscillation
-oscillations
-oscillator
-oscillators
-oscillatory
-oscilloscope
-oscilloscopes
-osiris
-oslo
-osmium
-osmosis
-osmotic
-osprey
-ospreys
-ossification
-ossified
-ostensible
-ostensibly
-ostentation
-ostentatious
-ostentatiously
-osteoarthritis
-osteopath
-osteopaths
-osteopathy
-osteoporosis
-ostler
-ostlers
-ostracise
-ostracised
-ostracism
-ostrich
-ostriches
-other
-otherness
-others
-otherwise
-otter
-otters
-ottoman
-ouch
-ought
-ounce
-ounces
-our
-ours
-ourselves
-oust
-ousted
-ouster
-ousting
-ousts
-out
-outage
-outages
-outback
-outbid
-outbids
-outboard
-outbound
-outbreak
-outbreaks
-outbred
-outbuilding
-outbuildings
-outburst
-outbursts
-outcall
-outcast
-outcasts
-outclassed
-outcome
-outcomes
-outcries
-outcrop
-outcrops
-outcry
-outdated
-outdid
-outdo
-outdoes
-outdoing
-outdone
-outdoor
-outdoors
-outer
-outermost
-outface
-outfall
-outfalls
-outfield
-outfit
-outfits
-outfitters
-outflank
-outflanked
-outflow
-outflows
-outfox
-outfoxed
-outfoxes
-outgo
-outgoing
-outgoings
-outgrew
-outgrow
-outgrowing
-outgrown
-outgrowth
-outgrowths
-outguess
-outhouse
-outhouses
-outing
-outings
-outlandish
-outlast
-outlasted
-outlasts
-outlaw
-outlawed
-outlawing
-outlawry
-outlaws
-outlay
-outlays
-outlet
-outlets
-outlier
-outliers
-outline
-outlined
-outlines
-outlining
-outlive
-outlived
-outlives
-outliving
-outlook
-outlooks
-outlying
-outmanoeuvre
-outmanoeuvred
-outmoded
-outmost
-outnumber
-outnumbered
-outnumbering
-outnumbers
-outpace
-outpaced
-outpacing
-outpatient
-outpatients
-outperform
-outperformed
-outperforming
-outperforms
-outplacement
-outplay
-outplayed
-outpointed
-outpointing
-outpost
-outposts
-outpouring
-outpourings
-output
-outputs
-outputting
-outrage
-outraged
-outrageous
-outrageously
-outrages
-outraging
-outran
-outrank
-outreach
-outride
-outrider
-outriders
-outrigger
-outright
-outrun
-outruns
-outs
-outsell
-outset
-outsets
-outshine
-outshines
-outshining
-outshone
-outside
-outsider
-outsiders
-outsides
-outsize
-outskirts
-outsmart
-outsold
-outsourcing
-outspan
-outspoken
-outspokenly
-outspokenness
-outspread
-outstanding
-outstandingly
-outstation
-outstations
-outstay
-outstayed
-outstep
-outstretched
-outstrip
-outstripped
-outstripping
-outstrips
-outvoted
-outward
-outwardly
-outwards
-outweigh
-outweighed
-outweighing
-outweighs
-outwit
-outwith
-outwits
-outwitted
-outwitting
-outwork
-outworking
-ova
-oval
-ovals
-ovarian
-ovaries
-ovary
-ovate
-ovation
-ovations
-oven
-ovens
-over
-overact
-overacted
-overacting
-overactive
-overacts
-overall
-overallocation
-overalls
-overambitious
-overanxious
-overate
-overbearing
-overboard
-overburdened
-overcame
-overcapacity
-overcast
-overcharge
-overcharged
-overcharging
-overcoat
-overcoats
-overcome
-overcomes
-overcoming
-overcommitment
-overcommitments
-overcompensate
-overcomplexity
-overcomplicated
-overconfident
-overcook
-overcooked
-overcrowd
-overcrowded
-overcrowding
-overdetermined
-overdid
-overdo
-overdoes
-overdoing
-overdone
-overdose
-overdosed
-overdoses
-overdosing
-overdraft
-overdrafts
-overdramatic
-overdraw
-overdrawn
-overdressed
-overdrive
-overdubbing
-overdue
-overeat
-overeating
-overeats
-overemotional
-overemphasis
-overemphasise
-overemphasised
-overenthusiastic
-overestimate
-overestimated
-overestimates
-overestimating
-overestimation
-overexposed
-overexposure
-overextended
-overfamiliarity
-overfed
-overfeed
-overfeeding
-overfill
-overfishing
-overflow
-overflowed
-overflowing
-overflown
-overflows
-overfly
-overflying
-overfull
-overgeneralised
-overgeneralising
-overgrazing
-overground
-overgrown
-overgrowth
-overhand
-overhang
-overhanging
-overhangs
-overhasty
-overhaul
-overhauled
-overhauling
-overhauls
-overhead
-overheads
-overhear
-overheard
-overhearing
-overhears
-overheat
-overheated
-overheating
-overhung
-overincredulous
-overindulgence
-overindulgent
-overinflated
-overjoyed
-overkill
-overladen
-overlaid
-overlain
-overland
-overlap
-overlapped
-overlapping
-overlaps
-overlay
-overlaying
-overlays
-overleaf
-overlie
-overlies
-overload
-overloaded
-overloading
-overloads
-overlong
-overlook
-overlooked
-overlooking
-overlooks
-overlord
-overlords
-overly
-overlying
-overmanning
-overmantel
-overmatching
-overmuch
-overnight
-overoptimistic
-overpaid
-overpass
-overpay
-overpayment
-overplay
-overplayed
-overplaying
-overpopulated
-overpopulation
-overpopulous
-overpower
-overpowered
-overpowering
-overpoweringly
-overpowers
-overpressure
-overpriced
-overprint
-overprinted
-overprinting
-overprints
-overproduced
-overproduction
-overqualified
-overran
-overrate
-overrated
-overreach
-overreached
-overreaching
-overreact
-overreacted
-overreacting
-overreaction
-overreacts
-overrepresented
-overridden
-override
-overrides
-overriding
-overripe
-overrode
-overrule
-overruled
-overruling
-overrun
-overrunning
-overruns
-overs
-oversampled
-oversampling
-oversaw
-overseas
-oversee
-overseeing
-overseen
-overseer
-overseers
-oversees
-oversensitive
-oversensitivity
-oversexed
-overshadow
-overshadowed
-overshadowing
-overshadows
-overshoot
-overshooting
-overshoots
-overshot
-oversight
-oversights
-oversimplification
-oversimplifications
-oversimplified
-oversimplifies
-oversimplify
-oversimplifying
-oversize
-oversized
-oversleep
-overslept
-overspend
-overspending
-overspent
-overspill
-overstaffed
-overstate
-overstated
-overstatement
-overstates
-overstating
-overstep
-overstepped
-overstepping
-oversteps
-overstocked
-overstocking
-overstress
-overstressed
-overstretch
-overstretched
-overstrung
-overstuffed
-oversubscribed
-oversupply
-overt
-overtake
-overtaken
-overtaker
-overtakers
-overtakes
-overtaking
-overtax
-overthetop
-overthrew
-overthrow
-overthrowing
-overthrown
-overthrows
-overtightened
-overtime
-overtly
-overtness
-overtone
-overtones
-overtook
-overtops
-overture
-overtures
-overturn
-overturned
-overturning
-overturns
-overuse
-overused
-overuses
-overvalue
-overvalued
-overview
-overviews
-overweening
-overweight
-overwhelm
-overwhelmed
-overwhelming
-overwhelmingly
-overwhelms
-overwinter
-overwintered
-overwintering
-overwork
-overworked
-overworking
-overwrite
-overwrites
-overwriting
-overwritten
-overwrote
-overwrought
-oviduct
-ovoid
-ovular
-ovulation
-ovum
-ow
-owe
-owed
-owes
-owing
-owl
-owlet
-owlets
-owlish
-owlishly
-owls
-own
-owned
-owner
-owners
-ownership
-ownerships
-owning
-owns
-ox
-oxalate
-oxalic
-oxcart
-oxen
-oxford
-oxidant
-oxidants
-oxidation
-oxide
-oxides
-oxidisation
-oxidise
-oxidised
-oxidiser
-oxidising
-oxtail
-oxtails
-oxygen
-oxygenated
-oxygenating
-oxygenation
-oxymoron
-oyster
-oysters
-ozone
-ozonefriendly
-pa
-pace
-paced
-pacemaker
-pacemakers
-paceman
-pacemen
-pacer
-pacers
-paces
-pacey
-pachyderm
-pacific
-pacification
-pacified
-pacifier
-pacifies
-pacifism
-pacifist
-pacifists
-pacify
-pacifying
-pacing
-pack
-packable
-package
-packaged
-packages
-packaging
-packed
-packer
-packers
-packet
-packets
-packhorse
-packing
-packings
-packs
-pact
-pacts
-pad
-padded
-padding
-paddings
-paddle
-paddled
-paddler
-paddlers
-paddles
-paddling
-paddock
-paddocks
-paddy
-padlock
-padlocked
-padlocking
-padlocks
-padre
-padres
-pads
-paean
-paeans
-paediatric
-paediatrician
-paediatricians
-paediatrics
-paedophile
-paedophiles
-paedophilia
-paella
-paeony
-pagan
-paganism
-pagans
-page
-pageant
-pageantry
-pageants
-pageboy
-paged
-pageful
-pager
-pagers
-pages
-paginal
-paginate
-paginated
-paginating
-pagination
-paging
-pagoda
-pagodas
-paid
-paidup
-pail
-pails
-pain
-pained
-painful
-painfully
-painfulness
-paining
-painkiller
-painkillers
-painless
-painlessly
-pains
-painstaking
-painstakingly
-paint
-paintbox
-paintbrush
-painted
-painter
-painters
-painting
-paintings
-paints
-paintwork
-pair
-paired
-pairing
-pairings
-pairs
-pairwise
-pajama
-pajamas
-pakistan
-pal
-palace
-palaces
-palaeographic
-palaeolithic
-palaeontological
-palaeontologist
-palaeontologists
-palaeontology
-palatability
-palatable
-palatal
-palate
-palates
-palatial
-palatinate
-palatine
-palaver
-pale
-paled
-paleface
-palely
-paleness
-paler
-pales
-palest
-palette
-palettes
-palimpsest
-palindrome
-palindromes
-palindromic
-paling
-palisade
-palisades
-pall
-palladium
-pallbearers
-palled
-pallet
-pallets
-palliative
-palliatives
-pallid
-pallmall
-pallor
-palls
-palm
-palmed
-palming
-palmist
-palmistry
-palms
-palmtop
-palmtops
-palmy
-palp
-palpable
-palpably
-palpate
-palpated
-palpates
-palpitate
-palpitated
-palpitating
-palpitation
-palpitations
-pals
-palsied
-palsy
-paltrier
-paltriest
-paltriness
-paltry
-paludal
-pampas
-pamper
-pampered
-pampering
-pampers
-pamphlet
-pamphleteer
-pamphleteers
-pamphlets
-pan
-panacea
-panaceas
-panache
-panama
-pancake
-pancaked
-pancakes
-pancreas
-pancreatic
-panda
-pandas
-pandemic
-pandemics
-pandemonium
-pander
-pandering
-panders
-pandora
-pane
-paned
-panel
-panelled
-panelling
-panellist
-panellists
-panels
-panes
-pang
-panga
-pangas
-pangolin
-pangs
-panic
-panicked
-panicking
-panicky
-panics
-panicstricken
-panjandrum
-panned
-pannier
-panniers
-panning
-panoply
-panorama
-panoramas
-panoramic
-pans
-pansies
-pansy
-pant
-pantaloons
-pantechnicon
-panted
-pantheism
-pantheist
-pantheistic
-pantheon
-panther
-panthers
-panties
-pantile
-pantiled
-pantiles
-panting
-pantograph
-pantographs
-pantomime
-pantomimes
-pantries
-pantry
-pants
-panzer
-pap
-papa
-papacy
-papal
-paparazzi
-papas
-papaw
-papaws
-papaya
-paper
-paperback
-paperbacks
-papered
-papering
-paperless
-papers
-paperthin
-paperweight
-paperweights
-paperwork
-papery
-papilla
-papist
-pappy
-paprika
-papua
-papule
-papyri
-papyrus
-par
-parable
-parables
-parabola
-parabolas
-parabolic
-paraboloid
-paraboloids
-paracetamol
-parachute
-parachuted
-parachutes
-parachuting
-parachutist
-parachutists
-parade
-paraded
-parader
-parades
-paradigm
-paradigmatic
-paradigms
-parading
-paradise
-paradises
-paradox
-paradoxes
-paradoxical
-paradoxically
-paraffin
-paragliding
-paragon
-paragons
-paragraph
-paragraphing
-paragraphs
-paraguay
-parakeet
-parakeets
-paralinguistic
-parallax
-parallaxes
-parallel
-paralleled
-parallelepiped
-paralleling
-parallelism
-parallelogram
-parallelograms
-parallels
-paralyse
-paralysed
-paralyses
-paralysing
-paralysis
-paralytic
-paralytically
-paramagnetic
-paramagnetism
-paramedic
-paramedical
-paramedics
-parameter
-parameters
-parametric
-parametrically
-parametrisation
-parametrise
-parametrised
-parametrises
-paramilitaries
-paramilitary
-paramount
-paramountcy
-paramour
-paranoia
-paranoiac
-paranoiacs
-paranoid
-paranormal
-parapet
-parapets
-paraphernalia
-paraphrase
-paraphrased
-paraphrases
-paraphrasing
-paraplegic
-parapsychologist
-parapsychology
-paraquat
-parasite
-parasites
-parasitic
-parasitical
-parasitised
-parasitism
-parasitologist
-parasitology
-parasol
-parasols
-paratroop
-paratrooper
-paratroopers
-paratroops
-parboil
-parcel
-parcelled
-parcelling
-parcels
-parch
-parched
-parches
-parchment
-parchments
-pardon
-pardonable
-pardoned
-pardoning
-pardons
-pare
-pared
-parent
-parentage
-parental
-parented
-parenteral
-parentheses
-parenthesis
-parenthesise
-parenthesised
-parenthetic
-parenthetical
-parenthetically
-parenthood
-parenting
-parentinlaw
-parents
-parentsinlaw
-pares
-parfait
-parfaits
-pariah
-pariahs
-parietal
-paring
-paris
-parish
-parishes
-parishioner
-parishioners
-parisian
-parities
-parity
-park
-parka
-parkas
-parked
-parking
-parkland
-parks
-parlance
-parley
-parleying
-parliament
-parliamentarian
-parliamentarians
-parliamentary
-parliaments
-parlour
-parlourmaid
-parlours
-parlous
-parochial
-parochialism
-parochiality
-parodied
-parodies
-parodist
-parody
-parodying
-parole
-paroxysm
-paroxysms
-parquet
-parried
-parries
-parrot
-parroting
-parrots
-parry
-parrying
-parse
-parsec
-parsecs
-parsed
-parser
-parsers
-parses
-parsimonious
-parsimony
-parsing
-parsings
-parsley
-parsnip
-parsnips
-parson
-parsonage
-parsons
-part
-partake
-partaken
-partaker
-partakers
-partakes
-partaking
-parted
-parthenogenesis
-partial
-partiality
-partially
-participant
-participants
-participate
-participated
-participates
-participating
-participation
-participative
-participators
-participatory
-participle
-participles
-particle
-particles
-particular
-particularise
-particularised
-particularism
-particularities
-particularity
-particularly
-particulars
-particulate
-particulates
-parties
-parting
-partings
-partisan
-partisans
-partisanship
-partition
-partitioned
-partitioning
-partitions
-partly
-partner
-partnered
-partnering
-partners
-partnership
-partnerships
-partook
-partridge
-partridges
-parts
-parttime
-party
-parvenu
-pascal
-pascals
-paschal
-pass
-passable
-passably
-passage
-passages
-passageway
-passageways
-passant
-passe
-passed
-passenger
-passengers
-passer
-passers
-passersby
-passes
-passim
-passing
-passion
-passionate
-passionately
-passionateness
-passionless
-passions
-passivated
-passive
-passively
-passives
-passivity
-passmark
-passover
-passport
-passports
-password
-passwords
-past
-pasta
-pastas
-paste
-pasteboard
-pasted
-pastel
-pastels
-pastes
-pasteur
-pasteurisation
-pasteurised
-pastiche
-pastiches
-pasties
-pastille
-pastime
-pastimes
-pasting
-pastis
-pastor
-pastoral
-pastoralism
-pastors
-pastrami
-pastries
-pastry
-pasts
-pasture
-pastured
-pastureland
-pastures
-pasturing
-pasty
-pat
-patch
-patchable
-patched
-patches
-patchier
-patchiest
-patchily
-patchiness
-patching
-patchup
-patchwork
-patchy
-pate
-patella
-paten
-patent
-patentable
-patented
-patentee
-patenting
-patently
-patents
-pater
-paternal
-paternalism
-paternalist
-paternalistic
-paternally
-paternity
-pates
-path
-pathetic
-pathetically
-pathfinder
-pathfinders
-pathless
-pathogen
-pathogenesis
-pathogenic
-pathogens
-pathological
-pathologically
-pathologies
-pathologist
-pathologists
-pathology
-pathos
-paths
-pathway
-pathways
-patience
-patient
-patiently
-patients
-patina
-patination
-patio
-patisserie
-patois
-patriarch
-patriarchal
-patriarchies
-patriarchs
-patriarchy
-patrician
-patricians
-patrilineal
-patrimony
-patriot
-patriotic
-patriotism
-patriots
-patrol
-patrolled
-patrolling
-patrols
-patron
-patronage
-patroness
-patronesses
-patronisation
-patronise
-patronised
-patronises
-patronising
-patronisingly
-patrons
-pats
-patted
-patten
-pattens
-patter
-pattered
-pattering
-pattern
-patterned
-patterning
-patternless
-patterns
-patters
-patties
-patting
-paucity
-paul
-paunch
-paunchy
-pauper
-paupers
-pause
-paused
-pauses
-pausing
-pave
-paved
-pavement
-pavements
-paves
-pavilion
-pavilions
-paving
-pavings
-pavlov
-paw
-pawed
-pawing
-pawn
-pawnbroker
-pawnbrokers
-pawned
-pawning
-pawns
-pawnshop
-pawnshops
-pawpaw
-pawpaws
-paws
-pay
-payable
-payback
-payday
-paydays
-payed
-payee
-payees
-payer
-payers
-paying
-payload
-payloads
-paymaster
-paymasters
-payment
-payments
-payphone
-payphones
-payroll
-payrolls
-pays
-payslips
-pea
-peace
-peaceable
-peaceably
-peaceful
-peacefully
-peacefulness
-peacekeepers
-peacekeeping
-peacemaker
-peacemakers
-peacemaking
-peacetime
-peach
-peaches
-peachier
-peachiest
-peachy
-peacock
-peacocks
-peafowl
-peahens
-peak
-peaked
-peakiness
-peaking
-peaks
-peaky
-peal
-pealed
-pealing
-peals
-peanut
-peanuts
-pear
-pearl
-pearls
-pearly
-pears
-peartrees
-peas
-peasant
-peasantry
-peasants
-peat
-peatland
-peatlands
-peaty
-pebble
-pebbled
-pebbles
-pebbly
-pecan
-peccary
-peck
-pecked
-pecker
-peckers
-pecking
-peckish
-pecks
-pectin
-pectoral
-pectorals
-peculiar
-peculiarities
-peculiarity
-peculiarly
-pecuniary
-pedagogic
-pedagogical
-pedagogically
-pedagogue
-pedagogy
-pedal
-pedalled
-pedalling
-pedals
-pedant
-pedantic
-pedantically
-pedantry
-pedants
-peddle
-peddled
-peddler
-peddlers
-peddles
-peddling
-pederasts
-pedestal
-pedestals
-pedestrian
-pedestrianisation
-pedestrianised
-pedestrians
-pedigree
-pedigrees
-pediment
-pedimented
-pediments
-pedlar
-pedlars
-pedology
-peek
-peeked
-peeking
-peeks
-peel
-peeled
-peeler
-peelers
-peeling
-peelings
-peels
-peep
-peeped
-peeper
-peepers
-peephole
-peeping
-peeps
-peer
-peerage
-peerages
-peered
-peering
-peerless
-peers
-peevish
-peevishly
-peevishness
-peg
-pegasus
-pegged
-pegging
-pegs
-pejorative
-pejoratively
-pejoratives
-pekan
-peking
-pele
-pelican
-pelicans
-pellet
-pellets
-pelmet
-pelmets
-pelt
-pelted
-pelting
-pelts
-pelvic
-pelvis
-pelvises
-pen
-penal
-penalisation
-penalise
-penalised
-penalises
-penalising
-penalties
-penalty
-penance
-penances
-pence
-penchant
-pencil
-pencilled
-pencilling
-pencils
-pendant
-pendants
-pending
-pendulous
-pendulum
-pendulums
-penetrable
-penetrate
-penetrated
-penetrates
-penetrating
-penetratingly
-penetration
-penetrations
-penetrative
-penguin
-penguins
-penicillin
-penile
-peninsula
-peninsular
-peninsulas
-penitence
-penitent
-penitential
-penitentiary
-penitently
-penitents
-penknife
-penname
-pennames
-pennant
-pennants
-penned
-pennies
-penniless
-penning
-penny
-pennypinching
-penology
-pens
-pension
-pensionable
-pensioned
-pensioner
-pensioners
-pensioning
-pensions
-pensive
-pensively
-pensiveness
-pent
-pentagon
-pentagonal
-pentagons
-pentagram
-pentagrams
-pentameter
-pentameters
-pentasyllabic
-pentathlete
-pentathlon
-pentatonic
-pentecostal
-penthouse
-penultimate
-penultimately
-penumbra
-penurious
-penury
-peonies
-people
-peopled
-peoples
-pep
-peperoni
-pepper
-peppercorn
-peppercorns
-peppered
-peppering
-peppermint
-peppermints
-peppers
-peppery
-peps
-peptic
-peptide
-peptides
-per
-perambulate
-perambulated
-perambulating
-perambulations
-perambulator
-perannum
-percales
-perceivable
-perceive
-perceived
-perceives
-perceiving
-percent
-percentage
-percentages
-percentile
-percentiles
-percept
-perceptibility
-perceptible
-perceptibly
-perception
-perceptions
-perceptive
-perceptively
-perceptiveness
-percepts
-perceptual
-perceptually
-perch
-perchance
-perched
-percher
-perches
-perching
-perchlorate
-percipient
-percolate
-percolated
-percolates
-percolating
-percolation
-percolator
-percolators
-percuss
-percussed
-percusses
-percussing
-percussion
-percussionist
-percussionists
-percussive
-percussively
-percutaneous
-perdition
-peregrinations
-peregrine
-peregrines
-peremptorily
-peremptoriness
-peremptory
-perennial
-perennially
-perennials
-perestroika
-perfect
-perfected
-perfectibility
-perfecting
-perfection
-perfectionism
-perfectionist
-perfectionists
-perfections
-perfectly
-perfects
-perfidious
-perfidiously
-perfidy
-perforate
-perforated
-perforation
-perforations
-perforce
-perform
-performable
-performance
-performances
-performed
-performer
-performers
-performing
-performs
-perfume
-perfumed
-perfumery
-perfumes
-perfuming
-perfunctorily
-perfunctory
-perfused
-perfusion
-pergola
-pergolas
-perhaps
-peri
-periastron
-perigee
-periglacial
-perihelion
-peril
-perilous
-perilously
-perils
-perimeter
-perimeters
-perinatal
-perineal
-perineum
-period
-periodic
-periodical
-periodically
-periodicals
-periodicity
-periods
-perioperative
-peripatetic
-peripheral
-peripherally
-peripherals
-peripheries
-periphery
-periphrasis
-periphrastic
-periscope
-periscopes
-perish
-perishable
-perishables
-perished
-perishes
-perishing
-peritoneum
-perjure
-perjured
-perjurer
-perjury
-perk
-perked
-perkier
-perkiest
-perkily
-perking
-perks
-perky
-perm
-permafrost
-permanence
-permanency
-permanent
-permanently
-permanganate
-permeability
-permeable
-permeate
-permeated
-permeates
-permeating
-permeation
-permed
-perming
-permissibility
-permissible
-permission
-permissions
-permissive
-permissiveness
-permit
-permits
-permitted
-permitting
-permittivity
-perms
-permutation
-permutations
-permute
-permuted
-permutes
-permuting
-pernicious
-perniciousness
-peroration
-peroxidase
-peroxide
-peroxides
-perpendicular
-perpendicularly
-perpendiculars
-perpetrate
-perpetrated
-perpetrates
-perpetrating
-perpetration
-perpetrator
-perpetrators
-perpetual
-perpetually
-perpetuate
-perpetuated
-perpetuates
-perpetuating
-perpetuation
-perpetuity
-perplex
-perplexed
-perplexedly
-perplexing
-perplexities
-perplexity
-perquisite
-perquisites
-perron
-perry
-persecute
-persecuted
-persecuting
-persecution
-persecutions
-persecutor
-persecutors
-perseverance
-persevere
-persevered
-perseveres
-persevering
-perseveringly
-persia
-persian
-persist
-persisted
-persistence
-persistent
-persistently
-persisting
-persists
-person
-persona
-personable
-personae
-personage
-personages
-personal
-personalisation
-personalise
-personalised
-personalising
-personalities
-personality
-personally
-personification
-personifications
-personified
-personifies
-personify
-personifying
-personnel
-persons
-perspective
-perspectives
-perspex
-perspicacious
-perspicacity
-perspicuity
-perspicuous
-perspicuously
-perspiration
-perspire
-perspiring
-persuade
-persuaded
-persuaders
-persuades
-persuading
-persuasion
-persuasions
-persuasive
-persuasively
-persuasiveness
-pert
-pertain
-pertained
-pertaining
-pertains
-perth
-pertinacious
-pertinaciously
-pertinacity
-pertinence
-pertinent
-pertinently
-pertly
-pertness
-perturb
-perturbation
-perturbations
-perturbed
-perturbing
-peru
-perusal
-peruse
-perused
-peruses
-perusing
-peruvian
-pervade
-pervaded
-pervades
-pervading
-pervasive
-pervasiveness
-perverse
-perversely
-perverseness
-perversion
-perversions
-perversity
-pervert
-perverted
-perverting
-perverts
-peseta
-pesetas
-pesky
-pessimism
-pessimist
-pessimistic
-pessimistically
-pessimists
-pest
-pester
-pestered
-pestering
-pesticide
-pesticides
-pestilence
-pestilent
-pestilential
-pestle
-pests
-pet
-petal
-petals
-petard
-peter
-petered
-petering
-peters
-pethidine
-petit
-petite
-petition
-petitioned
-petitioner
-petitioners
-petitioning
-petitions
-petrel
-petrels
-petrification
-petrified
-petrifies
-petrify
-petrifying
-petrochemical
-petrochemicals
-petrographic
-petrographical
-petrol
-petroleum
-petrological
-petrology
-pets
-petted
-petticoat
-petticoats
-pettier
-pettiest
-pettifoggers
-pettifogging
-pettiness
-petting
-pettish
-pettishly
-pettishness
-petty
-petulance
-petulant
-petulantly
-petunia
-petunias
-pew
-pews
-pewter
-phalanx
-phantasy
-phantom
-phantoms
-pharaoh
-pharmaceutical
-pharmaceuticals
-pharmacies
-pharmacist
-pharmacists
-pharmacological
-pharmacologist
-pharmacologists
-pharmacology
-pharmacy
-pharynx
-phase
-phased
-phases
-phasing
-pheasant
-pheasants
-phenol
-phenols
-phenomena
-phenomenal
-phenomenally
-phenomenological
-phenomenologically
-phenomenologists
-phenomenology
-phenomenon
-phenotype
-phenotypes
-phenylalanine
-pheromone
-pheromones
-phew
-philanthropic
-philanthropist
-philanthropists
-philanthropy
-philatelic
-philatelists
-philately
-philharmonic
-philistine
-philological
-philologist
-philologists
-philology
-philosopher
-philosophers
-philosophic
-philosophical
-philosophically
-philosophies
-philosophise
-philosophising
-philosophy
-phlebotomy
-phlegm
-phlegmatic
-phlegmatically
-phlogiston
-phlox
-phobia
-phobias
-phobic
-phoenix
-phoenixes
-phone
-phoned
-phoneme
-phonemes
-phonemic
-phonemically
-phoner
-phones
-phonetic
-phonetically
-phoneticians
-phoneticist
-phonetics
-phoney
-phoneys
-phoning
-phonograph
-phonographic
-phonological
-phonologically
-phonology
-phonon
-phony
-phooey
-phosphatase
-phosphate
-phosphates
-phosphatic
-phospholipids
-phosphor
-phosphorescence
-phosphorescent
-phosphoric
-phosphorous
-phosphors
-phosphorus
-photo
-photocells
-photochemical
-photochemically
-photochemistry
-photocopied
-photocopier
-photocopiers
-photocopies
-photocopy
-photocopying
-photoelectric
-photoelectrically
-photogenic
-photograph
-photographed
-photographer
-photographers
-photographic
-photographically
-photographing
-photographs
-photography
-photolysis
-photolytic
-photometric
-photometrically
-photometry
-photomultiplier
-photon
-photons
-photoreceptor
-photos
-photosensitive
-photosphere
-photostat
-photosynthesis
-photosynthesising
-photosynthetic
-photosynthetically
-phototypesetter
-phototypesetting
-photovoltaic
-phrasal
-phrase
-phrasebook
-phrased
-phraseology
-phrases
-phrasing
-phrenological
-phrenologically
-phrenologists
-phrenology
-phyla
-phylactery
-phylogenetic
-phylogeny
-phylum
-physic
-physical
-physicality
-physically
-physician
-physicians
-physicist
-physicists
-physics
-physio
-physiognomies
-physiognomy
-physiological
-physiologically
-physiologist
-physiologists
-physiology
-physiotherapist
-physiotherapists
-physiotherapy
-physique
-phytoplankton
-pi
-pianissimo
-pianist
-pianistic
-pianists
-piano
-pianoforte
-pianola
-piazza
-piazzas
-pica
-picaresque
-picasso
-piccolo
-pick
-pickaxe
-pickaxes
-picked
-picker
-pickerel
-pickerels
-pickers
-picket
-picketed
-picketing
-pickets
-picking
-pickings
-pickle
-pickled
-pickles
-pickling
-pickpocket
-pickpocketing
-pickpockets
-picks
-pickup
-pickups
-picnic
-picnicked
-picnickers
-picnicking
-picnics
-picoseconds
-pictogram
-pictograms
-pictographic
-pictorial
-pictorially
-pictural
-picture
-pictured
-pictures
-picturesque
-picturesquely
-picturesqueness
-picturing
-pidgin
-pie
-piebald
-piece
-pieced
-piecemeal
-pieces
-piecewise
-piecework
-piecing
-pied
-pier
-pierce
-pierced
-piercer
-piercers
-pierces
-piercing
-piercingly
-piers
-pies
-pieta
-piety
-piezoelectric
-piffle
-pig
-pigeon
-pigeons
-piggery
-piggish
-piggy
-piggyback
-piglet
-piglets
-pigment
-pigmentation
-pigmented
-pigments
-pigs
-pigsties
-pigsty
-pigtail
-pigtailed
-pigtails
-pike
-pikemen
-pikes
-pikestaff
-pilaster
-pilasters
-pilchard
-pilchards
-pile
-piled
-piles
-pileup
-pilfer
-pilfered
-pilfering
-pilgrim
-pilgrimage
-pilgrimages
-pilgrims
-piling
-pill
-pillage
-pillaged
-pillages
-pillaging
-pillar
-pillared
-pillars
-pillbox
-pillion
-pilloried
-pillories
-pillory
-pillow
-pillowcase
-pillowcases
-pillowed
-pillows
-pills
-pilot
-piloted
-piloting
-pilots
-pimp
-pimpernel
-pimping
-pimple
-pimpled
-pimples
-pimply
-pimps
-pin
-pinafore
-pinafores
-pinball
-pincer
-pincered
-pincers
-pinch
-pinched
-pincher
-pinches
-pinching
-pincushion
-pincushions
-pine
-pineal
-pineapple
-pineapples
-pined
-pines
-ping
-pingpong
-pings
-pinhead
-pinheads
-pinhole
-pinholes
-pining
-pinion
-pinioned
-pinions
-pink
-pinked
-pinker
-pinkie
-pinkies
-pinking
-pinkish
-pinkness
-pinks
-pinky
-pinnacle
-pinnacled
-pinnacles
-pinned
-pinning
-pinpoint
-pinpointed
-pinpointing
-pinpoints
-pinprick
-pinpricks
-pins
-pinstripe
-pinstriped
-pinstripes
-pint
-pints
-pintsized
-pinup
-pinups
-piny
-pion
-pioneer
-pioneered
-pioneering
-pioneers
-pions
-pious
-piously
-pip
-pipe
-piped
-pipeline
-pipelines
-piper
-pipers
-pipes
-pipette
-pipettes
-pipework
-piping
-pipings
-pipit
-pipits
-pipped
-pippin
-pipping
-pips
-piquancy
-piquant
-pique
-piqued
-piracies
-piracy
-piranha
-piranhas
-pirate
-pirated
-pirates
-piratical
-pirating
-pirouette
-pirouetted
-pirouettes
-pirouetting
-pisa
-pistol
-pistols
-piston
-pistons
-pit
-pitbull
-pitch
-pitchdark
-pitched
-pitcher
-pitchers
-pitches
-pitchfork
-pitchforks
-pitching
-piteous
-piteously
-pitfall
-pitfalls
-pith
-pithead
-pithier
-pithiest
-pithily
-piths
-pithy
-pitiable
-pitiably
-pitied
-pities
-pitiful
-pitifully
-pitiless
-pitilessly
-piton
-pitons
-pits
-pittance
-pitted
-pitting
-pituitary
-pity
-pitying
-pityingly
-pivot
-pivotal
-pivoted
-pivoting
-pivots
-pixel
-pixels
-pixie
-pixies
-pizazz
-pizza
-pizzas
-pizzeria
-pizzerias
-pizzicato
-placard
-placards
-placate
-placated
-placates
-placating
-placatingly
-placatory
-place
-placebo
-placed
-placeholder
-placemen
-placement
-placements
-placenta
-placentae
-placental
-placentas
-placer
-placers
-places
-placid
-placidity
-placidly
-placing
-placings
-plagiarise
-plagiarised
-plagiarising
-plagiarism
-plagiarist
-plagiarists
-plague
-plagued
-plagues
-plaguing
-plaice
-plaid
-plaids
-plain
-plainest
-plainly
-plainness
-plains
-plaint
-plaintiff
-plaintiffs
-plaintive
-plaintively
-plait
-plaited
-plaiting
-plaits
-plan
-planar
-plane
-planed
-planes
-planet
-planetarium
-planetary
-planetesimals
-planetoids
-planets
-plangent
-planing
-plank
-planking
-planks
-plankton
-planktonic
-planned
-planner
-planners
-planning
-plans
-plant
-plantain
-plantation
-plantations
-planted
-planter
-planters
-planting
-plantings
-plants
-plaque
-plaques
-plasm
-plasma
-plasmas
-plasmid
-plasmids
-plaster
-plasterboard
-plastered
-plasterer
-plasterers
-plastering
-plasters
-plasterwork
-plastic
-plasticised
-plasticisers
-plasticity
-plastics
-plate
-plateau
-plateaus
-plateaux
-plated
-plateful
-platefuls
-platelet
-platelets
-platen
-platens
-plates
-platform
-platforms
-plating
-platinum
-platitude
-platitudes
-platitudinous
-plato
-platonic
-platoon
-platoons
-platter
-platters
-platypus
-platypuses
-plaudits
-plausibility
-plausible
-plausibly
-play
-playable
-playback
-playboy
-playboys
-played
-player
-players
-playfellow
-playfellows
-playful
-playfully
-playfulness
-playground
-playgrounds
-playgroup
-playgroups
-playhouse
-playing
-playings
-playmate
-playmates
-playroom
-plays
-plaything
-playthings
-playtime
-playwright
-playwrights
-plaza
-plazas
-plea
-plead
-pleaded
-pleading
-pleadingly
-pleadings
-pleads
-pleas
-pleasant
-pleasanter
-pleasantest
-pleasantly
-pleasantness
-pleasantries
-pleasantry
-please
-pleased
-pleases
-pleasing
-pleasingly
-pleasurable
-pleasurably
-pleasure
-pleasures
-pleat
-pleated
-pleats
-pleb
-plebeian
-plebiscite
-plebs
-plectrum
-plectrums
-pledge
-pledged
-pledges
-pledging
-plenary
-plenipotentiary
-plenitude
-plenteous
-plenteously
-plentiful
-plentifully
-plenty
-plenum
-plethora
-pleura
-pleural
-pleurisy
-plexus
-pliable
-pliant
-plied
-pliers
-plies
-plight
-plights
-plimsolls
-plinth
-plinths
-plod
-plodded
-plodder
-plodding
-plods
-plop
-plopped
-plopping
-plops
-plosive
-plot
-plots
-plotted
-plotter
-plotters
-plotting
-plough
-ploughed
-ploughers
-ploughing
-ploughman
-ploughmen
-ploughs
-ploughshare
-ploughshares
-plover
-plovers
-ploy
-ploys
-pluck
-plucked
-plucker
-pluckier
-pluckiest
-plucking
-plucks
-plucky
-plug
-plugged
-plugging
-plughole
-plugs
-plum
-plumage
-plumages
-plumb
-plumbago
-plumbed
-plumber
-plumbers
-plumbing
-plumbs
-plume
-plumed
-plumes
-pluming
-plummet
-plummeted
-plummeting
-plummets
-plummy
-plump
-plumped
-plumper
-plumping
-plumpness
-plums
-plumtree
-plumy
-plunder
-plundered
-plunderers
-plundering
-plunders
-plunge
-plunged
-plunger
-plungers
-plunges
-plunging
-pluperfect
-plural
-pluralisation
-pluralise
-pluralised
-pluralising
-pluralism
-pluralist
-pluralistic
-pluralists
-plurality
-plurals
-plus
-pluses
-plush
-plushy
-pluto
-plutocracy
-plutocrats
-plutonic
-plutonium
-ply
-plying
-plywood
-pneumatic
-pneumatics
-pneumonia
-poach
-poached
-poacher
-poachers
-poaches
-poaching
-pock
-pocked
-pocket
-pocketbook
-pocketed
-pocketful
-pocketing
-pockets
-pockmarked
-pocks
-pod
-podded
-podgy
-podia
-podium
-podiums
-pods
-poem
-poems
-poet
-poetess
-poetic
-poetical
-poetically
-poetics
-poetise
-poetry
-poets
-pogo
-pogrom
-pogroms
-poignancy
-poignant
-poignantly
-poikilothermic
-poinsettias
-point
-pointblank
-pointed
-pointedly
-pointedness
-pointer
-pointers
-pointillism
-pointillist
-pointing
-pointless
-pointlessly
-pointlessness
-points
-pointy
-poise
-poised
-poises
-poising
-poison
-poisoned
-poisoner
-poisoning
-poisonings
-poisonous
-poisons
-poke
-poked
-poker
-pokerfaced
-pokers
-pokes
-poking
-poky
-poland
-polar
-polarisation
-polarisations
-polarise
-polarised
-polarising
-polarities
-polarity
-polder
-pole
-polecat
-polecats
-poled
-polemic
-polemical
-polemicist
-polemics
-poles
-polestar
-polevaulting
-poleward
-polewards
-police
-policed
-policeman
-policemen
-polices
-policewoman
-policewomen
-policies
-policing
-policy
-policyholder
-policyholders
-polio
-poliomyelitis
-polish
-polished
-polisher
-polishers
-polishes
-polishing
-polishings
-politburo
-polite
-politely
-politeness
-politer
-politesse
-politest
-politic
-political
-politically
-politician
-politicians
-politicisation
-politicise
-politicised
-politicising
-politicking
-politics
-polity
-polka
-polkas
-poll
-pollarded
-polled
-pollen
-pollens
-pollinate
-pollinated
-pollinating
-pollination
-pollinator
-pollinators
-polling
-polls
-pollster
-pollsters
-pollutant
-pollutants
-pollute
-polluted
-polluter
-polluters
-pollutes
-polluting
-pollution
-pollutions
-polo
-polonaise
-polonaises
-poloneck
-polonies
-polonium
-polony
-poltergeist
-poltergeists
-poltroon
-polyandry
-polyatomic
-polycarbonate
-polychromatic
-polychrome
-polycotton
-polycrystalline
-polycyclic
-polyester
-polyesters
-polyethylene
-polygamous
-polygamy
-polyglot
-polyglots
-polygon
-polygonal
-polygons
-polygraph
-polygynous
-polygyny
-polyhedra
-polyhedral
-polyhedron
-polymath
-polymer
-polymerase
-polymerases
-polymeric
-polymerisation
-polymerised
-polymers
-polymorphic
-polymorphism
-polymorphisms
-polymorphous
-polynomial
-polynomially
-polynomials
-polyp
-polypeptide
-polypeptides
-polyphonic
-polyphony
-polypropylene
-polyps
-polysaccharide
-polysaccharides
-polystyrene
-polysyllabic
-polysyllable
-polysyllables
-polytechnic
-polytechnics
-polytheism
-polytheist
-polytheistic
-polytheists
-polythene
-polytopes
-polyunsaturated
-polyunsaturates
-polyurethane
-pomade
-pomades
-pomegranate
-pomegranates
-pomelo
-pomp
-pompadour
-pompeii
-pompey
-pomposity
-pompous
-pompously
-pompousness
-ponce
-poncho
-pond
-ponder
-pondered
-pondering
-ponderous
-ponderously
-ponders
-ponds
-ponies
-pontiff
-pontiffs
-pontifical
-pontificate
-pontificated
-pontificating
-pontification
-pontifications
-pontoon
-pontoons
-pony
-ponytail
-pooch
-pooches
-poodle
-poodles
-poof
-pooh
-pool
-pooled
-pooling
-pools
-poolside
-poop
-poor
-poorer
-poorest
-poorly
-poorness
-poorspirited
-pop
-popcorn
-pope
-popes
-popeyed
-poplar
-poplars
-popmusic
-popped
-popper
-poppet
-poppies
-popping
-poppy
-poppycock
-pops
-populace
-popular
-popularisation
-popularisations
-popularise
-popularised
-popularising
-popularity
-popularly
-populate
-populated
-populating
-population
-populations
-populism
-populist
-populists
-populous
-popup
-porcelain
-porch
-porches
-porcine
-porcupine
-porcupines
-pore
-pored
-pores
-poring
-pork
-porkchop
-porker
-porky
-porn
-porno
-pornographer
-pornographers
-pornographic
-pornography
-porns
-porosity
-porous
-porphyritic
-porphyry
-porpoise
-porpoises
-porridge
-port
-portability
-portable
-portables
-portage
-portal
-portals
-portcullis
-portcullises
-ported
-portend
-portended
-portending
-portends
-portent
-portentous
-portentously
-portents
-porter
-porterage
-porters
-portfolio
-porthole
-portholes
-portico
-porting
-portion
-portions
-portly
-portmanteau
-portmanteaus
-portrait
-portraitist
-portraits
-portraiture
-portray
-portrayal
-portrayals
-portrayed
-portraying
-portrays
-ports
-portugal
-pose
-posed
-poseidon
-poser
-posers
-poses
-poseur
-poseurs
-posh
-posies
-posing
-posit
-posited
-positing
-position
-positionable
-positional
-positionally
-positioned
-positioning
-positions
-positive
-positively
-positiveness
-positives
-positivism
-positivist
-positivists
-positivity
-positron
-positrons
-posits
-posse
-possess
-possessed
-possesses
-possessing
-possession
-possessions
-possessive
-possessively
-possessiveness
-possessives
-possessor
-possessors
-possibilities
-possibility
-possible
-possibles
-possibly
-possum
-possums
-post
-postage
-postal
-postbag
-postbox
-postboxes
-postcard
-postcards
-postcode
-postcodes
-postdated
-posted
-poster
-posterior
-posteriors
-posterity
-posters
-postfixes
-postgraduate
-postgraduates
-posthumous
-posthumously
-postilion
-postilions
-postillion
-posting
-postings
-postlude
-postman
-postmark
-postmarked
-postmarks
-postmaster
-postmasters
-postmen
-postmistress
-postmodern
-postmodernism
-postmodernist
-postmortem
-postmortems
-postnatal
-postoperative
-postoperatively
-postpone
-postponed
-postponement
-postponements
-postpones
-postponing
-posts
-postscript
-postscripts
-postulate
-postulated
-postulates
-postulating
-postulation
-postural
-posture
-postured
-postures
-posturing
-posturings
-posy
-pot
-potable
-potash
-potassium
-potato
-potbellied
-potch
-potencies
-potency
-potent
-potentate
-potentates
-potential
-potentialities
-potentiality
-potentially
-potentials
-potentiometer
-potentiometers
-potently
-pothole
-potholes
-potion
-potions
-potpourri
-pots
-potsherds
-potshot
-potshots
-pottage
-potted
-potter
-pottered
-potteries
-pottering
-potters
-pottery
-potties
-potting
-potty
-pouch
-pouches
-pouffe
-pouffes
-poult
-poulterer
-poultice
-poultry
-pounce
-pounced
-pounces
-pouncing
-pound
-poundage
-pounded
-pounding
-pounds
-pour
-pourable
-poured
-pouring
-pours
-pout
-pouted
-pouter
-pouting
-pouts
-poverty
-povertystricken
-powder
-powdered
-powdering
-powders
-powdery
-power
-powerboat
-powerboats
-powered
-powerful
-powerfully
-powerfulness
-powerhouse
-powerhouses
-powering
-powerless
-powerlessness
-powers
-powersharing
-pox
-practicabilities
-practicability
-practicable
-practical
-practicalities
-practicality
-practically
-practicals
-practice
-practices
-practise
-practised
-practises
-practising
-practitioner
-practitioners
-pragmatic
-pragmatically
-pragmatics
-pragmatism
-pragmatist
-pragmatists
-prague
-prairie
-prairies
-praise
-praised
-praises
-praiseworthy
-praising
-praline
-pram
-prams
-prance
-pranced
-prancer
-prancing
-prang
-prank
-pranks
-prankster
-pranksters
-prat
-prattle
-prattled
-prattler
-prattling
-prawn
-prawns
-pray
-prayed
-prayer
-prayerbook
-prayerful
-prayerfully
-prayers
-praying
-prays
-pre
-preach
-preached
-preacher
-preachers
-preaches
-preaching
-preachings
-preadolescent
-preallocate
-preamble
-preambles
-preamp
-preamplifier
-prearranged
-preauthorise
-prebend
-prebendary
-precarious
-precariously
-precariousness
-precaution
-precautionary
-precautions
-precede
-preceded
-precedence
-precedences
-precedent
-precedents
-precedes
-preceding
-precept
-precepts
-precess
-precessed
-precessing
-precession
-precinct
-precincts
-precious
-preciously
-preciousness
-precipice
-precipices
-precipitate
-precipitated
-precipitately
-precipitates
-precipitating
-precipitation
-precipitous
-precipitously
-precis
-precise
-precisely
-preciseness
-precision
-precisions
-preclinical
-preclude
-precluded
-precludes
-precluding
-precocious
-precociously
-precociousness
-precocity
-precognition
-precognitions
-precomputed
-preconceived
-preconception
-preconceptions
-precondition
-preconditions
-precooked
-precursor
-precursors
-predate
-predated
-predates
-predating
-predation
-predations
-predator
-predators
-predatory
-predeceased
-predecessor
-predecessors
-predeclared
-predefine
-predefined
-predefining
-predestination
-predestined
-predetermination
-predetermine
-predetermined
-predetermines
-predicament
-predicaments
-predicate
-predicated
-predicates
-predicating
-predicative
-predict
-predictability
-predictable
-predictably
-predicted
-predicting
-prediction
-predictions
-predictive
-predictor
-predictors
-predicts
-predilection
-predilections
-predispose
-predisposed
-predisposes
-predisposing
-predisposition
-predispositions
-predominance
-predominant
-predominantly
-predominate
-predominated
-predominates
-predominating
-preen
-preened
-preening
-preens
-prefab
-prefabricated
-prefabrication
-prefabs
-preface
-prefaced
-prefaces
-prefacing
-prefatory
-prefect
-prefects
-prefecture
-prefer
-preferable
-preferably
-preference
-preferences
-preferential
-preferentially
-preferment
-preferred
-preferring
-prefers
-prefigured
-prefix
-prefixed
-prefixes
-prefixing
-pregnancies
-pregnancy
-pregnant
-preheat
-preheating
-prehensile
-prehistoric
-prehistory
-prejudge
-prejudged
-prejudging
-prejudice
-prejudiced
-prejudices
-prejudicial
-prejudicing
-prelate
-prelates
-preliminaries
-preliminarily
-preliminary
-prelude
-preludes
-premature
-prematurely
-prematureness
-prematurity
-premeditate
-premeditated
-premeditation
-premenstrual
-premier
-premiere
-premiered
-premieres
-premiers
-premiership
-premise
-premised
-premises
-premising
-premiss
-premisses
-premium
-premiums
-premolar
-premolars
-premonition
-premonitions
-prenatal
-preoccupation
-preoccupations
-preoccupied
-preoccupy
-preoccupying
-preordained
-prep
-prepaid
-preparation
-preparations
-preparative
-preparatory
-prepare
-prepared
-preparedness
-preparer
-preparers
-prepares
-preparing
-prepayment
-prepays
-preplanned
-preponderance
-preponderant
-preponderantly
-preposition
-prepositional
-prepositions
-preposterous
-preposterously
-preps
-prerogative
-prerogatives
-presbytery
-preschool
-prescribe
-prescribed
-prescribes
-prescribing
-prescription
-prescriptions
-prescriptive
-prescriptively
-prescriptivism
-prescriptivist
-preselect
-preselected
-preselects
-presence
-presences
-present
-presentable
-presentation
-presentational
-presentations
-presented
-presenter
-presenters
-presentiment
-presentiments
-presenting
-presently
-presents
-preservation
-preservationists
-preservative
-preservatives
-preserve
-preserved
-preserver
-preserves
-preserving
-preset
-presets
-presetting
-preside
-presided
-presidencies
-presidency
-president
-presidential
-presidents
-presides
-presiding
-presidium
-press
-pressed
-presses
-pressing
-pressingly
-pressings
-pressman
-pressmen
-pressup
-pressups
-pressure
-pressurecooking
-pressured
-pressures
-pressuring
-pressurise
-pressurised
-pressurises
-pressurising
-prestidigitation
-prestidigitator
-prestidigitatorial
-prestige
-prestigious
-presto
-presumable
-presumably
-presume
-presumed
-presumes
-presuming
-presumption
-presumptions
-presumptive
-presumptively
-presumptuous
-presumptuously
-presumptuousness
-presuppose
-presupposed
-presupposes
-presupposing
-presupposition
-presuppositions
-pretence
-pretences
-pretend
-pretended
-pretender
-pretenders
-pretending
-pretends
-pretension
-pretensions
-pretentious
-pretentiously
-pretentiousness
-preterite
-preternatural
-preternaturally
-pretext
-pretexts
-pretor
-pretoria
-pretreated
-pretreatment
-pretreatments
-prettier
-prettiest
-prettify
-prettily
-prettiness
-pretty
-prevail
-prevailed
-prevailing
-prevails
-prevalence
-prevalent
-prevalently
-prevaricate
-prevaricated
-prevaricating
-prevarication
-prevent
-preventable
-prevented
-preventing
-prevention
-preventions
-preventive
-prevents
-preview
-previewed
-previewer
-previewers
-previewing
-previews
-previous
-previously
-prevue
-prevues
-prey
-preyed
-preying
-preys
-priapic
-price
-priced
-priceless
-prices
-pricewar
-pricey
-pricier
-pricing
-prick
-pricked
-pricking
-prickle
-prickled
-prickles
-pricklier
-prickliest
-prickliness
-prickling
-prickly
-pricks
-pricy
-pride
-prided
-prides
-pried
-pries
-priest
-priestess
-priestesses
-priesthood
-priestly
-priests
-prig
-priggish
-priggishly
-priggishness
-prim
-primacy
-primaeval
-primal
-primaries
-primarily
-primary
-primate
-primates
-prime
-primed
-primeness
-primer
-primers
-primes
-primetime
-primeval
-priming
-primitive
-primitively
-primitiveness
-primitives
-primly
-primness
-primogeniture
-primordial
-primrose
-primroses
-primus
-prince
-princelings
-princely
-princes
-princess
-princesses
-principal
-principalities
-principality
-principally
-principals
-principle
-principled
-principles
-print
-printable
-printed
-printer
-printers
-printing
-printings
-printmakers
-printmaking
-printout
-printouts
-prints
-prions
-prior
-priories
-priorities
-prioritisation
-prioritise
-prioritised
-prioritises
-prioritising
-priority
-priors
-priory
-prise
-prised
-prises
-prising
-prism
-prismatic
-prisms
-prison
-prisoner
-prisoners
-prisons
-prissy
-pristine
-privacy
-private
-privateer
-privateers
-privately
-privates
-privation
-privations
-privatisation
-privatisations
-privatise
-privatised
-privatises
-privatising
-privet
-privilege
-privileged
-privileges
-privileging
-privy
-prize
-prized
-prizer
-prizes
-prizewinner
-prizing
-pro
-proactive
-probabilist
-probabilistic
-probabilistically
-probabilities
-probability
-probable
-probably
-probate
-probation
-probationary
-probative
-probe
-probed
-prober
-probes
-probing
-probity
-problem
-problematic
-problematical
-problematically
-problems
-proboscis
-procedural
-procedurally
-procedure
-procedures
-proceed
-proceeded
-proceeding
-proceedings
-proceeds
-process
-processable
-processed
-processes
-processing
-procession
-processional
-processions
-processor
-processors
-proclaim
-proclaimed
-proclaimers
-proclaiming
-proclaims
-proclamation
-proclamations
-proclivities
-proclivity
-procrastinate
-procrastinating
-procrastination
-procrastinations
-procrastinator
-procrastinators
-procreate
-procreated
-procreating
-procreation
-procreational
-procreative
-procreatory
-proctor
-proctorial
-proctors
-procurable
-procure
-procured
-procurement
-procurements
-procures
-procuring
-prod
-prodded
-prodding
-prodeo
-prodigal
-prodigality
-prodigally
-prodigies
-prodigious
-prodigiously
-prodigy
-prods
-produce
-produced
-producer
-producers
-produces
-producible
-producing
-product
-production
-productions
-productive
-productively
-productivity
-products
-profanation
-profane
-profaned
-profanely
-profaneness
-profanities
-profanity
-profess
-professed
-professedly
-professes
-professing
-profession
-professional
-professionalisation
-professionalised
-professionalism
-professionally
-professionals
-professions
-professor
-professorial
-professors
-professorship
-professorships
-proffer
-proffered
-proffering
-proffers
-proficiencies
-proficiency
-proficient
-proficiently
-profile
-profiled
-profiles
-profiling
-profit
-profitability
-profitable
-profitably
-profited
-profiteering
-profiteers
-profiteroles
-profiting
-profitless
-profits
-profittaking
-profligacy
-profligate
-profligately
-proforma
-proformas
-profound
-profounder
-profoundest
-profoundly
-profundity
-profuse
-profusely
-profuseness
-profusion
-progenitor
-progenitors
-progeny
-progesterone
-prognoses
-prognosis
-prognosticate
-prognostication
-prognostications
-program
-programmable
-programmatic
-programme
-programmed
-programmer
-programmers
-programmes
-programming
-programs
-progress
-progressed
-progresses
-progressing
-progression
-progressions
-progressive
-progressively
-progressiveness
-progressives
-prohibit
-prohibited
-prohibiting
-prohibition
-prohibitionist
-prohibitionists
-prohibitions
-prohibitive
-prohibitively
-prohibits
-project
-projected
-projectile
-projectiles
-projecting
-projection
-projectionist
-projections
-projective
-projectively
-projector
-projectors
-projects
-prokaryotes
-prolactin
-prolapse
-prolapsed
-proletarian
-proletarianisation
-proletarians
-proletariat
-proliferate
-proliferated
-proliferates
-proliferating
-proliferation
-proliferative
-prolific
-prolifically
-prolix
-prologue
-prologues
-prolong
-prolongation
-prolonged
-prolonging
-prolongs
-promenade
-promenaded
-promenader
-promenaders
-promenades
-prominence
-prominences
-prominent
-prominently
-promiscuity
-promiscuous
-promiscuously
-promise
-promised
-promises
-promising
-promisingly
-promissory
-promontories
-promontory
-promotable
-promote
-promoted
-promoter
-promoters
-promotes
-promoting
-promotion
-promotional
-promotions
-prompt
-prompted
-prompter
-prompters
-prompting
-promptings
-promptitude
-promptly
-promptness
-prompts
-promulgate
-promulgated
-promulgating
-promulgation
-promulgations
-prone
-proneness
-prong
-prongs
-pronominal
-pronoun
-pronounce
-pronounceable
-pronounced
-pronouncedly
-pronouncement
-pronouncements
-pronounces
-pronouncing
-pronouns
-pronto
-pronunciation
-pronunciations
-proof
-proofed
-proofing
-proofread
-proofreader
-proofreaders
-proofreading
-proofreads
-proofs
-prop
-propaganda
-propagandist
-propagandists
-propagate
-propagated
-propagates
-propagating
-propagation
-propagator
-propagators
-propane
-propel
-propellant
-propellants
-propelled
-propeller
-propellers
-propelling
-propels
-propensities
-propensity
-proper
-properly
-propertied
-properties
-property
-prophecies
-prophecy
-prophesied
-prophesies
-prophesy
-prophesying
-prophet
-prophetess
-prophetic
-prophetically
-prophets
-prophylactic
-prophylactics
-prophylaxis
-propinquity
-propionate
-propitiate
-propitiated
-propitiating
-propitiation
-propitiatory
-propitious
-proponent
-proponents
-proportion
-proportional
-proportionality
-proportionally
-proportionate
-proportionately
-proportioned
-proportions
-proposal
-proposals
-propose
-proposed
-proposer
-proposers
-proposes
-proposing
-proposition
-propositional
-propositioned
-propositioning
-propositions
-propound
-propounded
-propounding
-propped
-propping
-proprietary
-proprieties
-proprietor
-proprietorial
-proprietorially
-proprietors
-proprietorship
-proprietress
-propriety
-proprioceptive
-props
-propulsion
-propulsive
-propylene
-pros
-prosaic
-prosaically
-prosaist
-proscenium
-proscribe
-proscribed
-proscription
-proscriptive
-prose
-prosecutable
-prosecute
-prosecuted
-prosecutes
-prosecuting
-prosecution
-prosecutions
-prosecutor
-prosecutorial
-prosecutors
-proselytise
-proselytising
-prosodic
-prosody
-prospect
-prospecting
-prospective
-prospectively
-prospector
-prospectors
-prospects
-prospectus
-prospectuses
-prosper
-prospered
-prospering
-prosperity
-prosperous
-prosperously
-prospers
-prostaglandin
-prostaglandins
-prostate
-prostates
-prostatic
-prosthesis
-prosthetic
-prostitute
-prostituted
-prostitutes
-prostituting
-prostitution
-prostrate
-prostrated
-prostrates
-prostrating
-prostration
-protactinium
-protagonist
-protagonists
-protea
-protean
-proteas
-protease
-protect
-protected
-protecting
-protection
-protectionism
-protectionist
-protectionists
-protections
-protective
-protectively
-protectiveness
-protector
-protectorate
-protectorates
-protectors
-protects
-protege
-protegee
-protegees
-proteges
-protein
-proteins
-protest
-protestant
-protestantism
-protestants
-protestation
-protestations
-protested
-protester
-protesters
-protesting
-protestor
-protestors
-protests
-protists
-protocol
-protocols
-proton
-protons
-protoplasm
-protoplasmic
-prototype
-prototyped
-prototypes
-prototypical
-prototyping
-protozoa
-protozoan
-protozoans
-protract
-protracted
-protractor
-protractors
-protrude
-protruded
-protrudes
-protruding
-protrusion
-protrusions
-protrusive
-protuberance
-protuberances
-proud
-prouder
-proudest
-proudly
-provable
-provably
-prove
-proved
-proven
-provenance
-provence
-proverb
-proverbial
-proverbially
-proverbs
-proves
-providable
-provide
-provided
-providence
-provident
-providential
-providentially
-provider
-providers
-provides
-providing
-province
-provinces
-provincial
-provincialism
-proving
-provision
-provisional
-provisionally
-provisioned
-provisioning
-provisions
-provocation
-provocations
-provocative
-provocatively
-provoke
-provoked
-provoker
-provokes
-provoking
-provokingly
-provost
-prow
-prowess
-prowl
-prowled
-prowler
-prowlers
-prowling
-prowls
-prows
-proxies
-proximal
-proximally
-proximate
-proximately
-proximity
-proximo
-proxy
-prude
-prudence
-prudent
-prudential
-prudently
-prudery
-prudish
-prudishness
-prune
-pruned
-pruners
-prunes
-pruning
-prunings
-prurience
-prurient
-pruritus
-prussia
-prussian
-prussic
-pry
-prying
-pryings
-psalm
-psalmist
-psalmody
-psalms
-psalter
-psalters
-psaltery
-psephologist
-pseudo
-pseudonym
-pseudonymous
-pseudonyms
-pseudopod
-psoriasis
-psyche
-psychedelia
-psychedelic
-psychiatric
-psychiatrist
-psychiatrists
-psychiatry
-psychic
-psychically
-psychics
-psycho
-psychoanalyse
-psychoanalysis
-psychoanalyst
-psychoanalysts
-psychoanalytic
-psychokinesis
-psychokinetic
-psycholinguistic
-psycholinguistics
-psycholinguists
-psychological
-psychologically
-psychologies
-psychologist
-psychologists
-psychology
-psychometric
-psychopath
-psychopathic
-psychopathology
-psychopaths
-psychoses
-psychosis
-psychosocial
-psychosomatic
-psychotherapist
-psychotherapists
-psychotherapy
-psychotic
-psychotically
-psychotics
-ptarmigan
-ptarmigans
-pterodactyl
-pterosaurs
-ptolemy
-pub
-puberty
-pubescent
-pubic
-public
-publican
-publicans
-publication
-publications
-publicise
-publicised
-publicises
-publicising
-publicist
-publicists
-publicity
-publicly
-publish
-publishable
-published
-publisher
-publishers
-publishes
-publishing
-pubs
-pudding
-puddings
-puddle
-puddles
-puerile
-puerility
-puerperal
-puff
-puffballs
-puffed
-puffer
-puffin
-puffiness
-puffing
-puffins
-puffs
-puffy
-pug
-pugilist
-pugilistic
-pugnacious
-pugnaciously
-pugnacity
-pugs
-puissant
-puke
-puking
-pulchritude
-puling
-pull
-pulled
-puller
-pullets
-pulley
-pulleys
-pulling
-pullover
-pullovers
-pulls
-pulmonary
-pulp
-pulped
-pulping
-pulpit
-pulpits
-pulps
-pulpy
-pulsar
-pulsars
-pulsate
-pulsated
-pulsates
-pulsating
-pulsation
-pulsations
-pulse
-pulsed
-pulses
-pulsing
-pulverisation
-pulverise
-pulverised
-pulverising
-puma
-pumas
-pumice
-pummel
-pummelled
-pummelling
-pummels
-pump
-pumped
-pumping
-pumpkin
-pumpkins
-pumps
-pun
-punch
-punchable
-punchbowl
-punchcard
-punched
-puncher
-punches
-punching
-punchline
-punchlines
-punchy
-punctate
-punctilious
-punctiliously
-punctual
-punctuality
-punctually
-punctuate
-punctuated
-punctuates
-punctuating
-punctuation
-punctuational
-punctuations
-puncture
-punctured
-punctures
-puncturing
-pundit
-pundits
-pungency
-pungent
-pungently
-punier
-puniest
-punish
-punishable
-punished
-punishes
-punishing
-punishment
-punishments
-punitive
-punitively
-punk
-punks
-punky
-punned
-punnet
-punning
-puns
-punster
-punt
-punted
-punter
-punters
-punting
-punts
-puny
-pup
-pupa
-pupae
-pupal
-pupated
-pupates
-pupating
-pupil
-pupillage
-pupils
-puppet
-puppeteer
-puppetry
-puppets
-puppies
-puppy
-puppyhood
-pups
-purblind
-purchasable
-purchase
-purchased
-purchaser
-purchasers
-purchases
-purchasing
-purdah
-pure
-puree
-purees
-purely
-pureness
-purer
-purest
-purgative
-purgatorial
-purgatory
-purge
-purged
-purges
-purging
-purgings
-purification
-purified
-purifier
-purifies
-purify
-purifying
-purims
-purines
-purist
-purists
-puritan
-puritanical
-puritanism
-puritans
-purities
-purity
-purl
-purlieus
-purling
-purlins
-purloin
-purloined
-purls
-purple
-purples
-purplish
-purport
-purported
-purportedly
-purporting
-purports
-purpose
-purposed
-purposeful
-purposefully
-purposefulness
-purposeless
-purposelessly
-purposely
-purposes
-purposing
-purposive
-purr
-purred
-purring
-purrs
-purse
-pursed
-purser
-purses
-pursing
-pursuance
-pursuant
-pursue
-pursued
-pursuer
-pursuers
-pursues
-pursuing
-pursuit
-pursuits
-purvey
-purveyance
-purveyed
-purveying
-purveyor
-purveyors
-purview
-pus
-push
-pushable
-pushed
-pusher
-pushers
-pushes
-pushier
-pushing
-pushovers
-pushups
-pushy
-puss
-pussy
-pussycat
-pussyfooting
-pustular
-pustule
-pustules
-put
-putative
-putatively
-putput
-putrefaction
-putrefy
-putrefying
-putrescent
-putrid
-putridity
-puts
-putsch
-putt
-putted
-putter
-putters
-putti
-putting
-putts
-putty
-puzzle
-puzzled
-puzzlement
-puzzler
-puzzles
-puzzling
-puzzlingly
-pygmies
-pygmy
-pyjama
-pyjamas
-pylon
-pylons
-pyracantha
-pyramid
-pyramidal
-pyramids
-pyre
-pyres
-pyridine
-pyrite
-pyrites
-pyrolyse
-pyrolysis
-pyromaniac
-pyromaniacs
-pyrotechnic
-pyrotechnics
-pyroxene
-pyroxenes
-python
-pythons
-qatar
-qua
-quack
-quacked
-quacking
-quackish
-quacks
-quadrangle
-quadrangles
-quadrangular
-quadrant
-quadrants
-quadratic
-quadratically
-quadratics
-quadrature
-quadratures
-quadrilateral
-quadrilaterals
-quadrille
-quadrilles
-quadripartite
-quadrophonic
-quadruped
-quadrupeds
-quadruple
-quadrupled
-quadruples
-quadruplets
-quadruplicate
-quadrupling
-quadruply
-quadrupole
-quaff
-quaffed
-quaffing
-quagga
-quaggas
-quagmire
-quagmires
-quail
-quailed
-quails
-quaint
-quainter
-quaintly
-quaintness
-quake
-quaked
-quaker
-quakers
-quakes
-quaking
-qualification
-qualifications
-qualified
-qualifier
-qualifiers
-qualifies
-qualify
-qualifying
-qualitative
-qualitatively
-qualities
-quality
-qualm
-qualms
-quantifiable
-quantification
-quantified
-quantifier
-quantifiers
-quantifies
-quantify
-quantifying
-quantisation
-quantise
-quantised
-quantitative
-quantitatively
-quantities
-quantity
-quantum
-quarantine
-quarantined
-quark
-quarks
-quarrel
-quarrelled
-quarrelling
-quarrels
-quarrelsome
-quarried
-quarries
-quarry
-quarrying
-quarrymen
-quart
-quarter
-quarterback
-quartered
-quartering
-quarterly
-quartermaster
-quarters
-quarterstaff
-quarterstaffs
-quartet
-quartets
-quartic
-quartics
-quartile
-quartiles
-quarto
-quarts
-quartz
-quartzite
-quasar
-quasars
-quash
-quashed
-quashing
-quasi
-quasilinear
-quaternary
-quaternion
-quaternions
-quatrain
-quatrains
-quaver
-quavered
-quavering
-quavers
-quay
-quays
-quayside
-queasiness
-queasy
-quebec
-queen
-queenly
-queens
-queer
-queerest
-queerly
-quell
-quelled
-quelling
-quells
-quench
-quenched
-quencher
-quenchers
-quenches
-quenching
-queried
-queries
-quern
-querulous
-querulously
-querulousness
-query
-querying
-quest
-questing
-question
-questionable
-questionably
-questioned
-questioner
-questioners
-questioning
-questioningly
-questionings
-questionnaire
-questionnaires
-questions
-quests
-queue
-queued
-queueing
-queues
-queuing
-quibble
-quibbles
-quibbling
-quiche
-quiches
-quick
-quicken
-quickened
-quickening
-quickens
-quicker
-quickest
-quicklime
-quickly
-quickness
-quicksand
-quicksands
-quicksilver
-quickwitted
-quid
-quids
-quiesce
-quiesced
-quiescence
-quiescent
-quiet
-quieted
-quieten
-quietened
-quietening
-quietens
-quieter
-quietest
-quieting
-quietly
-quietness
-quiets
-quietus
-quiff
-quill
-quills
-quilt
-quilted
-quilting
-quilts
-quince
-quincentenary
-quinces
-quinine
-quinquennial
-quintessence
-quintessential
-quintessentially
-quintet
-quintets
-quintic
-quintillion
-quintuple
-quip
-quipped
-quipper
-quips
-quire
-quirk
-quirkier
-quirkiest
-quirkiness
-quirks
-quirky
-quisling
-quit
-quite
-quits
-quitted
-quitter
-quitting
-quiver
-quivered
-quivering
-quiveringly
-quivers
-quixotic
-quiz
-quizzed
-quizzes
-quizzical
-quizzically
-quizzing
-quoins
-quoits
-quondam
-quorate
-quorum
-quota
-quotable
-quotas
-quotation
-quotations
-quote
-quoted
-quoter
-quotes
-quotidian
-quotient
-quotients
-quoting
-quovadis
-rabat
-rabats
-rabbi
-rabbis
-rabbit
-rabbiting
-rabbits
-rabble
-rabid
-rabidly
-rabies
-raccoon
-raccoons
-race
-racecourse
-racecourses
-raced
-racegoers
-racehorse
-racehorses
-racer
-racers
-races
-racetrack
-rachis
-racial
-racialism
-racialist
-racialists
-racially
-racier
-raciest
-racily
-racing
-racings
-racism
-racist
-racists
-rack
-racked
-racket
-racketeering
-rackets
-racking
-racks
-raconteur
-racoon
-racquet
-racquets
-racy
-rad
-radar
-radars
-radial
-radially
-radials
-radian
-radiance
-radiancy
-radians
-radiant
-radiantly
-radiate
-radiated
-radiates
-radiating
-radiation
-radiations
-radiative
-radiatively
-radiator
-radiators
-radical
-radicalism
-radically
-radicals
-radices
-radii
-radio
-radioactive
-radioactively
-radioactivity
-radioastronomical
-radiocarbon
-radioed
-radiogalaxies
-radiogalaxy
-radiogram
-radiograph
-radiographer
-radiographers
-radiographic
-radiographs
-radiography
-radioing
-radiological
-radiologist
-radiologists
-radiology
-radiometric
-radionuclide
-radios
-radiotherapy
-radish
-radishes
-radium
-radius
-radix
-radon
-raffia
-raffle
-raffled
-raffles
-raft
-rafter
-rafters
-rafting
-raftman
-rafts
-raftsman
-rag
-ragamuffin
-ragamuffins
-ragbag
-rage
-raged
-rages
-ragged
-raggedly
-raging
-ragout
-rags
-ragstoriches
-ragtime
-ragwort
-raid
-raided
-raider
-raiders
-raiding
-raids
-rail
-railed
-railes
-railing
-railings
-raillery
-railroad
-rails
-railway
-railwayman
-railwaymen
-railways
-raiment
-rain
-rainbow
-rainbows
-raincloud
-rainclouds
-raincoat
-raincoats
-raindrop
-raindrops
-rained
-rainfall
-rainforest
-rainforests
-rainier
-rainiest
-raining
-rainless
-rainout
-rains
-rainstorm
-rainstorms
-rainswept
-rainwater
-rainy
-raise
-raised
-raiser
-raises
-raisin
-raising
-raisins
-raj
-rajah
-rake
-raked
-rakes
-raking
-rakish
-rallied
-rallies
-rally
-rallying
-ram
-ramble
-rambled
-rambler
-ramblers
-rambles
-rambling
-ramblings
-ramification
-ramifications
-ramified
-ramifies
-ramify
-rammed
-rammer
-ramming
-ramp
-rampage
-rampaged
-rampages
-rampaging
-rampant
-rampantly
-rampart
-ramparts
-ramped
-ramping
-ramps
-ramrod
-rams
-ramshackle
-ran
-ranch
-rancher
-ranchers
-ranches
-ranching
-rancid
-rancorous
-rancour
-rand
-random
-randomisation
-randomise
-randomised
-randomising
-randomly
-randomness
-rands
-randy
-rang
-range
-ranged
-ranger
-rangers
-ranges
-ranging
-rangy
-rani
-ranis
-rank
-ranked
-ranker
-rankers
-rankest
-ranking
-rankings
-rankle
-rankled
-rankles
-rankling
-rankness
-ranks
-ransack
-ransacked
-ransacking
-ransom
-ransomed
-ransoming
-ransoms
-rant
-ranted
-ranter
-ranters
-ranting
-rantings
-rants
-rap
-rapacious
-rapacity
-rape
-raped
-rapes
-rapeseed
-rapid
-rapidity
-rapidly
-rapids
-rapier
-rapiers
-rapine
-raping
-rapist
-rapists
-rapped
-rapping
-rapport
-rapporteur
-rapporteurs
-rapports
-rapprochement
-raps
-rapt
-raptor
-raptors
-rapture
-raptures
-rapturous
-rapturously
-rare
-rarebit
-rarefaction
-rarefactions
-rarefied
-rarely
-rareness
-rarer
-rarest
-raring
-rarities
-rarity
-rascal
-rascally
-rascals
-rased
-rash
-rasher
-rashers
-rashes
-rashest
-rashly
-rashness
-rasing
-rasp
-raspberries
-raspberry
-rasped
-rasper
-rasping
-rasps
-raspy
-raster
-rasters
-rat
-ratatouille
-rate
-rated
-ratepayer
-ratepayers
-rater
-rates
-rather
-ratification
-ratifications
-ratified
-ratifier
-ratifies
-ratify
-ratifying
-rating
-ratings
-ratio
-ratiocination
-ration
-rational
-rationale
-rationales
-rationalisation
-rationalisations
-rationalise
-rationalised
-rationalising
-rationalism
-rationalist
-rationalistic
-rationalists
-rationalities
-rationality
-rationally
-rationed
-rationing
-rations
-ratios
-ratlike
-ratrace
-rats
-rattier
-rattle
-rattled
-rattler
-rattles
-rattlesnake
-rattlesnakes
-rattling
-ratty
-raucous
-raucously
-ravage
-ravaged
-ravages
-ravaging
-rave
-raved
-ravel
-ravelled
-ravelling
-ravels
-raven
-ravening
-ravenous
-ravenously
-ravens
-raver
-ravers
-raves
-ravine
-ravines
-raving
-ravingly
-ravings
-ravioli
-ravish
-ravished
-ravisher
-ravishes
-ravishing
-ravishingly
-raw
-rawest
-rawness
-ray
-rayed
-rayon
-rays
-raze
-razed
-razes
-razing
-razor
-razorbills
-razorblades
-razoring
-razors
-razorsharp
-razzmatazz
-re
-reabsorb
-reabsorbed
-reabsorption
-reaccept
-reaccessed
-reach
-reachable
-reached
-reaches
-reachieved
-reaching
-reacquainting
-reacquired
-reacquisition
-react
-reactant
-reactants
-reacted
-reacting
-reaction
-reactionaries
-reactionary
-reactions
-reactivate
-reactivated
-reactivates
-reactivating
-reactivation
-reactive
-reactivities
-reactivity
-reactor
-reactors
-reacts
-read
-readability
-readable
-readably
-readapt
-reader
-readers
-readership
-readerships
-readied
-readier
-readies
-readiest
-readily
-readiness
-reading
-readings
-readjust
-readjusted
-readjusting
-readjustment
-readjustments
-readmission
-readmit
-readmits
-readmitted
-reads
-ready
-readying
-readymade
-reaffirm
-reaffirmation
-reaffirmed
-reaffirming
-reaffirms
-reafforestation
-reagent
-reagents
-real
-realign
-realigned
-realigning
-realignment
-realignments
-realigns
-realisable
-realisation
-realisations
-realise
-realised
-realises
-realising
-realism
-realist
-realistic
-realistically
-realists
-realities
-reality
-reallife
-reallocate
-reallocated
-reallocates
-reallocating
-reallocation
-really
-realm
-realms
-realness
-realpolitik
-reals
-realty
-ream
-reams
-reanimated
-reanimating
-reap
-reaped
-reaper
-reapers
-reaping
-reappear
-reappearance
-reappeared
-reappearing
-reappears
-reapplied
-reapply
-reapplying
-reappoint
-reappointed
-reappointment
-reappraisal
-reappraised
-reappraising
-reaps
-rear
-reared
-rearer
-rearguard
-rearing
-rearm
-rearmament
-rearmed
-rearming
-rearms
-rearrange
-rearranged
-rearrangement
-rearrangements
-rearranges
-rearranging
-rears
-rearview
-rearward
-reason
-reasonable
-reasonableness
-reasonably
-reasoned
-reasoner
-reasoners
-reasoning
-reasonless
-reasons
-reassemble
-reassembled
-reassembling
-reassembly
-reassert
-reasserted
-reasserting
-reassertion
-reasserts
-reassess
-reassessed
-reassessment
-reassessments
-reassign
-reassigned
-reassigning
-reassignment
-reassigns
-reassume
-reassuming
-reassurance
-reassurances
-reassure
-reassured
-reassures
-reassuring
-reassuringly
-reattachment
-reattempt
-reawaken
-reawakened
-reawakening
-rebalanced
-rebate
-rebates
-rebel
-rebelled
-rebelling
-rebellion
-rebellions
-rebellious
-rebelliously
-rebelliousness
-rebels
-rebind
-rebirth
-rebirths
-rebook
-reboot
-rebooted
-reborn
-rebound
-rebounded
-rebounding
-rebounds
-rebuff
-rebuffed
-rebuffing
-rebuffs
-rebuild
-rebuilding
-rebuilds
-rebuilt
-rebuke
-rebuked
-rebukes
-rebuking
-reburial
-reburied
-rebury
-rebus
-rebut
-rebuttable
-rebuttal
-rebuttals
-rebutted
-rebutting
-recalcitrance
-recalcitrant
-recalculate
-recalculated
-recalculation
-recalibrate
-recalibrating
-recalibration
-recall
-recalled
-recalling
-recalls
-recant
-recantation
-recanted
-recanting
-recants
-recap
-recapitalisation
-recapitulate
-recapitulates
-recapitulation
-recapped
-recaps
-recapture
-recaptured
-recapturing
-recast
-recasting
-recasts
-recede
-receded
-recedes
-receding
-receipt
-receipted
-receipts
-receivable
-receive
-received
-receiver
-receivers
-receivership
-receives
-receiving
-recency
-recension
-recent
-recently
-receptacle
-receptacles
-reception
-receptionist
-receptionists
-receptions
-receptive
-receptiveness
-receptivity
-receptor
-receptors
-recess
-recessed
-recesses
-recession
-recessional
-recessionary
-recessions
-recessive
-recharge
-rechargeable
-recharged
-recharger
-recharges
-recharging
-recheck
-rechecked
-rechecking
-recidivism
-recidivist
-recidivists
-recipe
-recipes
-recipient
-recipients
-reciprocal
-reciprocally
-reciprocals
-reciprocate
-reciprocated
-reciprocating
-reciprocation
-reciprocity
-recirculate
-recirculated
-recirculating
-recirculation
-recital
-recitals
-recitation
-recitations
-recitative
-recitatives
-recite
-recited
-recites
-reciting
-reckless
-recklessly
-recklessness
-reckon
-reckoned
-reckoner
-reckoning
-reckons
-reclaim
-reclaimable
-reclaimed
-reclaimer
-reclaiming
-reclaims
-reclamation
-reclamations
-reclassification
-reclassified
-reclassifies
-reclassify
-reclassifying
-recline
-reclined
-recliner
-reclines
-reclining
-reclothe
-recluse
-recluses
-reclusive
-recode
-recoded
-recodes
-recoding
-recognisable
-recognisably
-recognisances
-recognise
-recognised
-recogniser
-recognisers
-recognises
-recognising
-recognition
-recognitions
-recoil
-recoiled
-recoiling
-recoils
-recollect
-recollected
-recollecting
-recollection
-recollections
-recollects
-recombinant
-recombinants
-recombination
-recombine
-recombined
-recombines
-recombining
-recommence
-recommenced
-recommencement
-recommences
-recommencing
-recommend
-recommendable
-recommendation
-recommendations
-recommended
-recommending
-recommends
-recommissioning
-recompense
-recompensed
-recompenses
-recompilation
-recompilations
-recompile
-recompiled
-recompiling
-recomputable
-recompute
-recomputed
-recomputes
-recomputing
-reconcilable
-reconcile
-reconciled
-reconcilement
-reconciles
-reconciliation
-reconciliations
-reconciling
-recondite
-reconditioned
-reconditioning
-reconfigurable
-reconfiguration
-reconfigurations
-reconfigure
-reconfigured
-reconfigures
-reconfiguring
-reconnaissance
-reconnect
-reconnected
-reconnecting
-reconnection
-reconnoitre
-reconnoitred
-reconnoitring
-reconquer
-reconquest
-reconsider
-reconsideration
-reconsidered
-reconsidering
-reconsiders
-reconstitute
-reconstituted
-reconstitutes
-reconstituting
-reconstitution
-reconstruct
-reconstructed
-reconstructing
-reconstruction
-reconstructions
-reconstructs
-reconsult
-reconsulted
-reconsulting
-recontribute
-reconvene
-reconvened
-reconvening
-reconversion
-reconvert
-reconverted
-recopied
-recopy
-record
-recordable
-recordbreaking
-recorded
-recorder
-recorders
-recording
-recordings
-recordist
-recordists
-records
-recount
-recounted
-recounting
-recounts
-recoup
-recouped
-recouping
-recouple
-recoups
-recourse
-recover
-recoverability
-recoverable
-recovered
-recoveries
-recovering
-recovers
-recovery
-recreate
-recreated
-recreates
-recreating
-recreation
-recreational
-recreations
-recriminate
-recrimination
-recriminations
-recruit
-recruited
-recruiter
-recruiters
-recruiting
-recruitment
-recruits
-recrystallisation
-rectal
-rectangle
-rectangles
-rectangular
-rectifiable
-rectification
-rectified
-rectifier
-rectifies
-rectify
-rectifying
-rectilinear
-rectitude
-recto
-rector
-rectors
-rectory
-rectrix
-rectum
-rectums
-recumbent
-recuperate
-recuperated
-recuperates
-recuperating
-recuperation
-recuperative
-recur
-recured
-recures
-recuring
-recurred
-recurrence
-recurrences
-recurrent
-recurrently
-recurring
-recurs
-recursion
-recursions
-recursive
-recursively
-recyclable
-recycle
-recycled
-recyclers
-recycles
-recycling
-red
-redaction
-redblooded
-redbreast
-redcoats
-redcross
-redden
-reddened
-reddening
-reddens
-redder
-reddest
-reddish
-redeclaration
-redecorated
-redecorating
-redecoration
-rededication
-redeem
-redeemable
-redeemed
-redeemer
-redeeming
-redeems
-redefine
-redefined
-redefiner
-redefines
-redefining
-redefinition
-redefinitions
-redeliver
-redelivery
-redemption
-redemptions
-redemptive
-redeploy
-redeployed
-redeploying
-redeployment
-redeposited
-redeposition
-redesign
-redesigned
-redesigning
-redesigns
-redevelop
-redeveloped
-redeveloping
-redevelopment
-redfaced
-redhanded
-redhead
-redheaded
-redheads
-redial
-redialling
-redirect
-redirected
-redirecting
-redirection
-redirects
-rediscover
-rediscovered
-rediscoveries
-rediscovering
-rediscovers
-rediscovery
-rediscussed
-redisplay
-redisplayed
-redistributable
-redistribute
-redistributed
-redistributes
-redistributing
-redistribution
-redistributions
-redistributive
-redneck
-redness
-redo
-redoing
-redolent
-redone
-redouble
-redoubled
-redoubling
-redoubt
-redoubtable
-redoubts
-redound
-redounded
-redox
-redraft
-redrafted
-redrafting
-redraw
-redrawing
-redrawn
-redraws
-redress
-redressed
-redressing
-reds
-redsea
-redshift
-redshifts
-redstarts
-redtape
-reduce
-reduced
-reducer
-reducers
-reduces
-reducibility
-reducible
-reducing
-reduction
-reductionism
-reductionist
-reductionists
-reductions
-reductive
-redundancies
-redundancy
-redundant
-redundantly
-redwood
-reed
-reeds
-reef
-reefed
-reefing
-reefs
-reek
-reeked
-reeking
-reeks
-reel
-reelects
-reeled
-reeling
-reels
-ref
-refer
-referable
-referee
-refereed
-refereeing
-referees
-reference
-referenced
-referencer
-references
-referencing
-referenda
-referendum
-referendums
-referent
-referential
-referentially
-referents
-referral
-referrals
-referred
-referring
-refers
-refile
-refiled
-refiling
-refill
-refillable
-refilled
-refilling
-refillings
-refills
-refinance
-refinanced
-refinancing
-refine
-refined
-refinement
-refinements
-refiner
-refineries
-refiners
-refinery
-refines
-refining
-refinish
-refit
-refits
-refitted
-refitting
-reflation
-reflect
-reflectance
-reflected
-reflecting
-reflection
-reflectional
-reflections
-reflective
-reflectively
-reflectiveness
-reflectivity
-reflector
-reflectors
-reflects
-reflex
-reflexes
-reflexion
-reflexions
-reflexive
-reflexively
-reflexiveness
-reflexivity
-reflexology
-refloat
-reflooring
-reflux
-refluxed
-refluxing
-refocus
-refocused
-refocuses
-refocusing
-refocussed
-refocusses
-refocussing
-refolded
-refolding
-reforestation
-reform
-reformable
-reformat
-reformation
-reformations
-reformative
-reformatted
-reformatting
-reformed
-reformer
-reformers
-reforming
-reformist
-reformists
-reforms
-reformulate
-reformulated
-reformulates
-reformulating
-reformulation
-reformulations
-refract
-refracted
-refracting
-refraction
-refractions
-refractive
-refractors
-refractory
-refracts
-refrain
-refrained
-refraining
-refrains
-refreeze
-refresh
-refreshable
-refreshed
-refresher
-refreshes
-refreshing
-refreshingly
-refreshment
-refreshments
-refrigerant
-refrigerants
-refrigerate
-refrigerated
-refrigeration
-refrigerator
-refrigerators
-refs
-refuel
-refuelled
-refuelling
-refuels
-refuge
-refugee
-refugees
-refuges
-refund
-refundable
-refunded
-refunding
-refunds
-refurbish
-refurbished
-refurbishing
-refurbishment
-refurbishments
-refusal
-refusals
-refuse
-refused
-refuseniks
-refuses
-refusing
-refutable
-refutation
-refutations
-refute
-refuted
-refutes
-refuting
-regain
-regained
-regaining
-regains
-regal
-regale
-regaled
-regales
-regalia
-regaling
-regality
-regally
-regard
-regarded
-regarding
-regardless
-regards
-regatta
-regattas
-regelate
-regency
-regenerate
-regenerated
-regenerates
-regenerating
-regeneration
-regenerations
-regenerative
-regent
-regents
-reggae
-regicide
-regime
-regimen
-regimens
-regiment
-regimental
-regimentation
-regimented
-regiments
-regimes
-regina
-reginas
-region
-regional
-regionalisation
-regionalism
-regionally
-regions
-register
-registered
-registering
-registers
-registrable
-registrar
-registrars
-registration
-registrations
-registries
-registry
-regrading
-regress
-regressed
-regresses
-regressing
-regression
-regressions
-regressive
-regret
-regretful
-regretfully
-regrets
-regrettable
-regrettably
-regretted
-regretting
-regroup
-regrouped
-regrouping
-regrow
-regrowth
-regular
-regularisation
-regularise
-regularised
-regularities
-regularity
-regularly
-regulars
-regulate
-regulated
-regulates
-regulating
-regulation
-regulations
-regulative
-regulator
-regulators
-regulatory
-regurgitate
-regurgitated
-regurgitating
-regurgitation
-rehabilitate
-rehabilitated
-rehabilitating
-rehabilitation
-rehash
-rehashed
-rehashes
-rehashing
-reheard
-rehearing
-rehears
-rehearsal
-rehearsals
-rehearse
-rehearsed
-rehearses
-rehearsing
-reheat
-reheated
-reheating
-reheats
-rehouse
-rehoused
-rehousing
-rehydrate
-reich
-reification
-reify
-reign
-reigned
-reigning
-reigns
-reimburse
-reimbursed
-reimbursement
-reimburses
-reimbursing
-reimplementation
-reimplemented
-reimplementing
-reimporting
-reimpose
-reimposed
-rein
-reincarnate
-reincarnated
-reincarnating
-reincarnation
-reincarnations
-reindeer
-reined
-reinfection
-reinforce
-reinforced
-reinforcement
-reinforcements
-reinforces
-reinforcing
-reining
-reinitialisation
-reinitialise
-reinitialised
-reinitialising
-reins
-reinsert
-reinserted
-reinstall
-reinstalled
-reinstalling
-reinstate
-reinstated
-reinstatement
-reinstates
-reinstating
-reinsurance
-reintegration
-reinterpret
-reinterpretation
-reinterpreted
-reinterpreting
-reintroduce
-reintroduced
-reintroduces
-reintroducing
-reintroduction
-reintroductions
-reinvent
-reinvented
-reinventing
-reinvention
-reinventions
-reinvents
-reinvest
-reinvested
-reinvestigation
-reinvestment
-reinvigorate
-reinvigorated
-reissue
-reissued
-reissues
-reissuing
-reiterate
-reiterated
-reiterates
-reiterating
-reiteration
-reject
-rejected
-rejecting
-rejection
-rejections
-rejects
-rejoice
-rejoiced
-rejoices
-rejoicing
-rejoicings
-rejoin
-rejoinder
-rejoinders
-rejoined
-rejoining
-rejoins
-rejustified
-rejuvenate
-rejuvenated
-rejuvenating
-rejuvenation
-rejuvenations
-rejuvenatory
-rekindle
-rekindled
-relabel
-relabelled
-relabelling
-relabellings
-relaid
-relapse
-relapsed
-relapses
-relapsing
-relate
-related
-relatedness
-relates
-relating
-relation
-relational
-relationally
-relations
-relationship
-relationships
-relative
-relatively
-relatives
-relativism
-relativist
-relativistic
-relativistically
-relativists
-relativity
-relator
-relaunch
-relaunched
-relaunching
-relax
-relaxant
-relaxants
-relaxation
-relaxations
-relaxed
-relaxes
-relaxing
-relaxingly
-relay
-relayed
-relaying
-relays
-relearn
-relearning
-releasable
-release
-released
-releases
-releasing
-relegate
-relegated
-relegates
-relegating
-relegation
-relent
-relented
-relenting
-relentless
-relentlessly
-relentlessness
-relents
-relevance
-relevancy
-relevant
-relevantly
-reliabilities
-reliability
-reliable
-reliably
-reliance
-reliant
-relic
-relics
-relict
-relicts
-relied
-relief
-reliefs
-relies
-relieve
-relieved
-relieves
-relieving
-relight
-relighting
-religion
-religions
-religiosity
-religious
-religiously
-religiousness
-relined
-relink
-relinked
-relinking
-relinquish
-relinquished
-relinquishes
-relinquishing
-reliquaries
-reliquary
-relish
-relished
-relishes
-relishing
-relit
-relive
-relived
-relives
-reliving
-reload
-reloaded
-reloading
-reloads
-relocatable
-relocate
-relocated
-relocates
-relocating
-relocation
-relocations
-relocked
-reluctance
-reluctant
-reluctantly
-rely
-relying
-rem
-remade
-remain
-remainder
-remaindered
-remaindering
-remainders
-remained
-remaining
-remains
-remake
-remakes
-remaking
-remand
-remanded
-remands
-remap
-remaps
-remark
-remarkable
-remarkably
-remarked
-remarking
-remarks
-remarriage
-remarried
-remarry
-remaster
-remastered
-remastering
-remasters
-rematch
-rematching
-rematerialised
-remediable
-remedial
-remedied
-remedies
-remedy
-remedying
-remember
-remembered
-remembering
-remembers
-remembrance
-remembrances
-remind
-reminded
-reminder
-reminders
-reminding
-reminds
-reminisce
-reminisced
-reminiscence
-reminiscences
-reminiscent
-reminiscently
-reminisces
-reminiscing
-remiss
-remission
-remissions
-remit
-remits
-remittal
-remittance
-remittances
-remitted
-remitting
-remix
-remixed
-remixes
-remnant
-remnants
-remodel
-remodelled
-remodelling
-remonstrance
-remonstrate
-remonstrated
-remonstrating
-remonstration
-remonstrations
-remorse
-remorseful
-remorsefully
-remorseless
-remorselessly
-remote
-remotely
-remoteness
-remoter
-remotest
-remould
-remount
-remounted
-remounts
-removable
-removal
-removals
-remove
-removed
-remover
-removers
-removes
-removing
-remunerate
-remunerated
-remuneration
-remunerative
-remus
-renaissance
-renal
-rename
-renamed
-renames
-renaming
-render
-rendered
-rendering
-renderings
-renders
-rendezvous
-rendezvoused
-rending
-rendition
-renditions
-rends
-renegade
-renegades
-renege
-reneged
-reneging
-renegotiate
-renegotiated
-renegotiating
-renegotiation
-renew
-renewable
-renewal
-renewals
-renewed
-renewing
-renews
-renormalisation
-renounce
-renounced
-renouncement
-renounces
-renouncing
-renovate
-renovated
-renovating
-renovation
-renovations
-renown
-renowned
-rent
-rental
-rentals
-rented
-renter
-renters
-rentiers
-renting
-rents
-renumber
-renumbered
-renumbering
-renunciation
-renunciations
-reoccupation
-reoccupied
-reoccupy
-reoccupying
-reoccur
-reopen
-reopened
-reopening
-reopens
-reorder
-reordered
-reordering
-reorders
-reorganisation
-reorganisations
-reorganise
-reorganised
-reorganises
-reorganising
-reorientated
-reorientates
-reorientation
-rep
-repack
-repackage
-repackaged
-repacked
-repacking
-repaid
-repaint
-repainted
-repainting
-repair
-repairable
-repaired
-repairer
-repairers
-repairing
-repairman
-repairs
-repaper
-reparation
-reparations
-repartee
-repartition
-repartitioned
-repartitioning
-repast
-repasts
-repatriate
-repatriated
-repatriating
-repatriation
-repatriations
-repay
-repayable
-repaying
-repayment
-repayments
-repays
-repeal
-repealed
-repealing
-repeals
-repeat
-repeatability
-repeatable
-repeatably
-repeated
-repeatedly
-repeater
-repeaters
-repeating
-repeats
-repel
-repelled
-repellent
-repelling
-repellingly
-repels
-repent
-repentance
-repentant
-repentantly
-repented
-repenting
-repents
-repercussion
-repercussions
-repertoire
-repertoires
-repertory
-repetition
-repetitions
-repetitious
-repetitive
-repetitively
-repetitiveness
-rephrase
-rephrased
-rephrases
-rephrasing
-repine
-repined
-repining
-replace
-replaceable
-replaced
-replacement
-replacements
-replaces
-replacing
-replanning
-replant
-replanted
-replanting
-replay
-replayed
-replaying
-replays
-replenish
-replenished
-replenishing
-replenishment
-replete
-replica
-replicable
-replicas
-replicate
-replicated
-replicates
-replicating
-replication
-replications
-replicator
-replicators
-replied
-replier
-repliers
-replies
-replotted
-replug
-replugged
-replugging
-reply
-replying
-repopulate
-repopulated
-report
-reportable
-reportage
-reported
-reportedly
-reporter
-reporters
-reporting
-reports
-repose
-reposed
-reposes
-reposing
-reposition
-repositioned
-repositioning
-repositions
-repositories
-repository
-repossess
-repossessed
-repossessing
-repossession
-repossessions
-reprehend
-reprehensible
-represent
-representable
-representation
-representational
-representations
-representative
-representativeness
-representatives
-represented
-representing
-represents
-repress
-repressed
-represses
-repressing
-repression
-repressions
-repressive
-repressively
-reprieve
-reprieved
-reprimand
-reprimanded
-reprimanding
-reprimands
-reprint
-reprinted
-reprinting
-reprints
-reprisal
-reprisals
-reprise
-reproach
-reproached
-reproaches
-reproachful
-reproachfully
-reproachfulness
-reproaching
-reprobate
-reprobates
-reprocess
-reprocessed
-reprocessing
-reproduce
-reproduced
-reproduces
-reproducibility
-reproducible
-reproducibly
-reproducing
-reproduction
-reproductions
-reproductive
-reproductively
-reprogram
-reprogrammable
-reprogramme
-reprogrammed
-reprogramming
-reprojected
-reproof
-reproofs
-reprove
-reproved
-reprovingly
-reps
-reptile
-reptiles
-reptilian
-reptilians
-republic
-republican
-republicanism
-republicans
-republication
-republics
-republish
-republished
-republishes
-republishing
-repudiate
-repudiated
-repudiates
-repudiating
-repudiation
-repugnance
-repugnant
-repulse
-repulsed
-repulsing
-repulsion
-repulsions
-repulsive
-repulsively
-repulsiveness
-repurchase
-reputable
-reputably
-reputation
-reputations
-repute
-reputed
-reputedly
-reputes
-request
-requested
-requester
-requesting
-requests
-requiem
-requiems
-require
-required
-requirement
-requirements
-requires
-requiring
-requisite
-requisites
-requisition
-requisitioned
-requisitioning
-requisitions
-requital
-requite
-requited
-reran
-reread
-rereading
-rereads
-reregistration
-rerolled
-reroute
-rerouted
-rerouteing
-reroutes
-rerouting
-rerun
-rerunning
-reruns
-resale
-rescale
-rescaled
-rescales
-rescaling
-rescan
-rescanned
-rescanning
-rescans
-reschedule
-rescheduled
-rescheduling
-rescind
-rescinded
-rescinding
-rescue
-rescued
-rescuer
-rescuers
-rescues
-rescuing
-resea
-resealed
-research
-researched
-researcher
-researchers
-researches
-researching
-reseated
-reseeding
-reselect
-reselected
-reselection
-resell
-reseller
-resellers
-reselling
-resemblance
-resemblances
-resemble
-resembled
-resembles
-resembling
-resend
-resending
-resent
-resented
-resentful
-resentfully
-resenting
-resentment
-resentments
-resents
-reservation
-reservations
-reserve
-reserved
-reserver
-reserves
-reserving
-reservists
-reservoir
-reservoirs
-reset
-resets
-resettable
-resetting
-resettle
-resettled
-resettlement
-resettling
-reshape
-reshaped
-reshapes
-reshaping
-resharpen
-resharpened
-resharpening
-reshow
-reshowing
-reshuffle
-reshuffled
-reshuffles
-reshuffling
-reside
-resided
-residence
-residences
-residency
-resident
-residential
-residents
-resides
-residing
-residual
-residuals
-residuary
-residue
-residues
-residuum
-resign
-resignal
-resignation
-resignations
-resigned
-resignedly
-resigning
-resigns
-resilience
-resilient
-resin
-resinous
-resins
-resiny
-resist
-resistance
-resistances
-resistant
-resisted
-resistible
-resisting
-resistive
-resistively
-resistivity
-resistor
-resistors
-resists
-resit
-resiting
-resits
-resize
-resizing
-resold
-resolute
-resolutely
-resolution
-resolutions
-resolvability
-resolvable
-resolve
-resolved
-resolvent
-resolver
-resolvers
-resolves
-resolving
-resonance
-resonances
-resonant
-resonantly
-resonate
-resonated
-resonates
-resonating
-resonator
-resonators
-resort
-resorted
-resorting
-resorts
-resound
-resounded
-resounding
-resoundingly
-resounds
-resource
-resourced
-resourceful
-resourcefulness
-resources
-resourcing
-respecified
-respecify
-respect
-respectability
-respectable
-respectably
-respected
-respectful
-respectfully
-respecting
-respective
-respectively
-respects
-respiration
-respirator
-respirators
-respiratory
-respire
-respired
-respite
-resplendent
-respond
-responded
-respondent
-respondents
-responder
-responders
-responding
-responds
-response
-responses
-responsibilities
-responsibility
-responsible
-responsibly
-responsive
-responsively
-responsiveness
-respray
-resprayed
-resprays
-rest
-restart
-restartable
-restarted
-restarting
-restarts
-restate
-restated
-restatement
-restates
-restating
-restaurant
-restaurants
-restaurateur
-restaurateurs
-rested
-restful
-restfulness
-resting
-restitution
-restive
-restiveness
-restless
-restlessly
-restlessness
-restock
-restocking
-restoration
-restorations
-restorative
-restore
-restored
-restorer
-restorers
-restores
-restoring
-restrain
-restrained
-restraining
-restrains
-restraint
-restraints
-restrict
-restricted
-restricting
-restriction
-restrictions
-restrictive
-restrictively
-restricts
-restroom
-restructure
-restructured
-restructures
-restructuring
-rests
-restyled
-resubmission
-resubmissions
-resubmit
-resubmits
-resubmitted
-resubmitting
-resubstitute
-result
-resultant
-resulted
-resulting
-results
-resume
-resumed
-resumes
-resuming
-resumption
-resupply
-resurface
-resurfaced
-resurfacing
-resurgence
-resurgent
-resurrect
-resurrected
-resurrecting
-resurrection
-resurrects
-resuscitate
-resuscitated
-resuscitating
-resuscitation
-retail
-retailed
-retailer
-retailers
-retailing
-retails
-retain
-retained
-retainer
-retainers
-retaining
-retains
-retake
-retaken
-retakes
-retaking
-retaliate
-retaliated
-retaliates
-retaliating
-retaliation
-retaliatory
-retard
-retardant
-retardation
-retarded
-retarding
-retards
-retch
-retched
-retching
-retell
-retelling
-retention
-retentions
-retentive
-retentiveness
-retentivity
-retest
-retested
-retesting
-retests
-rethink
-rethinking
-rethought
-reticence
-reticent
-reticular
-reticulated
-reticulation
-reticule
-reticules
-reticulum
-retied
-retina
-retinal
-retinas
-retinitis
-retinue
-retinues
-retire
-retired
-retiree
-retirement
-retirements
-retires
-retiring
-retitle
-retitled
-retitling
-retold
-retook
-retort
-retorted
-retorting
-retorts
-retouch
-retouched
-retouching
-retrace
-retraced
-retraces
-retracing
-retract
-retractable
-retracted
-retracting
-retraction
-retractions
-retracts
-retrain
-retrained
-retraining
-retral
-retransmission
-retransmissions
-retransmit
-retransmits
-retransmitted
-retransmitting
-retread
-retreads
-retreat
-retreated
-retreating
-retreats
-retrench
-retrenchment
-retrial
-retribution
-retributive
-retried
-retries
-retrievable
-retrieval
-retrievals
-retrieve
-retrieved
-retriever
-retrievers
-retrieves
-retrieving
-retro
-retroactive
-retroactively
-retrofit
-retrofitted
-retrofitting
-retrograde
-retrogressive
-retrospect
-retrospection
-retrospective
-retrospectively
-retrospectives
-retroviruses
-retry
-retrying
-retsina
-retted
-retune
-retuning
-return
-returnable
-returned
-returnees
-returning
-returns
-retype
-retyped
-retypes
-retyping
-reunification
-reunified
-reunify
-reunion
-reunions
-reunite
-reunited
-reunites
-reuniting
-reusable
-reuse
-reused
-reuses
-reusing
-rev
-revaluation
-revaluations
-revalue
-revalued
-revalues
-revamp
-revamped
-revamping
-revamps
-revanchist
-reveal
-revealable
-revealed
-revealing
-revealingly
-reveals
-reveille
-revel
-revelation
-revelations
-revelatory
-revelled
-reveller
-revellers
-revelling
-revelries
-revelry
-revels
-revenant
-revenge
-revenged
-revengeful
-revenges
-revenging
-revenue
-revenues
-reverberant
-reverberate
-reverberated
-reverberates
-reverberating
-reverberation
-reverberations
-revere
-revered
-reverence
-reverend
-reverent
-reverential
-reverentially
-reverently
-reveres
-reverie
-reveries
-revering
-reversal
-reversals
-reverse
-reversed
-reverser
-reverses
-reversibility
-reversible
-reversibly
-reversing
-reversion
-revert
-reverted
-reverting
-reverts
-review
-reviewable
-reviewed
-reviewer
-reviewers
-reviewing
-reviews
-revile
-reviled
-reviling
-revisable
-revisal
-revise
-revised
-reviser
-revises
-revising
-revision
-revisionary
-revisionism
-revisionist
-revisionists
-revisions
-revisit
-revisited
-revisiting
-revisits
-revitalisation
-revitalise
-revitalised
-revitalising
-revival
-revivalism
-revivalist
-revivalists
-revivals
-revive
-revived
-reviver
-revives
-revivify
-revivifying
-reviving
-revocable
-revocation
-revocations
-revoke
-revoked
-revoker
-revokers
-revokes
-revoking
-revolt
-revolted
-revolting
-revoltingly
-revolts
-revolution
-revolutionaries
-revolutionary
-revolutionise
-revolutionised
-revolutionises
-revolutionising
-revolutions
-revolve
-revolved
-revolver
-revolvers
-revolves
-revolving
-revs
-revue
-revues
-revulsion
-revved
-revving
-reward
-rewarded
-rewarding
-rewards
-reweighed
-rewind
-rewindable
-rewinding
-rewinds
-rewire
-rewired
-rewiring
-reword
-reworded
-rewording
-rewordings
-rework
-reworked
-reworking
-reworks
-rewound
-rewrap
-rewritable
-rewrite
-rewrites
-rewriting
-rewritings
-rewritten
-rewrote
-rhapsodic
-rhapsodical
-rhapsodies
-rhapsody
-rhea
-rhein
-rhenium
-rheological
-rheology
-rheostat
-rhesus
-rhetoric
-rhetorical
-rhetorically
-rhetorician
-rhetoricians
-rheumatic
-rheumatics
-rheumatism
-rheumatoid
-rheumatology
-rhine
-rhinestone
-rhinitis
-rhino
-rhinoceros
-rhinoceroses
-rhizome
-rho
-rhodesia
-rhodium
-rhododendron
-rhododendrons
-rhombic
-rhomboids
-rhombus
-rhombuses
-rhubarb
-rhumbas
-rhyme
-rhymed
-rhymer
-rhymes
-rhyming
-rhythm
-rhythmic
-rhythmical
-rhythmically
-rhythms
-ria
-rial
-rials
-rialto
-rib
-ribald
-ribaldry
-ribbed
-ribbing
-ribbon
-ribbons
-ribcage
-riboflavin
-ribonucleic
-ribosomal
-ribosome
-ribosomes
-ribs
-rice
-rich
-richer
-riches
-richest
-richly
-richness
-rick
-rickets
-rickety
-ricking
-ricks
-ricksha
-rickshas
-rickshaw
-rickshaws
-ricochet
-ricocheted
-ricocheting
-rid
-riddance
-ridden
-ridding
-riddle
-riddled
-riddles
-riddling
-ride
-rider
-riders
-rides
-ridge
-ridged
-ridges
-ridicule
-ridiculed
-ridicules
-ridiculing
-ridiculous
-ridiculously
-ridiculousness
-riding
-ridings
-rids
-rife
-riff
-riffle
-riffled
-riffs
-rifle
-rifled
-rifleman
-riflemen
-rifles
-rifling
-riflings
-rift
-rifting
-rifts
-rig
-rigged
-rigger
-riggers
-rigging
-right
-righted
-righten
-righteous
-righteously
-righteousness
-righter
-rightful
-rightfully
-righthand
-righthanded
-righthandedness
-righthander
-righthanders
-righting
-rightist
-rightly
-rightminded
-rightmost
-rightness
-rights
-rightthinking
-rightward
-rightwards
-rightwing
-rightwinger
-rightwingers
-rigid
-rigidifies
-rigidify
-rigidities
-rigidity
-rigidly
-rigmarole
-rigor
-rigorous
-rigorously
-rigour
-rigours
-rigs
-rile
-riled
-riles
-riling
-rill
-rills
-rim
-rime
-rimless
-rimmed
-rims
-rind
-rinds
-ring
-ringed
-ringer
-ringers
-ringing
-ringingly
-ringleader
-ringleaders
-ringless
-ringlet
-ringlets
-ringmaster
-rings
-ringside
-ringworm
-rink
-rinks
-rinse
-rinsed
-rinses
-rinsing
-riot
-rioted
-rioter
-rioters
-rioting
-riotous
-riotously
-riots
-rip
-ripcord
-ripe
-ripely
-ripen
-ripened
-ripeness
-ripening
-ripens
-riper
-ripest
-riping
-ripoff
-riposte
-riposted
-ripostes
-ripped
-ripper
-rippers
-ripping
-ripple
-rippled
-ripples
-rippling
-rips
-ripstop
-rise
-risen
-riser
-risers
-rises
-risible
-rising
-risings
-risk
-risked
-riskier
-riskiest
-riskiness
-risking
-risks
-risky
-risotto
-risque
-rissole
-rissoles
-rite
-rites
-ritual
-ritualised
-ritualistic
-ritualistically
-ritually
-rituals
-rival
-rivalled
-rivalling
-rivalries
-rivalry
-rivals
-riven
-river
-riverine
-rivers
-riverside
-rivet
-riveted
-riveter
-riveting
-rivetingly
-rivets
-riviera
-rivulet
-rivulets
-roach
-roaches
-road
-roadblock
-roadblocks
-roadhouse
-roadmap
-roads
-roadshow
-roadshows
-roadside
-roadsides
-roadsigns
-roadster
-roadsweepers
-roadway
-roadways
-roadworks
-roadworthy
-roam
-roamed
-roamer
-roaming
-roams
-roan
-roar
-roared
-roarer
-roaring
-roars
-roast
-roasted
-roaster
-roasting
-roasts
-rob
-robbed
-robber
-robberies
-robbers
-robbery
-robbing
-robe
-robed
-robes
-robin
-robins
-robot
-robotic
-robotics
-robots
-robs
-robust
-robustly
-robustness
-roc
-rock
-rockbottom
-rocked
-rocker
-rockers
-rockery
-rocket
-rocketed
-rocketing
-rocketry
-rockets
-rockfall
-rockfalls
-rockier
-rockiest
-rocking
-rocks
-rocksolid
-rocky
-rococo
-rocs
-rod
-rode
-rodent
-rodents
-rodeo
-rodeos
-rods
-roe
-roebuck
-roentgen
-roes
-rogue
-roguery
-rogues
-roguish
-roguishly
-roguishness
-roister
-roistering
-role
-roles
-roll
-rollcall
-rolled
-roller
-rollercoaster
-rollers
-rollerskating
-rollicking
-rolling
-rolls
-rolypoly
-rom
-roman
-romance
-romanced
-romancer
-romances
-romancing
-romans
-romantic
-romantically
-romanticised
-romanticises
-romanticising
-romanticism
-romantics
-romany
-rome
-rommel
-romp
-romped
-romper
-romping
-romps
-romulus
-rondavel
-roo
-roof
-roofed
-roofer
-roofgarden
-roofing
-roofings
-roofless
-roofs
-rooftop
-rooftops
-rooibos
-rook
-rookeries
-rookery
-rookies
-rooks
-room
-roomful
-roomier
-roomiest
-roommate
-rooms
-roomy
-roost
-roosted
-rooster
-roosters
-roosting
-roosts
-root
-rooted
-rooting
-rootings
-rootless
-roots
-rope
-roped
-ropes
-roping
-rosaries
-rosary
-rose
-rosebud
-rosebuds
-rosebush
-rosemary
-roses
-rosette
-rosettes
-rosewood
-rosier
-rosiest
-rosily
-rosin
-roster
-rostering
-rosters
-rostrum
-rostrums
-rosy
-rot
-rota
-rotary
-rotas
-rotatable
-rotate
-rotated
-rotates
-rotating
-rotation
-rotational
-rotationally
-rotations
-rotator
-rotators
-rotatory
-rote
-rotor
-rotors
-rots
-rotted
-rotten
-rottenly
-rottenness
-rotter
-rotting
-rotund
-rotunda
-rotundity
-rouble
-roubles
-rouge
-rouged
-rouges
-rough
-roughage
-roughed
-roughen
-roughened
-roughens
-rougher
-roughest
-roughie
-roughing
-roughly
-roughness
-roughs
-roughshod
-roulette
-round
-roundabout
-roundabouts
-rounded
-roundel
-roundels
-rounder
-rounders
-roundest
-roundhouse
-rounding
-roundish
-roundly
-roundness
-rounds
-roundtheclock
-roundup
-roundups
-rouse
-roused
-rouses
-rousing
-rout
-route
-routed
-routeing
-router
-routers
-routes
-routine
-routinely
-routines
-routing
-routs
-rove
-roved
-rover
-rovers
-roves
-roving
-rovings
-row
-rowboat
-rowboats
-rowdier
-rowdiest
-rowdily
-rowdiness
-rowdy
-rowdyism
-rowed
-rower
-rowers
-rowing
-rows
-royal
-royalist
-royalists
-royally
-royals
-royalties
-royalty
-ruanda
-rub
-rubbed
-rubber
-rubberised
-rubbers
-rubberstamp
-rubberstamped
-rubberstamping
-rubbery
-rubbing
-rubbings
-rubbish
-rubbished
-rubbishes
-rubbishing
-rubbishy
-rubble
-rubbles
-rubella
-rubicon
-rubicund
-rubidium
-rubies
-rubric
-rubs
-ruby
-ruck
-rucks
-rucksack
-rucksacks
-ruction
-ructions
-rudder
-rudderless
-rudders
-ruddiness
-ruddy
-rude
-rudely
-rudeness
-ruder
-rudest
-rudimentary
-rudiments
-rue
-rueful
-ruefully
-ruefulness
-rues
-ruff
-ruffian
-ruffians
-ruffle
-ruffled
-ruffles
-ruffling
-ruffs
-rug
-rugby
-rugged
-ruggedly
-ruggedness
-rugs
-ruin
-ruination
-ruinations
-ruined
-ruiner
-ruining
-ruinous
-ruinously
-ruins
-rule
-rulebook
-rulebooks
-ruled
-ruler
-rulers
-rules
-ruling
-rulings
-rum
-rumania
-rumba
-rumbas
-rumble
-rumbled
-rumbles
-rumbling
-rumblings
-rumbustious
-rumen
-ruminant
-ruminants
-ruminate
-ruminated
-ruminating
-rumination
-ruminations
-ruminative
-ruminatively
-rummage
-rummaged
-rummages
-rummaging
-rummy
-rumour
-rumoured
-rumours
-rump
-rumple
-rumpled
-rumpling
-rumps
-rumpus
-rumpuses
-run
-runaway
-rundown
-rune
-runes
-rung
-rungs
-runnable
-runner
-runners
-runnersup
-runnerup
-runnier
-runniest
-running
-runny
-runofthemill
-runs
-runt
-runts
-runway
-runways
-rupee
-rupees
-rupert
-rupture
-ruptured
-ruptures
-rupturing
-rural
-ruralist
-rurally
-ruse
-rush
-rushed
-rushes
-rushhour
-rushier
-rushing
-rusk
-rusks
-russet
-russia
-russian
-rust
-rusted
-rustic
-rustically
-rusticate
-rusticated
-rusticity
-rustics
-rustier
-rustiest
-rustiness
-rusting
-rustle
-rustled
-rustler
-rustlers
-rustles
-rustling
-rustproof
-rusts
-rusty
-rut
-ruth
-ruthless
-ruthlessly
-ruthlessness
-ruts
-rutted
-rwanda
-rye
-sabbat
-sabbath
-sabbaths
-sabbatical
-sabbaticals
-saber
-sable
-sables
-sabotage
-sabotaged
-sabotages
-sabotaging
-saboteur
-saboteurs
-sabra
-sabras
-sabre
-sabres
-sabretoothed
-sac
-saccharides
-saccharin
-saccharine
-sacerdotal
-sachet
-sachets
-sack
-sackcloth
-sacked
-sackful
-sackfuls
-sacking
-sacks
-sacral
-sacrament
-sacramental
-sacraments
-sacred
-sacredly
-sacredness
-sacrifice
-sacrificed
-sacrifices
-sacrificial
-sacrificing
-sacrilege
-sacrilegious
-sacristy
-sacrosanct
-sacrum
-sacs
-sad
-sadden
-saddened
-saddening
-saddens
-sadder
-saddest
-saddle
-saddlebag
-saddlebags
-saddled
-saddler
-saddlers
-saddles
-saddling
-sadism
-sadist
-sadistic
-sadistically
-sadists
-sadly
-sadness
-sadomasochism
-sadomasochistic
-sadsack
-safari
-safaris
-safe
-safeguard
-safeguarded
-safeguarding
-safeguards
-safely
-safeness
-safer
-safes
-safest
-safeties
-safety
-saffron
-sag
-saga
-sagacious
-sagaciously
-sagacity
-sagas
-sage
-sagely
-sages
-sagest
-sagged
-sagging
-sago
-sags
-sahara
-sahib
-said
-saigon
-sail
-sailcloth
-sailed
-sailer
-sailing
-sailings
-sailmaker
-sailor
-sailors
-sails
-saint
-sainted
-sainthood
-saintlier
-saintliest
-saintliness
-saintly
-saints
-saipan
-sake
-sakes
-saki
-salaam
-salacious
-salad
-salads
-salamander
-salamanders
-salami
-salamis
-salaried
-salaries
-salary
-sale
-saleability
-saleable
-salem
-sales
-salesgirl
-salesman
-salesmanship
-salesmen
-salespeople
-salesperson
-saleswoman
-salicylic
-salience
-salient
-saline
-salinity
-saliva
-salivary
-salivas
-salivate
-salivating
-salivation
-salivations
-sallied
-sallies
-sallow
-sally
-sallying
-salmon
-salmonella
-salmons
-salome
-salon
-salons
-saloon
-saloons
-salsa
-salt
-salted
-saltier
-saltiest
-saltiness
-saltpetre
-salts
-saltwater
-salty
-salubrious
-salubrity
-salutary
-salutation
-salutations
-salute
-saluted
-salutes
-saluting
-salvage
-salvageable
-salvaged
-salvager
-salvages
-salvaging
-salvation
-salve
-salved
-salver
-salvers
-salving
-salvo
-sam
-samba
-sambas
-same
-sameness
-samizdat
-samoa
-samosas
-samovar
-sampan
-sample
-sampled
-sampler
-samplers
-samples
-sampling
-samplings
-samurai
-san
-sanatorium
-sanctification
-sanctified
-sanctifies
-sanctify
-sanctifying
-sanctimonious
-sanction
-sanctioned
-sanctioning
-sanctions
-sanctity
-sanctuaries
-sanctuary
-sanctum
-sand
-sandal
-sandalled
-sandals
-sandalwood
-sandbag
-sandbagged
-sandbags
-sandbank
-sandbanks
-sandcastle
-sandcastles
-sanddune
-sanded
-sander
-sandier
-sandiest
-sanding
-sandman
-sandpaper
-sandpapering
-sandpiper
-sandpipers
-sandpit
-sands
-sandstone
-sandstones
-sandwich
-sandwiched
-sandwiches
-sandwiching
-sandy
-sane
-sanely
-saner
-sanest
-sang
-sanguine
-sanitary
-sanitation
-sanitise
-sanitised
-sanitiser
-sanitisers
-sanity
-sank
-sanserif
-sanskrit
-santiago
-sap
-sapient
-sapling
-saplings
-sapped
-sapper
-sappers
-sapphire
-sapphires
-sapping
-saps
-sarcasm
-sarcasms
-sarcastic
-sarcastically
-sarcoma
-sarcophagi
-sarcophagus
-sardine
-sardines
-sardinia
-sardonic
-sardonically
-sarge
-sari
-saris
-sarong
-sartorial
-sartorially
-sash
-sashes
-sat
-satan
-satanic
-satanically
-satanism
-satchel
-satchels
-sated
-satellite
-satellites
-satiate
-satiated
-satiation
-satin
-sating
-satins
-satinwood
-satiny
-satire
-satires
-satiric
-satirical
-satirically
-satirise
-satirised
-satirises
-satirising
-satirist
-satirists
-satisfaction
-satisfactions
-satisfactorily
-satisfactory
-satisfiable
-satisfied
-satisfies
-satisfy
-satisfying
-satisfyingly
-satrap
-satraps
-satsumas
-saturate
-saturated
-saturates
-saturating
-saturation
-saturday
-saturn
-saturnalia
-saturnine
-satyr
-satyric
-satyrs
-sauce
-saucepan
-saucepans
-saucer
-saucers
-sauces
-saucier
-sauciest
-saucily
-sauciness
-saucy
-saudi
-saudis
-sauerkraut
-sauna
-saunas
-saunter
-sauntered
-sauntering
-saunters
-sausage
-sausages
-saute
-savage
-savaged
-savagely
-savagery
-savages
-savaging
-savanna
-savannah
-savant
-savants
-save
-saved
-saveloy
-saver
-savers
-saves
-saving
-savings
-saviour
-saviours
-savour
-savoured
-savouring
-savours
-savoury
-savvy
-saw
-sawdust
-sawed
-sawing
-sawmill
-sawmills
-sawn
-saws
-sawtooth
-sawyer
-sawyers
-saxon
-saxons
-saxony
-saxophone
-saxophones
-saxophonist
-say
-saying
-sayings
-says
-scab
-scabbard
-scabbards
-scabbed
-scabby
-scabies
-scabs
-scaffold
-scaffolding
-scaffolds
-scalability
-scalable
-scalar
-scalars
-scald
-scalded
-scalding
-scalds
-scale
-scaled
-scalene
-scales
-scaling
-scallop
-scalloped
-scallops
-scalp
-scalped
-scalpel
-scalpels
-scalping
-scalps
-scaly
-scam
-scamp
-scamped
-scamper
-scampered
-scampering
-scampi
-scams
-scan
-scandal
-scandalise
-scandalised
-scandalous
-scandalously
-scandals
-scanned
-scanner
-scanners
-scanning
-scans
-scansion
-scant
-scantier
-scantiest
-scantily
-scantiness
-scanty
-scape
-scapegoat
-scapegoats
-scapula
-scar
-scarab
-scarce
-scarcely
-scarceness
-scarcer
-scarcest
-scarcities
-scarcity
-scare
-scarecrow
-scarecrows
-scared
-scaremonger
-scaremongering
-scares
-scarf
-scarfs
-scarier
-scariest
-scarified
-scarify
-scarifying
-scarily
-scaring
-scarlet
-scarlets
-scarp
-scarred
-scarring
-scars
-scarves
-scary
-scat
-scathe
-scathed
-scathing
-scathingly
-scatological
-scatter
-scattered
-scatterer
-scatterers
-scattering
-scatterings
-scatters
-scavenge
-scavenged
-scavenger
-scavengers
-scavenging
-scenario
-scene
-scenery
-scenes
-scenic
-scenically
-scent
-scented
-scenting
-scentless
-scents
-sceptic
-sceptical
-sceptically
-scepticism
-sceptics
-sceptre
-sceptred
-sceptres
-schedule
-scheduled
-scheduler
-schedulers
-schedules
-scheduling
-schema
-schemas
-schemata
-schematic
-schematically
-schematics
-scheme
-schemed
-schemer
-schemes
-scheming
-scherzi
-scherzo
-schism
-schismatic
-schismatics
-schisms
-schist
-schistosomiasis
-schists
-schizoid
-schizophrenia
-schizophrenic
-schizophrenically
-schizophrenics
-schmalz
-schnapps
-scholar
-scholarly
-scholars
-scholarship
-scholarships
-scholastic
-scholasticism
-school
-schoolboy
-schoolboys
-schoolchild
-schoolchildren
-schooldays
-schooled
-schoolgirl
-schoolgirls
-schoolhouse
-schooling
-schoolmaster
-schoolmasters
-schoolmates
-schoolmistress
-schoolroom
-schools
-schoolteacher
-schoolteachers
-schooner
-schooners
-schwa
-schwas
-sciatica
-science
-sciences
-scientific
-scientifically
-scientist
-scientists
-scifi
-scimitar
-scimitars
-scintigraphy
-scintillate
-scintillated
-scintillating
-scintillation
-scintillations
-scintillator
-scintillators
-scissor
-scissored
-scissors
-sclerosis
-scoff
-scoffed
-scoffing
-scold
-scolded
-scolder
-scolding
-scolds
-scone
-scones
-scoop
-scooped
-scooper
-scoopful
-scooping
-scoops
-scoot
-scooter
-scooters
-scooting
-scoots
-scope
-scopes
-scorch
-scorched
-scorcher
-scorches
-scorching
-score
-scoreboard
-scoreboards
-scorecard
-scorecards
-scored
-scoreless
-scoreline
-scorer
-scorers
-scores
-scoring
-scorn
-scorned
-scornful
-scornfully
-scorning
-scorns
-scorpion
-scorpions
-scot
-scotch
-scotched
-scotches
-scotfree
-scotland
-scots
-scotsman
-scottish
-scoundrel
-scoundrels
-scour
-scoured
-scourge
-scourged
-scourges
-scourging
-scouring
-scours
-scout
-scouted
-scouting
-scoutmaster
-scoutmasters
-scouts
-scowl
-scowled
-scowling
-scowls
-scrabble
-scrabbled
-scrabbling
-scram
-scramble
-scrambled
-scrambler
-scramblers
-scrambles
-scrambling
-scrams
-scrap
-scrapbook
-scrapbooks
-scrape
-scraped
-scraper
-scrapers
-scrapes
-scrapie
-scraping
-scrapings
-scrapped
-scrappier
-scrappiest
-scrapping
-scrappy
-scraps
-scrapyard
-scrapyards
-scratch
-scratched
-scratches
-scratchier
-scratchiest
-scratchiness
-scratching
-scratchings
-scratchy
-scrawl
-scrawled
-scrawling
-scrawls
-scrawnier
-scrawniest
-scrawny
-scream
-screamed
-screamer
-screamers
-screaming
-screamingly
-screams
-scree
-screech
-screeched
-screeches
-screechier
-screechiest
-screeching
-screechy
-screed
-screeds
-screen
-screened
-screening
-screenings
-screenplay
-screenplays
-screens
-screenwriter
-screw
-screwdriver
-screwdrivers
-screwed
-screwing
-screws
-screwy
-scribal
-scribble
-scribbled
-scribbler
-scribblers
-scribbles
-scribbling
-scribblings
-scribe
-scribed
-scribes
-scribing
-scrimped
-script
-scripted
-scripting
-scriptorium
-scripts
-scriptural
-scripture
-scriptures
-scriptwriter
-scriptwriters
-scriptwriting
-scroll
-scrollable
-scrolled
-scrolling
-scrolls
-scrooge
-scrooges
-scrotum
-scrub
-scrubbed
-scrubber
-scrubbers
-scrubbing
-scrubby
-scrubland
-scrubs
-scruff
-scruffier
-scruffy
-scrum
-scrumhalf
-scrummage
-scrummaging
-scrums
-scrunched
-scruple
-scruples
-scrupulous
-scrupulously
-scrupulousness
-scrutineers
-scrutinies
-scrutinise
-scrutinised
-scrutinises
-scrutinising
-scrutiny
-scuba
-scubas
-scud
-scudded
-scudding
-scuds
-scuff
-scuffed
-scuffing
-scuffle
-scuffled
-scuffles
-scuffling
-scull
-sculled
-sculler
-sculleries
-scullery
-sculling
-sculls
-sculpt
-sculpted
-sculpting
-sculptor
-sculptors
-sculptress
-sculptural
-sculpture
-sculptured
-sculptures
-scum
-scupper
-scuppered
-scurried
-scurries
-scurrilous
-scurry
-scurrying
-scurryings
-scurvy
-scuttle
-scuttled
-scuttles
-scuttling
-scythe
-scythed
-scythes
-scything
-sea
-seabed
-seabird
-seabirds
-seaboard
-seaborne
-seacow
-seacows
-seafarer
-seafarers
-seafaring
-seafood
-seafront
-seagod
-seagoing
-seagreen
-seagull
-seagulls
-seal
-sealant
-sealants
-sealed
-sealer
-sealers
-sealing
-sealion
-seals
-seam
-seamail
-seaman
-seamanship
-seamed
-seamen
-seamier
-seamless
-seamlessly
-seams
-seamstress
-seamstresses
-seamy
-seance
-seances
-seaplane
-seaplanes
-seaport
-seaports
-sear
-search
-searched
-searcher
-searchers
-searches
-searching
-searchingly
-searchlight
-searchlights
-seared
-searing
-sears
-seas
-seascape
-seascapes
-seashells
-seashore
-seashores
-seasick
-seasickness
-seaside
-season
-seasonable
-seasonably
-seasonal
-seasonality
-seasonally
-seasoned
-seasoner
-seasoning
-seasons
-seat
-seated
-seating
-seatings
-seats
-seattle
-seaward
-seawards
-seawater
-seaweed
-seaweeds
-seaworthy
-sebaceous
-sec
-secant
-secateurs
-secede
-seceded
-secedes
-seceding
-secession
-secessionist
-secessionists
-secessions
-seclude
-secluded
-seclusion
-second
-secondaries
-secondarily
-secondary
-secondbest
-secondclass
-seconded
-seconder
-seconders
-secondhand
-seconding
-secondly
-secondment
-secondments
-secondrate
-seconds
-secrecy
-secret
-secretarial
-secretariat
-secretariats
-secretaries
-secretary
-secretaryship
-secrete
-secreted
-secretes
-secreting
-secretion
-secretions
-secretive
-secretively
-secretiveness
-secretly
-secretory
-secrets
-sect
-sectarian
-sectarianism
-section
-sectional
-sectioned
-sectioning
-sections
-sector
-sectoral
-sectored
-sectors
-sects
-secular
-secularisation
-secularised
-secularism
-secularist
-secularists
-secure
-secured
-securely
-securer
-secures
-securest
-securing
-securities
-security
-sedan
-sedate
-sedated
-sedately
-sedateness
-sedater
-sedates
-sedating
-sedation
-sedative
-sedatives
-sedentary
-sedge
-sedges
-sediment
-sedimentary
-sedimentation
-sediments
-sedition
-seditious
-seduce
-seduced
-seducer
-seducers
-seduces
-seducing
-seduction
-seductions
-seductive
-seductively
-seductiveness
-sedulously
-see
-seeable
-seed
-seedbed
-seeded
-seeder
-seedier
-seediest
-seediness
-seeding
-seedless
-seedling
-seedlings
-seeds
-seedy
-seeing
-seeings
-seek
-seeker
-seekers
-seeking
-seeks
-seem
-seemed
-seeming
-seemingly
-seemlier
-seemliest
-seemly
-seems
-seen
-seep
-seepage
-seeped
-seeping
-seeps
-seer
-seers
-sees
-seesaw
-seesaws
-seethe
-seethed
-seethes
-seething
-seethrough
-segment
-segmental
-segmentation
-segmented
-segmenting
-segments
-segregate
-segregated
-segregates
-segregating
-segregation
-seine
-seisin
-seismic
-seismogram
-seismograph
-seismological
-seismologist
-seismologists
-seismology
-seismometer
-seismometers
-seize
-seized
-seizer
-seizes
-seizing
-seizure
-seizures
-seldom
-select
-selectable
-selected
-selectee
-selecting
-selection
-selections
-selective
-selectively
-selectivity
-selector
-selectors
-selects
-selenium
-selenology
-self
-selfcentred
-selfcentredness
-selfconfidence
-selfconfident
-selfconscious
-selfconsciously
-selfconsciousness
-selfcontrol
-selfcontrolled
-selfdefence
-selfdestruct
-selfdestructed
-selfdestructing
-selfdestruction
-selfdestructive
-selfdestructs
-selfdiscipline
-selfemployed
-selfesteem
-selfevident
-selfgoverning
-selfgovernment
-selfinflicted
-selfinterest
-selfish
-selfishly
-selfishness
-selfless
-selflessly
-selfmade
-selfpity
-selfportrait
-selfportraits
-selfrespect
-selfrespecting
-selfrestraint
-selfrighteous
-selfrighteously
-selfrighteousness
-selfsacrifice
-selfsacrificing
-selfsame
-selfsupporting
-selftaught
-sell
-sellable
-seller
-sellers
-selling
-sells
-selves
-semantic
-semantically
-semantics
-semaphore
-semaphores
-semaphoring
-semblance
-semblances
-semen
-semester
-semesters
-semi
-semicircle
-semicircular
-semicolon
-semicolons
-semiconducting
-semiconductor
-semiconductors
-semiconscious
-semidetached
-semifinal
-semifinalist
-semifinalists
-semifinals
-seminar
-seminaries
-seminars
-seminary
-semite
-semites
-semitic
-semitics
-sen
-senate
-senates
-senator
-senatorial
-senators
-send
-sender
-senders
-sending
-sends
-senegal
-senhor
-senhors
-senile
-senility
-senior
-seniority
-seniors
-senora
-senoritas
-sensation
-sensational
-sensationalised
-sensationalism
-sensationalist
-sensationalistic
-sensationally
-sensations
-sense
-sensed
-senseless
-senselessly
-senselessness
-senses
-sensibilities
-sensibility
-sensible
-sensibleness
-sensibly
-sensing
-sensings
-sensitisation
-sensitised
-sensitisers
-sensitive
-sensitively
-sensitiveness
-sensitivities
-sensitivity
-sensor
-sensors
-sensory
-sensual
-sensuality
-sensually
-sensuous
-sensuously
-sensuousness
-sent
-sentence
-sentenced
-sentences
-sentencing
-sentential
-sententious
-sententiously
-sentience
-sentient
-sentiment
-sentimental
-sentimentalised
-sentimentalism
-sentimentalist
-sentimentality
-sentimentally
-sentiments
-sentinel
-sentinels
-sentries
-sentry
-seoul
-separability
-separable
-separate
-separated
-separately
-separateness
-separates
-separating
-separation
-separations
-separatism
-separatist
-separatists
-separator
-separators
-sepia
-september
-septet
-septets
-septic
-septicaemia
-sepulchral
-sepulchre
-sepulchres
-sequel
-sequels
-sequence
-sequenced
-sequencer
-sequencers
-sequences
-sequencing
-sequent
-sequential
-sequentially
-sequestered
-sequestrated
-sequestration
-sequin
-sequinned
-sequins
-sequoia
-seraglio
-serai
-seraphic
-seraphically
-seraphim
-seraphs
-serenade
-serenader
-serenades
-serenading
-serenata
-serendipitous
-serendipitously
-serendipity
-serene
-serenely
-serener
-serenest
-serenity
-serf
-serfdom
-serfhood
-serfs
-serge
-sergeant
-sergeants
-serial
-serialisation
-serialisations
-serialise
-serialised
-serialising
-serially
-serials
-series
-serif
-serifed
-serifs
-serious
-seriously
-seriousness
-sermon
-sermons
-serological
-serology
-seronegative
-serotonin
-serpent
-serpentine
-serpents
-serrate
-serrated
-serried
-serum
-serums
-servant
-servants
-serve
-served
-server
-servers
-serves
-service
-serviceability
-serviceable
-serviced
-serviceman
-servicemen
-services
-servicing
-serviette
-servile
-servilely
-servility
-serving
-servings
-servitude
-sesame
-sesotho
-sessile
-session
-sessions
-set
-setback
-setbacks
-seth
-sets
-setswana
-settee
-settees
-setter
-setters
-setting
-settings
-settle
-settled
-settlement
-settlements
-settler
-settlers
-settles
-settling
-setts
-setup
-seven
-sevenfold
-sevenpence
-sevens
-seventeen
-seventeenth
-seventh
-seventies
-seventieth
-seventy
-sever
-severable
-several
-severally
-severance
-severe
-severed
-severely
-severer
-severest
-severing
-severity
-severs
-sew
-sewage
-sewed
-sewer
-sewerage
-sewerrat
-sewers
-sewing
-sewings
-sewn
-sews
-sex
-sexed
-sexes
-sexier
-sexiest
-sexily
-sexiness
-sexing
-sexism
-sexist
-sexists
-sexless
-sexologists
-sexology
-sextant
-sextants
-sextet
-sextets
-sexton
-sextons
-sextuplet
-sextuplets
-sexual
-sexualities
-sexuality
-sexually
-sexy
-shabbier
-shabbiest
-shabbily
-shabbiness
-shabby
-shack
-shackle
-shackled
-shackles
-shacks
-shade
-shaded
-shadeless
-shades
-shadier
-shadiest
-shadily
-shading
-shadings
-shadow
-shadowed
-shadowing
-shadowless
-shadows
-shadowy
-shady
-shaft
-shafted
-shafting
-shafts
-shag
-shagged
-shaggiest
-shaggy
-shags
-shah
-shahs
-shakable
-shake
-shakeable
-shakedown
-shaken
-shaker
-shakers
-shakes
-shakeup
-shakeups
-shakier
-shakiest
-shakily
-shaking
-shaky
-shale
-shall
-shallot
-shallots
-shallow
-shallower
-shallowest
-shallowly
-shallowness
-shallows
-sham
-shaman
-shamanic
-shamanism
-shamanistic
-shamans
-shamble
-shambled
-shambles
-shambling
-shame
-shamed
-shamefaced
-shamefacedly
-shameful
-shamefully
-shameless
-shamelessly
-shamelessness
-shames
-shaming
-shammed
-shamming
-shampoo
-shampooed
-shampooing
-shampoos
-shamrock
-shams
-shandy
-shank
-shanks
-shanties
-shanty
-shape
-shaped
-shapeless
-shapelier
-shapeliest
-shapely
-shaper
-shapers
-shapes
-shaping
-sharable
-shard
-shards
-share
-shareable
-shared
-shareholder
-shareholders
-shareholding
-shareholdings
-sharer
-shares
-shareware
-sharing
-shark
-sharks
-sharp
-sharpen
-sharpened
-sharpener
-sharpeners
-sharpening
-sharpens
-sharper
-sharpest
-sharply
-sharpness
-sharps
-shatter
-shattered
-shattering
-shatteringly
-shatterproof
-shatters
-shave
-shaved
-shaven
-shaver
-shavers
-shaves
-shaving
-shavings
-shaw
-shawl
-shawls
-she
-sheaf
-shear
-sheared
-shearer
-shearers
-shearing
-shears
-shearwater
-shearwaters
-sheath
-sheathe
-sheathed
-sheathing
-sheaths
-sheaves
-shed
-shedding
-sheds
-sheen
-sheep
-sheepdog
-sheepdogs
-sheepish
-sheepishly
-sheepishness
-sheepskin
-sheepskins
-sheer
-sheered
-sheerest
-sheerness
-sheet
-sheeted
-sheeting
-sheets
-sheik
-sheikh
-sheikhs
-sheiks
-shekel
-shekels
-shelf
-shell
-shellac
-shelled
-shellfire
-shellfish
-shelling
-shells
-shelter
-sheltered
-sheltering
-shelters
-shelve
-shelved
-shelves
-shelving
-shepherd
-shepherded
-shepherdess
-shepherding
-shepherds
-sherbet
-sherds
-sheriff
-sheriffs
-sherlock
-sherries
-sherry
-shetland
-shibboleth
-shibboleths
-shied
-shield
-shielded
-shielding
-shields
-shielings
-shies
-shift
-shifted
-shifter
-shifters
-shiftier
-shiftily
-shiftiness
-shifting
-shiftless
-shifts
-shifty
-shilling
-shimmer
-shimmered
-shimmering
-shimmers
-shin
-shinbone
-shindig
-shine
-shined
-shiner
-shines
-shingle
-shingles
-shinier
-shiniest
-shining
-shinned
-shinning
-shins
-shiny
-ship
-shipboard
-shipborne
-shipbuilder
-shipbuilders
-shipbuilding
-shipload
-shiploads
-shipmate
-shipmates
-shipment
-shipments
-shipowner
-shipowners
-shippable
-shipped
-shipping
-ships
-shipshape
-shipwreck
-shipwrecked
-shipwrecks
-shipwright
-shipwrights
-shipyard
-shipyards
-shire
-shires
-shirk
-shirked
-shirking
-shirt
-shirtless
-shirts
-shirtsleeves
-shiver
-shivered
-shivering
-shiveringly
-shivers
-shivery
-shoal
-shoals
-shock
-shocked
-shocker
-shockers
-shocking
-shockingly
-shocks
-shod
-shoddier
-shoddiest
-shoddily
-shoddiness
-shoddy
-shoe
-shoebox
-shoed
-shoehorn
-shoeing
-shoelace
-shoelaces
-shoeless
-shoemaker
-shoemakers
-shoes
-shoestring
-shoestrings
-shogun
-shoguns
-shone
-shoo
-shooed
-shooing
-shook
-shoot
-shooter
-shooters
-shooting
-shootings
-shoots
-shop
-shopfront
-shopfronts
-shopkeeper
-shopkeepers
-shopkeeping
-shoplift
-shoplifted
-shoplifter
-shoplifters
-shoplifting
-shopped
-shopper
-shoppers
-shopping
-shops
-shore
-shored
-shoreline
-shorelines
-shores
-shoreward
-shorewards
-shoring
-shorn
-short
-shortage
-shortages
-shortbread
-shortcircuit
-shortcircuited
-shortcircuiting
-shortcoming
-shortcomings
-shortcrust
-shortcut
-shortcuts
-shorted
-shorten
-shortened
-shortening
-shortens
-shorter
-shortest
-shortfall
-shortfalls
-shorthand
-shorting
-shortish
-shortlist
-shortlisted
-shortlisting
-shortlived
-shortly
-shortness
-shorts
-shortsighted
-shortsightedly
-shortsightedness
-shortstaffed
-shorttempered
-shortterm
-shortwinded
-shorty
-shot
-shotgun
-shotguns
-shots
-should
-shoulder
-shouldered
-shouldering
-shoulders
-shout
-shouted
-shouter
-shouters
-shouting
-shouts
-shove
-shoved
-shovel
-shovelful
-shovelled
-shoveller
-shovelling
-shovels
-shoves
-shoving
-show
-showcase
-showcases
-showcasing
-showdown
-showed
-shower
-showered
-showering
-showers
-showery
-showgirl
-showground
-showier
-showiest
-showing
-showings
-showjumpers
-showman
-showmanship
-showmen
-shown
-showoff
-showpiece
-showpieces
-showplace
-showroom
-showrooms
-shows
-showy
-shrank
-shrapnel
-shred
-shredded
-shredder
-shredders
-shredding
-shreds
-shrew
-shrewd
-shrewder
-shrewdest
-shrewdly
-shrewdness
-shrews
-shriek
-shrieked
-shrieker
-shriekers
-shrieking
-shrieks
-shrift
-shrill
-shrilled
-shrillest
-shrillness
-shrills
-shrilly
-shrimp
-shrimps
-shrine
-shrines
-shrink
-shrinkable
-shrinkage
-shrinking
-shrinkingly
-shrinks
-shrivel
-shrivelled
-shrivelling
-shrivels
-shroud
-shrouded
-shrouding
-shrouds
-shrub
-shrubberies
-shrubbery
-shrubby
-shrubs
-shrug
-shrugged
-shrugging
-shrugs
-shrunk
-shrunken
-shudder
-shuddered
-shuddering
-shudders
-shuffle
-shuffled
-shuffler
-shufflers
-shuffles
-shuffling
-shun
-shunned
-shunning
-shuns
-shunt
-shunted
-shunter
-shunters
-shunting
-shunts
-shushed
-shut
-shutdown
-shutdowns
-shuts
-shutter
-shuttered
-shuttering
-shutters
-shutting
-shuttle
-shuttlecock
-shuttlecocks
-shuttled
-shuttles
-shuttling
-shutup
-shy
-shyer
-shyest
-shying
-shyly
-shyness
-siam
-siamese
-siberia
-siberian
-sibilance
-sibilancy
-sibilant
-sibling
-siblings
-sibyl
-sic
-sicilian
-sicily
-sick
-sickbay
-sickbed
-sicken
-sickened
-sickening
-sickeningly
-sickens
-sicker
-sickest
-sickle
-sickles
-sickliest
-sickly
-sickness
-sicknesses
-sickroom
-side
-sideband
-sidebands
-sideboard
-sideboards
-sideburns
-sidecar
-sided
-sidekick
-sidelight
-sidelights
-sideline
-sidelines
-sidelong
-sider
-sidereal
-sides
-sideshow
-sideshows
-sidestep
-sidestepped
-sidestepping
-sidesteps
-sideswipes
-sidetrack
-sidetracked
-sidetracking
-sidewalk
-sidewards
-sideways
-sidewinders
-siding
-sidings
-sidle
-sidled
-sidling
-siege
-sieges
-sienna
-sierra
-siesta
-siestas
-sieve
-sieved
-sieves
-sieving
-sift
-sifted
-sifter
-sifters
-sifting
-siftings
-sifts
-sigh
-sighed
-sighing
-sighs
-sight
-sighted
-sightedness
-sighting
-sightings
-sightless
-sightlessly
-sightly
-sights
-sightsee
-sightseeing
-sightseers
-sigma
-sigmoid
-sign
-signal
-signalled
-signaller
-signallers
-signalling
-signally
-signalman
-signalmen
-signals
-signatories
-signatory
-signature
-signatures
-signboards
-signed
-signer
-signers
-signet
-significance
-significances
-significant
-significantly
-signification
-significations
-signified
-signifier
-signifies
-signify
-signifying
-signing
-signings
-signor
-signora
-signors
-signpost
-signposted
-signposting
-signposts
-signs
-signwriter
-silage
-silence
-silenced
-silencer
-silencers
-silences
-silencing
-silent
-silently
-silhouette
-silhouetted
-silhouettes
-silica
-silicate
-silicates
-silicon
-silicone
-silicosis
-silk
-silken
-silkier
-silkiest
-silkily
-silkiness
-silklike
-silks
-silkworm
-silkworms
-silky
-sillier
-silliest
-silliness
-silly
-silo
-silt
-silted
-silting
-silts
-siltstone
-silty
-silver
-silvered
-silvering
-silvers
-silversmith
-silversmiths
-silverware
-silvery
-simeon
-similar
-similarities
-similarity
-similarly
-simile
-similes
-similitude
-simmer
-simmered
-simmering
-simmers
-simper
-simpered
-simpering
-simpers
-simple
-simpleminded
-simpler
-simplest
-simpleton
-simpletons
-simplex
-simplexes
-simplicities
-simplicity
-simplification
-simplifications
-simplified
-simplifier
-simplifies
-simplify
-simplifying
-simplism
-simplistic
-simplistically
-simply
-simulacrum
-simulate
-simulated
-simulates
-simulating
-simulation
-simulations
-simulator
-simulators
-simulcasts
-simultaneity
-simultaneous
-simultaneously
-sin
-sinai
-since
-sincere
-sincerely
-sincerest
-sincerity
-sine
-sinecure
-sinecures
-sinecurist
-sines
-sinew
-sinews
-sinewy
-sinful
-sinfully
-sinfulness
-sing
-singable
-singalong
-singe
-singed
-singeing
-singer
-singers
-singes
-singing
-single
-singlehanded
-singlehandedly
-singleminded
-singlemindedly
-singlemindedness
-singleness
-singles
-singly
-sings
-singsong
-singular
-singularisation
-singularities
-singularity
-singularly
-singulars
-sinister
-sinisterly
-sinistral
-sink
-sinkable
-sinker
-sinkers
-sinking
-sinks
-sinless
-sinned
-sinner
-sinners
-sinning
-sins
-sinter
-sinters
-sinuous
-sinuously
-sinus
-sinuses
-sinusitis
-sinusoid
-sinusoidal
-sinusoidally
-sip
-siphon
-siphoned
-siphoning
-siphons
-sipped
-sipper
-sippers
-sipping
-sips
-sir
-sire
-sired
-siren
-sirens
-sires
-sirius
-sirloin
-sirloins
-sirs
-sis
-sisal
-sissies
-sissy
-sister
-sisterhood
-sisterinlaw
-sisterly
-sisters
-sistersinlaw
-sit
-sitar
-sitcom
-sitcoms
-site
-sited
-sites
-siting
-sitings
-sits
-sitter
-sitters
-sitting
-sittings
-situate
-situated
-situating
-situation
-situational
-situationally
-situationist
-situations
-six
-sixes
-sixfold
-sixpence
-sixteen
-sixteenth
-sixth
-sixths
-sixties
-sixtieth
-sixty
-size
-sizeable
-sized
-sizes
-sizing
-sizzle
-sizzled
-sizzles
-sizzling
-sjambok
-skate
-skateboard
-skateboards
-skated
-skater
-skaters
-skates
-skating
-skein
-skeletal
-skeleton
-skeletons
-skeptic
-skerries
-sketch
-sketchbook
-sketchbooks
-sketched
-sketcher
-sketches
-sketchier
-sketchiest
-sketchily
-sketching
-sketchpad
-sketchy
-skew
-skewed
-skewer
-skewered
-skewers
-skewness
-skews
-ski
-skid
-skidded
-skidding
-skids
-skied
-skier
-skiers
-skies
-skiing
-skilful
-skilfully
-skill
-skilled
-skillet
-skillful
-skills
-skim
-skimmed
-skimmer
-skimming
-skimp
-skimped
-skimping
-skimpy
-skims
-skin
-skincare
-skindeep
-skinflint
-skinhead
-skinheads
-skinless
-skinned
-skinner
-skinners
-skinnier
-skinniest
-skinning
-skinny
-skins
-skintight
-skip
-skipped
-skipper
-skippered
-skippering
-skippers
-skipping
-skips
-skirl
-skirmish
-skirmishes
-skirmishing
-skirt
-skirted
-skirting
-skirts
-skis
-skit
-skits
-skittish
-skittishly
-skittishness
-skittle
-skittles
-skua
-skuas
-skulduggery
-skulk
-skulked
-skulking
-skulks
-skull
-skullcap
-skullduggery
-skulls
-skunk
-skunks
-sky
-skydive
-skydived
-skydiver
-skydivers
-skydives
-skydiving
-skyhigh
-skylark
-skylarks
-skylight
-skylights
-skyline
-skylines
-skyscape
-skyscraper
-skyscrapers
-skyward
-skywards
-slab
-slabs
-slack
-slacked
-slacken
-slackened
-slackening
-slackens
-slacker
-slackers
-slackest
-slacking
-slackly
-slackness
-slacks
-slag
-slags
-slain
-slake
-slaked
-slalom
-slaloms
-slam
-slammed
-slamming
-slams
-slander
-slandered
-slanderer
-slanderers
-slandering
-slanderous
-slanders
-slang
-slanging
-slant
-slanted
-slanting
-slants
-slantwise
-slap
-slapdash
-slapped
-slapper
-slapping
-slaps
-slapstick
-slash
-slashed
-slasher
-slashes
-slashing
-slat
-slate
-slated
-slater
-slaters
-slates
-slating
-slats
-slatted
-slaughter
-slaughtered
-slaughterer
-slaughterhouse
-slaughterhouses
-slaughtering
-slaughterings
-slaughters
-slav
-slave
-slaved
-slavedriver
-slavedrivers
-slaver
-slavered
-slavering
-slavers
-slavery
-slaves
-slavic
-slaving
-slavish
-slavishly
-slavs
-slay
-slayed
-slayer
-slayers
-slaying
-slays
-sleaze
-sleazier
-sleaziest
-sleazy
-sled
-sledding
-sledge
-sledgehammer
-sledgehammers
-sledges
-sledging
-sleds
-sleek
-sleeker
-sleekly
-sleekness
-sleeks
-sleep
-sleeper
-sleepers
-sleepier
-sleepiest
-sleepily
-sleepiness
-sleeping
-sleepless
-sleeplessness
-sleeps
-sleepwalk
-sleepwalker
-sleepwalking
-sleepwalks
-sleepy
-sleet
-sleets
-sleeve
-sleeved
-sleeveless
-sleeves
-sleigh
-sleighs
-sleight
-sleights
-slender
-slenderest
-slenderly
-slenderness
-slept
-sleuth
-sleuths
-slew
-slewed
-slewing
-slice
-sliced
-slicer
-slicers
-slices
-slicing
-slicings
-slick
-slicked
-slicker
-slickest
-slickly
-slickness
-slicks
-slid
-slide
-slided
-slider
-sliders
-slides
-sliding
-slight
-slighted
-slighter
-slightest
-slighting
-slightingly
-slightly
-slights
-slily
-slim
-slime
-slimes
-slimier
-slimiest
-slimline
-slimly
-slimmed
-slimmer
-slimmers
-slimmest
-slimming
-slimness
-slims
-slimy
-sling
-slinging
-slings
-slingshot
-slink
-slinking
-slinky
-slip
-slippage
-slipped
-slipper
-slipperiness
-slippers
-slippery
-slipping
-slips
-slipshod
-slipstream
-slipup
-slipway
-slit
-slither
-slithered
-slithering
-slithers
-slithery
-slits
-slitting
-sliver
-slivers
-slob
-slobber
-slobbering
-slobbers
-slobbery
-slobs
-slog
-slogan
-slogans
-slogged
-slogging
-slogs
-sloop
-slop
-slope
-sloped
-slopes
-sloping
-slopped
-sloppier
-sloppiest
-sloppily
-sloppiness
-slopping
-sloppy
-slops
-slosh
-sloshed
-sloshing
-slot
-sloth
-slothful
-sloths
-slots
-slotted
-slotting
-slouch
-slouched
-slouches
-slouching
-slough
-sloughed
-sloughing
-slovak
-slovenia
-slovenliness
-slovenly
-slow
-slowcoaches
-slowdown
-slowed
-slower
-slowest
-slowing
-slowish
-slowly
-slowness
-slowpoke
-slows
-sludge
-sludgy
-slug
-sluggard
-sluggards
-slugged
-slugging
-sluggish
-sluggishly
-sluggishness
-slugs
-sluice
-sluiced
-sluices
-sluicing
-slum
-slumber
-slumbered
-slumbering
-slumbers
-slumming
-slump
-slumped
-slumping
-slumps
-slums
-slung
-slunk
-slur
-slurp
-slurped
-slurping
-slurps
-slurred
-slurring
-slurry
-slurs
-slush
-slushed
-slushes
-slushier
-slushiest
-slushy
-slut
-sluts
-sly
-slyer
-slyly
-slyness
-smack
-smacked
-smacker
-smacking
-smacks
-small
-smaller
-smallest
-smallholder
-smallholders
-smallholding
-smallholdings
-smallish
-smallminded
-smallmindedness
-smallness
-smallpox
-smalls
-smallscale
-smalltalk
-smalltime
-smalltown
-smart
-smarted
-smarten
-smartened
-smartening
-smarter
-smartest
-smarting
-smartly
-smartness
-smarts
-smash
-smashed
-smasher
-smashes
-smashing
-smattering
-smatterings
-smear
-smeared
-smearing
-smears
-smegma
-smell
-smellable
-smelled
-smellier
-smelliest
-smelling
-smells
-smelly
-smelt
-smelted
-smelter
-smelters
-smelting
-smidgeon
-smile
-smiled
-smiler
-smilers
-smiles
-smiling
-smilingly
-smirk
-smirked
-smirking
-smirks
-smite
-smith
-smithereens
-smiths
-smithy
-smiting
-smitten
-smock
-smocks
-smog
-smoggy
-smogs
-smoke
-smoked
-smokeless
-smoker
-smokers
-smokes
-smokescreen
-smokestack
-smokestacks
-smokier
-smokiest
-smokiness
-smoking
-smoky
-smolder
-smooch
-smooth
-smoothed
-smoother
-smoothest
-smoothing
-smoothly
-smoothness
-smooths
-smoothtongued
-smote
-smother
-smothered
-smothering
-smothers
-smoulder
-smouldered
-smouldering
-smoulders
-smudge
-smudged
-smudges
-smudgier
-smudgiest
-smudging
-smudgy
-smug
-smuggle
-smuggled
-smuggler
-smugglers
-smuggles
-smuggling
-smugly
-smugness
-smut
-smuts
-smutty
-snack
-snacks
-snaffle
-snag
-snagged
-snagging
-snags
-snail
-snails
-snake
-snaked
-snakepit
-snakes
-snakeskin
-snaking
-snaky
-snap
-snapped
-snapper
-snappier
-snappily
-snapping
-snappy
-snaps
-snapshot
-snapshots
-snare
-snared
-snares
-snaring
-snarl
-snarled
-snarling
-snarls
-snatch
-snatched
-snatcher
-snatchers
-snatches
-snatching
-sneak
-sneaked
-sneakers
-sneakier
-sneakiest
-sneakily
-sneaking
-sneaks
-sneaky
-sneer
-sneered
-sneering
-sneeringly
-sneers
-sneeze
-sneezed
-sneezes
-sneezing
-snick
-snide
-sniff
-sniffed
-sniffer
-sniffers
-sniffing
-sniffle
-sniffles
-sniffling
-sniffly
-sniffs
-snifter
-snigger
-sniggered
-sniggering
-sniggers
-snip
-snipe
-sniper
-snipers
-snipes
-sniping
-snipped
-snippet
-snippets
-snipping
-snips
-snits
-snivel
-snivelling
-snob
-snobbery
-snobbish
-snobbishly
-snobbishness
-snobs
-snoek
-snooker
-snoop
-snooped
-snooper
-snoopers
-snooping
-snoops
-snoopy
-snooze
-snoozed
-snoozes
-snoozing
-snore
-snored
-snorer
-snorers
-snores
-snoring
-snorkel
-snorkelling
-snorkels
-snort
-snorted
-snorting
-snorts
-snotty
-snout
-snouts
-snow
-snowball
-snowballed
-snowballing
-snowballs
-snowbound
-snowcapped
-snowdrift
-snowdrifts
-snowdrop
-snowdrops
-snowed
-snowfall
-snowfalls
-snowfields
-snowflake
-snowflakes
-snowier
-snowiest
-snowing
-snowline
-snowman
-snowmen
-snowplough
-snowploughs
-snows
-snowstorm
-snowstorms
-snowwhite
-snowy
-snub
-snubbed
-snubbing
-snubnosed
-snubs
-snuff
-snuffbox
-snuffed
-snuffing
-snuffle
-snuffled
-snuffles
-snuffling
-snuffs
-snug
-snugger
-snuggle
-snuggled
-snuggles
-snuggling
-snugly
-snugness
-so
-soak
-soaked
-soaker
-soakers
-soaking
-soakings
-soaks
-soandso
-soap
-soapbox
-soaped
-soapier
-soapiest
-soaping
-soaps
-soapy
-soar
-soared
-soaring
-soaringly
-soars
-sob
-sobbed
-sobbing
-sobbings
-sober
-sobered
-soberer
-sobering
-soberly
-sobers
-sobriety
-sobriquet
-sobs
-socalled
-soccer
-sociability
-sociable
-sociably
-social
-socialisation
-socialise
-socialised
-socialising
-socialism
-socialist
-socialistic
-socialists
-socialite
-socially
-socials
-societal
-societies
-society
-sociobiology
-sociocultural
-socioeconomic
-sociolinguistic
-sociolinguistics
-sociolinguists
-sociological
-sociologically
-sociologist
-sociologists
-sociology
-sociopolitical
-sock
-socked
-socket
-sockets
-socking
-socks
-socrates
-sod
-soda
-sodas
-sodded
-sodden
-soddy
-sodium
-sodom
-sodomise
-sodomised
-sodomising
-sodomite
-sodomites
-sodomy
-sods
-sofa
-sofas
-soffit
-soft
-softball
-softboiled
-soften
-softened
-softener
-softeners
-softening
-softens
-softer
-softest
-softhearted
-softie
-softish
-softly
-softness
-softspoken
-software
-softwood
-softy
-soggier
-soggiest
-soggy
-soh
-soil
-soiled
-soiling
-soilings
-soils
-soiree
-sojourn
-sojourned
-sojourner
-sojourners
-sojourning
-sojourns
-solace
-solaces
-solanum
-solar
-solaria
-solarium
-sold
-solder
-soldered
-soldering
-solders
-soldier
-soldiered
-soldiering
-soldierly
-soldiers
-soldiery
-sole
-solecism
-solecisms
-solely
-solemn
-solemnities
-solemnity
-solemnly
-solenoid
-solenoidal
-solenoids
-soler
-soles
-solfa
-solicit
-solicitation
-solicitations
-solicited
-soliciting
-solicitor
-solicitors
-solicitous
-solicitously
-solicits
-solicitude
-solid
-solidarity
-solidification
-solidified
-solidifies
-solidify
-solidifying
-solidity
-solidly
-solidness
-solids
-solitaire
-solitary
-solitude
-solitudes
-solo
-soloing
-soloist
-soloists
-solstice
-solstices
-solubility
-soluble
-solute
-solutes
-solution
-solutions
-solvable
-solve
-solved
-solvency
-solvent
-solvents
-solver
-solvers
-solves
-solving
-soma
-somali
-somalia
-somas
-somatic
-sombre
-sombrely
-sombreness
-sombrero
-some
-somebody
-someday
-somehow
-someone
-somersault
-somersaulted
-somersaulting
-somersaults
-something
-sometime
-sometimes
-someway
-someways
-somewhat
-somewhere
-somnambulist
-somnolence
-somnolent
-son
-sonar
-sonars
-sonata
-sonatas
-sones
-song
-songbird
-songbirds
-songbook
-songs
-songsters
-songwriter
-songwriters
-songwriting
-sonic
-sonically
-soninlaw
-sonnet
-sonnets
-sonny
-sonora
-sonorities
-sonority
-sonorous
-sonorously
-sonorousness
-sons
-sonsinlaw
-soon
-sooner
-soonest
-soonish
-soot
-soothe
-soothed
-soothers
-soothes
-soothing
-soothingly
-soothsayer
-soothsayers
-soothsaying
-sootier
-soots
-sooty
-sop
-sophist
-sophisticate
-sophisticated
-sophisticates
-sophistication
-sophistry
-sophists
-soporific
-sopping
-soppy
-soprano
-sorbet
-sorbets
-sorcerer
-sorcerers
-sorceress
-sorcery
-sordid
-sordidly
-sordidness
-sore
-sorely
-soreness
-sores
-sorghum
-sorority
-sorrel
-sorrier
-sorriest
-sorrow
-sorrowed
-sorrowful
-sorrowfully
-sorrowing
-sorrows
-sorry
-sort
-sortable
-sorted
-sorter
-sorters
-sortie
-sorties
-sorting
-sorts
-sos
-soso
-sot
-sotho
-soubriquet
-soudan
-souffle
-sought
-soughtafter
-souk
-souks
-soul
-souldestroying
-souled
-soulful
-soulfully
-soulless
-souls
-soulsearching
-sound
-soundcheck
-sounded
-sounder
-soundest
-sounding
-soundings
-soundless
-soundlessly
-soundly
-soundness
-soundproof
-soundproofed
-soundproofing
-sounds
-soundtrack
-soundtracks
-soup
-soups
-soupy
-sour
-source
-sourced
-sourceless
-sources
-sourcing
-soured
-sourest
-souring
-sourly
-sourness
-sours
-soused
-south
-southbound
-southerly
-southern
-southerner
-southerners
-southernmost
-southward
-southwards
-souvenir
-souvenirs
-sovereign
-sovereigns
-sovereignty
-soviet
-sow
-sowed
-sower
-sowers
-soweto
-sowing
-sown
-sows
-soy
-soya
-soybean
-soybeans
-spa
-space
-spaceage
-spacecraft
-spaced
-spaceflight
-spaceman
-spacemen
-spacer
-spacers
-spaces
-spaceship
-spaceships
-spacesuit
-spacesuits
-spacey
-spacial
-spacing
-spacings
-spacious
-spaciously
-spaciousness
-spade
-spaded
-spades
-spadework
-spaghetti
-spain
-spam
-span
-spandrels
-spangle
-spangled
-spangles
-spaniel
-spaniels
-spanish
-spank
-spanked
-spanker
-spanking
-spankings
-spanks
-spanned
-spanner
-spanners
-spanning
-spans
-spar
-spare
-spared
-sparely
-spares
-sparetime
-sparing
-sparingly
-spark
-sparked
-sparking
-sparkle
-sparkled
-sparkler
-sparklers
-sparkles
-sparkling
-sparklingly
-sparkly
-sparks
-sparred
-sparring
-sparrow
-sparrowhawk
-sparrows
-spars
-sparse
-sparsely
-sparseness
-sparser
-sparsest
-sparsity
-sparta
-spartan
-spartans
-spas
-spasm
-spasmodic
-spasmodically
-spasms
-spastic
-spastics
-spat
-spate
-spatial
-spatially
-spats
-spatter
-spattered
-spattering
-spatters
-spatula
-spatulas
-spawn
-spawned
-spawning
-spawns
-spay
-spayed
-spaying
-spays
-speak
-speakable
-speaker
-speakers
-speaking
-speaks
-spear
-speared
-spearhead
-spearheaded
-spearheading
-spearheads
-spearing
-spears
-spec
-special
-specialisation
-specialisations
-specialise
-specialised
-specialises
-specialising
-specialism
-specialisms
-specialist
-specialists
-specialities
-speciality
-specially
-specialness
-specials
-specialty
-speciation
-species
-specifiable
-specifiably
-specific
-specifically
-specification
-specifications
-specificities
-specificity
-specificness
-specifics
-specified
-specifier
-specifiers
-specifies
-specify
-specifying
-specimen
-specimens
-specious
-speck
-speckle
-speckled
-speckles
-specks
-specs
-spectacle
-spectacles
-spectacular
-spectacularly
-spectaculars
-spectator
-spectators
-spectra
-spectral
-spectre
-spectres
-spectrogram
-spectrograph
-spectrometer
-spectrometers
-spectrometric
-spectrometry
-spectrophotometer
-spectrophotometers
-spectrophotometry
-spectroscope
-spectroscopes
-spectroscopic
-spectroscopically
-spectroscopy
-spectrum
-specular
-speculate
-speculated
-speculates
-speculating
-speculation
-speculations
-speculative
-speculatively
-speculator
-speculators
-speculum
-sped
-speech
-speeches
-speechifying
-speechless
-speechlessly
-speed
-speedboat
-speedboats
-speedcop
-speeded
-speedier
-speediest
-speedily
-speeding
-speedometer
-speedometers
-speeds
-speedup
-speedway
-speedwell
-speedy
-spell
-spellable
-spellbinder
-spellbinding
-spellbound
-spelled
-speller
-spellers
-spelling
-spellings
-spells
-spelt
-spencer
-spend
-spender
-spenders
-spending
-spends
-spendthrift
-spent
-spermatozoa
-spew
-spewed
-spewing
-spews
-sphagnum
-sphere
-spheres
-spheric
-spherical
-spherically
-spheroid
-spheroidal
-sphincter
-sphincters
-sphinx
-sphygmomanometer
-spice
-spiced
-spicer
-spicery
-spices
-spicier
-spicily
-spicing
-spicy
-spider
-spiders
-spidery
-spied
-spies
-spigot
-spike
-spiked
-spikes
-spikier
-spikiest
-spiking
-spiky
-spill
-spillage
-spillages
-spilled
-spiller
-spilling
-spills
-spilt
-spin
-spinach
-spinal
-spindle
-spindles
-spindly
-spindrier
-spindriers
-spindrift
-spindry
-spine
-spinechilling
-spineless
-spines
-spinet
-spinnaker
-spinner
-spinners
-spinney
-spinning
-spinoff
-spinoffs
-spins
-spinster
-spinsterhood
-spinsters
-spiny
-spiral
-spiralled
-spiralling
-spirally
-spirals
-spirant
-spirants
-spire
-spires
-spirit
-spirited
-spiritedl
-spiritedly
-spiritless
-spirits
-spiritual
-spiritualised
-spiritualism
-spiritualist
-spiritualists
-spirituality
-spiritually
-spirituals
-spit
-spite
-spiteful
-spitefully
-spitfire
-spitfires
-spits
-spitting
-spittle
-spittoon
-spittoons
-splash
-splashdown
-splashed
-splashes
-splashing
-splashy
-splat
-splatter
-splattered
-splattering
-splayed
-splaying
-spleen
-spleens
-splendid
-splendidly
-splendour
-splendours
-splenetic
-splice
-spliced
-splicer
-splicers
-splices
-splicing
-spline
-splines
-splint
-splinted
-splinter
-splintered
-splintering
-splinters
-splints
-split
-splits
-splittable
-splitter
-splitters
-splitting
-splittings
-splodge
-splodges
-splotches
-splurge
-splutter
-spluttered
-spluttering
-splutters
-spoil
-spoilage
-spoiled
-spoiler
-spoilers
-spoiling
-spoils
-spoilsport
-spoilt
-spoke
-spoken
-spokes
-spokeshave
-spokeshaves
-spokesman
-spokesmen
-spokespeople
-spokesperson
-spokespersons
-spokeswoman
-spokeswomen
-sponge
-sponged
-sponger
-sponges
-spongier
-spongiest
-sponginess
-sponging
-spongy
-sponsor
-sponsored
-sponsoring
-sponsors
-sponsorship
-sponsorships
-spontaneity
-spontaneous
-spontaneously
-spoof
-spoofs
-spook
-spooked
-spooking
-spooks
-spooky
-spool
-spooled
-spooling
-spools
-spoon
-spooned
-spoonful
-spoonfuls
-spooning
-spoons
-spoor
-sporadic
-sporadically
-spore
-spores
-sporran
-sporrans
-sport
-sported
-sporting
-sportingly
-sportive
-sports
-sportsman
-sportsmanship
-sportsmen
-sportswear
-sporty
-spot
-spotless
-spotlessly
-spotlessness
-spotlight
-spotlighting
-spotlights
-spotlit
-spoton
-spots
-spotted
-spotter
-spotters
-spottier
-spottiest
-spotting
-spotty
-spouse
-spouses
-spout
-spouted
-spouting
-spouts
-sprain
-sprained
-spraining
-sprains
-sprang
-sprat
-sprats
-sprawl
-sprawled
-sprawling
-sprawls
-spray
-sprayed
-sprayer
-sprayers
-spraying
-sprays
-spread
-spreadeagled
-spreaders
-spreading
-spreads
-spreadsheet
-spreadsheets
-spree
-spreeing
-sprig
-sprightlier
-sprightliest
-sprightliness
-sprightly
-sprigs
-spring
-springboard
-springboards
-springbok
-springboks
-springclean
-springcleaned
-springer
-springier
-springiest
-springing
-springs
-springtime
-springy
-sprinkle
-sprinkled
-sprinkler
-sprinklers
-sprinkles
-sprinkling
-sprint
-sprinted
-sprinter
-sprinters
-sprinting
-sprints
-sprite
-sprites
-sprocket
-sprockets
-sprout
-sprouted
-sprouting
-sprouts
-spruce
-spruced
-sprucing
-sprung
-spry
-spud
-spume
-spun
-spunky
-spur
-spurge
-spurges
-spurious
-spuriously
-spurn
-spurned
-spurning
-spurns
-spurred
-spurring
-spurs
-spurt
-spurted
-spurting
-spurts
-sputnik
-sputniks
-sputter
-sputtered
-sputtering
-sputum
-spy
-spyglass
-spyhole
-spying
-spyings
-squabble
-squabbled
-squabbles
-squabbling
-squad
-squadron
-squadrons
-squads
-squalid
-squall
-squalling
-squalls
-squally
-squalor
-squander
-squandered
-squandering
-squanders
-square
-squared
-squarely
-squareness
-squarer
-squares
-squaring
-squarish
-squash
-squashed
-squashes
-squashier
-squashiest
-squashing
-squashy
-squat
-squats
-squatted
-squatter
-squatters
-squatting
-squaw
-squawk
-squawked
-squawking
-squawks
-squeak
-squeaked
-squeaker
-squeakier
-squeakiest
-squeaking
-squeaks
-squeaky
-squeal
-squealed
-squealer
-squealing
-squeals
-squeamish
-squeamishly
-squeamishness
-squeegee
-squeeze
-squeezed
-squeezer
-squeezes
-squeezing
-squeezy
-squelch
-squelched
-squelching
-squelchy
-squib
-squibs
-squid
-squids
-squiggle
-squiggles
-squint
-squinted
-squinting
-squints
-squire
-squirearchy
-squires
-squirm
-squirmed
-squirming
-squirms
-squirrel
-squirrelled
-squirrels
-squirt
-squirted
-squirting
-squirts
-srilanka
-stab
-stabbed
-stabber
-stabbing
-stabbings
-stabilisation
-stabilise
-stabilised
-stabiliser
-stabilisers
-stabilises
-stabilising
-stability
-stable
-stabled
-stablemate
-stabler
-stables
-stabling
-stably
-stabs
-staccato
-stack
-stacked
-stacker
-stacking
-stacks
-stadia
-stadium
-stadiums
-staff
-staffed
-staffing
-staffroom
-staffs
-stag
-stage
-stagecoach
-stagecoaches
-staged
-stagehands
-stager
-stages
-stagey
-stagflation
-stagger
-staggered
-staggering
-staggeringly
-staggers
-staging
-stagings
-stagnancy
-stagnant
-stagnate
-stagnated
-stagnates
-stagnating
-stagnation
-stags
-staid
-staidness
-stain
-stained
-stainer
-staining
-stainless
-stains
-stair
-staircase
-staircases
-stairhead
-stairs
-stairway
-stairways
-stairwell
-stairwells
-stake
-staked
-stakeholder
-stakeholders
-stakes
-staking
-stalactite
-stalactites
-stalagmite
-stalagmites
-stale
-stalemate
-stalemated
-stalemates
-staleness
-stalin
-stalk
-stalked
-stalker
-stalkers
-stalking
-stalks
-stall
-stalled
-stallholders
-stalling
-stallion
-stallions
-stalls
-stalwart
-stalwarts
-stamen
-stamens
-stamina
-stammer
-stammered
-stammering
-stammers
-stamp
-stamped
-stampede
-stampeded
-stampeding
-stamper
-stampers
-stamping
-stampings
-stamps
-stance
-stances
-stanchion
-stanchions
-stand
-standard
-standardisation
-standardisations
-standardise
-standardised
-standardises
-standardising
-standards
-standby
-standing
-standings
-standpoint
-standpoints
-stands
-standstill
-stank
-stanza
-stanzas
-stapes
-staphylococcus
-staple
-stapled
-stapler
-staplers
-staples
-stapling
-star
-starboard
-starch
-starched
-starches
-starchier
-starchiest
-starchy
-stardom
-stardust
-stare
-stared
-starer
-stares
-starfish
-stargaze
-stargazer
-stargazers
-stargazing
-staring
-stark
-starker
-starkest
-starkly
-starkness
-starless
-starlet
-starlets
-starlight
-starlike
-starling
-starlings
-starlit
-starred
-starrier
-starriest
-starring
-starry
-starryeyed
-stars
-starship
-starspangled
-starstruck
-starstudded
-start
-started
-starter
-starters
-starting
-startle
-startled
-startles
-startling
-startlingly
-starts
-startup
-startups
-starvation
-starve
-starved
-starves
-starving
-stashed
-stashes
-stashing
-stasis
-state
-statecraft
-stated
-statehood
-stateless
-stateliest
-stateliness
-stately
-statement
-statements
-stateoftheart
-staterooms
-states
-statesman
-statesmanlike
-statesmanship
-statesmen
-static
-statical
-statically
-statics
-stating
-station
-stationary
-stationed
-stationer
-stationers
-stationery
-stationing
-stationmaster
-stations
-statistic
-statistical
-statistically
-statistician
-statisticians
-statistics
-stator
-stators
-statuary
-statue
-statues
-statuesque
-statuette
-statuettes
-stature
-statures
-status
-statuses
-statute
-statutes
-statutorily
-statutory
-staunch
-staunchest
-staunching
-staunchly
-staunchness
-stave
-staved
-staves
-staving
-stay
-stayed
-stayers
-staying
-stays
-stead
-steadfast
-steadfastly
-steadfastness
-steadied
-steadier
-steadiest
-steadily
-steadiness
-steady
-steadygoing
-steadying
-steak
-steaks
-steal
-stealer
-stealers
-stealing
-steals
-stealth
-stealthier
-stealthiest
-stealthily
-stealthy
-steam
-steamboat
-steamboats
-steamed
-steamer
-steamers
-steamier
-steamiest
-steaming
-steamroller
-steamrollers
-steams
-steamship
-steamships
-steamy
-steed
-steeds
-steel
-steelclad
-steeled
-steeling
-steels
-steelwork
-steelworker
-steelworkers
-steelworks
-steely
-steep
-steeped
-steepen
-steepened
-steepening
-steepens
-steeper
-steepest
-steeping
-steeple
-steeplechase
-steeplechaser
-steeplechasers
-steeplechasing
-steepled
-steeplejack
-steeples
-steeply
-steepness
-steeps
-steer
-steerable
-steerage
-steered
-steering
-steers
-stegosaurus
-stellar
-stellated
-stem
-stemmed
-stemming
-stems
-stench
-stenches
-stencil
-stencilled
-stencils
-stenographer
-stenographers
-stenographic
-stenography
-stenosis
-stentor
-stentorian
-step
-stepbrother
-stepchildren
-stepdaughter
-stepfather
-stepladder
-stepmother
-stepparents
-steppe
-stepped
-steppes
-stepping
-steps
-stepsister
-stepson
-stepsons
-stepwise
-steradians
-stereo
-stereographic
-stereophonic
-stereos
-stereoscopic
-stereoscopically
-stereoscopy
-stereotype
-stereotyped
-stereotypes
-stereotypical
-stereotypically
-stereotyping
-sterile
-sterilisation
-sterilisations
-sterilise
-sterilised
-steriliser
-sterilising
-sterility
-sterling
-stern
-sterner
-sternest
-sternly
-sternness
-sterns
-sternum
-steroid
-steroids
-stet
-stethoscope
-stevedore
-stew
-steward
-stewardess
-stewardesses
-stewards
-stewardship
-stewed
-stewing
-stews
-stick
-sticker
-stickers
-stickiest
-stickily
-stickiness
-sticking
-stickleback
-sticklebacks
-stickler
-sticks
-sticky
-sties
-stiff
-stiffen
-stiffened
-stiffener
-stiffening
-stiffens
-stiffer
-stiffest
-stiffly
-stiffnecked
-stiffness
-stifle
-stifled
-stifles
-stifling
-stiflingly
-stigma
-stigmas
-stigmata
-stigmatisation
-stigmatise
-stigmatised
-stigmatising
-stiletto
-still
-stillbirths
-stillborn
-stilled
-stiller
-stilling
-stillness
-stills
-stilt
-stilted
-stilts
-stimulant
-stimulants
-stimulate
-stimulated
-stimulates
-stimulating
-stimulation
-stimulator
-stimulatory
-stimuli
-stimulus
-sting
-stinged
-stinger
-stingers
-stingier
-stingily
-stinging
-stingray
-stings
-stingy
-stink
-stinker
-stinkers
-stinking
-stinks
-stinky
-stint
-stinted
-stints
-stipel
-stipend
-stipendiary
-stipends
-stippled
-stipples
-stipulate
-stipulated
-stipulates
-stipulating
-stipulation
-stipulations
-stir
-stirfried
-stirfry
-stirred
-stirrer
-stirrers
-stirring
-stirrings
-stirrup
-stirrups
-stirs
-stitch
-stitched
-stitcher
-stitches
-stitching
-stoa
-stoat
-stoats
-stochastic
-stock
-stockade
-stockbroker
-stockbrokers
-stockbroking
-stockcar
-stocked
-stockholders
-stockholding
-stockier
-stockily
-stocking
-stockinged
-stockings
-stockist
-stockists
-stockpile
-stockpiled
-stockpiles
-stockpiling
-stockroom
-stocks
-stocktaking
-stocky
-stodge
-stodgier
-stodgiest
-stodgy
-stoep
-stoic
-stoical
-stoically
-stoicism
-stoics
-stoke
-stoked
-stoker
-stokers
-stokes
-stoking
-stole
-stolen
-stolid
-stolidity
-stolidly
-stoma
-stomach
-stomachache
-stomachs
-stomata
-stomp
-stomped
-stomping
-stomps
-stone
-stonecold
-stoned
-stoneless
-stonemason
-stonemasons
-stones
-stonewalled
-stoneware
-stonework
-stonier
-stoniest
-stonily
-stoning
-stony
-stood
-stooge
-stooges
-stool
-stoolpigeon
-stools
-stoop
-stooped
-stooping
-stoops
-stop
-stopcock
-stopgap
-stopover
-stoppable
-stoppage
-stoppages
-stopped
-stopper
-stoppered
-stoppers
-stopping
-stops
-stopwatch
-storage
-storages
-store
-stored
-storehouse
-storehouses
-storekeeper
-storekeepers
-storeman
-storeroom
-storerooms
-stores
-storey
-storeys
-stories
-storing
-stork
-storks
-storm
-stormed
-stormer
-stormers
-stormier
-stormiest
-storming
-storms
-stormtroopers
-stormy
-story
-storybook
-storyline
-storylines
-storyteller
-storytellers
-storytelling
-stout
-stouter
-stoutest
-stoutly
-stoutness
-stove
-stovepipe
-stoves
-stow
-stowage
-stowaway
-stowed
-stowing
-stows
-straddle
-straddled
-straddles
-straddling
-strafe
-strafed
-strafing
-straggle
-straggled
-straggler
-stragglers
-straggling
-straggly
-straight
-straightaway
-straighten
-straightened
-straightening
-straightens
-straighter
-straightest
-straightforward
-straightforwardly
-straightforwardness
-straightness
-strain
-strained
-strainer
-strainers
-straining
-strains
-strait
-straiten
-straitened
-straitjacket
-straitjackets
-straits
-strand
-stranded
-stranding
-strands
-strange
-strangely
-strangeness
-stranger
-strangers
-strangest
-strangle
-strangled
-stranglehold
-strangler
-stranglers
-strangles
-strangling
-strangulated
-strangulation
-strap
-strapless
-strapped
-strapper
-strapping
-straps
-strata
-stratagem
-stratagems
-strategic
-strategically
-strategies
-strategist
-strategists
-strategy
-stratification
-stratified
-stratifies
-stratifying
-stratigraphic
-stratigraphical
-stratigraphy
-stratosphere
-stratospheric
-stratospherically
-stratum
-stratus
-straw
-strawberries
-strawberry
-strawman
-straws
-stray
-strayed
-strayer
-straying
-strays
-streak
-streaked
-streaker
-streakers
-streakier
-streakiest
-streaking
-streaks
-streaky
-stream
-streamed
-streamer
-streamers
-streaming
-streamline
-streamlined
-streamlines
-streamlining
-streams
-street
-streets
-streetwalkers
-streetwise
-strength
-strengthen
-strengthened
-strengthening
-strengthens
-strengths
-strenuous
-strenuously
-streptococcal
-streptococci
-streptomycin
-stress
-stressed
-stresses
-stressful
-stressfulness
-stressing
-stretch
-stretchability
-stretchable
-stretched
-stretcher
-stretchered
-stretchers
-stretches
-stretchiness
-stretching
-stretchy
-strew
-strewed
-strewing
-strewn
-striated
-striation
-striations
-stricken
-strict
-stricter
-strictest
-strictly
-strictness
-stricture
-strictures
-stride
-stridency
-strident
-stridently
-strider
-strides
-striding
-strife
-strifes
-strike
-striker
-strikers
-strikes
-striking
-strikingly
-string
-stringed
-stringencies
-stringency
-stringent
-stringently
-stringer
-stringing
-strings
-stringy
-strip
-stripe
-striped
-striper
-stripes
-stripier
-stripiest
-striping
-stripling
-stripped
-stripper
-strippers
-stripping
-strips
-stripy
-strive
-strived
-striven
-striver
-strives
-striving
-strivings
-strode
-stroke
-stroked
-strokes
-stroking
-stroll
-strolled
-stroller
-strollers
-strolling
-strolls
-strong
-stronger
-strongest
-stronghold
-strongholds
-strongish
-strongly
-strongman
-strongmen
-strongminded
-strongroom
-strontium
-strop
-stropped
-stropping
-strops
-strove
-struck
-structural
-structuralism
-structuralist
-structuralists
-structurally
-structure
-structured
-structureless
-structures
-structuring
-strudel
-strudels
-struggle
-struggled
-struggles
-struggling
-strum
-strummed
-strumming
-strumpet
-strung
-strut
-struts
-strutted
-strutter
-strutting
-strychnine
-stub
-stubbed
-stubbing
-stubble
-stubbled
-stubbles
-stubbly
-stubborn
-stubbornly
-stubbornness
-stubby
-stubs
-stucco
-stuccoed
-stuck
-stuckup
-stud
-studded
-student
-students
-studentship
-studentships
-studied
-studier
-studiers
-studies
-studio
-studios
-studious
-studiously
-studiousness
-studs
-study
-studying
-stuff
-stuffed
-stuffer
-stuffier
-stuffiest
-stuffiness
-stuffing
-stuffs
-stuffy
-stultified
-stultify
-stultifying
-stumble
-stumbled
-stumbles
-stumbling
-stumblingly
-stump
-stumped
-stumping
-stumps
-stumpy
-stun
-stung
-stunned
-stunner
-stunning
-stunningly
-stuns
-stunt
-stunted
-stunting
-stuntman
-stunts
-stupefaction
-stupefied
-stupefy
-stupefying
-stupefyingly
-stupendous
-stupendously
-stupid
-stupider
-stupidest
-stupidities
-stupidity
-stupidly
-stupor
-stupors
-sturdier
-sturdiest
-sturdily
-sturdy
-sturgeon
-sturgeons
-stutter
-stuttered
-stuttering
-stutters
-sty
-style
-styled
-styles
-styli
-styling
-stylisation
-stylised
-stylish
-stylishly
-stylishness
-stylist
-stylistic
-stylistically
-stylistics
-stylists
-stylus
-styluses
-stymie
-stymied
-styrene
-styx
-suasion
-suave
-suavely
-sub
-subaltern
-subalterns
-subarctic
-subatomic
-subbed
-subbing
-subclass
-subclasses
-subcommittee
-subcommittees
-subconscious
-subconsciously
-subconsciousness
-subcontinent
-subcontract
-subcontracted
-subcontracting
-subcontractor
-subcontractors
-subcultural
-subculture
-subcultures
-subcutaneous
-subcutaneously
-subdivide
-subdivided
-subdivides
-subdividing
-subdivision
-subdivisions
-subducted
-subduction
-subdue
-subdued
-subdues
-subduing
-subeditor
-subeditors
-subfamily
-subgroup
-subgroups
-subharmonic
-subharmonics
-subhuman
-subject
-subjected
-subjecting
-subjection
-subjective
-subjectively
-subjectivism
-subjectivist
-subjectivity
-subjects
-subjugate
-subjugated
-subjugating
-subjugation
-subjunctive
-sublayer
-sublimate
-sublimated
-sublimation
-sublime
-sublimed
-sublimely
-sublimes
-sublimest
-subliminal
-subliminally
-sublimity
-sublunary
-submarine
-submarines
-submerge
-submerged
-submergence
-submerges
-submerging
-submersible
-submersion
-submission
-submissions
-submissive
-submissively
-submissiveness
-submit
-submits
-submittable
-submitted
-submitter
-submitters
-submitting
-subnormal
-suboptimal
-subordinate
-subordinated
-subordinates
-subordinating
-subordination
-subplot
-subplots
-subpoena
-subpoenaed
-subprogram
-subprograms
-subregional
-subroutine
-subroutines
-subs
-subscribe
-subscribed
-subscriber
-subscribers
-subscribes
-subscribing
-subscript
-subscription
-subscriptions
-subscripts
-subsection
-subsections
-subsequent
-subsequently
-subservience
-subservient
-subset
-subsets
-subside
-subsided
-subsidence
-subsides
-subsidiaries
-subsidiarity
-subsidiary
-subsidies
-subsiding
-subsidise
-subsidised
-subsidises
-subsidising
-subsidy
-subsist
-subsisted
-subsistence
-subsisting
-subsists
-subsoil
-subsonic
-subspace
-subspaces
-subspecies
-substance
-substances
-substandard
-substantial
-substantially
-substantiate
-substantiated
-substantiates
-substantiating
-substantiation
-substantive
-substantively
-substantives
-substation
-substitutable
-substitute
-substituted
-substitutes
-substituting
-substitution
-substitutions
-substrata
-substrate
-substrates
-substratum
-substructure
-substructures
-subsume
-subsumed
-subsumes
-subsuming
-subsurface
-subsystem
-subsystems
-subtenants
-subtend
-subtended
-subtending
-subtends
-subterfuge
-subterranean
-subtext
-subtitle
-subtitled
-subtitles
-subtitling
-subtle
-subtler
-subtlest
-subtleties
-subtlety
-subtly
-subtotal
-subtotals
-subtract
-subtracted
-subtracting
-subtraction
-subtractions
-subtractive
-subtractively
-subtracts
-subtropical
-subtropics
-subtype
-subtypes
-subunit
-subunits
-suburb
-suburban
-suburbanisation
-suburbanites
-suburbia
-suburbs
-subvention
-subventions
-subversion
-subversive
-subversively
-subversives
-subvert
-subverted
-subverting
-subverts
-subway
-subways
-subzero
-succeed
-succeeded
-succeeding
-succeeds
-success
-successes
-successful
-successfully
-succession
-successions
-successive
-successively
-successor
-successors
-succinct
-succinctly
-succinctness
-succour
-succulence
-succulent
-succumb
-succumbed
-succumbing
-succumbs
-such
-suchandsuch
-suchlike
-suck
-suckable
-sucked
-sucker
-suckers
-sucking
-suckle
-suckled
-suckles
-suckling
-sucklings
-sucks
-sucrose
-suction
-sud
-sudan
-sudden
-suddenly
-suddenness
-suds
-sue
-sued
-suede
-sues
-suet
-suffer
-sufferance
-suffered
-sufferer
-sufferers
-suffering
-sufferings
-suffers
-suffice
-sufficed
-suffices
-sufficiency
-sufficient
-sufficiently
-sufficing
-suffix
-suffixed
-suffixes
-suffocate
-suffocated
-suffocates
-suffocating
-suffocatingly
-suffocation
-suffrage
-suffragette
-suffragettes
-suffragist
-suffuse
-suffused
-suffuses
-suffusing
-suffusion
-sugar
-sugarcoated
-sugared
-sugaring
-sugarplums
-sugars
-sugary
-suggest
-suggested
-suggester
-suggesters
-suggestibility
-suggestible
-suggesting
-suggestion
-suggestions
-suggestive
-suggestively
-suggestiveness
-suggests
-sugillate
-suicidal
-suicidally
-suicide
-suicides
-suing
-suit
-suitabilities
-suitability
-suitable
-suitableness
-suitably
-suitcase
-suitcases
-suite
-suited
-suites
-suiting
-suitor
-suitors
-suits
-sulk
-sulked
-sulkier
-sulkiest
-sulkily
-sulkiness
-sulking
-sulks
-sulky
-sullen
-sullenly
-sullenness
-sullied
-sully
-sullying
-sulphate
-sulphates
-sulphide
-sulphides
-sulphonamides
-sulphur
-sulphuric
-sulphurous
-sultan
-sultana
-sultanas
-sultans
-sultry
-sum
-sumatra
-summa
-summability
-summable
-summaries
-summarily
-summarise
-summarised
-summariser
-summarisers
-summarises
-summarising
-summary
-summation
-summations
-summed
-summer
-summers
-summertime
-summery
-summing
-summit
-summits
-summon
-summoned
-summoner
-summoning
-summonings
-summons
-summonsed
-summonses
-summonsing
-sumo
-sump
-sumps
-sumptuous
-sumptuously
-sumptuousness
-sums
-sun
-sunbath
-sunbathe
-sunbathed
-sunbathers
-sunbathing
-sunbeam
-sunbeams
-sunbed
-sunbeds
-sunblock
-sunburn
-sunburned
-sunburns
-sunburnt
-sunburst
-suncream
-sundaes
-sunday
-sundays
-sundial
-sundials
-sundown
-sundried
-sundries
-sundry
-sunflower
-sunflowers
-sung
-sunglasses
-sunk
-sunken
-sunking
-sunless
-sunlight
-sunlit
-sunlounger
-sunned
-sunnier
-sunniest
-sunning
-sunny
-sunrise
-sunrises
-sunroof
-suns
-sunscreen
-sunscreens
-sunset
-sunsets
-sunshade
-sunshine
-sunspot
-sunspots
-sunstroke
-suntan
-suntanned
-sup
-super
-superabundance
-superabundant
-superannuate
-superannuated
-superannuating
-superannuation
-superb
-superbly
-supercharged
-supercharger
-supercilious
-superciliously
-superciliousness
-supercomputer
-supercomputers
-supercomputing
-superconducting
-superconductivity
-superconductor
-superconductors
-supercooled
-supercooling
-supercritical
-superdense
-superfamily
-superficial
-superficiality
-superficially
-superfix
-superfluities
-superfluity
-superfluous
-superfluously
-superglue
-superheat
-superheated
-superhero
-superhuman
-superimpose
-superimposed
-superimposes
-superimposing
-superimposition
-superintend
-superintendence
-superintendent
-superintendents
-superior
-superiority
-superiors
-superlative
-superlatively
-superlatives
-superman
-supermarket
-supermarkets
-supermen
-supermodel
-supermodels
-supernatant
-supernatural
-supernaturally
-supernova
-supernovae
-supernumerary
-superordinate
-superpose
-superposed
-superposition
-superpositions
-superpower
-superpowers
-supersaturated
-supersaturation
-superscript
-superscripts
-supersede
-superseded
-supersedes
-superseding
-supersonic
-supersonically
-superstar
-superstars
-superstate
-superstates
-superstition
-superstitions
-superstitious
-superstitiously
-superstore
-superstores
-superstructure
-superstructures
-supertanker
-supertankers
-supervene
-supervise
-supervised
-supervises
-supervising
-supervision
-supervisions
-supervisor
-supervisors
-supervisory
-supine
-supped
-supper
-suppers
-supping
-supplant
-supplanted
-supplanting
-supple
-supplement
-supplemental
-supplementary
-supplementation
-supplemented
-supplementing
-supplements
-suppleness
-suppliant
-suppliants
-supplicant
-supplicants
-supplicate
-supplicating
-supplication
-supplications
-supplied
-supplier
-suppliers
-supplies
-supply
-supplying
-support
-supportability
-supportable
-supported
-supporter
-supporters
-supporting
-supportive
-supports
-suppose
-supposed
-supposedly
-supposes
-supposing
-supposition
-suppositions
-suppositories
-suppress
-suppressed
-suppresses
-suppressible
-suppressing
-suppression
-suppressive
-suppressor
-suppressors
-suppurating
-supranational
-supranationalism
-supremacist
-supremacy
-supremal
-supreme
-supremely
-supremo
-sups
-surcharge
-surcharged
-surcharges
-surd
-sure
-surefooted
-surely
-sureness
-surer
-surest
-sureties
-surety
-surf
-surface
-surfaced
-surfacer
-surfaces
-surfacing
-surfactant
-surfactants
-surfboard
-surfed
-surfeit
-surfer
-surfers
-surfing
-surfings
-surfs
-surge
-surged
-surgeon
-surgeons
-surgeries
-surgery
-surges
-surgical
-surgically
-surging
-surliest
-surlily
-surliness
-surly
-surmise
-surmised
-surmises
-surmising
-surmount
-surmountable
-surmounted
-surmounting
-surname
-surnames
-surpass
-surpassed
-surpasses
-surpassing
-surplice
-surplus
-surpluses
-surprise
-surprised
-surprises
-surprising
-surprisingly
-surreal
-surrealism
-surrealist
-surrealistic
-surrealists
-surreality
-surrender
-surrendered
-surrendering
-surrenders
-surreptitious
-surreptitiously
-surrey
-surreys
-surrogacy
-surrogate
-surrogates
-surround
-surrounded
-surrounding
-surroundings
-surrounds
-surtax
-surtitles
-surveillance
-survey
-surveyed
-surveying
-surveyor
-surveyors
-surveys
-survivability
-survivable
-survival
-survivals
-survive
-survived
-survives
-surviving
-survivor
-survivors
-susceptibilities
-susceptibility
-susceptible
-sushi
-sushis
-suspect
-suspected
-suspecting
-suspects
-suspend
-suspended
-suspender
-suspenders
-suspending
-suspends
-suspense
-suspension
-suspensions
-suspicion
-suspicions
-suspicious
-suspiciously
-sustain
-sustainability
-sustainable
-sustainably
-sustained
-sustaining
-sustains
-sustenance
-suture
-sutures
-suzerainty
-swab
-swabbed
-swabbing
-swabs
-swad
-swaddled
-swaddling
-swads
-swag
-swagger
-swaggered
-swaggering
-swags
-swahili
-swains
-swallow
-swallowed
-swallower
-swallowing
-swallows
-swallowtail
-swam
-swamp
-swamped
-swampier
-swampiest
-swamping
-swampland
-swamplands
-swamps
-swampy
-swan
-swans
-swansong
-swap
-swappable
-swapped
-swapper
-swappers
-swapping
-swaps
-sward
-swarm
-swarmed
-swarming
-swarms
-swarthier
-swarthiest
-swarthy
-swashbuckling
-swastika
-swastikas
-swat
-swathe
-swathed
-swathes
-swats
-swatted
-swatting
-sway
-swayed
-swaying
-sways
-swazi
-swazis
-swear
-swearer
-swearers
-swearing
-swears
-swearword
-swearwords
-sweat
-sweatband
-sweated
-sweater
-sweaters
-sweatier
-sweatiest
-sweatily
-sweating
-sweats
-sweatshirt
-sweatshirts
-sweatshop
-sweatshops
-sweaty
-swede
-sweden
-swedish
-sweep
-sweepable
-sweeper
-sweepers
-sweeping
-sweepingly
-sweepings
-sweeps
-sweepstake
-sweet
-sweetbread
-sweetcorn
-sweeten
-sweetened
-sweetener
-sweeteners
-sweetening
-sweetens
-sweeter
-sweetest
-sweetheart
-sweethearts
-sweetie
-sweetish
-sweetly
-sweetmeat
-sweetmeats
-sweetness
-sweetpea
-sweets
-sweetshop
-swell
-swelled
-swelling
-swellings
-swells
-sweltering
-sweltry
-swept
-swerve
-swerved
-swerves
-swerving
-swift
-swifter
-swiftest
-swiftlet
-swiftly
-swiftness
-swifts
-swill
-swilled
-swilling
-swim
-swimmer
-swimmers
-swimming
-swimmingly
-swims
-swimsuit
-swimsuits
-swimwear
-swindle
-swindled
-swindler
-swindlers
-swindles
-swindling
-swine
-swines
-swing
-swingeing
-swinger
-swingers
-swinging
-swings
-swingy
-swipe
-swiped
-swipes
-swirl
-swirled
-swirling
-swirls
-swish
-swished
-swishing
-swishy
-swiss
-switch
-switchable
-switchback
-switchboard
-switchboards
-switched
-switcher
-switches
-switchgear
-switching
-swivel
-swivelled
-swivelling
-swivels
-swollen
-swoon
-swooned
-swooning
-swoons
-swoop
-swooped
-swooping
-swoops
-swop
-swopped
-swopping
-swops
-sword
-swordfish
-swords
-swordsman
-swordsmen
-swore
-sworn
-swot
-swots
-swotted
-swotting
-swum
-swung
-sycamore
-sycamores
-sycophancy
-sycophant
-sycophantic
-sycophantically
-sycophants
-sydney
-syllabary
-syllabi
-syllabic
-syllable
-syllables
-syllabub
-syllabus
-syllabuses
-syllogism
-syllogisms
-syllogistic
-sylph
-sylphs
-symbiont
-symbiosis
-symbiotic
-symbiotically
-symbol
-symbolic
-symbolical
-symbolically
-symbolisation
-symbolise
-symbolised
-symbolises
-symbolising
-symbolism
-symbolist
-symbolists
-symbols
-symmetric
-symmetrical
-symmetrically
-symmetries
-symmetrisation
-symmetrising
-symmetry
-sympathetic
-sympathetically
-sympathies
-sympathise
-sympathised
-sympathiser
-sympathisers
-sympathises
-sympathising
-sympathy
-symphonic
-symphonies
-symphonists
-symphony
-symposia
-symposium
-symptom
-symptomatic
-symptomatically
-symptomless
-symptoms
-synagogue
-synagogues
-synapse
-synapses
-synaptic
-sync
-synchronic
-synchronicity
-synchronisation
-synchronise
-synchronised
-synchronises
-synchronising
-synchronous
-synchronously
-synchrony
-synchrotron
-syncopated
-syncopation
-syncretic
-syndicalism
-syndicalist
-syndicate
-syndicated
-syndicates
-syndication
-syndrome
-syndromes
-synergism
-synergistic
-synergy
-synod
-synodic
-synods
-synonym
-synonymic
-synonymous
-synonymously
-synonyms
-synonymy
-synopses
-synopsis
-synoptic
-synovial
-syntactic
-syntactical
-syntactically
-syntagmatic
-syntax
-syntheses
-synthesis
-synthesise
-synthesised
-synthesiser
-synthesisers
-synthesises
-synthesising
-synthetic
-synthetically
-synthetics
-syphilis
-syphilitic
-syphon
-syphoned
-syphoning
-syphons
-syria
-syrian
-syringe
-syringes
-syrup
-syrups
-syrupy
-system
-systematic
-systematically
-systematisation
-systematise
-systemic
-systemically
-systems
-systoles
-systolic
-taal
-tab
-tabasco
-tabbed
-tabbing
-tabby
-tabernacle
-tabernacles
-table
-tableau
-tableaux
-tablebay
-tablecloth
-tablecloths
-tabled
-tableland
-tables
-tablespoon
-tablespoonfuls
-tablespoons
-tablet
-tablets
-tableware
-tabling
-tabloid
-tabloids
-taboo
-taboos
-tabs
-tabular
-tabulate
-tabulated
-tabulates
-tabulating
-tabulation
-tabulations
-tabulator
-tachograph
-tachographs
-tachycardia
-tachyon
-tachyons
-tacit
-tacitly
-taciturn
-tack
-tacked
-tackier
-tackiest
-tackiness
-tacking
-tackle
-tackled
-tackler
-tackles
-tackling
-tacks
-tacky
-tact
-tactful
-tactfully
-tactic
-tactical
-tactically
-tactician
-tactics
-tactile
-tactless
-tactlessly
-tactlessness
-tactual
-tadpole
-tadpoles
-taffeta
-tag
-tagged
-tagging
-tags
-tahiti
-tahr
-tail
-tailed
-tailing
-tailless
-taillessness
-tailor
-tailorable
-tailored
-tailoring
-tailormade
-tailors
-tailpiece
-tailplane
-tails
-tailspin
-tailwind
-taint
-tainted
-tainting
-taints
-taipei
-taiwan
-take
-takeable
-takeaway
-takeaways
-taken
-takeover
-takeovers
-taker
-takers
-takes
-taking
-takings
-talc
-talcum
-tale
-talent
-talented
-talentless
-talents
-tales
-talisman
-talismans
-talk
-talkative
-talkativeness
-talkback
-talked
-talker
-talkers
-talkie
-talkies
-talking
-talkings
-talks
-tall
-tallboy
-taller
-tallest
-tallied
-tallies
-tallish
-tallness
-tallow
-tally
-tallyho
-tallying
-talmud
-talon
-talons
-tambourine
-tambourines
-tame
-tamed
-tamely
-tameness
-tamer
-tamers
-tames
-tamest
-taming
-tamp
-tamped
-tamper
-tampered
-tampering
-tampers
-tan
-tandem
-tandems
-tang
-tangelo
-tangent
-tangential
-tangentially
-tangents
-tangerine
-tangerines
-tangible
-tangibly
-tangle
-tangled
-tangles
-tangling
-tango
-tangy
-tank
-tankage
-tankard
-tankards
-tanked
-tanker
-tankers
-tankful
-tanking
-tanks
-tanned
-tanner
-tanneries
-tanners
-tannery
-tannic
-tannin
-tanning
-tannins
-tannoy
-tans
-tantalise
-tantalised
-tantalising
-tantalisingly
-tantalum
-tantamount
-tantrum
-tantrums
-tanzania
-tap
-tapas
-tapdance
-tapdancing
-tape
-taped
-taper
-taperecorded
-taperecording
-tapered
-taperer
-tapering
-tapers
-tapes
-tapestries
-tapestry
-tapeworm
-tapeworms
-taping
-tapioca
-tapir
-tapped
-tappers
-tapping
-tappings
-taproom
-taps
-tar
-taramasalata
-tarantula
-tarantulas
-tardily
-tardiness
-tardy
-tares
-target
-targeted
-targeting
-targets
-tariff
-tariffs
-tarmac
-tarmacadam
-tarn
-tarnish
-tarnished
-tarnishing
-tarns
-tarot
-tarpaulin
-tarpaulins
-tarragon
-tarred
-tarried
-tarrier
-tarriest
-tarring
-tarry
-tarrying
-tars
-tarsal
-tarsus
-tart
-tartan
-tartans
-tartar
-tartaric
-tartly
-tartness
-tartrate
-tarts
-tarty
-tarzan
-task
-tasked
-tasking
-taskmaster
-tasks
-tasmania
-tassel
-tasselled
-tassels
-taste
-tasted
-tasteful
-tastefully
-tastefulness
-tasteless
-tastelessly
-tastelessness
-taster
-tasters
-tastes
-tastier
-tastiest
-tasting
-tastings
-tasty
-tat
-tattered
-tatters
-tattle
-tattoo
-tattooed
-tattooing
-tattoos
-tatty
-tau
-taught
-taunt
-taunted
-taunter
-taunting
-tauntingly
-taunts
-taut
-tauter
-tautest
-tautly
-tautness
-tautological
-tautologically
-tautologies
-tautologous
-tautology
-tavern
-taverna
-tavernas
-taverns
-tawdry
-tawny
-tax
-taxable
-taxation
-taxdeductible
-taxed
-taxes
-taxfree
-taxi
-taxicab
-taxidermist
-taxidermists
-taxidermy
-taxied
-taxies
-taxiing
-taxing
-taxis
-taxman
-taxonomic
-taxonomical
-taxonomies
-taxonomist
-taxonomists
-taxonomy
-taxpayer
-taxpayers
-taxpaying
-taylor
-tea
-teabag
-teabags
-teach
-teachable
-teacher
-teachers
-teaches
-teaching
-teachings
-teacloth
-teacup
-teacups
-teak
-teal
-team
-teamed
-teaming
-teammate
-teammates
-teams
-teamster
-teamwork
-teaparty
-teapot
-teapots
-tear
-tearaway
-teardrop
-teardrops
-tearful
-tearfully
-tearfulness
-teargas
-tearing
-tearless
-tearoom
-tearooms
-tears
-tearstained
-teas
-tease
-teased
-teaser
-teasers
-teases
-teashop
-teashops
-teasing
-teasingly
-teaspoon
-teaspoonful
-teaspoonfuls
-teaspoons
-teat
-teatime
-teatimes
-teats
-tech
-technical
-technicalities
-technicality
-technically
-technician
-technicians
-technique
-techniques
-technocracies
-technocracy
-technocrat
-technocratic
-technocrats
-technological
-technologically
-technologies
-technologist
-technologists
-technology
-technophiles
-technophobia
-technophobic
-tectonic
-tectonically
-tectonics
-ted
-teddies
-teddy
-tedious
-tediously
-tediousness
-tedium
-tediums
-teds
-tee
-teed
-teehee
-teeing
-teem
-teemed
-teeming
-teems
-teen
-teenage
-teenaged
-teenager
-teenagers
-teeniest
-teens
-teensy
-teeny
-teenyweeny
-teepee
-teepees
-tees
-teeter
-teetered
-teetering
-teeth
-teethe
-teethed
-teethes
-teething
-teethmarks
-teetotal
-teetotalism
-teetotaller
-teetotallers
-teheran
-telaviv
-telecommunication
-telecommunications
-telecommuting
-telecoms
-teleconference
-telegram
-telegrams
-telegraph
-telegraphed
-telegraphic
-telegraphing
-telegraphs
-telegraphy
-telekinesis
-telemetry
-teleological
-teleology
-telepathic
-telepathically
-telepathy
-telephone
-telephoned
-telephones
-telephonic
-telephoning
-telephonist
-telephonists
-telephony
-telephoto
-teleprinter
-teleprinters
-telesales
-telescope
-telescoped
-telescopes
-telescopic
-telescoping
-teletext
-telethon
-teletype
-teletypes
-televise
-televised
-televising
-television
-televisions
-televisual
-teleworking
-telex
-telexes
-tell
-teller
-tellers
-telling
-tellingly
-tells
-telltale
-telly
-temerity
-temper
-tempera
-temperament
-temperamental
-temperamentally
-temperaments
-temperance
-temperate
-temperately
-temperature
-temperatures
-tempered
-tempering
-tempers
-tempest
-tempests
-tempestuous
-tempi
-template
-templates
-temple
-temples
-tempo
-temporal
-temporality
-temporally
-temporaries
-temporarily
-temporary
-tempt
-temptation
-temptations
-tempted
-tempter
-tempters
-tempting
-temptingly
-temptress
-tempts
-ten
-tenability
-tenable
-tenacious
-tenaciously
-tenacity
-tenancies
-tenancy
-tenant
-tenanted
-tenantry
-tenants
-tench
-tend
-tended
-tendencies
-tendency
-tendentious
-tendentiously
-tender
-tendered
-tenderer
-tenderest
-tendering
-tenderly
-tenderness
-tenders
-tending
-tendon
-tendons
-tendril
-tendrils
-tends
-tenement
-tenements
-tenet
-tenets
-tenfold
-tenners
-tennis
-tenon
-tenor
-tenors
-tens
-tense
-tensed
-tensely
-tenseness
-tenser
-tenses
-tensest
-tensile
-tensing
-tension
-tensional
-tensioned
-tensions
-tensity
-tensor
-tensors
-tent
-tentacle
-tentacled
-tentacles
-tentative
-tentatively
-tented
-tenterhooks
-tenth
-tenths
-tents
-tenuous
-tenuously
-tenure
-tenured
-tenures
-tenurial
-tepee
-tepid
-tequila
-tercentenary
-term
-termed
-terminal
-terminally
-terminals
-terminate
-terminated
-terminates
-terminating
-termination
-terminations
-terminator
-terminators
-terming
-termini
-terminological
-terminologies
-terminology
-terminus
-termite
-termites
-termly
-terms
-tern
-ternary
-terns
-terrace
-terraced
-terraces
-terracing
-terracotta
-terraform
-terraformed
-terrain
-terrains
-terrapin
-terrapins
-terrazzo
-terrestrial
-terrible
-terribly
-terrier
-terriers
-terrific
-terrifically
-terrified
-terrifies
-terrify
-terrifying
-terrifyingly
-terrine
-territorial
-territoriality
-territorially
-territories
-territory
-terror
-terrorise
-terrorised
-terrorising
-terrorism
-terrorist
-terrorists
-terrors
-terrorstricken
-terry
-terse
-tersely
-terseness
-terser
-tertiaries
-tertiary
-tessellated
-tessellation
-tessellations
-tesseral
-test
-testability
-testable
-testament
-testamentary
-testaments
-testdrive
-testdriving
-tested
-tester
-testers
-testes
-testicle
-testicles
-testicular
-testier
-testiest
-testified
-testifies
-testify
-testifying
-testily
-testimonial
-testimonials
-testimonies
-testimony
-testiness
-testing
-testings
-testis
-testosterone
-tests
-testtube
-testy
-tetanus
-tetchily
-tetchy
-tether
-tethered
-tethering
-tethers
-tetra
-tetrachloride
-tetrahedra
-tetrahedral
-tetrahedron
-tetrahedrons
-tetrameters
-tetroxide
-texan
-texans
-texas
-text
-textbook
-textbooks
-textile
-textiles
-texts
-textual
-textuality
-textually
-textural
-texturally
-texture
-textured
-textures
-thai
-thalamus
-thalidomide
-thallium
-thames
-than
-thane
-thank
-thanked
-thankful
-thankfully
-thankfulness
-thanking
-thankless
-thanklessly
-thanks
-thanksgiving
-that
-thatch
-thatched
-thatcher
-thatchers
-thatching
-thaumaturge
-thaw
-thawed
-thawing
-thaws
-the
-theatre
-theatres
-theatrical
-theatricality
-theatrically
-theatricals
-thebes
-thee
-theft
-thefts
-their
-theirs
-theism
-theist
-theistic
-theists
-them
-themas
-thematic
-thematically
-theme
-themed
-themes
-themselves
-then
-thence
-thenceforth
-thenceforward
-theocracies
-theocracy
-theodolite
-theodolites
-theologian
-theologians
-theological
-theologically
-theologies
-theologists
-theology
-theorem
-theorems
-theoretic
-theoretical
-theoretically
-theoretician
-theoreticians
-theories
-theorisation
-theorise
-theorised
-theorises
-theorising
-theorist
-theorists
-theory
-theosophy
-therapeutic
-therapeutically
-therapies
-therapist
-therapists
-therapy
-there
-thereabouts
-thereafter
-thereby
-therefor
-therefore
-therefrom
-therein
-thereof
-thereon
-thereto
-thereunder
-thereupon
-therewith
-thermal
-thermally
-thermals
-thermochemical
-thermodynamic
-thermodynamical
-thermodynamically
-thermodynamics
-thermoelectric
-thermometer
-thermometers
-thermoplastic
-thermostat
-thermostatic
-thermostatically
-thermostats
-therms
-thesauri
-thesaurus
-these
-thesis
-thespian
-thespians
-theta
-they
-thick
-thicken
-thickened
-thickening
-thickens
-thicker
-thickest
-thicket
-thickets
-thickish
-thickly
-thickness
-thicknesses
-thickset
-thickskinned
-thief
-thieve
-thieved
-thievery
-thieves
-thieving
-thievish
-thievishness
-thigh
-thighs
-thimble
-thimbleful
-thimblefuls
-thimbles
-thin
-thine
-thing
-things
-think
-thinkable
-thinker
-thinkers
-thinking
-thinks
-thinktank
-thinly
-thinned
-thinner
-thinners
-thinness
-thinnest
-thinning
-thinnish
-thins
-third
-thirdly
-thirds
-thirst
-thirsted
-thirstier
-thirstiest
-thirstily
-thirsting
-thirsts
-thirsty
-thirteen
-thirteenth
-thirties
-thirtieth
-thirty
-this
-thistle
-thistles
-thither
-thomas
-thong
-thongs
-thor
-thoracic
-thorax
-thorium
-thorn
-thornier
-thorniest
-thorns
-thorny
-thorough
-thoroughbred
-thoroughbreds
-thoroughfare
-thoroughfares
-thoroughgoing
-thoroughly
-thoroughness
-those
-thou
-though
-thought
-thoughtful
-thoughtfully
-thoughtfulness
-thoughtless
-thoughtlessly
-thoughtlessness
-thoughtprovoking
-thoughts
-thousand
-thousandfold
-thousands
-thousandth
-thousandths
-thrall
-thrash
-thrashed
-thrasher
-thrashes
-thrashing
-thrashings
-thread
-threadbare
-threaded
-threading
-threads
-threat
-threaten
-threatened
-threatening
-threateningly
-threatens
-threats
-three
-threedimensional
-threefold
-threequarters
-threes
-threesome
-threesomes
-thresh
-threshed
-thresher
-threshers
-threshing
-threshold
-thresholds
-threw
-thrice
-thrift
-thriftier
-thriftiest
-thriftless
-thrifts
-thrifty
-thrill
-thrilled
-thriller
-thrillers
-thrilling
-thrillingly
-thrills
-thrive
-thrived
-thrives
-thriving
-throat
-throatier
-throatiest
-throatily
-throats
-throaty
-throb
-throbbed
-throbbing
-throbs
-thromboses
-thrombosis
-thrombus
-throne
-throned
-thrones
-throng
-thronged
-thronging
-throngs
-throroughly
-throttle
-throttled
-throttles
-throttling
-through
-throughout
-throughput
-throw
-throwaway
-throwback
-thrower
-throwers
-throwing
-thrown
-throws
-thrum
-thrush
-thrushes
-thrust
-thruster
-thrusters
-thrusting
-thrusts
-thud
-thudded
-thudding
-thuds
-thug
-thuggery
-thuggish
-thugs
-thumb
-thumbed
-thumbing
-thumbnail
-thumbprint
-thumbs
-thumbscrew
-thumbscrews
-thump
-thumped
-thumping
-thumps
-thunder
-thunderbolt
-thunderbolts
-thunderclap
-thunderclaps
-thundercloud
-thundered
-thunderflashes
-thundering
-thunderous
-thunderously
-thunders
-thunderstorm
-thunderstorms
-thunderstruck
-thundery
-thursday
-thus
-thwack
-thwart
-thwarted
-thwarting
-thwarts
-thy
-thyme
-thymus
-thyristor
-thyristors
-thyroid
-thyroids
-thyself
-tiara
-tiaras
-tibia
-tibiae
-tic
-tick
-ticked
-ticker
-tickers
-ticket
-ticketed
-tickets
-ticking
-tickle
-tickled
-tickler
-tickles
-tickling
-ticklish
-ticks
-tics
-tidal
-tidbit
-tidbits
-tiddlers
-tiddlywinks
-tide
-tideless
-tides
-tideway
-tidied
-tidier
-tidies
-tidiest
-tidily
-tidiness
-tiding
-tidings
-tidy
-tidying
-tie
-tiebreak
-tied
-tier
-tiered
-tiers
-ties
-tiger
-tigerish
-tigers
-tight
-tighten
-tightened
-tightening
-tightens
-tighter
-tightest
-tightfisted
-tightlipped
-tightly
-tightness
-tightrope
-tights
-tightwad
-tigress
-tigris
-tikka
-tilde
-tildes
-tile
-tiled
-tiler
-tiles
-tiling
-tilings
-till
-tillage
-tilled
-tiller
-tillers
-tilling
-tills
-tilt
-tilted
-tilting
-tilts
-timber
-timbered
-timbre
-time
-timebase
-timeconsuming
-timed
-timeframe
-timehonoured
-timekeeper
-timekeepers
-timekeeping
-timelapse
-timeless
-timelessness
-timeliness
-timely
-timeout
-timepiece
-timer
-timers
-times
-timescale
-timescales
-timeshare
-timetable
-timetabled
-timetables
-timetabling
-timid
-timidity
-timidly
-timing
-timings
-tin
-tincan
-tincture
-tinctured
-tinder
-tinderbox
-tinfoil
-tinge
-tinged
-tinges
-tingle
-tingled
-tingles
-tinglier
-tingliest
-tingling
-tingly
-tinier
-tiniest
-tinker
-tinkered
-tinkering
-tinkers
-tinkle
-tinkled
-tinkling
-tinkly
-tinned
-tinner
-tinnier
-tinniest
-tinnily
-tinnitus
-tinny
-tinopener
-tinpot
-tins
-tinsel
-tinsels
-tint
-tinted
-tinting
-tintings
-tints
-tinware
-tiny
-tip
-tipoff
-tipoffs
-tipped
-tipper
-tipping
-tipple
-tippling
-tips
-tipster
-tipsters
-tipsy
-tiptoe
-tiptoed
-tiptoeing
-tiptoes
-tiptop
-tirade
-tirades
-tire
-tired
-tiredly
-tiredness
-tireless
-tirelessly
-tires
-tiresome
-tiresomely
-tiring
-tiro
-tissue
-tissues
-tit
-titan
-titanic
-titanically
-titanium
-titans
-titbit
-titbits
-titfortat
-tithe
-tithes
-tithing
-titillate
-titillated
-titillating
-titillation
-title
-titled
-titles
-titling
-titrated
-titration
-titre
-titres
-tits
-titter
-tittered
-tittering
-titters
-titular
-to
-toad
-toadies
-toads
-toadstool
-toadstools
-toady
-toast
-toasted
-toaster
-toasters
-toasting
-toasts
-toasty
-tobacco
-tobacconist
-tobacconists
-tobago
-toboggan
-tobogganing
-toby
-toccata
-tocsin
-today
-toddle
-toddled
-toddler
-toddlers
-toddling
-toddy
-todies
-toe
-toed
-toehold
-toeing
-toeless
-toenail
-toenails
-toes
-toffee
-toffees
-toffy
-tofu
-tog
-toga
-togas
-together
-togetherness
-toggle
-toggled
-toggles
-toggling
-togo
-togs
-toil
-toiled
-toiler
-toilet
-toileting
-toiletries
-toiletry
-toilets
-toilette
-toiling
-toils
-toitoi
-tokamak
-token
-tokenism
-tokenistic
-tokens
-tokyo
-tolbooth
-told
-toledo
-tolerable
-tolerably
-tolerance
-tolerances
-tolerant
-tolerantly
-tolerate
-tolerated
-tolerates
-tolerating
-toleration
-toll
-tolled
-tollgate
-tolling
-tolls
-toluene
-tomahawk
-tomahawks
-tomato
-tomb
-tombola
-tomboy
-tomboys
-tombs
-tombstone
-tombstones
-tomcat
-tome
-tomes
-tomfoolery
-tomography
-tomorrow
-tomorrows
-tomtom
-ton
-tonal
-tonalities
-tonality
-tonally
-tone
-toned
-tonedeaf
-toneless
-tonelessly
-toner
-toners
-tones
-tonga
-tongs
-tongue
-tongueincheek
-tongues
-tonguetied
-tonguetwister
-tonguetwisters
-tonic
-tonics
-tonight
-toning
-tonnage
-tonnages
-tonne
-tonnes
-tons
-tonsil
-tonsillectomy
-tonsillitis
-tonsils
-tonsure
-tony
-too
-took
-tool
-toolbox
-toolboxes
-tooled
-tooling
-toolmaker
-toolmaking
-tools
-toot
-tooted
-tooth
-toothache
-toothbrush
-toothbrushes
-toothed
-toothier
-toothiest
-toothless
-toothmarks
-toothpaste
-toothpick
-toothpicks
-toothsome
-toothy
-tooting
-tootle
-top
-topaz
-topazes
-topcoat
-topheavy
-topiary
-topic
-topical
-topicality
-topically
-topics
-topless
-toplevel
-topmost
-topnotch
-topographic
-topographical
-topographically
-topography
-topological
-topologically
-topologies
-topologist
-topologists
-topology
-topped
-topper
-topping
-toppings
-topple
-toppled
-topples
-toppling
-tops
-topsoil
-topspin
-topsyturvy
-torah
-torch
-torchbearer
-torchbearers
-torched
-torches
-torchlight
-torchlit
-tore
-tori
-tories
-torment
-tormented
-tormenting
-tormentor
-tormentors
-torments
-torn
-tornado
-toronto
-torpedo
-torpedoed
-torpid
-torpor
-torque
-torques
-torrent
-torrential
-torrents
-torrid
-torsion
-torsional
-torsions
-torso
-tortoise
-tortoises
-tortoiseshell
-torts
-tortuous
-tortuously
-torture
-tortured
-torturer
-torturers
-tortures
-torturing
-torturous
-torus
-tory
-toss
-tossed
-tossers
-tosses
-tossing
-tossup
-tossups
-tot
-total
-totalising
-totalitarian
-totalitarianism
-totality
-totalled
-totalling
-totally
-totals
-totem
-totemic
-totems
-tots
-totted
-totter
-tottered
-tottering
-totters
-totting
-toucans
-touch
-touchandgo
-touchdown
-touchdowns
-touche
-touched
-toucher
-touches
-touchier
-touchiest
-touchiness
-touching
-touchingly
-touchy
-tough
-toughen
-toughened
-toughens
-tougher
-toughest
-toughie
-toughies
-toughly
-toughness
-toughs
-toupee
-tour
-toured
-tourer
-tourers
-touring
-tourism
-tourist
-touristic
-tourists
-touristy
-tournament
-tournaments
-tourney
-tourniquet
-tours
-tousled
-tousles
-tout
-touted
-touting
-touts
-tow
-toward
-towards
-towed
-towel
-towelled
-towelling
-towels
-tower
-towered
-towering
-towers
-towing
-town
-towns
-townscape
-townscapes
-townsfolk
-township
-townships
-townsman
-townsmen
-townspeople
-towpath
-towpaths
-tows
-toxaemia
-toxic
-toxicity
-toxicological
-toxicology
-toxin
-toxins
-toy
-toyed
-toying
-toymaker
-toys
-toyshop
-trace
-traceability
-traceable
-traced
-traceless
-tracer
-tracers
-tracery
-traces
-trachea
-tracheal
-tracheostomy
-tracheotomy
-tracing
-tracings
-track
-trackbed
-tracked
-tracker
-trackers
-tracking
-trackless
-tracks
-tracksuit
-tracksuits
-trackway
-trackways
-tract
-tractability
-tractable
-traction
-tractor
-tractors
-tracts
-trad
-trade
-tradeable
-traded
-tradein
-tradeins
-trademark
-trademarked
-trademarks
-trader
-traders
-trades
-tradesman
-tradesmen
-tradespeople
-trading
-tradings
-tradition
-traditional
-traditionalism
-traditionalist
-traditionalists
-traditionally
-traditions
-traduced
-traducer
-traffic
-trafficked
-trafficker
-traffickers
-trafficking
-tragedian
-tragedians
-tragedies
-tragedy
-tragic
-tragical
-tragically
-trail
-trailed
-trailer
-trailers
-trailing
-trails
-train
-trained
-trainee
-trainees
-trainer
-trainers
-training
-trainings
-trainload
-trains
-trait
-traitor
-traitorous
-traitorously
-traitors
-traits
-trajectories
-trajectory
-tram
-tramcar
-tramcars
-tramlines
-trammel
-tramp
-tramped
-tramping
-trample
-trampled
-tramples
-trampling
-trampoline
-trampolines
-trampolining
-trampolinist
-tramps
-trams
-tramway
-tramways
-trance
-trances
-tranche
-tranches
-tranny
-tranquil
-tranquillise
-tranquillised
-tranquilliser
-tranquillisers
-tranquillity
-tranquilly
-transact
-transacted
-transacting
-transaction
-transactional
-transactions
-transactor
-transatlantic
-transceiver
-transceivers
-transcend
-transcended
-transcendence
-transcendent
-transcendental
-transcendentally
-transcendentals
-transcending
-transcends
-transcontinental
-transcribe
-transcribed
-transcriber
-transcribers
-transcribes
-transcribing
-transcript
-transcription
-transcriptional
-transcriptions
-transcripts
-transducer
-transducers
-transduction
-transection
-transept
-transepts
-transfer
-transferability
-transferable
-transferee
-transferees
-transference
-transferral
-transferred
-transferring
-transfers
-transfiguration
-transfigured
-transfinite
-transfinitely
-transfixed
-transform
-transformation
-transformational
-transformations
-transformative
-transformed
-transformer
-transformers
-transforming
-transforms
-transfused
-transfusing
-transfusion
-transfusions
-transgress
-transgressed
-transgresses
-transgressing
-transgression
-transgressions
-transgressive
-transgressor
-transgressors
-transhipment
-transience
-transient
-transiently
-transients
-transistor
-transistorised
-transistors
-transit
-transition
-transitional
-transitions
-transitive
-transitively
-transitivity
-transitoriness
-transitory
-transits
-translatable
-translate
-translated
-translates
-translating
-translation
-translational
-translations
-translator
-translators
-transliterate
-transliterated
-transliterates
-transliterating
-transliteration
-transliterations
-translucence
-translucency
-translucent
-transmigration
-transmissible
-transmission
-transmissions
-transmissive
-transmit
-transmits
-transmittable
-transmittance
-transmitted
-transmitter
-transmitters
-transmitting
-transmogrification
-transmogrifies
-transmogrify
-transmutation
-transmute
-transmuted
-transmuting
-transnational
-transom
-transonic
-transparencies
-transparency
-transparent
-transparently
-transpiration
-transpire
-transpired
-transpires
-transplant
-transplantation
-transplanted
-transplanting
-transplants
-transponder
-transponders
-transport
-transportability
-transportable
-transportation
-transported
-transporter
-transporters
-transporting
-transports
-transpose
-transposed
-transposes
-transposing
-transposition
-transpositions
-transverse
-transversely
-transvestism
-transvestite
-transvestites
-trap
-trapdoor
-trapdoors
-trapeze
-trappable
-trapped
-trapper
-trappers
-trapping
-trappings
-traps
-trash
-trashed
-trashy
-trauma
-traumas
-traumata
-traumatic
-traumatise
-traumatised
-travail
-travails
-travel
-travelled
-traveller
-travellers
-travelling
-travelogue
-travelogues
-travels
-traversal
-traversals
-traverse
-traversed
-traverses
-traversing
-travesties
-travesty
-trawl
-trawled
-trawler
-trawlers
-trawling
-trawlnet
-trawls
-tray
-trays
-treacherous
-treacherously
-treachery
-treacle
-tread
-treader
-treading
-treadle
-treadmill
-treadmills
-treads
-treason
-treasonable
-treasonous
-treasons
-treasure
-treasured
-treasurer
-treasurers
-treasurership
-treasures
-treasuries
-treasuring
-treasury
-treat
-treatable
-treated
-treaties
-treating
-treatise
-treatises
-treatment
-treatments
-treats
-treaty
-treble
-trebled
-trebles
-trebling
-tree
-treeless
-trees
-treetop
-treetops
-trefoil
-trefoils
-trek
-trekked
-trekker
-trekkers
-trekking
-treks
-trellis
-trellised
-trellises
-tremble
-trembled
-trembler
-trembles
-trembling
-tremblingly
-tremblings
-tremendous
-tremendously
-tremolo
-tremor
-tremors
-tremulous
-tremulously
-tremulousness
-trench
-trenchant
-trenchantly
-trenched
-trencher
-trenches
-trenching
-trend
-trendier
-trendiest
-trendiness
-trends
-trendy
-trepanned
-trepidation
-trepidations
-trespass
-trespassed
-trespasser
-trespassers
-trespasses
-trespassing
-tress
-tresses
-trestle
-trestles
-trews
-triad
-triadic
-triads
-triage
-trial
-trials
-triangle
-triangles
-triangular
-triangulate
-triangulated
-triangulating
-triangulation
-triangulations
-triathlon
-triatomic
-tribal
-tribalism
-tribally
-tribe
-tribes
-tribesman
-tribesmen
-tribespeople
-tribulation
-tribulations
-tribunal
-tribunals
-tribune
-tribunes
-tributaries
-tributary
-tribute
-tributes
-trice
-trick
-tricked
-trickery
-trickier
-trickiest
-trickily
-tricking
-trickle
-trickled
-trickles
-trickling
-tricks
-trickster
-tricksters
-tricky
-tricolour
-tricolours
-tricycle
-tricycles
-trident
-tridents
-tried
-triennial
-trier
-tries
-triffid
-triffids
-trifle
-trifled
-trifler
-trifles
-trifling
-trigger
-triggered
-triggerhappy
-triggering
-triggers
-triglyceride
-trigonometric
-trigonometrical
-trigonometry
-trigram
-trigrams
-trigs
-trikes
-trilateral
-trilby
-trilingual
-trill
-trilled
-trilling
-trillion
-trillions
-trills
-trilobite
-trilobites
-trilogies
-trilogy
-trim
-trimaran
-trimmed
-trimmer
-trimmers
-trimming
-trimmings
-trimodal
-trims
-trinidad
-trinity
-trinket
-trinkets
-trio
-trip
-tripartite
-tripe
-triplane
-triple
-tripled
-triples
-triplet
-triplets
-triplex
-triplicate
-triplication
-tripling
-triply
-tripod
-tripods
-tripoli
-tripped
-trippers
-tripping
-trips
-triptych
-tripwire
-tripwires
-trireme
-trisecting
-trisection
-trisector
-tristan
-trite
-triteness
-tritium
-triumph
-triumphal
-triumphalism
-triumphalist
-triumphant
-triumphantly
-triumphed
-triumphing
-triumphs
-triumvirate
-trivia
-trivial
-trivialisation
-trivialisations
-trivialise
-trivialised
-trivialises
-trivialising
-trivialities
-triviality
-trivially
-trod
-trodden
-troglodyte
-troglodytes
-troika
-troikas
-troll
-trolley
-trolleys
-trolling
-trollish
-trolls
-trombone
-trombones
-trombonist
-trombonists
-troop
-trooped
-trooper
-troopers
-trooping
-troops
-troopship
-trope
-tropes
-trophies
-trophy
-tropic
-tropical
-tropically
-tropics
-tropopause
-troposphere
-tropospheric
-trot
-trots
-trotted
-trotter
-trotters
-trotting
-troubadour
-troubadours
-trouble
-troubled
-troublemaker
-troublemakers
-troubles
-troubleshooter
-troubleshooters
-troubleshooting
-troublesome
-troublesomeness
-troubling
-trough
-troughs
-trounce
-trounced
-trounces
-trouncing
-troupe
-trouper
-troupers
-troupes
-trouser
-trousers
-trout
-trouts
-trove
-trowel
-trowels
-troy
-truancy
-truant
-truanting
-truants
-truce
-truces
-truck
-trucks
-truculence
-truculent
-truculently
-trudge
-trudged
-trudges
-trudging
-true
-trueblue
-truer
-truest
-truffle
-truffles
-truism
-truisms
-truly
-trump
-trumped
-trumpery
-trumpet
-trumpeted
-trumpeter
-trumpeters
-trumpeting
-trumpets
-trumps
-truncate
-truncated
-truncates
-truncating
-truncation
-truncations
-truncheon
-truncheons
-trundle
-trundled
-trundles
-trundling
-trunk
-trunking
-trunks
-trunnion
-trunnions
-truss
-trussed
-trusses
-trussing
-trust
-trusted
-trustee
-trustees
-trusteeship
-trustful
-trustfully
-trustfulness
-trusties
-trusting
-trustingly
-trusts
-trustworthiness
-trustworthy
-trusty
-truth
-truthful
-truthfully
-truthfulness
-truths
-try
-trying
-tsetse
-tshirt
-tsunami
-tswana
-tswanas
-tuareg
-tuaregs
-tuatara
-tub
-tuba
-tubas
-tubby
-tube
-tubed
-tubeless
-tuber
-tubercular
-tuberculosis
-tubers
-tubes
-tubing
-tubs
-tubular
-tubules
-tuck
-tucked
-tucker
-tuckers
-tucking
-tucks
-tues
-tuesday
-tuesdays
-tuft
-tufted
-tufting
-tufts
-tug
-tugela
-tugged
-tugging
-tugs
-tuition
-tulip
-tulips
-tumble
-tumbled
-tumbledown
-tumbler
-tumblers
-tumbles
-tumbling
-tumbrils
-tumescent
-tummies
-tummy
-tumour
-tumours
-tumult
-tumults
-tumultuous
-tumultuously
-tumulus
-tun
-tuna
-tunable
-tunas
-tundra
-tundras
-tune
-tuned
-tuneful
-tunefully
-tuneless
-tunelessly
-tuner
-tuners
-tunes
-tungsten
-tunic
-tunics
-tuning
-tunings
-tunisia
-tunisian
-tunnel
-tunnelled
-tunnellers
-tunnelling
-tunnels
-tunny
-tuns
-tuppence
-tuppences
-turban
-turbans
-turbid
-turbidity
-turbine
-turbines
-turbo
-turbocharged
-turbocharger
-turboprop
-turbot
-turbulence
-turbulent
-tureen
-tureens
-turf
-turfed
-turfs
-turfy
-turgid
-turgidity
-turgidly
-turin
-turk
-turkey
-turkeys
-turkish
-turks
-turmeric
-turmoil
-turmoils
-turn
-turnabout
-turnaround
-turncoat
-turncoats
-turned
-turner
-turners
-turning
-turnings
-turnip
-turnips
-turnkey
-turnout
-turnouts
-turnover
-turnovers
-turnpike
-turnround
-turns
-turnstile
-turnstiles
-turntable
-turntables
-turpentine
-turpitude
-turquoise
-turret
-turreted
-turrets
-turtle
-turtleneck
-turtles
-tuscany
-tusk
-tusked
-tusker
-tusks
-tussle
-tussles
-tussling
-tussock
-tussocks
-tussocky
-tutelage
-tutelary
-tutor
-tutored
-tutorial
-tutorials
-tutoring
-tutors
-tutu
-tuxedo
-twain
-twang
-twanged
-twanging
-twangs
-tweak
-tweaked
-tweaking
-tweaks
-twee
-tweed
-tweeds
-tweedy
-tweeness
-tweet
-tweeter
-tweeters
-tweets
-tweezers
-twelfth
-twelfths
-twelve
-twelves
-twenties
-twentieth
-twenty
-twice
-twiddle
-twiddled
-twiddler
-twiddles
-twiddling
-twiddly
-twig
-twigged
-twiggy
-twigs
-twilight
-twilit
-twill
-twin
-twine
-twined
-twines
-twinge
-twinges
-twining
-twinkle
-twinkled
-twinkles
-twinkling
-twinned
-twinning
-twins
-twirl
-twirled
-twirling
-twirls
-twist
-twisted
-twister
-twisters
-twisting
-twists
-twisty
-twit
-twitch
-twitched
-twitches
-twitching
-twitchy
-twitter
-twittered
-twittering
-two
-twodimensional
-twofaced
-twofold
-twosome
-tycoon
-tycoons
-tying
-tyke
-tykes
-type
-typecast
-typecasting
-typed
-typeface
-typefaces
-typeless
-types
-typescript
-typescripts
-typeset
-typesets
-typesetter
-typesetters
-typesetting
-typewriter
-typewriters
-typewriting
-typewritten
-typhoid
-typhoon
-typhoons
-typhus
-typical
-typicality
-typically
-typified
-typifies
-typify
-typifying
-typing
-typings
-typist
-typists
-typographer
-typographers
-typographic
-typographical
-typographically
-typography
-typological
-typologically
-typologies
-typology
-tyrannic
-tyrannical
-tyrannically
-tyrannicide
-tyrannies
-tyrannise
-tyrannised
-tyrannous
-tyranny
-tyrant
-tyrants
-tyre
-tyres
-uboats
-udder
-udders
-ufo
-uganda
-ugandan
-uglier
-ugliest
-uglification
-ugliness
-ugly
-uhuh
-uke
-ukraine
-ukulele
-ukuleles
-ulcer
-ulcerate
-ulcerated
-ulceration
-ulcerations
-ulcerous
-ulcers
-ulster
-ulsters
-ulterior
-ultimacy
-ultimate
-ultimately
-ultimatum
-ultimatums
-ultimo
-ultra
-ultramarine
-ultramontane
-ultrasonic
-ultrasonics
-ultrasound
-ultraviolet
-umbilical
-umbilicus
-umbra
-umbrae
-umbrage
-umbrageous
-umbras
-umbrella
-umbrellas
-umlaut
-umlauts
-umpire
-umpired
-umpires
-umpiring
-umpteen
-umpteenth
-unabashed
-unabashedly
-unabated
-unable
-unabridged
-unabsorbed
-unacceptability
-unacceptable
-unacceptably
-unaccepted
-unaccommodating
-unaccompanied
-unaccountability
-unaccountable
-unaccountably
-unaccounted
-unaccustomed
-unachievable
-unacknowledged
-unacquainted
-unactivated
-unadapted
-unadaptive
-unaddressable
-unaddressed
-unadjusted
-unadorned
-unadulterated
-unadventurous
-unadvertised
-unaesthetic
-unaffected
-unaffectedly
-unaffiliated
-unaffordable
-unafraid
-unaided
-unaligned
-unalike
-unallocated
-unalloyed
-unalterable
-unalterably
-unaltered
-unambiguity
-unambiguous
-unambiguously
-unambitious
-unamended
-unamused
-unanimity
-unanimous
-unanimously
-unannotated
-unannounced
-unanswerable
-unanswered
-unanticipated
-unapologetic
-unappealing
-unappeased
-unappetising
-unappreciated
-unappreciative
-unapproachable
-unapproved
-unapt
-unarchived
-unarguable
-unarguably
-unarm
-unarmed
-unarms
-unaroused
-unarticulated
-unary
-unashamed
-unashamedly
-unasked
-unassailable
-unassailed
-unassertive
-unassigned
-unassisted
-unassociated
-unassuaged
-unassuming
-unattached
-unattainable
-unattainably
-unattained
-unattended
-unattenuated
-unattractive
-unattractiveness
-unattributable
-unattributed
-unaudited
-unauthenticated
-unauthorised
-unavailability
-unavailable
-unavailing
-unavailingly
-unavenged
-unavoidable
-unavoidably
-unawakened
-unaware
-unawareness
-unawares
-unawed
-unbalance
-unbalanced
-unbalances
-unbalancing
-unbanned
-unbanning
-unbaptised
-unbar
-unbarred
-unbars
-unbearable
-unbearably
-unbeatable
-unbeaten
-unbecoming
-unbeknown
-unbeknownst
-unbelievability
-unbelievable
-unbelievably
-unbelieved
-unbeliever
-unbelievers
-unbelieving
-unbend
-unbending
-unbent
-unbiased
-unbiasedly
-unbiassed
-unbiassedly
-unbidden
-unbind
-unbleached
-unblemished
-unblinking
-unblinkingly
-unblock
-unblocked
-unblocking
-unbloodied
-unboiled
-unbolt
-unbolted
-unbooked
-unborn
-unbosom
-unbothered
-unbound
-unbounded
-unbowed
-unbraced
-unbracketed
-unbranded
-unbreakability
-unbreakable
-unbridgeable
-unbridged
-unbridled
-unbroken
-unbruised
-unbuckle
-unbuckled
-unbuckling
-unbundled
-unburden
-unburdened
-unburdening
-unburied
-unburned
-unburnt
-unbutton
-unbuttoned
-unbuttoning
-uncalibrated
-uncalled
-uncancelled
-uncannily
-uncanny
-uncapped
-uncared
-uncaring
-uncased
-uncatalogued
-uncaught
-unceasing
-unceasingly
-uncelebrated
-uncensored
-unceremoniously
-uncertain
-uncertainly
-uncertainties
-uncertainty
-unchain
-unchained
-unchaining
-unchallengeable
-unchallenged
-unchangeable
-unchanged
-unchanging
-unchaperoned
-uncharacteristic
-uncharacteristically
-uncharged
-uncharismatic
-uncharitable
-uncharitably
-uncharted
-unchartered
-uncheckable
-unchecked
-unchristened
-unchristian
-unchronicled
-uncircumcised
-uncivil
-uncivilised
-unclad
-unclaimed
-unclasped
-unclasping
-unclassifiable
-unclassified
-uncle
-unclean
-uncleanliness
-uncleanly
-unclear
-uncleared
-unclench
-unclenched
-unclenching
-uncles
-unclesam
-unclimbable
-unclimbed
-unclog
-unclosed
-unclothed
-unclouded
-uncluttered
-uncoil
-uncoiled
-uncoiling
-uncoils
-uncollated
-uncollected
-uncollimated
-uncombed
-uncomely
-uncomfortable
-uncomfortableness
-uncomfortably
-uncommitted
-uncommon
-uncommonly
-uncommunicative
-uncompetitive
-uncompetitiveness
-uncompilable
-uncomplaining
-uncomplainingly
-uncompleted
-uncomplicated
-uncomplimentary
-uncomprehending
-uncomprehendingly
-uncompressed
-uncompromisable
-uncompromising
-uncompromisingly
-unconcern
-unconcerned
-unconcernedly
-unconditional
-unconditionally
-unconditioned
-unconfined
-unconfirmed
-unconfused
-uncongenial
-unconnected
-unconquerable
-unconquered
-unconscionable
-unconscionably
-unconscious
-unconsciously
-unconsciousness
-unconsecrated
-unconsidered
-unconsoled
-unconstitutional
-unconstitutionally
-unconstrained
-unconsumed
-uncontainable
-uncontaminated
-uncontentious
-uncontested
-uncontrollable
-uncontrollably
-uncontrolled
-uncontroversial
-uncontroversially
-unconventional
-unconventionally
-unconverted
-unconvinced
-unconvincing
-unconvincingly
-uncooked
-uncooperative
-uncoordinated
-uncorked
-uncorrectable
-uncorrected
-uncorrelated
-uncorroborated
-uncorrupted
-uncountable
-uncountably
-uncounted
-uncouple
-uncoupled
-uncouth
-uncouthness
-uncover
-uncovered
-uncovering
-uncovers
-uncrackable
-uncreased
-uncreated
-uncreative
-uncredited
-uncritical
-uncritically
-uncross
-uncrossable
-uncrossed
-uncrowded
-uncrowned
-uncrushable
-unction
-unctuous
-unctuously
-uncultivated
-uncultured
-uncured
-uncurled
-uncut
-undamaged
-undated
-undaunted
-undead
-undeceived
-undecidability
-undecidable
-undecided
-undeclared
-undecorated
-undefeated
-undefended
-undefiled
-undefinable
-undefined
-undeliverable
-undelivered
-undemanding
-undemocratic
-undemocratically
-undemonstrative
-undeniable
-undeniably
-under
-underachievement
-underachieving
-underarm
-underbelly
-underbody
-undercarriage
-underclass
-underclothes
-underclothing
-undercoat
-undercoating
-undercooked
-undercover
-undercroft
-undercurrent
-undercurrents
-undercut
-undercuts
-undercutting
-underdeveloped
-underdevelopment
-underdog
-underdogs
-underdone
-undereducated
-underemphasis
-underemployment
-underestimate
-underestimated
-underestimates
-underestimating
-underestimation
-underexploited
-underfed
-underfloor
-underflow
-underfoot
-underframe
-underfund
-underfunded
-underfunding
-undergarment
-undergarments
-undergo
-undergoes
-undergoing
-undergone
-undergraduate
-undergraduates
-underground
-undergrounds
-undergrowth
-underhand
-underinvestment
-underlain
-underlay
-underlie
-underlies
-underline
-underlined
-underlines
-underling
-underlings
-underlining
-underlinings
-underloaded
-underlying
-undermanned
-undermine
-undermined
-undermines
-undermining
-underneath
-undernourished
-undernourishment
-underpaid
-underpants
-underparts
-underpass
-underpay
-underpaying
-underperformance
-underperformed
-underpin
-underpinned
-underpinning
-underpinnings
-underpins
-underplay
-underplayed
-underplays
-underpopulated
-underpopulation
-underpowered
-underpriced
-underpricing
-underprivileged
-underrate
-underrated
-underscored
-undersea
-underside
-undersides
-undersigned
-undersized
-underskirt
-understaffed
-understand
-understandability
-understandable
-understandably
-understander
-understanding
-understandingly
-understandings
-understands
-understate
-understated
-understatement
-understates
-understating
-understocked
-understood
-understorey
-understudy
-undertake
-undertaken
-undertaker
-undertakers
-undertakes
-undertaking
-undertakings
-undertone
-undertones
-undertook
-underutilised
-undervalued
-undervalues
-undervaluing
-underwater
-underwear
-underweight
-underwent
-underwood
-underworld
-underwrite
-underwriter
-underwriters
-underwrites
-underwriting
-underwritten
-underwrote
-undeserved
-undeservedly
-undeserving
-undesirability
-undesirable
-undesirables
-undesirably
-undesired
-undetectability
-undetectable
-undetectably
-undetected
-undetermined
-undeterred
-undetonated
-undeveloped
-undiagnosable
-undiagnosed
-undid
-undifferentiated
-undigested
-undignified
-undiluted
-undiminished
-undiplomatic
-undirected
-undiscerning
-undisciplined
-undisclosed
-undiscovered
-undiscriminated
-undiscriminating
-undisguised
-undisguisedly
-undismayed
-undisplayed
-undisputed
-undissipated
-undistinguished
-undistorted
-undistributed
-undisturbed
-undivided
-undo
-undocumented
-undoing
-undoings
-undomesticated
-undone
-undoubted
-undoubtedly
-undress
-undressed
-undressing
-undrinkability
-undrinkable
-undroppable
-undue
-undulate
-undulated
-undulates
-undulating
-undulation
-undulations
-unduly
-undying
-unearned
-unearth
-unearthed
-unearthing
-unearthly
-unearths
-unease
-uneasier
-uneasiest
-uneasily
-uneasiness
-uneasy
-uneatable
-uneaten
-uneconomic
-uneconomical
-unedifying
-unedited
-uneducated
-unelectable
-unelected
-unemotional
-unemotionally
-unemployable
-unemployed
-unemployment
-unencrypted
-unencumbered
-unending
-unendingly
-unendurable
-unenforceable
-unengaged
-unenlightened
-unenlightening
-unentered
-unenthusiastic
-unenthusiastically
-unenviable
-unequal
-unequalled
-unequally
-unequivocal
-unequivocally
-unergonomic
-unerring
-unerringly
-unescorted
-unestablished
-unethical
-unethically
-unevaluated
-uneven
-unevenly
-unevenness
-uneventful
-uneventfully
-unexacting
-unexamined
-unexceptionable
-unexceptional
-unexcited
-unexciting
-unexpanded
-unexpected
-unexpectedly
-unexpectedness
-unexpired
-unexplainable
-unexplained
-unexploded
-unexploited
-unexplored
-unexpressed
-unexpurgated
-unfailing
-unfailingly
-unfair
-unfairly
-unfairness
-unfaithful
-unfaithfulness
-unfalsifiable
-unfamiliar
-unfamiliarity
-unfancied
-unfashionable
-unfashionably
-unfasten
-unfastened
-unfastening
-unfathomable
-unfathomed
-unfatigued
-unfavourable
-unfavourably
-unfavoured
-unfeasible
-unfeasibly
-unfed
-unfeeling
-unfeelingly
-unfeigned
-unfelt
-unfeminine
-unfenced
-unfertilised
-unfetchable
-unfettered
-unfilled
-unfinished
-unfired
-unfirm
-unfit
-unfitness
-unfits
-unfitting
-unfix
-unfixed
-unflagging
-unflattering
-unflawed
-unfledged
-unflinching
-unflinchingly
-unfocused
-unfocussed
-unfold
-unfolded
-unfolding
-unfolds
-unforced
-unfordable
-unforeseeable
-unforeseen
-unforgettable
-unforgivable
-unforgivably
-unforgiven
-unforgiving
-unformed
-unforthcoming
-unfortunate
-unfortunately
-unfortunates
-unfounded
-unfreeze
-unfreezing
-unfrequented
-unfriendlier
-unfriendliest
-unfriendliness
-unfriendly
-unfrozen
-unfruitful
-unfulfillable
-unfulfilled
-unfunded
-unfunny
-unfurl
-unfurled
-unfurling
-unfurls
-unfurnished
-unfussy
-ungainly
-ungenerous
-ungenerously
-ungentlemanly
-ungerminated
-unglamorous
-unglazed
-ungodly
-ungovernable
-ungoverned
-ungraceful
-ungracious
-ungraciously
-ungrammatical
-ungrateful
-ungratefully
-ungrounded
-unguarded
-unguessable
-unguided
-ungulates
-unhampered
-unhand
-unhandy
-unhappier
-unhappiest
-unhappily
-unhappiness
-unhappy
-unharmed
-unhealthier
-unhealthiest
-unhealthily
-unhealthy
-unheard
-unheated
-unheeded
-unhelpful
-unhelpfully
-unheralded
-unheroic
-unhesitating
-unhesitatingly
-unhidden
-unhindered
-unhinge
-unhinged
-unholy
-unhonoured
-unhook
-unhooked
-unhooks
-unhoped
-unhuman
-unhurried
-unhurriedly
-unhurt
-unhygienic
-unhyphenated
-unicameral
-unicellular
-unicorn
-unicorns
-unicycle
-unicycles
-unicyclist
-unicyclists
-unideal
-unidentifiable
-unidentified
-unidirectional
-unifiable
-unification
-unified
-unifier
-unifies
-uniform
-uniformed
-uniformity
-uniformly
-uniforms
-unify
-unifying
-unilateral
-unilateralism
-unilateralist
-unilaterally
-unillustrated
-unimaginable
-unimaginably
-unimaginative
-unimaginatively
-unimagined
-unimpaired
-unimpeachable
-unimpeded
-unimplementable
-unimplemented
-unimportance
-unimportant
-unimpressed
-unimpressive
-unimproved
-unincorporated
-uninfected
-uninfluenced
-uninformative
-uninformatively
-uninformed
-uninhabitable
-uninhabited
-uninhibited
-uninhibitedly
-uninitialised
-uninitiated
-uninjured
-uninspired
-uninspiring
-uninsulated
-uninsurable
-uninsured
-unintellectual
-unintelligent
-unintelligible
-unintended
-unintentional
-unintentionally
-uninterested
-uninterestedly
-uninteresting
-uninterpretable
-uninterpreted
-uninterrupted
-uninterruptedly
-unintuitive
-uninvented
-uninvited
-uninviting
-uninvolved
-union
-unionisation
-unionised
-unionism
-unionist
-unionists
-unions
-unipolar
-unique
-uniquely
-uniqueness
-unisex
-unison
-unisons
-unissued
-unit
-unitary
-unite
-united
-unites
-unities
-uniting
-units
-unity
-universal
-universalism
-universalist
-universality
-universally
-universals
-universe
-universes
-universities
-university
-unjam
-unjammed
-unjamming
-unjaundiced
-unjust
-unjustifiable
-unjustifiably
-unjustified
-unjustly
-unjustness
-unkempt
-unkept
-unkind
-unkindest
-unkindly
-unkindness
-unknightly
-unknowable
-unknowing
-unknowingly
-unknown
-unknowns
-unlabelled
-unlace
-unlaced
-unlacing
-unladen
-unladylike
-unlamented
-unlatching
-unlawful
-unlawfully
-unlawfulness
-unleaded
-unlearn
-unlearned
-unleash
-unleashed
-unleashes
-unleashing
-unleavened
-unless
-unlicensed
-unlike
-unlikeable
-unlikeliest
-unlikelihood
-unlikeliness
-unlikely
-unlimited
-unlined
-unlink
-unlinked
-unlisted
-unlit
-unload
-unloaded
-unloading
-unloads
-unlock
-unlocked
-unlocking
-unlocks
-unloose
-unlovable
-unloved
-unlovely
-unloving
-unluckier
-unluckiest
-unluckily
-unlucky
-unmade
-unmagnified
-unmaintainable
-unmaintained
-unmaking
-unmanageable
-unmanageably
-unmanly
-unmanned
-unmannerly
-unmapped
-unmarked
-unmarried
-unmask
-unmasked
-unmasks
-unmatchable
-unmatched
-unmeasurable
-unmechanised
-unmeetable
-unmelodious
-unmemorable
-unmemorised
-unmentionable
-unmentionables
-unmentioned
-unmercifully
-unmerited
-unmet
-unmissable
-unmistakable
-unmistakably
-unmistakeable
-unmistakeably
-unmitigated
-unmixed
-unmnemonic
-unmodifiable
-unmodified
-unmolested
-unmonitored
-unmotivated
-unmounted
-unmoved
-unmoving
-unmusical
-unmusically
-unmutilated
-unmuzzled
-unnamed
-unnatural
-unnaturally
-unnavigable
-unnecessarily
-unnecessary
-unneeded
-unnerve
-unnerved
-unnerving
-unnervingly
-unnoted
-unnoticeable
-unnoticed
-unnumbered
-unobjectionable
-unobliging
-unobservable
-unobservant
-unobserved
-unobstructed
-unobtainable
-unobtrusive
-unobtrusively
-unoccupied
-unofficial
-unofficially
-unopened
-unopposed
-unoptimised
-unordered
-unorganised
-unoriginal
-unoriginality
-unorthodox
-unorthodoxy
-unowned
-unpack
-unpacked
-unpackers
-unpacking
-unpacks
-unpaid
-unpainted
-unpaired
-unpalatable
-unparalleled
-unpardonable
-unparodied
-unpasted
-unpasteurised
-unpatriotic
-unpaved
-unpeeled
-unperceived
-unpersonalised
-unpersuaded
-unpersuasive
-unperturbed
-unphysical
-unpick
-unpicked
-unpicking
-unplaced
-unplanned
-unplayability
-unplayable
-unpleasant
-unpleasantly
-unpleasantness
-unpleasing
-unploughed
-unplug
-unplugged
-unplugging
-unpoetical
-unpolished
-unpolluted
-unpopular
-unpopularity
-unpopulated
-unportable
-unpractical
-unpractised
-unprecedented
-unprecedentedly
-unpredictability
-unpredictable
-unpredictably
-unpredicted
-unprejudiced
-unpremeditated
-unprepared
-unpreparedness
-unprepossessing
-unpressurised
-unpretending
-unpretentious
-unprincipled
-unprintable
-unprinted
-unprivileged
-unproblematic
-unprocessed
-unproductive
-unprofessional
-unprofitable
-unprofitably
-unpromising
-unprompted
-unpronounceable
-unpronounced
-unprotected
-unprovable
-unproved
-unproven
-unprovoked
-unpublicised
-unpublishable
-unpublished
-unpunctual
-unpunctuality
-unpunished
-unqualified
-unquantifiable
-unquantified
-unquenchable
-unquestionable
-unquestionably
-unquestioned
-unquestioning
-unquestioningly
-unquiet
-unquote
-unquoted
-unraisable
-unravel
-unravelled
-unravelling
-unravels
-unreachable
-unreached
-unread
-unreadability
-unreadable
-unready
-unreal
-unrealisable
-unrealised
-unrealistic
-unrealistically
-unreality
-unreasonable
-unreasonableness
-unreasonably
-unreasoned
-unreasoning
-unreceived
-unreceptive
-unrecognisable
-unrecognisably
-unrecognised
-unrecommended
-unreconciled
-unreconstructed
-unrecorded
-unrecoverable
-unredeemed
-unreduced
-unrefereed
-unreferenced
-unreferencing
-unrefined
-unreflected
-unreformed
-unrefreshed
-unrefrigerated
-unregarded
-unregenerate
-unregistered
-unregulated
-unrehearsed
-unrelated
-unreleasable
-unreleased
-unrelenting
-unrelentingly
-unreliability
-unreliable
-unreliably
-unrelieved
-unremarkable
-unremarked
-unremembered
-unremitting
-unremittingly
-unrepairable
-unrepeatability
-unrepeatable
-unrepeated
-unrepentant
-unrepentantly
-unreported
-unrepresentable
-unrepresentative
-unrepresented
-unreproducible
-unrequested
-unrequited
-unreserved
-unreservedly
-unresisting
-unresistingly
-unresolvable
-unresolved
-unresponsive
-unresponsiveness
-unrest
-unrestrained
-unrestricted
-unrests
-unrevealed
-unrevealing
-unrevised
-unrewarded
-unrewarding
-unriddle
-unripe
-unrivalled
-unroll
-unrolled
-unrolling
-unromantic
-unruffled
-unruliness
-unruly
-unsaddled
-unsafe
-unsafely
-unsafeness
-unsaid
-unsaleable
-unsalted
-unsanitary
-unsatisfactorily
-unsatisfactoriness
-unsatisfactory
-unsatisfiable
-unsatisfied
-unsatisfying
-unsaturated
-unsaved
-unsavory
-unsavoury
-unscaled
-unscathed
-unscheduled
-unscientific
-unscramble
-unscrambled
-unscrambles
-unscrambling
-unscratched
-unscrew
-unscrewed
-unscrewing
-unscripted
-unscrupulous
-unseal
-unsealable
-unsealed
-unsealing
-unseasonable
-unseasonably
-unseasonal
-unseat
-unseated
-unseaworthiness
-unsecured
-unseeded
-unseeing
-unseeingly
-unseemly
-unseen
-unselected
-unselfconscious
-unselfconsciously
-unselfish
-unselfishly
-unselfishness
-unsellable
-unsensational
-unsent
-unsentimental
-unserviceable
-unserviced
-unset
-unsettle
-unsettled
-unsettling
-unshackled
-unshaded
-unshakable
-unshakeable
-unshaken
-unshaped
-unshapen
-unsharable
-unshared
-unshaved
-unshaven
-unsheathed
-unshielded
-unshockable
-unshod
-unshorn
-unshrinking
-unsighted
-unsightly
-unsigned
-unsimplified
-unsinkable
-unskilful
-unskilled
-unsliced
-unsmiling
-unsmilingly
-unsmooth
-unsociable
-unsocial
-unsoiled
-unsold
-unsolder
-unsolicited
-unsolvable
-unsolved
-unsophisticated
-unsophistication
-unsorted
-unsought
-unsound
-unsoundness
-unspanned
-unspeakable
-unspeakably
-unspecialised
-unspecific
-unspecified
-unspectacular
-unspent
-unspoiled
-unspoilt
-unspoken
-unsporting
-unstable
-unstack
-unstacked
-unstacking
-unstained
-unstamped
-unstated
-unsteadily
-unsteadiness
-unsteady
-unsterilised
-unsticking
-unstimulated
-unstinting
-unstintingly
-unstirred
-unstoppable
-unstoppably
-unstopped
-unstrapped
-unstressed
-unstretchable
-unstructured
-unstuck
-unsubdued
-unsubsidised
-unsubstantial
-unsubstantiated
-unsubstituted
-unsubtle
-unsubtly
-unsuccessful
-unsuccessfully
-unsuitability
-unsuitable
-unsuitableness
-unsuitably
-unsuited
-unsullied
-unsung
-unsupervised
-unsupportable
-unsupported
-unsuppressed
-unsure
-unsureness
-unsurfaced
-unsurpassable
-unsurpassed
-unsurprised
-unsurprising
-unsurprisingly
-unsurvivable
-unsuspected
-unsuspecting
-unsustainable
-unswappable
-unsweetened
-unswerving
-unswervingly
-unsympathetic
-unsympathetically
-unsystematic
-untactful
-untagged
-untainted
-untalented
-untamed
-untangle
-untangled
-untangling
-untapped
-untarnished
-untasted
-untaught
-untaxed
-untaxing
-untempered
-untenability
-untenable
-untended
-unterminated
-untestable
-untested
-untethered
-untextured
-unthinkable
-unthinkably
-unthinking
-unthinkingly
-unthoughtful
-untidier
-untidiest
-untidily
-untidiness
-untidy
-untie
-untied
-unties
-until
-untimely
-untiring
-untitled
-unto
-untold
-untouchable
-untouchables
-untouched
-untoward
-untraceable
-untraced
-untrained
-untrammelled
-untransformed
-untranslatable
-untranslated
-untransportable
-untrappable
-untreatable
-untreated
-untried
-untrodden
-untroubled
-untrue
-untrusted
-untrustworthy
-untrusty
-untruth
-untruthful
-untruthfully
-untruths
-unturned
-untutored
-untwist
-untwisted
-untying
-untyped
-untypical
-untypically
-unusable
-unusably
-unused
-unusual
-unusually
-unutterable
-unutterably
-unvalidated
-unvalued
-unvanquished
-unvarnished
-unvarying
-unvaryingly
-unveil
-unveiled
-unveiling
-unveils
-unventilated
-unverifiable
-unverified
-unversed
-unvisitable
-unvisited
-unvoiced
-unwanted
-unwarily
-unwarmed
-unwarned
-unwarrantable
-unwarrantably
-unwarranted
-unwary
-unwashed
-unwatchable
-unwatched
-unwavering
-unwaveringly
-unweaned
-unwearied
-unweary
-unwed
-unwedded
-unwedge
-unweighted
-unwelcome
-unwelcoming
-unwell
-unwholesome
-unwieldy
-unwilling
-unwillingly
-unwillingness
-unwind
-unwindable
-unwinding
-unwinds
-unwisdom
-unwise
-unwisely
-unwisest
-unwitting
-unwittingly
-unwontedly
-unworkability
-unworkable
-unworldly
-unworn
-unworried
-unworthily
-unworthiness
-unworthy
-unwound
-unwounded
-unwrap
-unwrapped
-unwrapping
-unwraps
-unwritten
-unyielding
-unzip
-unzipped
-unzipping
-unzips
-up
-upbeat
-upbraid
-upbraided
-upbraiding
-upbraids
-upbringing
-upbringings
-upcast
-upcoming
-updatability
-update
-updated
-updater
-updates
-updating
-upended
-upfield
-upfront
-upgradable
-upgrade
-upgradeable
-upgraded
-upgrades
-upgrading
-upgradings
-upheaval
-upheavals
-upheld
-uphill
-uphold
-upholder
-upholders
-upholding
-upholds
-upholster
-upholstered
-upholsterer
-upholsterers
-upholstery
-upkeep
-upland
-uplands
-uplift
-uplifted
-uplifting
-uplifts
-uplink
-uplinks
-upload
-uploaded
-uploads
-upmarket
-upmost
-upon
-upped
-upper
-uppercase
-upperclass
-uppercut
-uppermost
-uppers
-upraised
-uprate
-uprated
-uprating
-upright
-uprightly
-uprightness
-uprights
-uprise
-uprising
-uprisings
-upriver
-uproar
-uproarious
-uproariously
-uproars
-uproo
-uproot
-uprooted
-uprooting
-uproots
-ups
-upset
-upsets
-upsetting
-upshot
-upside
-upsidedown
-upsilon
-upstage
-upstaged
-upstages
-upstaging
-upstairs
-upstanding
-upstart
-upstarts
-upstream
-upsurge
-upsurges
-upswing
-uptake
-upthrust
-uptotheminute
-uptown
-upturn
-upturned
-upward
-upwardly
-upwards
-upwind
-uranium
-uranus
-urban
-urbane
-urbanely
-urbanisation
-urbanise
-urbanised
-urbanising
-urbanites
-urbanity
-urchin
-urchins
-urea
-ureter
-ureters
-urethane
-urethra
-urethrae
-urethral
-urethras
-urethritis
-urge
-urged
-urgency
-urgent
-urgently
-urges
-urging
-urgings
-urinary
-urine
-urn
-urns
-urologist
-ursine
-urticaria
-uruguay
-us
-usability
-usable
-usage
-usages
-usances
-use
-useable
-used
-useful
-usefully
-usefulness
-useless
-uselessly
-uselessness
-user
-userfriendliness
-userfriendly
-users
-uses
-usher
-ushered
-usherette
-ushering
-ushers
-using
-usual
-usually
-usurer
-usurers
-usurious
-usurp
-usurpation
-usurped
-usurper
-usurping
-usury
-utah
-utensil
-utensils
-uteri
-uterine
-uterus
-utilisation
-utilise
-utilised
-utilises
-utilising
-utilitarian
-utilitarianism
-utilitarians
-utilities
-utility
-utmost
-utopia
-utopian
-utopians
-utopias
-utter
-utterance
-utterances
-uttered
-utterer
-uttering
-utterly
-uttermost
-utters
-uturns
-uvula
-uvular
-vacancies
-vacancy
-vacant
-vacantly
-vacate
-vacated
-vacates
-vacating
-vacation
-vacations
-vaccinate
-vaccinated
-vaccinating
-vaccination
-vaccinations
-vaccine
-vaccines
-vacillate
-vacillating
-vacillation
-vacillations
-vacua
-vacuity
-vacuole
-vacuoles
-vacuous
-vacuously
-vacuum
-vacuums
-vaduz
-vagabond
-vagabonds
-vagrancy
-vagrant
-vagrants
-vague
-vaguely
-vagueness
-vaguer
-vaguest
-vain
-vainer
-vainest
-vainglorious
-vainglory
-vainly
-valance
-vale
-valediction
-valedictory
-valence
-valencies
-valency
-valentine
-vales
-valet
-valets
-valhalla
-valiant
-valiantly
-valid
-validate
-validated
-validates
-validating
-validation
-validity
-validly
-valise
-valley
-valleys
-valour
-valuable
-valuables
-valuation
-valuations
-value
-valueadded
-valued
-valueformoney
-valueless
-valuer
-valuers
-values
-valuing
-valuta
-valve
-valves
-vamp
-vamped
-vamper
-vamping
-vampire
-vampires
-vamps
-van
-vanadium
-vandal
-vandalise
-vandalised
-vandalising
-vandalism
-vandals
-vane
-vaned
-vanes
-vangogh
-vanguard
-vanilla
-vanish
-vanished
-vanishes
-vanishing
-vanishingly
-vanities
-vanity
-vanquish
-vanquished
-vanquishing
-vans
-vantage
-vapid
-vaporisation
-vaporise
-vaporised
-vaporising
-vaporous
-vapour
-vapours
-variability
-variable
-variables
-variably
-variance
-variances
-variant
-variants
-variate
-variates
-variation
-variational
-variations
-varicose
-varied
-variegated
-varies
-varietal
-varieties
-variety
-various
-variously
-varnish
-varnished
-varnishes
-varnishing
-varsity
-vary
-varying
-vascular
-vase
-vasectomies
-vasectomy
-vaseline
-vases
-vassal
-vassalage
-vassals
-vast
-vaster
-vastly
-vastness
-vat
-vatican
-vats
-vault
-vaulted
-vaulting
-vaults
-vaunted
-vaunting
-veal
-vector
-vectored
-vectoring
-vectorisation
-vectorised
-vectors
-veer
-veered
-veering
-veers
-veg
-vegan
-vegans
-vegetable
-vegetables
-vegetarian
-vegetarianism
-vegetarians
-vegetate
-vegetated
-vegetating
-vegetation
-vegetational
-vegetative
-vegetive
-veggies
-vehemence
-vehement
-vehemently
-vehicle
-vehicles
-vehicular
-veil
-veiled
-veiling
-veils
-vein
-veined
-veins
-velar
-veld
-veldt
-vellum
-velocipede
-velocities
-velocity
-velodrome
-velour
-velum
-velvet
-velveteen
-velveteens
-velvets
-velvety
-venal
-venality
-vend
-venders
-vendetta
-vendettas
-vending
-vendor
-vendors
-vends
-veneer
-veneered
-veneers
-venerable
-venerate
-venerated
-venerates
-venerating
-veneration
-venereal
-venetian
-vengeance
-vengeful
-vengefully
-venial
-venice
-venison
-venom
-venomous
-venomously
-venoms
-venose
-venous
-vent
-vented
-ventilate
-ventilated
-ventilating
-ventilation
-ventilator
-ventilators
-venting
-ventings
-ventral
-ventrally
-ventricle
-ventricles
-ventricular
-ventriloquism
-ventriloquist
-ventriloquists
-ventriloquy
-vents
-venture
-ventured
-venturer
-ventures
-venturesome
-venturing
-venue
-venues
-venus
-veracity
-veranda
-verandah
-verandahs
-verandas
-verb
-verbal
-verbalise
-verbally
-verbals
-verbatim
-verbiage
-verbose
-verbosely
-verboseness
-verbosity
-verbs
-verdant
-verdict
-verdicts
-verdigris
-verdure
-verge
-verged
-verger
-verges
-verging
-verifiability
-verifiable
-verification
-verifications
-verified
-verifier
-verifiers
-verifies
-verify
-verifying
-verily
-verisimilitude
-veritable
-veritably
-verities
-verity
-vermilion
-vermin
-verminous
-vernacular
-vernal
-vernier
-verona
-versatile
-versatility
-verse
-versed
-verses
-versicle
-versification
-versifier
-version
-versions
-versus
-vertebra
-vertebrae
-vertebral
-vertebrate
-vertebrates
-vertex
-vertical
-verticality
-vertically
-verticals
-vertices
-vertiginous
-vertigo
-verve
-very
-vesicle
-vesicles
-vesicular
-vespers
-vessel
-vessels
-vest
-vestal
-vested
-vestibular
-vestibule
-vestibules
-vestige
-vestiges
-vestigial
-vesting
-vestment
-vestments
-vestry
-vests
-vesuvius
-vet
-veteran
-veterans
-veterinary
-veto
-vetoed
-vetoing
-vets
-vetted
-vetting
-vex
-vexation
-vexations
-vexatious
-vexed
-vexes
-vexing
-via
-viability
-viable
-viably
-viaduct
-viaducts
-vial
-vials
-vibes
-vibrancy
-vibrant
-vibrantly
-vibrate
-vibrated
-vibrates
-vibrating
-vibration
-vibrational
-vibrationally
-vibrations
-vibrato
-vibrator
-vibrators
-vibratory
-vicar
-vicarage
-vicarages
-vicarious
-vicariously
-vicars
-vice
-vicechancellor
-vicechancellors
-vicepresidency
-vicepresident
-vicepresidential
-vicepresidents
-viceroy
-viceroys
-vices
-vicinities
-vicinity
-vicious
-viciously
-viciousness
-vicissitude
-vicissitudes
-victim
-victimisation
-victimise
-victimised
-victimises
-victimising
-victimless
-victims
-victor
-victoria
-victories
-victorious
-victoriously
-victors
-victory
-victualling
-victuals
-video
-videoconferencing
-videodisc
-videoed
-videoing
-videophone
-videos
-videotape
-videotaped
-videotapes
-videotaping
-vie
-vied
-vienna
-vier
-vies
-view
-viewable
-viewed
-viewer
-viewers
-viewfinder
-viewfinders
-viewing
-viewings
-viewpoint
-viewpoints
-views
-vigil
-vigilance
-vigilant
-vigilante
-vigilantes
-vigilantly
-vigils
-vignette
-vignettes
-vigorous
-vigorously
-vigour
-viking
-vikings
-vile
-vilely
-vileness
-viler
-vilest
-vilification
-vilified
-vilify
-vilifying
-villa
-village
-villager
-villagers
-villages
-villain
-villainous
-villains
-villainy
-villas
-vim
-vims
-vindicate
-vindicated
-vindicates
-vindicating
-vindication
-vindictive
-vindictively
-vindictiveness
-vine
-vinegar
-vinegars
-vines
-vineyard
-vineyards
-vino
-vintage
-vintages
-vintner
-vinyl
-vinyls
-viol
-viola
-violas
-violate
-violated
-violates
-violating
-violation
-violations
-violator
-violators
-violence
-violent
-violently
-violet
-violets
-violin
-violinist
-violinists
-violins
-violist
-viper
-vipers
-virago
-viral
-virgil
-virgin
-virginal
-virginia
-virginity
-virgins
-virile
-virility
-virology
-virtual
-virtually
-virtue
-virtues
-virtuosi
-virtuosic
-virtuosity
-virtuoso
-virtuous
-virtuously
-virulence
-virulent
-virulently
-virus
-viruses
-visa
-visage
-visas
-viscose
-viscosity
-viscount
-viscounts
-viscous
-vise
-visibilities
-visibility
-visible
-visibly
-vision
-visionaries
-visionary
-visions
-visit
-visitable
-visitant
-visitation
-visitations
-visited
-visiting
-visitor
-visitors
-visits
-visor
-visors
-vista
-vistas
-visual
-visualisation
-visualise
-visualised
-visualising
-visually
-visuals
-vital
-vitalise
-vitality
-vitally
-vitals
-vitamin
-vitamins
-vitiate
-vitiated
-vitiates
-vitiating
-vitreous
-vitrified
-vitriol
-vitriolic
-vituperate
-vituperation
-vituperative
-viva
-vivacious
-vivaciously
-vivacity
-vivid
-vividly
-vividness
-vivified
-vivisected
-vivisection
-vivisectionist
-vivisectionists
-vixen
-vixens
-vizier
-vocabularies
-vocabulary
-vocal
-vocalisation
-vocalisations
-vocalise
-vocalised
-vocalising
-vocalist
-vocalists
-vocally
-vocals
-vocation
-vocational
-vocationally
-vocations
-vocative
-vociferous
-vociferously
-vodka
-vogue
-voice
-voiced
-voiceless
-voices
-voicing
-voicings
-void
-voidable
-voided
-voiding
-voids
-voile
-volatile
-volatiles
-volatility
-volcanic
-volcanically
-volcanism
-volcano
-vole
-voles
-volga
-volition
-volley
-volleyball
-volleyed
-volleying
-volleys
-volt
-voltage
-voltages
-voltmeter
-volts
-volubility
-voluble
-volubly
-volume
-volumes
-volumetric
-voluminous
-voluntarily
-voluntary
-volunteer
-volunteered
-volunteering
-volunteers
-voluptuous
-voluptuously
-voluptuousness
-volute
-vomit
-vomited
-vomiting
-vomits
-voodoo
-voracious
-voraciously
-voracity
-vortex
-vortexes
-vortices
-vorticity
-vote
-voted
-voteless
-voter
-voters
-votes
-voting
-votive
-vouch
-vouched
-voucher
-vouchers
-vouches
-vouchsafe
-vouchsafed
-vouchsafing
-vow
-vowed
-vowel
-vowels
-vowing
-vows
-voyage
-voyaged
-voyager
-voyagers
-voyages
-voyaging
-voyeur
-voyeurism
-voyeuristic
-voyeurs
-vulcan
-vulcanise
-vulcanised
-vulcanism
-vulcanologist
-vulgar
-vulgarities
-vulgarity
-vulgarly
-vulgate
-vulnerabilities
-vulnerability
-vulnerable
-vulpine
-vulture
-vultures
-vulva
-vying
-wackier
-wacky
-wad
-wadding
-waddle
-waddled
-waddles
-waddling
-wade
-waded
-wader
-waders
-wades
-wadi
-wading
-wadings
-wadis
-wads
-wafer
-wafers
-waffle
-waffled
-waffles
-waft
-wafted
-wafting
-wafts
-wafture
-wag
-wage
-waged
-wager
-wagered
-wagerer
-wagers
-wages
-wagged
-waggery
-wagging
-waggish
-waggishly
-waggle
-waggled
-waggles
-waggling
-waggly
-waggoners
-waggons
-waging
-wagon
-wagons
-wags
-wagtail
-wagtails
-waif
-waifs
-wail
-wailed
-wailer
-wailing
-wails
-wainscot
-wainscoting
-waist
-waistband
-waistcoat
-waistcoats
-waistline
-waists
-wait
-waited
-waiter
-waiters
-waiting
-waitress
-waitresses
-waits
-waive
-waived
-waiver
-waivers
-waives
-waiving
-wake
-waked
-wakeful
-wakefulness
-waken
-wakened
-wakening
-wakens
-wakes
-waking
-wales
-walk
-walkable
-walkabout
-walkabouts
-walked
-walker
-walkers
-walkietalkie
-walkietalkies
-walking
-walkout
-walkover
-walks
-walkway
-walkways
-wall
-wallabies
-wallaby
-wallchart
-walled
-wallet
-wallets
-wallflower
-wallflowers
-walling
-wallop
-wallow
-wallowed
-wallowing
-wallows
-wallpaper
-wallpapering
-wallpapers
-walls
-walltowall
-walnut
-walnuts
-walrus
-walruses
-waltz
-waltzed
-waltzes
-waltzing
-wan
-wand
-wander
-wandered
-wanderer
-wanderers
-wandering
-wanderings
-wanderlust
-wanders
-wands
-wane
-waned
-wanes
-waning
-wanly
-want
-wanted
-wanting
-wanton
-wantonly
-wantonness
-wants
-wapiti
-wapitis
-war
-warble
-warbled
-warbler
-warblers
-warbles
-warbling
-ward
-warded
-warden
-wardens
-warder
-warders
-warding
-wardrobe
-wardrobes
-wards
-wardship
-ware
-warehouse
-warehoused
-warehouseman
-warehousemen
-warehouses
-warehousing
-wares
-warfare
-warhead
-warheads
-warhorse
-warhorses
-wariest
-warily
-wariness
-waring
-warlike
-warlock
-warlocks
-warlord
-warlords
-warm
-warmblooded
-warmed
-warmer
-warmers
-warmest
-warmhearted
-warmheartedness
-warming
-warmish
-warmly
-warmness
-warmonger
-warms
-warmth
-warmup
-warn
-warned
-warners
-warning
-warningly
-warnings
-warns
-warp
-warpaint
-warpath
-warped
-warping
-warplanes
-warps
-warrant
-warranted
-warranties
-warranting
-warrants
-warranty
-warred
-warren
-warrens
-warring
-warrior
-warriors
-wars
-warsaw
-warship
-warships
-wart
-warthog
-warthogs
-wartime
-warts
-warty
-wary
-was
-wash
-washable
-washbasin
-washbasins
-washboard
-washday
-washed
-washer
-washers
-washerwoman
-washerwomen
-washes
-washing
-washings
-washington
-washout
-washstand
-washy
-wasp
-waspish
-waspishly
-wasps
-waspwaisted
-wast
-wastage
-wastages
-waste
-wasted
-wasteful
-wastefully
-wastefulness
-wasteland
-wastelands
-wastepaper
-waster
-wasters
-wastes
-wasting
-wastings
-wastrel
-watch
-watchable
-watchdog
-watchdogs
-watched
-watcher
-watchers
-watches
-watchful
-watchfully
-watchfulness
-watching
-watchmaker
-watchmakers
-watchman
-watchmen
-watchtower
-watchtowers
-watchword
-watchwords
-water
-waterbed
-waterbeds
-watercolour
-watercolourists
-watercolours
-watercooled
-watercourse
-watercourses
-watercress
-watered
-waterfall
-waterfalls
-waterfowl
-waterfront
-waterglass
-waterhole
-waterholes
-watering
-waterless
-waterline
-waterlogged
-waterloo
-waterman
-watermark
-watermarks
-watermelon
-watermelons
-watermen
-watermill
-watermills
-waterproof
-waterproofed
-waterproofing
-waterproofs
-waterresistant
-waters
-watershed
-watersheds
-waterside
-waterskiing
-watersoluble
-waterspouts
-watertable
-watertight
-waterway
-waterways
-waterwheel
-waterwheels
-waterworks
-watery
-watt
-wattage
-wattle
-watts
-wave
-waveband
-wavebands
-waved
-waveform
-waveforms
-wavefront
-waveguide
-waveguides
-wavelength
-wavelengths
-wavelet
-wavelets
-wavelike
-waver
-wavered
-waverers
-wavering
-wavers
-waves
-wavier
-waviest
-wavily
-waving
-wavings
-wavy
-wax
-waxed
-waxen
-waxes
-waxing
-waxpaper
-waxwork
-waxworks
-waxy
-way
-wayout
-ways
-wayside
-wayward
-waywardly
-waywardness
-we
-weak
-weaken
-weakened
-weakening
-weakens
-weaker
-weakest
-weakish
-weakkneed
-weakling
-weaklings
-weakly
-weakminded
-weakness
-weaknesses
-weal
-wealth
-wealthier
-wealthiest
-wealthy
-wean
-weaned
-weaning
-weanling
-weans
-weapon
-weaponry
-weapons
-wear
-wearable
-wearer
-wearers
-wearied
-wearier
-wearies
-weariest
-wearily
-weariness
-wearing
-wearisome
-wears
-weary
-wearying
-wearyingly
-weasel
-weaselling
-weaselly
-weasels
-weather
-weatherbeaten
-weatherbound
-weathercock
-weathercocks
-weathered
-weathering
-weatherman
-weathermen
-weatherproof
-weathers
-weathervane
-weatherworn
-weave
-weaved
-weaver
-weavers
-weaves
-weaving
-weavings
-web
-webbed
-webbing
-webby
-webfoot
-webs
-website
-wed
-wedded
-wedding
-weddings
-wedge
-wedged
-wedges
-wedging
-wedlock
-weds
-wee
-weed
-weeded
-weedier
-weediest
-weeding
-weedkiller
-weedkillers
-weeds
-weedy
-week
-weekday
-weekdays
-weekend
-weekenders
-weekends
-weeklies
-weekly
-weeks
-ween
-weeny
-weep
-weeper
-weeping
-weepings
-weeps
-weepy
-weevil
-weevils
-weigh
-weighbridge
-weighed
-weighing
-weighs
-weight
-weighted
-weightier
-weightiest
-weightily
-weighting
-weightings
-weightless
-weightlessly
-weightlessness
-weightlifter
-weightlifters
-weightlifting
-weights
-weighty
-weir
-weird
-weirder
-weirdest
-weirdly
-weirdness
-weirdo
-weirs
-welcome
-welcomed
-welcomer
-welcomes
-welcoming
-weld
-welded
-welder
-welders
-welding
-welds
-welfare
-well
-welladjusted
-wellbalanced
-wellbehaved
-wellbeing
-wellbeloved
-wellborn
-wellbred
-wellbuilt
-wellchosen
-wellconnected
-welldefined
-welldeserved
-welldesigned
-welldeveloped
-welldisposed
-welldressed
-wellearned
-welled
-welleducated
-wellendowed
-wellequipped
-wellestablished
-wellfed
-wellformed
-wellfounded
-wellgrounded
-wellhead
-wellinformed
-welling
-wellington
-wellingtons
-wellintentioned
-wellkept
-wellknown
-wellliked
-wellloved
-wellmade
-wellmannered
-wellmarked
-wellmatched
-wellmeaning
-wellmeant
-welloff
-wellordered
-wellorganised
-wellpaid
-wellplaced
-wellprepared
-wellpreserved
-wellread
-wellreceived
-wellrounded
-wells
-wellspoken
-wellstructured
-wellsupported
-welltaken
-wellthoughtout
-welltimed
-welltodo
-welltried
-wellused
-wellwisher
-wellwishers
-wellworn
-welly
-welsh
-welshman
-welt
-welter
-weltering
-welters
-welterweight
-welts
-wench
-wenches
-wend
-wended
-wending
-wends
-went
-wept
-were
-werewolf
-werewolves
-west
-westbound
-westerly
-western
-westerner
-westerners
-westernisation
-westernised
-westernmost
-westerns
-westward
-westwards
-wet
-wether
-wetland
-wetlands
-wetly
-wetness
-wets
-wetsuit
-wetsuits
-wettable
-wetted
-wetter
-wettest
-wetting
-whack
-whacked
-whacker
-whacko
-whacks
-whale
-whalebone
-whaler
-whalers
-whales
-whaling
-wham
-whap
-wharf
-wharfs
-wharves
-what
-whatever
-whatnot
-whatsoever
-wheals
-wheat
-wheatears
-wheaten
-wheatgerm
-wheats
-whee
-wheedle
-wheedled
-wheedling
-wheel
-wheelbarrow
-wheelbarrows
-wheelbase
-wheelchair
-wheelchairs
-wheeled
-wheeler
-wheelers
-wheelhouse
-wheelie
-wheeling
-wheels
-wheelwright
-wheelwrights
-wheeze
-wheezed
-wheezes
-wheezing
-wheezy
-whelk
-whelked
-whelks
-whelp
-when
-whence
-whenever
-where
-whereabouts
-whereas
-whereby
-wherefore
-wherefores
-wherein
-whereof
-whereon
-wheresoever
-whereto
-whereupon
-wherever
-wherewith
-wherewithal
-wherry
-whet
-whether
-whetstone
-whetstones
-whetted
-whetting
-whey
-which
-whichever
-whiff
-whiffs
-while
-whiled
-whiles
-whiling
-whilst
-whim
-whimper
-whimpered
-whimpering
-whimpers
-whims
-whimsical
-whimsically
-whimsy
-whine
-whined
-whines
-whining
-whinnied
-whinny
-whinnying
-whip
-whipcord
-whiplash
-whipped
-whipper
-whippet
-whippets
-whipping
-whippy
-whips
-whir
-whirl
-whirled
-whirligig
-whirling
-whirlpool
-whirlpools
-whirls
-whirlwind
-whirlwinds
-whirr
-whirred
-whirring
-whisk
-whisked
-whisker
-whiskers
-whiskery
-whiskey
-whiskeys
-whiskies
-whisking
-whisks
-whisky
-whisper
-whispered
-whisperers
-whispering
-whisperings
-whispers
-whist
-whistle
-whistled
-whistler
-whistles
-whistling
-whists
-white
-whitebait
-whiteboards
-whitecollar
-whitely
-whiten
-whitened
-whitener
-whiteness
-whitening
-whitens
-whiter
-whites
-whitest
-whitewash
-whitewashed
-whitewashing
-whither
-whiting
-whitish
-whittle
-whittled
-whittling
-whizkids
-whizz
-whizzkid
-who
-whoa
-whodunit
-whodunnit
-whoever
-whole
-wholefood
-wholegrain
-wholehearted
-wholeheartedly
-wholemeal
-wholeness
-wholes
-wholesale
-wholesaler
-wholesalers
-wholesaling
-wholesome
-wholesomely
-wholesomeness
-wholewheat
-wholly
-whom
-whomever
-whomsoever
-whoop
-whooped
-whooping
-whoops
-whoosh
-whop
-whore
-whorehouse
-whores
-whoring
-whorled
-whorls
-whose
-whosoever
-why
-whys
-wick
-wicked
-wickedest
-wickedly
-wickedness
-wicker
-wickerwork
-wicket
-wicketkeeper
-wicketkeepers
-wicketkeeping
-wickets
-wicks
-wide
-wideeyed
-widely
-widen
-widened
-wideness
-widening
-widens
-wideopen
-wider
-wideranging
-wides
-widescreen
-widespread
-widest
-widgeon
-widget
-widow
-widowed
-widower
-widowers
-widowhood
-widows
-width
-widths
-wield
-wielded
-wielder
-wielding
-wields
-wife
-wifeless
-wifely
-wig
-wigeon
-wigeons
-wigging
-wiggle
-wiggled
-wiggler
-wiggles
-wiggling
-wigs
-wigwam
-wigwams
-wild
-wildcat
-wildcats
-wildebeest
-wilder
-wilderness
-wildernesses
-wildest
-wildeyed
-wildfire
-wildfires
-wildfowl
-wildlife
-wildly
-wildness
-wildoats
-wilds
-wile
-wiles
-wilful
-wilfully
-wilfulness
-wilier
-wiliest
-wiling
-will
-willed
-willing
-willingly
-willingness
-willow
-willows
-willowy
-willpower
-wills
-willynilly
-wilt
-wilted
-wilting
-wilts
-wily
-wimp
-wimple
-wimpy
-win
-wince
-winced
-winces
-winch
-winched
-winches
-winching
-wincing
-wind
-windbag
-windbags
-windbreak
-windcheater
-windcheaters
-winded
-winder
-winders
-windfall
-windfalls
-windier
-windiest
-windily
-winding
-windings
-windlass
-windless
-windmill
-windmills
-window
-windowed
-windowing
-windowless
-windows
-windowshop
-windowshopping
-windpipe
-winds
-windscreen
-windscreens
-windsock
-windsor
-windsurf
-windsurfer
-windsurfers
-windsurfing
-windswept
-windward
-windy
-wine
-wined
-wineglass
-wineglasses
-winemakers
-winery
-wines
-wineskin
-wing
-winged
-winger
-wingers
-winging
-wingless
-wings
-wingspan
-wining
-wink
-winked
-winker
-winkers
-winking
-winkle
-winkled
-winkles
-winks
-winnable
-winner
-winners
-winning
-winningly
-winnings
-winnow
-winnowing
-wins
-winsome
-winter
-wintered
-wintering
-winters
-wintertime
-wintery
-wintrier
-wintriest
-wintry
-wipe
-wiped
-wiper
-wipers
-wipes
-wiping
-wire
-wired
-wireless
-wirer
-wires
-wirier
-wiriest
-wiring
-wirings
-wiry
-wisdom
-wisdoms
-wise
-wisecracks
-wiseguys
-wisely
-wiser
-wisest
-wish
-wishbone
-wished
-wishes
-wishful
-wishfully
-wishing
-wishywashy
-wisp
-wisps
-wispy
-wistful
-wistfully
-wistfulness
-wit
-witch
-witchcraft
-witchdoctor
-witchdoctors
-witchery
-witches
-witchhunt
-witchhunts
-witchlike
-with
-withdraw
-withdrawal
-withdrawals
-withdrawing
-withdrawn
-withdraws
-withdrew
-wither
-withered
-withering
-witheringly
-withers
-withheld
-withhold
-withholding
-withholds
-within
-without
-withstand
-withstanding
-withstands
-withstood
-witless
-witness
-witnessed
-witnesses
-witnessing
-wits
-witter
-wittering
-witticism
-witticisms
-wittier
-wittiest
-wittily
-wittiness
-witting
-wittingly
-witty
-wives
-wizard
-wizardry
-wizards
-wizened
-woad
-wobble
-wobbled
-wobbler
-wobbles
-wobblier
-wobbliest
-wobbling
-wobbly
-wodan
-wodge
-woe
-woebegone
-woeful
-woefully
-woes
-wok
-woke
-woken
-woks
-wold
-wolds
-wolf
-wolfcubs
-wolfed
-wolfhound
-wolfhounds
-wolfish
-wolfishly
-wolfwhistles
-wolves
-woman
-womanhood
-womanise
-womaniser
-womanish
-womanising
-womankind
-womanliness
-womanly
-womans
-womb
-wombat
-wombats
-wombs
-women
-womenfolk
-won
-wonder
-wondered
-wonderful
-wonderfully
-wonderfulness
-wondering
-wonderingly
-wonderland
-wonderment
-wonders
-wondrous
-wondrously
-wont
-woo
-wood
-woodbine
-woodcock
-woodcocks
-woodcut
-woodcuts
-woodcutter
-woodcutters
-wooded
-wooden
-woodenly
-woodenness
-woodland
-woodlands
-woodlice
-woodlouse
-woodman
-woodmen
-woodpecker
-woodpeckers
-woodpile
-woods
-woodshed
-woodsman
-woodsmoke
-woodwind
-woodwork
-woodworker
-woodworkers
-woodworking
-woodworm
-woody
-wooed
-wooer
-woof
-woofer
-woofers
-wooing
-wool
-woollen
-woollens
-woollier
-woollies
-woollike
-woolliness
-woolly
-wools
-wooly
-woos
-word
-wordage
-worded
-wordgame
-wordier
-wordiest
-wordiness
-wording
-wordings
-wordless
-wordlessly
-wordplay
-wordprocessing
-words
-wordsmith
-wordy
-wore
-work
-workability
-workable
-workaday
-workbench
-workbook
-workbooks
-workday
-workdays
-worked
-worker
-workers
-workfare
-workforce
-workforces
-workhorse
-workhorses
-workhouse
-workhouses
-working
-workings
-workless
-workload
-workloads
-workman
-workmanlike
-workmanship
-workmate
-workmates
-workmen
-workout
-workouts
-workpeople
-workpiece
-workpieces
-workplace
-workplaces
-workroom
-workrooms
-works
-worksheet
-worksheets
-workshop
-workshops
-workshy
-workspace
-workstation
-workstations
-worktop
-worktops
-workweek
-world
-worldclass
-worldfamous
-worldliness
-worldly
-worlds
-worldwar
-worldwide
-worm
-wormhole
-wormholes
-worming
-wormlike
-worms
-wormy
-worn
-worried
-worriedly
-worrier
-worriers
-worries
-worrisome
-worry
-worrying
-worryingly
-worse
-worsen
-worsened
-worsening
-worsens
-worser
-worship
-worshipful
-worshipped
-worshipper
-worshippers
-worshipping
-worships
-worst
-worsted
-worth
-worthier
-worthies
-worthiest
-worthily
-worthiness
-worthless
-worthlessness
-worthwhile
-worthy
-would
-wound
-wounded
-wounding
-wounds
-wove
-woven
-wow
-wowed
-wows
-wrack
-wracked
-wraith
-wraiths
-wrangle
-wrangled
-wrangler
-wrangles
-wrangling
-wrap
-wraparound
-wrapped
-wrapper
-wrappers
-wrapping
-wrappings
-wraps
-wrasse
-wrath
-wrathful
-wrathfully
-wraths
-wreak
-wreaked
-wreaking
-wreaks
-wreath
-wreathe
-wreathed
-wreathes
-wreathing
-wreaths
-wreck
-wreckage
-wrecked
-wrecker
-wreckers
-wrecking
-wrecks
-wren
-wrench
-wrenched
-wrenches
-wrenching
-wrens
-wrest
-wrested
-wresting
-wrestle
-wrestled
-wrestler
-wrestlers
-wrestles
-wrestling
-wretch
-wretched
-wretchedly
-wretchedness
-wretches
-wriggle
-wriggled
-wriggles
-wriggling
-wriggly
-wright
-wring
-wringer
-wringing
-wrings
-wrinkle
-wrinkled
-wrinkles
-wrinkling
-wrinkly
-wrist
-wristband
-wristbands
-wrists
-wristwatch
-writ
-writable
-write
-writer
-writers
-writes
-writhe
-writhed
-writhes
-writhing
-writing
-writings
-writs
-written
-wrong
-wrongdoer
-wrongdoers
-wrongdoing
-wrongdoings
-wronged
-wronger
-wrongest
-wrongful
-wrongfully
-wronging
-wrongly
-wrongness
-wrongs
-wrote
-wrought
-wroughtiron
-wrung
-wry
-wryly
-wryness
-wunderkind
-xenon
-xenophobe
-xenophobia
-xenophobic
-xerography
-xhosa
-xhosas
-xmas
-xray
-xrayed
-xraying
-xrays
-xylophone
-xylophonist
-yacht
-yachting
-yachts
-yachtsman
-yachtsmen
-yak
-yaks
-yale
-yalelock
-yam
-yams
-yank
-yankee
-yankees
-yanks
-yap
-yapping
-yaps
-yard
-yardage
-yards
-yardstick
-yardsticks
-yarn
-yarns
-yaw
-yawed
-yawl
-yawls
-yawn
-yawned
-yawning
-yawningly
-yawns
-yaws
-ye
-yea
-yeah
-yeaned
-year
-yearbook
-yearbooks
-yearling
-yearlings
-yearlong
-yearly
-yearn
-yearned
-yearning
-yearningly
-yearnings
-yearns
-years
-yeas
-yeast
-yeasts
-yeasty
-yell
-yelled
-yelling
-yellings
-yellow
-yellowed
-yellower
-yellowing
-yellowish
-yellows
-yellowy
-yells
-yelp
-yelped
-yelping
-yelpings
-yelps
-yemen
-yen
-yens
-yeoman
-yeomanry
-yeomen
-yep
-yes
-yesterday
-yesterdays
-yesteryear
-yet
-yeti
-yetis
-yew
-yews
-yiddish
-yield
-yielded
-yielding
-yields
-yip
-yippee
-yodel
-yodelled
-yodeller
-yodelling
-yodels
-yoga
-yogi
-yoke
-yoked
-yokel
-yokels
-yokes
-yolk
-yolks
-yon
-yonder
-yore
-york
-yorker
-yorkers
-you
-young
-younger
-youngest
-youngish
-youngster
-youngsters
-your
-yours
-yourself
-yourselves
-youth
-youthful
-youthfulness
-youths
-yowl
-yoyo
-yrs
-yttrium
-yuck
-yukon
-yule
-yuletide
-yummiest
-yummy
-yuppie
-yuppies
-zag
-zaire
-zambezi
-zambia
-zambian
-zambians
-zaniest
-zany
-zanzibar
-zap
-zapping
-zappy
-zaps
-zeal
-zealot
-zealotry
-zealots
-zealous
-zealously
-zealousness
-zeals
-zebra
-zebras
-zebu
-zebus
-zees
-zenith
-zeniths
-zeolite
-zeolites
-zephyr
-zephyrs
-zeppelin
-zero
-zeroed
-zeroing
-zest
-zestfully
-zesty
-zeta
-zeus
-zig
-zigzag
-zigzagged
-zigzagging
-zigzags
-zillion
-zillions
-zimbabwe
-zinc
-zion
-zionism
-zionist
-zionists
-zip
-zipped
-zipper
-zippers
-zipping
-zippy
-zips
-zither
-zithers
-zombi
-zombie
-zombies
-zonal
-zonation
-zone
-zoned
-zones
-zoning
-zoo
-zookeepers
-zoological
-zoologist
-zoologists
-zoology
-zoom
-zoomed
-zooming
-zooms
-zooplankton
-zoos
-zulu
-zulus
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/AggregateLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/AggregateLight.scala
deleted file mode 100644
index 2eaddd7572..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/AggregateLight.scala
+++ /dev/null
@@ -1,39 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-import scala.collection.parallel.mutable.ParArray
-import extra166y.{ParallelArray => JSR166Array}
-
-
-object AggregateLight extends Companion {
- def benchName = "aggregate-light";
- def apply(sz: Int, parallelism: Int, what: String) = new AggregateLight(sz, parallelism, what)
- override def comparisons = List()
- override def defaultSize = 200000
-
- val seqop = (a: Cont, b: Cont) => b
- val combop = (a: Cont, b: Cont) => a
-}
-
-
-class AggregateLight(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = AggregateLight
- override def repetitionsPerRun = 350
- override val runs = 20
-
- def runpar = pa.aggregate(new Cont(0))(companion.seqop, companion.combop)
- def runseq = sequentialReduce(companion.seqop, sz, new Cont(0))
- override def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Companion.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Companion.scala
deleted file mode 100644
index f5d6c75abb..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Companion.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-trait Companion extends BenchCompanion {
- def collectionName = "ParArray"
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CopyToArray.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CopyToArray.scala
deleted file mode 100644
index 033921d451..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CopyToArray.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-object CopyToArray extends Companion {
- def benchName = "copytoarray";
- def apply(sz: Int, parallelism: Int, what: String) = new CopyToArray(sz, parallelism, what)
- override def comparisons = List()
- override def defaultSize = 200000
-}
-
-class CopyToArray(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = CopyToArray
- val destarr = new Array[Any](sz)
-
- def runpar = pa.copyToArray(destarr, 0, sz)
- def runseq = sequentialCopyToArray(destarr, 0, sz)
- def comparisonMap = collection.Map()
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Corresponds.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Corresponds.scala
deleted file mode 100644
index c9b3f07ff3..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Corresponds.scala
+++ /dev/null
@@ -1,47 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class Corresponds(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont])
-with HavingResult[Boolean] {
- def companion = Corresponds
- override def repetitionsPerRun = 400
-
- val same = {
- val p = new collection.parallel.mutable.ParArray[Cont](sz)
- for (i <- 0 until sz) p(i) = what match {
- case "seq" => arr(i).asInstanceOf[Cont]
- case "par" => pa(i)
- }
- p
- }
-
- def runpar = runresult = pa.corresponds(same)(corr)
- def runseq = runresult = sequentialCorresponds(same, corr, sz)
- override def comparisonMap = collection.Map()
-
- val corr = (a: Cont, b: Cont) => a.in == b.in
-}
-
-object Corresponds extends Companion {
- def benchName = "corresponds";
- def apply(sz: Int, p: Int, what: String) = new Corresponds(sz, p, what)
- override def comparisons = List()
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountHeavy.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountHeavy.scala
deleted file mode 100644
index 7438be8447..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountHeavy.scala
+++ /dev/null
@@ -1,36 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-object CountHeavy extends Companion {
- def benchName = "count-heavy";
- def apply(sz: Int, parallelism: Int, what: String) = new CountHeavy(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 16
-
- val pred = (a: Cont) => heavyCheck(a)
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = heavyCheck(a)
- }
-
- def heavyCheck(a: Cont) = {
- val n = a.in
- (n until (n + 200)).map(checkPrime(_)).reduceLeft(_ && _)
- }
- def checkPrime(n: Int) = {
- var isPrime = true
- for (i <- 2 until (scala.math.sqrt(n).toInt + 1)) if (n % i == 0) isPrime = false
- isPrime
- }
-}
-
-class CountHeavy(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = CountHeavy
-
- def runpar = pa.count(CountHeavy.pred)
- def runseq = sequentialCount(CountHeavy.pred, sz)
- def runjsr = jsrarr.withFilter(CountHeavy.predjsr).size
- def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountLight.scala
deleted file mode 100644
index 21c64358b4..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountLight.scala
+++ /dev/null
@@ -1,22 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-object CountLight extends Companion {
- def benchName = "count-light";
- def apply(sz: Int, parallelism: Int, what: String) = new CountLight(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 200000
-}
-
-class CountLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = CountLight
-
- def runpar = pa.count(Cont.pred)
- def runseq = sequentialCount(Cont.pred, sz)
- def runjsr = jsrarr.withFilter(Cont.predjsr).size
- def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountList.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountList.scala
deleted file mode 100644
index 9c6ac19229..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/CountList.scala
+++ /dev/null
@@ -1,30 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-object CountList extends Companion {
- def benchName = "count-list";
- def apply(sz: Int, parallelism: Int, what: String) = new CountList(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 1000
-
- val listCreator = (i: Int) => (0 until (i % 50 + 50)).toList
- val pred = (lst: List[Int]) => check(lst)
- val predjsr = new extra166y.Ops.Predicate[List[Int]] {
- def op(lst: List[Int]) = check(lst)
- }
-
- def check(lst: List[Int]) = lst.foldLeft(0)((sum, n) => sum + n * n) % 2 == 0
-}
-
-class CountList(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, CountList.listCreator, new Array[Any](_), classOf[List[Int]]) {
- def companion = CountList
- override def repetitionsPerRun = 250
-
- def runpar = pa.count(CountList.pred)
- def runseq = sequentialCount(CountList.pred, sz)
- def runjsr = jsrarr.withFilter(CountList.predjsr).size
- def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/DiffHalf.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/DiffHalf.scala
deleted file mode 100644
index 4b27569239..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/DiffHalf.scala
+++ /dev/null
@@ -1,48 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class DiffHalf(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = DiffHalf
- override def repetitionsPerRun = 400
-
- val similar = {
- val p = new collection.parallel.mutable.ParArray[Cont](sz)
- for (i <- 0 until sz) p(i) = what match {
- case "seq" => arr(i).asInstanceOf[Cont]
- case "par" => pa(i)
- }
- p.drop(p.size / 2)
- }
-
- def runpar = runresult = pa.diff(similar).size
- def runseq = runresult = sequentialDiff(similar, sz).size
- override def comparisonMap = collection.Map()
-
- val corr = (a: Cont, b: Cont) => a.in == b.in
-}
-
-object DiffHalf extends Companion {
- def benchName = "diff-half";
- def apply(sz: Int, p: Int, what: String) = new DiffHalf(sz, p, what)
- override def comparisons = List()
- override def defaultSize = 10000
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/DropMany.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/DropMany.scala
deleted file mode 100644
index 443ef2b500..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/DropMany.scala
+++ /dev/null
@@ -1,47 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object DropMany extends Companion {
- def benchName = "drop-many";
- def apply(sz: Int, parallelism: Int, what: String) = new DropMany(sz, parallelism, what)
- override def comparisons = Nil
- override def defaultSize = 50000
-}
-
-class DropMany(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = DropMany
- override def repetitionsPerRun = 400
- runresult = -1
-
- def runpar = runresult = pa.drop(pa.size / 2).size
- def runseq = runresult = sequentialDrop(sz / 2, sz).size
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ExistsLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ExistsLight.scala
deleted file mode 100644
index 2749216735..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ExistsLight.scala
+++ /dev/null
@@ -1,49 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object ExistsLight extends Companion {
- def benchName = "exists-light";
- def apply(sz: Int, parallelism: Int, what: String) = new ExistsLight(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 200000
-
- val pred = (a: Cont) => a.in < 0
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = a.in < 0
- }
-}
-
-class ExistsLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Boolean] {
- def companion = ExistsLight
- runresult = false
-
- def runpar = runresult = pa.exists(ExistsLight.pred)
- def runseq = runresult = sequentialExists(ExistsLight.pred, sz)
- def runjsr = runresult = jsrarr.withFilter(ExistsLight.predjsr).size > 0
- def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FilterLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FilterLight.scala
deleted file mode 100644
index d4c8395951..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FilterLight.scala
+++ /dev/null
@@ -1,64 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object FilterLight extends Companion {
- def benchName = "filter-light";
- def apply(sz: Int, parallelism: Int, what: String) = new FilterLight(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 10000
-
- val pred = (a: Cont) => check(a.in)
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = check(a.in)
- }
-
- def check(n: Int) = {
- var res = n
-// var i = 1
-// while (i < 10) {
-// res += n % i
-// i += 1
-// }
- res % 2 == 0
- }
-}
-
-class FilterLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = FilterLight
- override def repetitionsPerRun = 250
- override val runs = 30
- runresult = -1
-
- def runpar = runresult = pa.filter(FilterLight.pred).size
- def runseq = runresult = sequentialFilter(FilterLight.pred, sz).size
- def runjsr = runresult = { jsrarr.withFilter(FilterLight.predjsr).all.size }
- def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FindLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FindLight.scala
deleted file mode 100644
index f08ddf29e3..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FindLight.scala
+++ /dev/null
@@ -1,52 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object FindLight extends Companion {
- def benchName = "find-light";
- def apply(sz: Int, parallelism: Int, what: String) = new FindLight(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 200000
-
- val pred = (a: Cont) => a.in < -10
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = a.in < -10
- }
-}
-
-class FindLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Option[Cont]] {
- def companion = FindLight
- runresult = None
-
- def runpar = runresult = pa.find(FindLight.pred)
- def runseq = runresult = sequentialFind(FindLight.pred, sz)
- def runjsr = runresult = { jsrarr.withFilter(FindLight.predjsr).size > 0; None }
- def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FlatMapLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FlatMapLight.scala
deleted file mode 100644
index 01ecbbf016..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/FlatMapLight.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-
-
-object FlatMapLight extends Companion {
- def benchName = "flatmap-light";
- def apply(sz: Int, parallelism: Int, what: String) = new FlatMapLight(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 10000
-
- def fun = (a: Cont) => { List(1, 2, 3, 4, a.in) }
-}
-
-class FlatMapLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = FlatMapLight
-
- def runpar = pa.flatMap(FlatMapLight.fun)
- def runseq = sequentialFlatMap(FlatMapLight.fun, sz)
- def comparisonMap = collection.Map()
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallHeavy.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallHeavy.scala
deleted file mode 100644
index 0d61e5aeb5..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallHeavy.scala
+++ /dev/null
@@ -1,59 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-object ForallHeavy extends Companion {
- def benchName = "forall-heavy";
- def apply(sz: Int, parallelism: Int, what: String) = new ForallHeavy(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 16
-
- val pred = (a: Cont) => heavyCheck(a)
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = heavyCheck(a)
- }
-
- def heavyCheck(a: Cont) = {
- val init = a.in + 1
- var cnt = init
- var i = 0
- while (i < 10000) {
- cnt = -2 * cnt
- cnt /= 2
- i += 1
- }
- cnt += init * 5 + 10
- cnt >= 0
- }
-}
-
-class ForallHeavy(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = ForallHeavy
-
- def runpar = pa.forall(ForallHeavy.pred)
- def runseq = sequentialForall(ForallHeavy.pred, sz)
- def runjsr = jsrarr.withFilter(ForallHeavy.predjsr).size == sz
- def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallLight.scala
deleted file mode 100644
index 19671d2bc4..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallLight.scala
+++ /dev/null
@@ -1,46 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-object ForallLight extends Companion {
- def benchName = "forall-light";
- def apply(sz: Int, parallelism: Int, what: String) = new ForallLight(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 200000
-
- val pred = (a: Cont) => a.in >= 0
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = a.in >= 0
- }
-}
-
-class ForallLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = ForallLight
-
- def runpar = pa.forall(ForallLight.pred)
- def runseq = sequentialForall(ForallLight.pred, sz)
- def runjsr = jsrarr.withFilter(ForallLight.predjsr).size == sz
- def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallQuickStop.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallQuickStop.scala
deleted file mode 100644
index 624266e49d..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallQuickStop.scala
+++ /dev/null
@@ -1,46 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object ForallQuickStop extends Companion {
- def benchName = "forall-quickstop";
- def apply(sz: Int, parallelism: Int, what: String) = new ForallQuickStop(sz, parallelism, what)
- override def defaultSize = 200000
-
- val pred = (a: Cont) => a.in != 50
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = a.in != 50
- }
-}
-
-class ForallQuickStop(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Boolean] {
- def companion = ForallQuickStop
-
- def runpar = runresult = pa.forall(ForallQuickStop.pred)
- def runseq = runresult = sequentialForall(ForallQuickStop.pred, sz)
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallStop80k.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallStop80k.scala
deleted file mode 100644
index c7462ed04b..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallStop80k.scala
+++ /dev/null
@@ -1,46 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object ForallStop80k extends Companion {
- def benchName = "forall-stop80k";
- def apply(sz: Int, parallelism: Int, what: String) = new ForallStop80k(sz, parallelism, what)
- override def defaultSize = 100000
-
- val pred = (a: Cont) => a.in != 80000
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = a.in != 80000
- }
-}
-
-class ForallStop80k(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Boolean] {
- def companion = ForallStop80k
-
- def runpar = runresult = pa.forall(ForallStop80k.pred)
- def runseq = runresult = sequentialForall(ForallStop80k.pred, sz)
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala
deleted file mode 100644
index d1a3f8085c..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala
+++ /dev/null
@@ -1,45 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-object ForeachHeavy extends Companion {
- def benchName = "foreach-heavy";
- def apply(sz: Int, parallelism: Int, what: String) = new ForeachHeavy(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 2048
-
- @volatile var z = 0
-
- val fun = (a: Cont) => heavyOperation(a)
- val funjsr = new extra166y.Ops.Procedure[Cont] {
- def op(a: Cont) = heavyOperation(a)
- }
-
- def heavyOperation(a: Cont) {
- checkPrime(a.in + 1000000000)
- }
-
- def checkPrime(n: Int) = {
- var isPrime = true
- var i = 2
- val until = 550
- while (i < until) {
- if (n % i == 0) isPrime = false
- i += 1
- }
- if (isPrime && (n.toString == z)) z += 1
- isPrime
- }
-}
-
-class ForeachHeavy(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = ForeachHeavy
- override def repetitionsPerRun = 250
-
- def runpar = pa.pforeach(ForeachHeavy.fun)
- def runseq = sequentialForeach(ForeachHeavy.fun, sz)
- def runjsr = jsrarr.apply(ForeachHeavy.funjsr)
- def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala
deleted file mode 100644
index 3d0c5c45c4..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala
+++ /dev/null
@@ -1,26 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-object ForeachLight extends Companion {
- def benchName = "foreach-light";
- def apply(sz: Int, parallelism: Int, what: String) = new ForeachLight(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 200000
-
- val fun = (a: Cont) => a.num = a.in
- val funjsr = new extra166y.Ops.Procedure[Cont] {
- def op(a: Cont) = a.num = a.in
- }
-}
-
-class ForeachLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = ForeachLight
-
- def runpar = pa.pforeach(ForeachLight.fun)
- def runseq = sequentialForeach(ForeachLight.fun, sz)
- def runjsr = jsrarr.apply(ForeachLight.funjsr)
- def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/GroupBy.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/GroupBy.scala
deleted file mode 100644
index a90227a6e4..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/GroupBy.scala
+++ /dev/null
@@ -1,45 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-object GroupByLight extends Companion {
- def benchName = "groupby-light";
- def apply(sz: Int, parallelism: Int, what: String) = new GroupByLight(sz, parallelism, what)
- override def comparisons = List()
- override def defaultSize = 10000
-
- val fun = (a: Cont) => a.in % 32
-}
-
-
-class GroupByLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = GroupByLight
- runresult = -1
-
- val array = new Array[Cont](sz)
- for (i <- 0 until sz) array(i) = new Cont(i)
-
- def runpar = runresult = pa.groupBy(GroupByLight.fun).size
- def runseq = runresult = array.asInstanceOf[Array[Cont]].groupBy(GroupByLight.fun).size
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/IndexWhere.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/IndexWhere.scala
deleted file mode 100644
index 3a22bdd1db..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/IndexWhere.scala
+++ /dev/null
@@ -1,47 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class IndexWhere(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = IndexWhere
- override def repetitionsPerRun = 400
-
- def runpar = runresult = pa.indexWhere(IndexWhere.pred2, 0)
- def runseq = runresult = sequentialIndexWhere(IndexWhere.pred2, 0, sz)
- override def comparisonMap = collection.Map()
-}
-
-object IndexWhere extends Companion {
- def benchName = "index-where";
- def apply(sz: Int, p: Int, what: String) = new IndexWhere(sz, p, what)
- override def comparisons = List()
-
- val pred = (c: Cont) => {
- var in = c.in
- var i = 2
- while (i < 5) {
- if (in % i == 0) in = 0
- i += 1
- }
- c.in >= 0 && in == -1
- }
- val pred2 = (c: Cont) => c.in == 280000
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/IntersectHalf.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/IntersectHalf.scala
deleted file mode 100644
index e429fb288e..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/IntersectHalf.scala
+++ /dev/null
@@ -1,48 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class IntersectHalf(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = IntersectHalf
- override def repetitionsPerRun = 400
-
- val similar = {
- val p = new collection.parallel.mutable.ParArray[Cont](sz)
- for (i <- 0 until sz) p(i) = what match {
- case "seq" => arr(i).asInstanceOf[Cont]
- case "par" => pa(i)
- }
- p.drop(p.size / 2)
- }
-
- def runpar = runresult = pa.intersect(similar).size
- def runseq = runresult = sequentialIntersect(similar, sz).size
- override def comparisonMap = collection.Map()
-
- val corr = (a: Cont, b: Cont) => a.in == b.in
-}
-
-object IntersectHalf extends Companion {
- def benchName = "intersect-half";
- def apply(sz: Int, p: Int, what: String) = new IntersectHalf(sz, p, what)
- override def comparisons = List()
- override def defaultSize = 10000
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/LastIndexWhere.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/LastIndexWhere.scala
deleted file mode 100644
index 427afa5571..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/LastIndexWhere.scala
+++ /dev/null
@@ -1,47 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class LastIndexWhere(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = LastIndexWhere
- override def repetitionsPerRun = 400
-
- def runpar = runresult = pa.lastIndexWhere(LastIndexWhere.pred2, pa.size - 1)
- def runseq = runresult = sequentialLastIndexWhere(LastIndexWhere.pred2, sz - 1, sz)
- override def comparisonMap = collection.Map()
-}
-
-object LastIndexWhere extends Companion {
- def benchName = "last-index-where";
- def apply(sz: Int, p: Int, what: String) = new LastIndexWhere(sz, p, what)
- override def comparisons = List()
-
- val pred = (c: Cont) => {
- var in = c.in
- var i = 2
- while (i < 5) {
- if (in % i == 0) in = 0
- i += 1
- }
- c.in >= 0 || in == 0
- }
- val pred2 = (c: Cont) => c.in == 500
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MapLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MapLight.scala
deleted file mode 100644
index 1451f6a57a..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MapLight.scala
+++ /dev/null
@@ -1,27 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-object MapLight extends Companion {
- def benchName = "map-light";
- def apply(sz: Int, parallelism: Int, what: String) = new MapLight(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 100000
-
- def fun = (a: Cont) => { a }
- def funjsr = new extra166y.Ops.Op[Cont, Cont] {
- def op(a: Cont) = { a }
- }
-}
-
-class MapLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = MapLight
-
- def runpar = pa.map(MapLight.fun)
- def runseq = sequentialMap(MapLight.fun, sz)
-// def runseq = sequentialMapOpt(MapLight.fun, sz)
- def runjsr = jsrarr.replaceWithMapping(MapLight.funjsr).all
- def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MatrixMultiplication.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MatrixMultiplication.scala
deleted file mode 100644
index 6d5b189c3a..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MatrixMultiplication.scala
+++ /dev/null
@@ -1,84 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-import collection.parallel.immutable.ParRange
-
-
-object MatrixMultiplication extends Companion {
- def benchName = "matrix-mult";
- def apply(sz: Int, parallelism: Int, what: String) = new MatrixMultiplication(sz, parallelism, what)
- override def comparisons = List()
- override def defaultSize = 100
-}
-
-class MatrixMultiplication(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = MatrixMultiplication
- collection.parallel.tasksupport.environment = forkjoinpool
-
- val a = Matrix.unit[Int](sz)
- val b = Matrix.unit[Int](sz)
- var c = new Matrix[Int](sz)
-
- def runpar = c = a * b //{ c.assignProduct(a, b) } //; println("--------"); c.output }
- def runseq = throw new UnsupportedOperationException
- def comparisonMap = collection.Map()
-
- class Matrix[T](n: Int)(implicit num: Numeric[T], tag: ClassTag[T]) {
- val array = new Array[T](n * n)
-
- def apply(y: Int, x: Int) = array(y * n + x)
-
- def update(y: Int, x: Int, elem: T) = array(y * n + x) = elem
-
- def *(b: Matrix[T]) = {
- val m = new Matrix[T](n)
- m.assignProduct(this, b)
- m
- }
-
- def assignProduct(a: Matrix[T], b: Matrix[T]) = {
- val range = ParRange(0, n * n, 1, false)
- for (i <- range) this(i / n, i % n) = calcProduct(a, b, i / n, i % n);
- }
-
- private def calcProduct(a: Matrix[T], b: Matrix[T], y: Int, x: Int): T = {
- import num._
- var sum = zero
- for (i <- 0 until n) sum += a(y, i) * b(i, x)
- sum
- }
-
- def output = for (y <- 0 until n) {
- for (x <- 0 until n) print(this(y, x))
- println
- }
- }
-
- object Matrix {
- def unit[T](n: Int)(implicit num: Numeric[T], tag: ClassTag[T]) = {
- val m = new Matrix[T](n)
- for (i <- 0 until n) m(i, i) = num.one
- m
- }
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MinLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MinLight.scala
deleted file mode 100644
index a51b5d6176..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/MinLight.scala
+++ /dev/null
@@ -1,28 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-
-/** Tests reduce method using an operator creating an object as a result. */
-class MinLight(sz: Int, p: Int, what: String)
-extends Resettable[Int](sz, p, what, (i: Int) => i, new Array[Any](_), classOf[Int]) {
- def companion = MinLight
- override def repetitionsPerRun = 400
-
- def runpar = pa.min(Ordering[Int])
- def runseq = sequentialMin(sz)
- override def comparisonMap = collection.Map()
-}
-
-object MinLight extends Companion {
- def benchName = "min-light";
- def apply(sz: Int, p: Int, what: String) = new MinLight(sz, p, what)
- override def comparisons = List()
-}
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PadToDouble.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PadToDouble.scala
deleted file mode 100644
index f8a985c349..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PadToDouble.scala
+++ /dev/null
@@ -1,53 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class PadToDouble(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = PadToDouble
- override def repetitionsPerRun = 400
-
- val similar = {
- val p = new collection.parallel.mutable.ParArray[Cont](sz)
- for (i <- 0 until sz) p(i) = what match {
- case "seq" => arr(i).asInstanceOf[Cont]
- case "par" => pa(i)
- }
- p.drop(p.size / 2)
- }
-
- def runpar = runresult = pa.padTo(size * 2, padder).size
- def runseq = runresult = sequentialPadTo(size * 2, padder, size).size
- override def comparisonMap = collection.Map()
-
- val padder = new Cont(0)
-}
-
-
-object PadToDouble extends Companion {
- def benchName = "padto-double";
- def apply(sz: Int, p: Int, what: String) = new PadToDouble(sz, p, what)
- override def comparisons = List()
- override def defaultSize = 25000
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PartialMapLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PartialMapLight.scala
deleted file mode 100644
index 57f8536b9e..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PartialMapLight.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-object PartialMapLight extends Companion {
- def benchName = "partmap-light";
- def apply(sz: Int, parallelism: Int, what: String) = new PartialMapLight(sz, parallelism, what)
- override def comparisons = List()
- override def defaultSize = 100000
-
- def fun: PartialFunction[Cont, Cont] = {
- case c: Cont if c.in >= 0 => c
- }
-}
-
-class PartialMapLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = PartialMapLight
-
- def runpar = pa.collect(PartialMapLight.fun)
- def runseq = sequentialPartialMap(PartialMapLight.fun, sz)
- def comparisonMap = collection.Map()
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PartitionLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PartitionLight.scala
deleted file mode 100644
index b99a25b285..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PartitionLight.scala
+++ /dev/null
@@ -1,61 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object PartitionLight extends Companion {
- def benchName = "partition-light";
- def apply(sz: Int, parallelism: Int, what: String) = new PartitionLight(sz, parallelism, what)
- override def comparisons = Nil
- override def defaultSize = 20000
-
- val pred = (a: Cont) => check(a.in)
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = check(a.in)
- }
-
- def check(n: Int) = {
- var res = n
- var i = 1
- while (i < 5) {
- res += n % i
- i += 1
- }
- (res % 2 == 0) && (res % 312 == 0)
- }
-}
-
-class PartitionLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = PartitionLight
- runresult = -1
-
- def runpar = runresult = pa.partition(PartitionLight.pred)._1.size
- def runseq = runresult = sequentialPartition(PartitionLight.pred, sz)._1.size
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PatchHalf.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PatchHalf.scala
deleted file mode 100644
index 55cc71f129..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PatchHalf.scala
+++ /dev/null
@@ -1,46 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class PatchHalf(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = PatchHalf
- override def repetitionsPerRun = 400
-
- val similar = {
- val p = new collection.parallel.mutable.ParArray[Cont](sz)
- for (i <- 0 until sz) p(i) = what match {
- case "seq" => arr(i).asInstanceOf[Cont]
- case "par" => pa(i)
- }
- p.drop(p.size / 2)
- }
-
- def runpar = runresult = pa.patch(size / 2, similar, 0).size
- def runseq = runresult = sequentialPatch(size / 2, similar, 0, size).size
- override def comparisonMap = collection.Map()
-}
-
-object PatchHalf extends Companion {
- def benchName = "patch-half";
- def apply(sz: Int, p: Int, what: String) = new PatchHalf(sz, p, what)
- override def comparisons = List()
- override def defaultSize = 25000
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PlusPlus.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PlusPlus.scala
deleted file mode 100644
index 2574621212..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/PlusPlus.scala
+++ /dev/null
@@ -1,29 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.mutable.ParArray
-
-
-object PlusPlus extends Companion {
- def benchName = "plusplus";
- def apply(sz: Int, parallelism: Int, what: String) = new PlusPlus(sz, parallelism, what)
- override def comparisons = List()
- override def defaultSize = 50000
-}
-
-class PlusPlus(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = PlusPlus
-
- val thatarr = new Array[Cont](sz)
- val thatpa = new ParArray[Cont](sz)
-
- def runpar = pa ++ thatpa
- def runseq = arr ++ thatarr
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceHeavy.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceHeavy.scala
deleted file mode 100644
index dd660ba8e0..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceHeavy.scala
+++ /dev/null
@@ -1,22 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-class ReduceHeavy(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = ReduceHeavy
- override def repetitionsPerRun = 100
-
- def runseq = sequentialReduce(Cont.opheavy, sz, new Cont(0))
- def runpar = pa.reduce(Cont.opheavy)
- def runjsr = jsrarr.reduce(Cont.reducerheavy, new Cont(0))
- override def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
-object ReduceHeavy extends Companion {
- def benchName = "reduce-heavy";
- def apply(sz: Int, p: Int, what: String) = new ReduceHeavy(sz, p, what)
- override def comparisons = List("jsr")
- override def defaultSize = 16
-}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceLight.scala
deleted file mode 100644
index f1f2a32403..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceLight.scala
+++ /dev/null
@@ -1,50 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-import scala.collection.parallel.mutable.ParArray
-import extra166y.{ParallelArray => JSR166Array}
-
-
-object ReduceLight extends Companion {
- def benchName = "reduce-light";
- def apply(sz: Int, parallelism: Int, what: String) = new ReduceLight(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 200000
-}
-
-
-class ReduceLight(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = ReduceLight
- override def repetitionsPerRun = 350
- override val runs = 20
-
- def runpar = {
- pa.reduce(Cont.op)
-// updatePar
- }
-
- def runjsr = {
- jsrarr.reduce(Cont.reducer, new Cont(0))
-// updateJsr
- }
-
- def runseq = {
- sequentialReduce(Cont.op, sz, new Cont(0))
-// updateSeq
- }
-
- override def comparisonMap = collection.Map("jsr" -> runjsr _)
-
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceList.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceList.scala
deleted file mode 100644
index f095797d1c..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceList.scala
+++ /dev/null
@@ -1,53 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-object ReduceList extends Companion {
- def benchName = "reduce-list";
- def apply(sz: Int, p: Int, what: String) = new ReduceList(sz, p, what)
- override def comparisons = List("jsr")
- override def defaultSize = 20000
-}
-
-object ListCreator extends (Int => List[Int]) {
- def apply(idx: Int) = {
- val len = 50 + idx % 100
- (for (i <- 0 until len) yield i).toList
- }
-}
-
-object ListOps {
- val redop = (a: List[Int], b: List[Int]) => combineLists(a, b)
- val reducer = new extra166y.Ops.Reducer[List[Int]] {
- def op(a: List[Int], b: List[Int]) = combineLists(a, b)
- }
- def combineLists(a: List[Int], b: List[Int]) = {
- if (a.foldLeft(0)(_ + _) > b.foldLeft(0)(_ + _)) a else b
- }
-}
-
-class ReduceList(sz: Int, p: Int, what: String)
-extends Resettable[List[Int]](sz, p, what, ListCreator, new Array[Any](_), classOf[List[Int]]) {
- def companion = ReduceList
- override def repetitionsPerRun = 10
- override val runs = 15
-
- def runpar = pa.reduce(ListOps.redop)
- def runseq = sequentialReduce(ListOps.redop, sz, List[Int]())
- def runjsr = jsrarr.reduce(ListOps.reducer, List[Int]())
- override def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceNew.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceNew.scala
deleted file mode 100644
index 1cf4f4169a..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReduceNew.scala
+++ /dev/null
@@ -1,30 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-
-/** Tests reduce method using an operator creating an object as a result. */
-class ReduceNew(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i),
- new Array[Any](_), classOf[Cont]) {
- def companion = ReduceNew
- override def repetitionsPerRun = 200
-
- def runpar = pa.reduce(Cont.opnew)
- def runseq = sequentialReduce(Cont.opnew, sz, new Cont(0))
- def runjsr = jsrarr.reduce(Cont.reducernew, new Cont(0))
- override def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
-object ReduceNew extends Companion {
- def benchName = "reduce-new";
- def apply(sz: Int, p: Int, what: String) = new ReduceNew(sz, p, what)
- override def comparisons = List("jsr")
-}
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReducePrime.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReducePrime.scala
deleted file mode 100644
index 8fb90981ac..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReducePrime.scala
+++ /dev/null
@@ -1,65 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object IntWrapCreator extends (Int => IntWrap) {
- def apply(idx: Int) = new IntWrap(shiftaround(idx))
- def shiftaround(idx: Int) = idx * 40192 + 717
-}
-
-case class IntWrap(val num: Int)
-
-object IntOps {
- val op = (a: IntWrap, b: IntWrap) => primereduce(a, b)
- val reducer = new extra166y.Ops.Reducer[IntWrap] {
- def op(a: IntWrap, b: IntWrap) = primereduce(a, b)
- }
-
- def primereduce(a: IntWrap, b: IntWrap) = {
- val check = (checkPrime(a.num), checkPrime(b.num))
- if (a.num > b.num) a else b
- }
-
- def checkPrime(n: Int) = {
- var isPrime = true
- var i = 2
- val until = scala.math.sqrt(n).toInt + 1
- while (i < until) {
- if (n % i == 0) isPrime = false
- i += 1
- }
- isPrime
- }
-}
-
-class ReducePrime(sz: Int, p: Int, what: String)
-extends Resettable[IntWrap](sz, p, what, IntWrapCreator, new Array[Any](_), classOf[IntWrap])
-with HavingResult[IntWrap] {
- def companion = ReducePrime
-
- def runseq = runresult = sequentialReduce(IntOps.op, sz, new IntWrap(0))
- def runpar = runresult = pa.reduce(IntOps.op)
- def runjsr = runresult = jsrarr.reduce(IntOps.reducer, new IntWrap(0))
- override def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
-object ReducePrime extends Companion {
- def benchName = "reduce-prime";
- def apply(sz: Int, p: Int, what: String) = new ReducePrime(sz, p, what)
- override def comparisons = List("jsr")
- override def defaultSize = 100
-}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/RemoveDuplicates.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/RemoveDuplicates.scala
deleted file mode 100644
index feb1bd9466..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/RemoveDuplicates.scala
+++ /dev/null
@@ -1,44 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class RemoveDuplicates(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = RemoveDuplicates
- override def repetitionsPerRun = 400
-
- def runpar = runresult = pa.distinct.size
- def runseq = runresult = sequentialRemoveDuplicates(size).size
- override def comparisonMap = collection.Map()
-}
-
-object RemoveDuplicates extends Companion {
- def benchName = "remove-duplicates";
- def apply(sz: Int, p: Int, what: String) = new RemoveDuplicates(sz, p, what)
- override def comparisons = List()
- override def defaultSize = 10000
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Resettable.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Resettable.scala
deleted file mode 100644
index b4403fcb9c..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Resettable.scala
+++ /dev/null
@@ -1,127 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-import scala.collection.parallel.mutable.ParArray
-import extra166y.{ParallelArray => JSR166Array}
-
-
-class Cont(val in: Int) {
- var num = in
- override def toString = in.toString
-}
-
-object Cont {
- val pred = (a: Cont) => a.in > 100
-
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = a.in > 100
- }
-
- val op = (a: Cont, b: Cont) => {
- b.num = a.in + b.in
- b
- }
-
- val opnew = (a: Cont, b: Cont) => new Cont(a.in + b.in)
-
- val opheavy = (a: Cont, b: Cont) => {
- heavyComputation(a, b)
- }
-
- val reducer = new extra166y.Ops.Reducer[Cont] {
- def op(a: Cont, b: Cont) = {
- b.num = a.in + b.in
- b
- }
- }
-
- val reducernew = new extra166y.Ops.Reducer[Cont] {
- def op(a: Cont, b: Cont) = new Cont(a.in + b.in)
- }
-
- val reducerheavy = new extra166y.Ops.Reducer[Cont] {
- def op(a: Cont, b: Cont) = heavyComputation(a, b)
- }
-
- def heavyComputation(a: Cont, b: Cont) = {
- val f = a.in
- val s = b.in
- var i = 0
- var res = f * s
- while (i < 50000) {
- if ((i + f) % 3 == 0) res += s
- else res -= f
- i += 1
- }
- b.num = res
- b
- }
-}
-
-abstract class Resettable[T](val size: Int, val parallelism: Int, val runWhat: String,
- elemcreator: Int => T, arrcreator: Int => Array[Any], cls: Class[T])
-extends Bench with SequentialOps[T] {
- val forkjoinpool = new scala.concurrent.forkjoin.ForkJoinPool(parallelism)
- forkjoinpool.setMaximumPoolSize(parallelism)
- val papool = new jsr166y.ForkJoinPool(parallelism)
- papool.setMaximumPoolSize(parallelism)
-
- var pa: ParArray[T] = null
- var jsrarr: JSR166Array[T] = null
- reset
-
- def reset = runWhat match {
- case "seq" =>
- arr = arrcreator(size)
- for (i <- 0 until size) arr(i) = elemcreator(i)
- case "par" =>
- pa = new ParArray[T](size)
- collection.parallel.tasksupport.environment = forkjoinpool
- for (i <- 0 until size) pa(i) = elemcreator(i)
- case "jsr" =>
- jsrarr = JSR166Array.create(size, cls, papool)
- for (i <- 0 until size) jsrarr.set(i, elemcreator(i))
- case _ => throw new IllegalArgumentException("Unknown type: " + runWhat)
- }
-
- var updateCounter = 0
- def incUpdateCounter {
- updateCounter += 1
- if (updateCounter > size) updateCounter = 0
- }
-
- def updateSeq {
- val tmp = arr(updateCounter)
- arr(updateCounter) = arr(size - updateCounter - 1)
- arr(size - updateCounter - 1) = tmp
- incUpdateCounter
- }
-
- def updatePar {
- val tmp = pa(updateCounter)
- pa(updateCounter) = pa(size - updateCounter - 1)
- pa(size - updateCounter - 1) = tmp
- incUpdateCounter
- }
-
- def updateJsr {
- val tmp = jsrarr.get(updateCounter)
- jsrarr.set(updateCounter, jsrarr.get(size - updateCounter - 1))
- jsrarr.set(size - updateCounter - 1, tmp)
- incUpdateCounter
- }
-
- override def printResults {
- println(" --- Fork join pool state --- ")
- println("Parallelism: " + forkjoinpool.getParallelism)
- println("Active threads: " + forkjoinpool.getActiveThreadCount)
- println("Work stealings: " + forkjoinpool.getStealCount)
- }
-}
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Reverse.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Reverse.scala
deleted file mode 100644
index ec690d4b2d..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/Reverse.scala
+++ /dev/null
@@ -1,35 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class Reverse(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont]) {
- def companion = Reverse
- override def repetitionsPerRun = 400
-
- def runpar = pa.reverse
- def runseq = sequentialReverse(sz)
- override def comparisonMap = collection.Map()
-}
-
-object Reverse extends Companion {
- def benchName = "reverse";
- def apply(sz: Int, p: Int, what: String) = new Reverse(sz, p, what)
- override def comparisons = List()
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReverseMap.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReverseMap.scala
deleted file mode 100644
index 47ae108c45..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ReverseMap.scala
+++ /dev/null
@@ -1,48 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class ReverseMap(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont]) {
- def companion = ReverseMap
- override def repetitionsPerRun = 100
-
- def runpar = pa.reverseMap(compl)
- def runseq = sequentialReverseMap(compl, sz)
- override def comparisonMap = collection.Map()
-
- val id = (c: Cont) => c
- val compl = (c: Cont) => {
- var in = c.in
- var i = 2
- while (i < 6) {
- if (in % i == 0) in = 0
- i += 1
- }
- if (in < 0) null
- else c
- }
-}
-
-object ReverseMap extends Companion {
- def benchName = "reverse-map";
- def apply(sz: Int, p: Int, what: String) = new ReverseMap(sz, p, what)
- override def comparisons = List()
- override def defaultSize = 100000
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SameElementsLong.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SameElementsLong.scala
deleted file mode 100644
index d22c4df661..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SameElementsLong.scala
+++ /dev/null
@@ -1,45 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class SameElementsLong(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont])
-with HavingResult[Boolean] {
- def companion = SameElementsLong
- override def repetitionsPerRun = 400
-
- val same = {
- val p = new collection.parallel.mutable.ParArray[Cont](sz)
- for (i <- 0 until sz) p(i) = what match {
- case "seq" => arr(i).asInstanceOf[Cont]
- case "par" => pa(i)
- }
- p
- }
-
- def runpar = runresult = pa.sameElements(same)
- def runseq = runresult = sequentialSameElements(same, sz)
- override def comparisonMap = collection.Map()
-}
-
-object SameElementsLong extends Companion {
- def benchName = "same-elements-long";
- def apply(sz: Int, p: Int, what: String) = new SameElementsLong(sz, p, what)
- override def comparisons = List()
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanLight.scala
deleted file mode 100644
index d0ddf9f70e..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanLight.scala
+++ /dev/null
@@ -1,46 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-import scala.collection.parallel.mutable.ParArray
-
-
-object ScanLight extends Companion {
- def benchName = "scan-light";
- def apply(sz: Int, parallelism: Int, what: String) = new ScanLight(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 40000
-
- val op = (a: Cont, b: Cont) => {
- operation(a, b)
- }
- def operation(a: Cont, b: Cont) = {
- val m = if (a.in < 0) 1 else 0
- new Cont(a.in + b.in + m * (0 until 2).reduceLeft(_ + _))
- }
-}
-
-
-class ScanLight(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = ScanLight
- override def repetitionsPerRun = 50
- override val runs = 12
-
- def runpar = pa.scan(new Cont(0))(ScanLight.op)
- def runseq = sequentialScan(new Cont(0), ScanLight.op, sz)
- def runjsr = jsrarr.cumulate(new extra166y.Ops.Reducer[Cont] {
- def op(a: Cont, b: Cont) = ScanLight.operation(a, b)
- }, new Cont(0))
- override def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanMedium.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanMedium.scala
deleted file mode 100644
index a60ba7aa33..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ScanMedium.scala
+++ /dev/null
@@ -1,55 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-import scala.collection.parallel.mutable.ParArray
-
-
-object ScanMedium extends Companion {
- def benchName = "scan-medium";
- def apply(sz: Int, parallelism: Int, what: String) = new ScanMedium(sz, parallelism, what)
- override def comparisons = List("jsr")
- override def defaultSize = 5000
-
- val op = (a: Cont, b: Cont) => {
- operation(a, b)
- }
- def operation(a: Cont, b: Cont) = {
- val m = if (a.in < 0) 1 else 0
- val k = calc(a.in, b.in, m)
- new Cont(a.in + b.in + k * m * (0 until 2).reduceLeft(_ + _))
- }
- private def calc(x: Int, y: Int, n: Int) = {
- var sum = x
- for (i <- 0 until 500) {
- sum += y + (if (sum % 2 == 0) n * x else y)
- if (sum % 5 == 0) sum -= x * y - n * (x + y)
- }
- sum
- }
-}
-
-
-class ScanMedium(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
- def companion = ScanMedium
- override def repetitionsPerRun = 50
- override val runs = 12
-
- def runpar = pa.scan(new Cont(0))(ScanMedium.op)
- def runseq = sequentialScan(new Cont(0), ScanMedium.op, sz)
- def runjsr = jsrarr.cumulate(new extra166y.Ops.Reducer[Cont] {
- def op(a: Cont, b: Cont) = ScanMedium.operation(a, b)
- }, new Cont(0))
- override def comparisonMap = collection.Map("jsr" -> runjsr _)
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SegmentLength.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SegmentLength.scala
deleted file mode 100644
index 8fae899b45..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SegmentLength.scala
+++ /dev/null
@@ -1,42 +0,0 @@
-package scala.collection.parallel.benchmarks
-package parallel_array
-
-
-
-
-
-
-
-class SegmentLength(sz: Int, p: Int, what: String)
-extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = SegmentLength
- override def repetitionsPerRun = 400
-
- def runpar = runresult = pa.segmentLength(SegmentLength.pred2, 0)
- def runseq = runresult = sequentialSegmentLength(SegmentLength.pred2, 0, sz)
- override def comparisonMap = collection.Map()
-}
-
-object SegmentLength extends Companion {
- def benchName = "segment-length";
- def apply(sz: Int, p: Int, what: String) = new SegmentLength(sz, p, what)
- override def comparisons = List()
-
- val pred = (c: Cont) => {
- var in = c.in
- var i = 2
- while (i < 5) {
- if (in % i == 0) in = 0
- i += 1
- }
- c.in >= 0 || in == 0
- }
- val pred2 = (c: Cont) => c.in >= 0
-}
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SequentialOps.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SequentialOps.scala
deleted file mode 100644
index 9300851b5f..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SequentialOps.scala
+++ /dev/null
@@ -1,562 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-trait SequentialOps[T] {
-
- var arr: Array[Any] = null
-
- def sequentialReduce(op: (T, T) => T, sz: Int, init: T) = {
- var i = 0
- val until = sz
- var sum = init
- while (i < until) {
- sum = op(sum, arr(i).asInstanceOf[T])
- i += 1
- }
- sum
- }
-
- def sequentialScan(z: T, op: (T, T) => T, sz: Int) = {
- var outarr = new Array[Any](sz + 1)
- outarr(0) = z
- var last = z
- var i = 0
- var j = 1
- val until = sz
- while (i < until) {
- last = op(last, arr(i).asInstanceOf[T])
- outarr(j) = last
- i += 1
- j += 1
- }
- }
-
- def sequentialCount(pred: T => Boolean, sz: Int) = {
- var i = 0
- val until = sz
- var sum = 0
- while (i < until) {
- if (pred(arr(i).asInstanceOf[T])) sum += 1
- i += 1
- }
- sum
- }
-
- def sequentialForeach[U](f: T => U, sz: Int) = {
- var i = 0
- val until = sz
- var sum = 0
- while (i < until) {
- f(arr(i).asInstanceOf[T])
- i += 1
- }
- }
-
- def sequentialSum[U >: T](sz: Int)(implicit num: Numeric[U]) = {
- var i = 0
- val until = sz
- var sum = num.zero
- while (i < until) {
- sum = num.plus(sum, arr(i).asInstanceOf[T])
- i += 1
- }
- sum
- }
-
- def sequentialMin[U >: T](sz: Int)(implicit ord: Ordering[U]) = {
- var i = 1
- val until = sz
- var min = arr(0).asInstanceOf[U]
- while (i < until) {
- val elem = arr(i).asInstanceOf[U]
- if (ord.lt(elem, min)) min = elem
- i += 1
- }
- min
- }
-
- def sequentialForall(pred: T => Boolean, sz: Int) = {
- var i = 0
- val until = sz
- var all = true
- while (i < until) {
- if (pred(arr(i).asInstanceOf[T])) i += 1
- else {
- all = false
- i = until
- }
- }
- all
- }
-
- def sequentialExists(pred: T => Boolean, sz: Int) = {
- var i = 0
- val until = sz
- var some = false
- while (i < until) {
- if (pred(arr(i).asInstanceOf[T])) {
- some = true
- i = until
- } else i += 1
- }
- some
- }
-
- def sequentialFind(pred: T => Boolean, sz: Int) = {
- var i = 0
- val until = sz
- var opt: Option[T] = None
- while (i < until) {
- if (pred(arr(i).asInstanceOf[T])) {
- opt = Some(arr(i).asInstanceOf[T])
- i = until
- } else i += 1
- }
- opt
- }
-
- def sequentialFilter(pred: T => Boolean, sz: Int) = {
- var i = 0
- val buff = new collection.mutable.ArrayBuffer[T]
- while (i < sz) {
- val elem = arr(i).asInstanceOf[T]
- if (pred(elem)) buff += elem
- i += 1
- }
- val resarr = new Array[Any](buff.size)
- buff.copyToArray(resarr, 0)
- resarr
- }
-
- def sequentialPartition(pred: T => Boolean, sz: Int) = {
- var i = 0
- val btrue = new collection.mutable.ArrayBuffer[T]
- val bfalse = new collection.mutable.ArrayBuffer[T]
- while (i < sz) {
- val elem = arr(i).asInstanceOf[T]
- if (pred(elem)) btrue += elem
- else bfalse += elem
- i += 1
- }
- val restrue = new Array[Any](btrue.size)
- val resfalse = new Array[Any](bfalse.size)
- btrue.copyToArray(restrue, 0)
- bfalse.copyToArray(resfalse, 0)
- (restrue, resfalse)
- }
-
- def sequentialTakeOpt(n: Int, sz: Int) = {
- var i = 0
- val until = if (n < sz) n else sz
- val res = new Array[Any](until)
- Array.copy(arr, 0, res, 0, until)
-// while (i < until) {
-// res(i) = arr(i)
-// i += 1
-// }
- res
- }
-
- def sequentialTake(n: Int, sz: Int) = {
- var i = 0
- val b = new collection.mutable.ArrayBuffer[T]
- val until = if (n < sz) n else sz
- b.sizeHint(until)
- while (i < until) {
- val elem = arr(i).asInstanceOf[T]
- b += elem
- i += 1
- }
- val res = new Array[Any](n)
- b.copyToArray(res, 0)
- res
- }
-
- def sequentialDrop(n: Int, sz: Int) = {
- var i = n
- val b = new collection.mutable.ArrayBuffer[T]
- b.sizeHint(sz - n)
- while (i < sz) {
- val elem = arr(i).asInstanceOf[T]
- b += elem
- i += 1
- }
- val res = new Array[Any](n)
- b.copyToArray(res, 0)
- res
- }
-
- def sequentialSlice(from: Int, until: Int, sz: Int) = {
- var i = from
- val b = new collection.mutable.ArrayBuffer[T]
- b.sizeHint(until - from)
- while (i < until) {
- val elem = arr(i).asInstanceOf[T]
- b += elem
- i += 1
- }
- val res = new Array[Any](until - from)
- b.copyToArray(res, 0)
- res
- }
-
- def sequentialSplitAtOpt(n: Int, sz: Int) = {
- var i = 0
- val before = new Array[Any](n)
- val after = new Array[Any](sz - n)
- Array.copy(arr, 0, before, 0, n)
- Array.copy(arr, n, after, 0, sz - n)
- (before, after)
- }
-
- def sequentialSplitAt(n: Int, sz: Int) = {
- var i = 0
- val before = new collection.mutable.ArrayBuffer[T]
- before.sizeHint(n)
- val after = new collection.mutable.ArrayBuffer[T]
- after.sizeHint(sz - n)
- while (i < sz) {
- if (i < n) before += arr(i).asInstanceOf[T]
- else after += arr(i).asInstanceOf[T]
- i += 1
- }
- val resbef = new Array[Any](n)
- val resaft = new Array[Any](sz - n)
- before.copyToArray(resbef, 0)
- after.copyToArray(resaft, 0)
- (resbef, resaft)
- }
-
- def sequentialTakeWhile(p: T => Boolean, sz: Int) = {
- var i = 0
- val b = new collection.mutable.ArrayBuffer[T]
- while (i < sz) {
- val elem = arr(i).asInstanceOf[T]
- if (p(elem)) {
- b += elem
- i += 1
- } else i = sz
- }
- val res = new Array[Any](sz)
- b.copyToArray(res, 0)
- res
- }
-
- def sequentialSpan(p: T => Boolean, sz: Int) = {
- val bpref = new collection.mutable.ArrayBuffer[T]
- val brest = new collection.mutable.ArrayBuffer[T]
- var i = 0
- var prefix = true
- var pos = sz
- while (i < sz) {
- val elem = arr(i).asInstanceOf[T]
- if (prefix) {
- if (p(elem)) bpref += elem
- else {
- pos = i
- prefix = false
- brest += elem
- }
- } else brest += elem
- i += 1
- }
- val respref = new Array[Any](pos)
- val resrest = new Array[Any](sz - pos)
- bpref.copyToArray(respref, 0)
- brest.copyToArray(resrest, 0)
- (respref, resrest)
- }
-
- def sequentialMap(f: T => T, sz: Int) = {
- val b = new collection.mutable.ArrayBuffer[T](sz)
-
- var i = 0
- while (i < sz) {
- b += f(arr(i).asInstanceOf[T])
- i += 1
- }
-
- val res = new Array[Any](sz)
- b.copyToArray(res, 0)
- res
- }
-
- def sequentialMapOpt(f: T => T, sz: Int) = {
- val res = new Array[Any](sz)
-
- var i = 0
- while (i < sz) {
- res(i) = f(arr(i).asInstanceOf[T])
- i += 1
- }
-
- res
- }
-
- def sequentialPartialMap(f: PartialFunction[T, T], sz: Int) = {
- val b = new collection.mutable.ArrayBuffer[T](sz)
-
- var i = 0
- while (i < sz) {
- val elem = arr(i).asInstanceOf[T]
- if (f.isDefinedAt(elem)) b += f(elem)
- i += 1
- }
-
- val res = new Array[Any](b.size)
- b.copyToArray(res, 0)
- res
- }
-
- def sequentialFlatMap(f: T => Traversable[Int], sz: Int) = {
- val b = new collection.mutable.ArrayBuffer[Int](sz)
-
- var i = 0
- while (i < sz) {
- val ts = f(arr(i).asInstanceOf[T])
- for (elem <- ts) b += elem
- i += 1
- }
-
- val res = new Array[Any](b.size)
- b.copyToArray(res, 0)
- res
- }
-
- def sequentialCopyToArray(destarr: Array[Any], pos: Int, sz: Int) = {
- Array.copy(arr, 0, destarr, pos, sz)
- }
-
- def sequentialSegmentLength(pred: T => Boolean, from: Int, sz: Int) = {
- var i = from
- var cnt = 0
-
- while (i < sz) {
- if (pred(arr(i).asInstanceOf[T])) {
- cnt += 1
- i += 1
- } else i = sz
- }
-
- cnt
- }
-
- def sequentialIndexWhere(pred: T => Boolean, from: Int, sz: Int) = {
- var i = from
- var pos = -1
-
- while (i < sz) {
- if (pred(arr(i).asInstanceOf[T])) {
- pos = i
- i = sz
- } else i += 1
- }
-
- pos
- }
-
- def sequentialLastIndexWhere(pred: T => Boolean, end: Int, sz: Int) = {
- var i = end
- var pos = -1
-
- while (i >= 0) {
- if (pred(arr(i).asInstanceOf[T])) {
- pos = i
- i = -1
- } else i -= 1
- }
-
- pos
- }
-
- def sequentialReverse(sz: Int) = {
- val res = new Array[Any](sz)
-
- var i = sz - 1
- var j = 0
- while (i >= 0) {
- res(j) = arr(i)
- i -= 1
- j += 1
- }
- res
- }
-
- def sequentialReverseMap(f: T => T, sz: Int) = {
- val res = new Array[Any](sz)
-
- var i = sz - 1
- var j = 0
- while (i >= 0) {
- res(j) = f(arr(i).asInstanceOf[T])
- i -= 1
- j += 1
- }
- res
- }
-
- def sequentialSameElements(sq: Seq[T], sz: Int): Boolean = {
- if (sz != sq.length) false
- else {
- var i = 0
- val jt = sq.iterator
- while (i < sz) {
- if (arr(i) == jt.next) i += 1
- else i = sz + 1
- }
- if (i == sz) true
- else false
- }
- }
-
- def sequentialCorresponds(sq: Seq[T], f: (T, T) => Boolean, sz: Int): Boolean = {
- if (sz != sq.length) false
- else {
- var i = 0
- val jt = sq.iterator
- while (i < sz) {
- if (f(arr(i).asInstanceOf[T], jt.next)) i += 1
- else i = sz + 1
- }
- if (i == sz) true
- else false
- }
- }
-
- def sequentialDiff(sq: Seq[T], sz: Int) = {
- val occmap = occurrences(sq)
- val b = new collection.mutable.ArrayBuffer[T]
-
- var i = 0
- while (i < sz) {
- val elem = arr(i).asInstanceOf[T]
- if (occmap(elem) == 0) b += elem
- else occmap(elem) -= 1
- i += 1
- }
-
- val res = new Array[Any](b.size)
- b.copyToArray(res, 0)
- res
- }
-
- def sequentialIntersect(sq: Seq[T], sz: Int) = {
- val occmap = occurrences(sq)
- val b = new collection.mutable.ArrayBuffer[T]
-
- var i = 0
- while (i < sz) {
- val elem = arr(i).asInstanceOf[T]
- val num = occmap(elem)
- if (num > 0) {
- b += elem
- occmap(elem) = num - 1
- }
- i += 1
- }
-
- val res = new Array[Any](b.size)
- b.copyToArray(res, 0)
- res
- }
-
- private def occurrences(sq: Seq[T]) = {
- val occmap = new collection.mutable.HashMap[T, Int] { override def default(k: T) = 0 }
- for (elem <- sq.iterator) occmap(elem) += 1
- occmap
- }
-
- def sequentialRemoveDuplicates(sz: Int) = {
- val occ = new collection.mutable.HashSet[T]
- val b = new collection.mutable.ArrayBuffer[T]
-
- var i = 0
- while (i < sz) {
- val elem = arr(i).asInstanceOf[T]
- if (!occ.contains(elem)) {
- b += elem
- occ.add(elem)
- }
- i += 1
- }
-
- val res = new Array[Any](b.size)
- b.copyToArray(res, 0)
- res
- }
-
- def sequentialPatch(from: Int, p: Seq[T], replaced: Int, sz: Int) = {
- val b = new collection.mutable.ArrayBuffer[T]
- b.sizeHint(from + (sz - from - replaced) + p.size)
-
- var i = 0
- while (i < from) {
- b += arr(i).asInstanceOf[T]
- i += 1
- }
-
- val jt = p.iterator
- while (jt.hasNext) b += jt.next
-
- val skipto = from + replaced
- while (i < from + replaced) i += 1
-
- while (i < sz) {
- b += arr(i).asInstanceOf[T]
- i += 1
- }
-
- val res = new Array[Any](b.size)
- b.copyToArray(res, 0)
- res
- }
-
- def sequentialPadTo(tosize: Int, elem: T, sz: Int) = {
- val b = new collection.mutable.ArrayBuffer[T]
- b.sizeHint(tosize)
-
- var i = 0
- while (i < sz) {
- b += arr(i).asInstanceOf[T]
- i += 1
- }
-
- while (i < tosize) {
- b += elem
- i += 1
- }
-
- val res = new Array[Any](b.size)
- b.copyToArray(res, 0)
- res
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceFew.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceFew.scala
deleted file mode 100644
index 450d640b8d..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceFew.scala
+++ /dev/null
@@ -1,47 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object SliceFew extends Companion {
- def benchName = "slice-few";
- def apply(sz: Int, parallelism: Int, what: String) = new SliceFew(sz, parallelism, what)
- override def comparisons = Nil
- override def defaultSize = 50000
-}
-
-class SliceFew(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = SliceFew
- override def repetitionsPerRun = 200
- runresult = -1
-
- def runpar = runresult = pa.slice(5, 25).size
- def runseq = runresult = sequentialSlice(5, 25, sz).size
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceMany.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceMany.scala
deleted file mode 100644
index 4a30b60e1f..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceMany.scala
+++ /dev/null
@@ -1,47 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object SliceMany extends Companion {
- def benchName = "slice-many";
- def apply(sz: Int, parallelism: Int, what: String) = new SliceMany(sz, parallelism, what)
- override def comparisons = Nil
- override def defaultSize = 50000
-}
-
-class SliceMany(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = SliceMany
- override def repetitionsPerRun = 200
- runresult = -1
-
- def runpar = runresult = pa.slice(pa.size / 4, pa.size * 3 / 4).size
- def runseq = runresult = sequentialSlice(sz / 4, sz * 3 / 4, sz).size
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceMedium.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceMedium.scala
deleted file mode 100644
index e16002f15d..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SliceMedium.scala
+++ /dev/null
@@ -1,47 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object SliceMedium extends Companion {
- def benchName = "slice-medium";
- def apply(sz: Int, parallelism: Int, what: String) = new SliceMedium(sz, parallelism, what)
- override def comparisons = Nil
- override def defaultSize = 50000
-}
-
-class SliceMedium(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = SliceMedium
- override def repetitionsPerRun = 200
- runresult = -1
-
- def runpar = runresult = pa.slice(pa.size / 7, pa.size * 4 / 7).size
- def runseq = runresult = sequentialSlice(sz / 7, sz * 4 / 7, sz).size
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SpanLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SpanLight.scala
deleted file mode 100644
index 5f1e631bce..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SpanLight.scala
+++ /dev/null
@@ -1,62 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object SpanLight extends Companion {
- def benchName = "span-light";
- def apply(sz: Int, parallelism: Int, what: String) = new SpanLight(sz, parallelism, what)
- override def comparisons = Nil
- override def defaultSize = 20000
-
- val pred = (a: Cont) => check(a.in)
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = check(a.in)
- }
-
- def check(n: Int) = {
- var res = n
- var i = 1
- while (i < 10) {
- res += n % i
- i += 1
- }
- if (n != 10000) res % 2 == 0 || n != 10000
- else false
- }
-}
-
-class SpanLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = SpanLight
- runresult = -1
-
- def runpar = runresult = pa.span(SpanLight.pred)._1.size
- def runseq = runresult = sequentialSpan(SpanLight.pred, sz)._1.size
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SplitHalf.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SplitHalf.scala
deleted file mode 100644
index ff1e009481..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SplitHalf.scala
+++ /dev/null
@@ -1,47 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object SplitHalf extends Companion {
- def benchName = "split-half";
- def apply(sz: Int, parallelism: Int, what: String) = new SplitHalf(sz, parallelism, what)
- override def comparisons = Nil
- override def defaultSize = 50000
-}
-
-class SplitHalf(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = SplitHalf
- override def repetitionsPerRun = 300
- runresult = -1
-
- def runpar = runresult = pa.splitAt(pa.size / 2)._1.size
- def runseq = runresult = sequentialSplitAtOpt(sz / 2, sz)._1.size
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SumLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SumLight.scala
deleted file mode 100644
index 6ed6d14370..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/SumLight.scala
+++ /dev/null
@@ -1,28 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-
-
-
-/** Tests reduce method using an operator creating an object as a result. */
-class SumLight(sz: Int, p: Int, what: String)
-extends Resettable[Int](sz, p, what, (i: Int) => i, new Array[Any](_), classOf[Int]) {
- def companion = SumLight
- override def repetitionsPerRun = 500
-
- def runpar = pa.sum
- def runseq = sequentialSum(sz)
- override def comparisonMap = collection.Map()
-}
-
-object SumLight extends Companion {
- def benchName = "sum-light";
- def apply(sz: Int, p: Int, what: String) = new SumLight(sz, p, what)
- override def comparisons = List()
-}
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/TakeMany.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/TakeMany.scala
deleted file mode 100644
index 9ddfb77a9d..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/TakeMany.scala
+++ /dev/null
@@ -1,47 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object TakeMany extends Companion {
- def benchName = "take-many";
- def apply(sz: Int, parallelism: Int, what: String) = new TakeMany(sz, parallelism, what)
- override def comparisons = Nil
- override def defaultSize = 250000
-}
-
-class TakeMany(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = TakeMany
- override def repetitionsPerRun = 400
- runresult = -1
-
- def runpar = runresult = pa.take(pa.size / 2).size
- def runseq = runresult = sequentialTake(sz / 2, sz).size
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/TakeWhileLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/TakeWhileLight.scala
deleted file mode 100644
index a86c67d0d8..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/TakeWhileLight.scala
+++ /dev/null
@@ -1,61 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_array
-
-
-import scala.collection.parallel.benchmarks._
-
-
-object TakeWhileLight extends Companion {
- def benchName = "takewhile-light";
- def apply(sz: Int, parallelism: Int, what: String) = new TakeWhileLight(sz, parallelism, what)
- override def comparisons = Nil
- override def defaultSize = 10000
-
- val pred = (a: Cont) => check(a.in)
- val predjsr = new extra166y.Ops.Predicate[Cont] {
- def op(a: Cont) = check(a.in)
- }
-
- def check(n: Int) = {
- var res = n
- var i = 1
- while (i < 10) {
- res += n % i
- i += 1
- }
- res % 2 == 0 || n > 0
- }
-}
-
-class TakeWhileLight(sz: Int, p: Int, what: String)
-extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont])
-with HavingResult[Int] {
- def companion = TakeWhileLight
- runresult = -1
-
- def runpar = runresult = pa.takeWhile(TakeWhileLight.pred).size
- def runseq = runresult = sequentialTakeWhile(TakeWhileLight.pred, sz).size
- def comparisonMap = collection.Map()
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_range/RangeBenches.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_range/RangeBenches.scala
deleted file mode 100644
index af852ce992..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_range/RangeBenches.scala
+++ /dev/null
@@ -1,211 +0,0 @@
-package scala.collection.parallel.benchmarks.parallel_range
-
-
-
-
-
-import scala.collection.parallel.benchmarks.generic._
-import scala.collection.parallel.immutable.ParRange
-import scala.collection.parallel.benchmarks.generic.StandardParIterableBenches
-
-
-
-
-
-object RangeBenches extends StandardParIterableBenches[Int, ParRange] {
-
- def nameOfCollection = "ParRange"
- def operators = new IntOperators {}
- def comparisonMap = collection.Map()
- val forkJoinPool = new scala.concurrent.forkjoin.ForkJoinPool
- def createSequential(sz: Int, p: Int) = new collection.immutable.Range(0, sz, 1)
- def createParallel(sz: Int, p: Int) = {
- val pr = collection.parallel.immutable.ParRange(0, sz, 1, false)
- forkJoinPool.setParallelism(p)
- collection.parallel.tasksupport.environment = forkJoinPool
- pr
- }
-
- object MapLight extends IterableBenchCompanion {
- override def defaultSize = 20000
- def benchName = "map-light";
- def apply(sz: Int, p: Int, w: String) = new MapLight(sz, p, w)
- }
-
- class MapLight(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def calc(n: Int) = n % 2 + 1
-
- def comparisonMap = collection.Map()
- def runseq = for (n <- this.seqcoll) yield calc(n)
- def runpar = for (n <- this.parcoll) yield calc(n)
- def companion = MapLight
- }
-
- object MapMedium extends IterableBenchCompanion {
- override def defaultSize = 5000
- def benchName = "map-medium";
- def apply(sz: Int, p: Int, w: String) = new MapMedium(sz, p, w)
- }
-
- class MapMedium(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- def calc(n: Int) = {
- var i = 0
- var sum = n
- while (i < 40) {
- i += 1
- sum += n % i
- }
- sum
- }
-
- def comparisonMap = collection.Map()
- def runseq = for (n <- this.seqcoll) yield calc(n)
- def runpar = for (n <- this.parcoll) yield calc(n)
- def companion = MapMedium
- }
-
- object ForeachModify extends IterableBenchCompanion {
- override def defaultSize = 150000
- def benchName = "foreach-modify";
- def apply(sz: Int, p: Int, w: String) = new ForeachModify(sz, p, w)
- }
-
- class ForeachModify(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- val array = new Array[Int](size)
- def modify(n: Int) = array(n) += 1
-
- def comparisonMap = collection.Map()
- def runseq = for (n <- this.seqcoll) modify(n)
- def runpar = for (n <- this.parcoll.asInstanceOf[ParRange]) {
- modify(n)
- ()
- }
- def companion = ForeachModify
- }
-
- object ForeachModifyMedium extends IterableBenchCompanion {
- override def defaultSize = 20000
- def benchName = "foreach-modify-medium";
- def apply(sz: Int, p: Int, w: String) = new ForeachModifyMedium(sz, p, w)
- }
-
- class ForeachModifyMedium(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- val array = new Array[Int](size)
- def modify(n: Int) = array(n) = {
- var i = 0
- var sum = 0
- while (i < 15) {
- sum += i % 3
- i += i + 1
- }
- sum
- }
-
- def comparisonMap = collection.Map()
- def runseq = for (n <- this.seqcoll) modify(n)
- def runpar = for (n <- this.parcoll) modify(n)
- def companion = ForeachModifyMedium
- }
-
- object ForeachModifyHeavy extends IterableBenchCompanion {
- override def defaultSize = 1000
- def benchName = "foreach-modify-heavy";
- def apply(sz: Int, p: Int, w: String) = new ForeachModifyHeavy(sz, p, w)
- }
-
- class ForeachModifyHeavy(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- val array = new Array[Int](size)
- def modify(n: Int) = array(n) = collatz(10000 + array(n))
-
- def comparisonMap = collection.Map()
- def runseq = for (n <- this.seqcoll) modify(n)
- def runpar = for (n <- this.parcoll) modify(n)
- def companion = ForeachModifyHeavy
- }
-
- object ForeachAdd extends IterableBenchCompanion {
- override def defaultSize = 10000
- def benchName = "foreach-add";
- def apply(sz: Int, p: Int, w: String) = new ForeachAdd(sz, p, w)
- override def comparisons = List("seq-hashmap")
- }
-
- class ForeachAdd(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- val cmap = new java.util.concurrent.ConcurrentHashMap[Int, Int]
- val hmap = new java.util.HashMap[Int, Int]
-
- override def reset = runWhat match {
- case "seq-hashmap" => seqcoll = createSequential(size, parallelism)
- case _ => super.reset
- }
-
- def comparisonMap = collection.Map("seq-hashmap" -> runseqhashmap _)
- def runseqhashmap = for (i <- seqcoll) hmap put (i, onesum(i))
- def runseq = for (i <- seqcoll) cmap put (i, onesum(i))
- def runpar = for (i <- parcoll) cmap put (i, onesum(i))
- def companion = ForeachAdd
- }
-
- object ForeachAddCollatz extends IterableBenchCompanion {
- override def defaultSize = 5000
- def benchName = "foreach-add-collatz";
- def apply(sz: Int, p: Int, w: String) = new ForeachAddCollatz(sz, p, w)
- override def comparisons = List("seq-hashmap")
- }
-
- class ForeachAddCollatz(val size: Int, val parallelism: Int, val runWhat: String)
- extends IterableBench {
- val cmap = new java.util.concurrent.ConcurrentHashMap[Int, Int]
- val hmap = new java.util.HashMap[Int, Int]
-
- override def reset = runWhat match {
- case "seq-hashmap" => seqcoll = createSequential(size, parallelism)
- case _ => super.reset
- }
-
- def comparisonMap = collection.Map("seq-hashmap" -> runseqhashmap _)
- def runseqhashmap = for (i <- seqcoll) hmap put (i, collatz(i))
- def runseq = for (i <- seqcoll) cmap put (i, collatz(i))
- def runpar = for (i <- parcoll) cmap put (i, collatz(i))
- def companion = ForeachAddCollatz
- }
-
- def collatz(n: Int) = {
- var curr = n
- var sum = 0
- while (curr > 1) {
- sum += curr
- if (curr % 2 == 0) curr = curr / 2
- else curr = curr * 3 + 1
- }
- sum
- }
-
- def onesum(n: Int) = {
- var left = n
- var sum = 0
- while (left > 0) {
- sum += left % 2
- left /= 2
- }
- sum
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_view/SeqViewBenches.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_view/SeqViewBenches.scala
deleted file mode 100644
index 1c1cd52120..0000000000
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_view/SeqViewBenches.scala
+++ /dev/null
@@ -1,51 +0,0 @@
-package scala.collection.parallel
-package benchmarks.parallel_view
-
-
-
-import scala.collection.parallel.benchmarks.generic._
-import scala.collection.SeqView
-
-
-
-
-
-
-
-
-
-
-trait DummyViewBenches
-extends ParSeqViewBenches[Dummy, ParSeqView[Dummy, ParSeq[Dummy], Seq[Dummy]], Seq[Dummy]] {
- def nameOfCollection = "ParView"
- def operators = DummyOperators
- def comparisonMap = collection.Map()
- val forkJoinPool = new scala.concurrent.forkjoin.ForkJoinPool
- def createSequential(sz: Int, p: Int) = {
- val s = new Array[Dummy](sz)
- for (i <- 0 until sz) s(i) = new Dummy(i)
- s
- }
- def createParallel(sz: Int, p: Int) = {
- val pa = new collection.parallel.mutable.ParArray[Dummy](sz)
- forkJoinPool.setParallelism(p)
- for (i <- 0 until sz) pa(i) = new Dummy(i)
- val v = pa.view
- collection.parallel.tasksupport.environment = forkJoinPool
- v
- }
- def createSeqView(sz: Int, p: Int) = createSequential(sz, p).view
-}
-
-
-object DummyViewBenchList extends DummyViewBenches
-
-
-
-
-
-
-
-
-
-
diff --git a/test/benchmarks/src/scala/util/HashSpeedTest.scala b/test/benchmarks/src/scala/util/HashSpeedTest.scala
deleted file mode 100644
index a4d310e6d1..0000000000
--- a/test/benchmarks/src/scala/util/HashSpeedTest.scala
+++ /dev/null
@@ -1,253 +0,0 @@
-object HashSpeedTest {
-
- import System.{ nanoTime => now }
-
- def time[A](f: => A) = {
- val t0 = now
- val ans = f
- (ans, now - t0)
- }
-
- def ptime[A](f: => A) = {
- val (ans, dt) = time(f)
- printf("Elapsed: %.3f\n", dt * 1e-9)
- ans
- }
-
- object HashHist {
- var enabled = true
- val counts = new collection.mutable.HashMap[Int, Int]
- def add(i: Int) { if (enabled) counts(i) = counts.get(i).getOrElse(0) + 1 }
- def resultAndReset = {
- var s = 0L
- var o = 0L
- var m = 0
- counts.valuesIterator.foreach(i => {
- s += i
- if (i > 0) o += 1
- if (i > m) m = i
- })
- counts.clear
- (s, o, m)
- }
- }
-
- def report(s: String, res: (Long, Long, Int)) {
- println("Hash quality of " + s)
- printf(" %5.2f%% of entries are collisions\n", 100 * (res._1 - res._2).toDouble / res._1)
- printf(" Max of %d entries mapped to the same value\n", res._3)
- }
-
- // If you have MurmurHash3 installed, uncomment below (and in main)
- import scala.util.{ MurmurHash3 => MH3 }
-
- val justCountString: String => Unit = str => {
- var s, i = 0
- while (i < str.length) { s += str.charAt(i); i += 1 }
- HashHist.add(s)
- }
-
- val defaultHashString: String => Unit = str => HashHist.add(str.hashCode)
-
- val murmurHashString: String => Unit = str => HashHist.add(MH3.stringHash(str))
-
- def makeCharStrings = {
- val a = new Array[Byte](4)
- val buffer = new collection.mutable.ArrayBuffer[String]
- var i: Int = 'A'
- while (i <= 'Z') {
- a(0) = (i & 0xFF).toByte
- var j: Int = 'a'
- while (j <= 'z') {
- a(1) = (j & 0xFF).toByte
- var k: Int = 'A'
- while (k <= 'z') {
- a(2) = (k & 0xFF).toByte
- var l: Int = 'A'
- while (l <= 'z') {
- a(3) = (l & 0xFF).toByte
- buffer += new String(a)
- l += 1
- }
- k += 1
- }
- j += 1
- }
- i += 1
- }
- buffer.toArray
- }
-
- def hashCharStrings(ss: Array[String], hash: String => Unit) {
- var i = 0
- while (i < ss.length) {
- hash(ss(i))
- i += 1
- }
- }
-
- def justCountList: List[List[Int]] => Unit = lli => {
- var s = 0
- lli.foreach(_.foreach(s += _))
- HashHist.add(s)
- }
-
- def defaultHashList: List[List[Int]] => Unit = lli => HashHist.add(lli.hashCode)
-
- def makeBinaryLists = {
- def singleLists(depth: Int): List[List[Int]] = {
- if (depth <= 0) List(Nil)
- else {
- val set = singleLists(depth - 1)
- val longest = set filter (_.length == depth - 1)
- set ::: (longest.map(0 :: _)) ::: (longest.map(1 :: _))
- }
- }
- val buffer = new collection.mutable.ArrayBuffer[List[List[Int]]]
- val blocks = singleLists(4).toArray
- buffer += List(Nil)
- var i = 0
- while (i < blocks.length) {
- val li = blocks(i) :: Nil
- buffer += li
- var j = 0
- while (j < blocks.length) {
- val lj = blocks(j) :: li
- buffer += lj
- var k = 0
- while (k < blocks.length) {
- val lk = blocks(k) :: lj
- buffer += lk
- var l = 0
- while (l < blocks.length) {
- val ll = blocks(l) :: lk
- buffer += ll
- l += 1
- }
- k += 1
- }
- j += 1
- }
- i += 1
- }
- buffer.toArray
- }
-
- def hashBinaryLists(ls: Array[List[List[Int]]], hash: List[List[Int]] => Unit) {
- var i = 0
- while (i < ls.length) {
- hash(ls(i))
- i += 1
- }
- }
-
- def justCountSets: Set[Int] => Unit = si => {
- var s = 0
- si.foreach(s += _)
- HashHist.add(s)
- }
-
- def defaultHashSets: Set[Int] => Unit = si => HashHist.add(si.hashCode)
-
- def makeIntSets = {
- def sets(depth: Int): List[Set[Int]] = {
- if (depth <= 0) List(Set.empty[Int])
- else {
- val set = sets(depth - 1)
- set ::: set.map(_ + depth)
- }
- }
- sets(20).toArray
- }
-
- def hashIntSets(ss: Array[Set[Int]], hash: Set[Int] => Unit) {
- var i = 0
- while (i < ss.length) {
- hash(ss(i))
- i += 1
- }
- }
-
- def defaultHashTuples: (Product with Serializable) => Unit = p => HashHist.add(p.hashCode)
-
- def makeNestedTuples = {
- val basic = Array(
- (0, 0),
- (0, 1),
- (1, 0),
- (1, 1),
- (0, 0, 0),
- (0, 0, 1),
- (0, 1, 0),
- (1, 0, 0),
- (0, 0, 0, 0),
- (0, 0, 0, 0, 0),
- (false, false),
- (true, false),
- (false, true),
- (true, true),
- (0.7, true, "fish"),
- ((), true, 'c', 400, 9.2, "galactic"))
- basic ++
- (for (i <- basic; j <- basic) yield (i, j)) ++
- (for (i <- basic; j <- basic; k <- basic) yield (i, j, k)) ++
- (for (i <- basic; j <- basic; k <- basic) yield ((i, j), k)) ++
- (for (i <- basic; j <- basic; k <- basic) yield (i, (j, k))) ++
- (for (i <- basic; j <- basic; k <- basic; l <- basic) yield (i, j, k, l)) ++
- (for (i <- basic; j <- basic; k <- basic; l <- basic) yield ((i, j), (k, l))) ++
- (for (i <- basic; j <- basic; k <- basic; l <- basic) yield (i, (j, k, l))) ++
- (for (i <- basic; j <- basic; k <- basic; l <- basic; m <- basic) yield (i, j, k, l, m)) ++
- (for (i <- basic; j <- basic; k <- basic; l <- basic; m <- basic) yield (i, (j, (k, (l, m)))))
- }
-
- def hashNestedTuples(ts: Array[Product with Serializable], hash: (Product with Serializable) => Unit) {
- var i = 0
- while (i < ts.length) {
- hash(ts(i))
- i += 1
- }
- }
-
- def findSpeed[A](n: Int, h: (Array[A], A => Unit) => Unit, aa: Array[A], f: A => Unit) = {
- (time { for (i <- 1 to n) { h(aa, f) } }._2, aa.length.toLong * n)
- }
-
- def reportSpeed[A](repeats: Int, xs: List[(String, () => (Long, Long))]) {
- val tn = Array.fill(xs.length)((0L, 0L))
- for (j <- 1 to repeats) {
- for ((l, i) <- xs zipWithIndex) {
- val x = l._2()
- tn(i) = (tn(i)._1 + x._1, tn(i)._2 + x._2)
- }
- }
- for (((t, n), (title, _)) <- (tn zip xs)) {
- val rate = (n * 1e-6) / (t * 1e-9)
- printf("Hash rate for %s: %4.2f million/second\n", title, rate)
- }
- }
-
- def main(args: Array[String]) {
- val bl = makeBinaryLists
- val is = makeIntSets
- val nt = makeNestedTuples
- // Uncomment the following for string stats if MurmurHash3 available
- val cs = makeCharStrings
- report("Java String hash for strings", { hashCharStrings(cs, defaultHashString); HashHist.resultAndReset })
- report("MurmurHash3 for strings", { hashCharStrings(cs, murmurHashString); HashHist.resultAndReset })
- HashHist.enabled = false
- reportSpeed(3, List(
- ("Java string hash", () => findSpeed[String](30, (x, y) => hashCharStrings(x, y), cs, defaultHashString)),
- ("MurmurHash3 string hash", () => findSpeed[String](30, (x, y) => hashCharStrings(x, y), cs, murmurHashString))))
- // reportSpeed("Java string hash",30,hashCharStrings.tupled,cs,defaultHashString)
- // reportSpeed("MurmurHash3 string hash",30,hashCharStrings.tupled,cs,murmurHashString)
- HashHist.enabled = true
- report("lists of binary int lists", { hashBinaryLists(bl, defaultHashList); HashHist.resultAndReset })
- report("small integer sets", { hashIntSets(is, defaultHashSets); HashHist.resultAndReset })
- report("small nested tuples", { hashNestedTuples(nt, defaultHashTuples); HashHist.resultAndReset })
- HashHist.enabled = false
- reportSpeed(3, List(
- ("lists of lists of binary ints", () => findSpeed(20, hashBinaryLists, bl, defaultHashList)),
- ("small integer sets", () => findSpeed(10, hashIntSets, is, defaultHashSets)),
- ("small nested tuples", () => findSpeed(5, hashNestedTuples, nt, defaultHashTuples))))
- }
-}
diff --git a/test/disabled/coder/Coder.scala b/test/disabled/coder/Coder.scala
index 62b99e0cf0..b116a41a5d 100644
--- a/test/disabled/coder/Coder.scala
+++ b/test/disabled/coder/Coder.scala
@@ -168,7 +168,7 @@ object Test {
/* */
def main(args : Array[String]) {
- // import scala.concurrent.forkjoin.ForkJoinPool
+ // import java.util.concurrent.ForkJoinPool
// collection.parallel.tasksupport.environment match {
// case fj: ForkJoinPool => fj.setParallelism(1)
// }
diff --git a/test/disabled/run/applet-prop.scala b/test/disabled/run/applet-prop.scala
index 9c29dfd979..7a98c25cab 100644
--- a/test/disabled/run/applet-prop.scala
+++ b/test/disabled/run/applet-prop.scala
@@ -8,7 +8,7 @@ class S extends javax.swing.JApplet {
object Test extends SecurityTest {
val s = new S
- // lazy val TestKey = sys.SystemProperties.noTraceSupression.key
+ // lazy val TestKey = sys.SystemProperties.noTraceSuppression.key
// def hitPerm() = new Throwable with scala.util.control.ControlThrowable { }
//
// var throwing = false
diff --git a/test/disabled/run/indylambda-specialization.scala b/test/disabled/run/indylambda-specialization.scala
new file mode 100644
index 0000000000..2c66073e90
--- /dev/null
+++ b/test/disabled/run/indylambda-specialization.scala
@@ -0,0 +1,15 @@
+object Test {
+ def assertApply(expected: Boolean) = {
+ val frames = Thread.currentThread.getStackTrace.takeWhile(_.getMethodName != "main")
+ val usesObjectApply = frames.exists(_.getMethodName == "apply")
+ assert(expected == usesObjectApply, frames.mkString("\n"))
+ }
+ def assertSpecialized() = assertApply(false)
+ def assertUnspecialized() = assertApply(true)
+ def main(args: Array[String]): Unit = {
+ ((i: String) => {assertUnspecialized(); i}).apply("")
+ (() => {assertSpecialized(); 0}).apply()
+ ((i: Int) => {assertSpecialized(); i}).apply(0)
+ ((i: Int, j: Int) => {assertSpecialized(); i + j}).apply(0, 0)
+ }
+}
diff --git a/test/files/jvm/actor-exceptions.check b/test/files/jvm/actor-exceptions.check
deleted file mode 100644
index d86bac9de5..0000000000
--- a/test/files/jvm/actor-exceptions.check
+++ /dev/null
@@ -1 +0,0 @@
-OK
diff --git a/test/files/jvm/actor-exceptions.scala b/test/files/jvm/actor-exceptions.scala
deleted file mode 100644
index bdd983a0e8..0000000000
--- a/test/files/jvm/actor-exceptions.scala
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, Exit}
-import Actor._
-
-case class MyException(text: String) extends Exception {
- override def fillInStackTrace() = this
-}
-
-case class MyOtherException(text: String) extends Exception {
- override def fillInStackTrace() = this
-}
-
-object Master extends Actor {
- trapExit = true
- def act() {
- try {
- link(Slave)
- Slave.start()
- for (i <- 0 until 10) Slave ! A
- react {
- case Exit(from, reason) =>
- println("OK")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Slave extends Actor {
- override def toString = "Slave"
- override def exceptionHandler: PartialFunction[Exception, Unit] = {
- case MyException(text) =>
- case other if !other.isInstanceOf[scala.util.control.ControlThrowable] => super.exceptionHandler(other)
- }
- def act() {
- try {
- var cnt = 0
- loop {
- react {
- case A =>
- cnt += 1
- if (cnt % 2 != 0) throw MyException("problem")
- if (cnt == 10) {
- throw MyOtherException("unhandled")
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] &&
- !e.isInstanceOf[MyException] &&
- !e.isInstanceOf[MyOtherException] =>
- e.printStackTrace()
- }
- }
-}
-
-case object A
-
- def main(args: Array[String]) {
- Master.start()
- }
-}
diff --git a/test/files/jvm/actor-executor.check b/test/files/jvm/actor-executor.check
deleted file mode 100644
index bdbdb5c6a2..0000000000
--- a/test/files/jvm/actor-executor.check
+++ /dev/null
@@ -1,20 +0,0 @@
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
diff --git a/test/files/jvm/actor-executor.scala b/test/files/jvm/actor-executor.scala
deleted file mode 100644
index 0fc28b4d85..0000000000
--- a/test/files/jvm/actor-executor.scala
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import java.util.concurrent.Executors
-import scala.actors.{Actor, SchedulerAdapter}
-import Actor._
-
-trait AdaptedActor extends Actor {
- override def scheduler =
- Test.scheduler
-}
-
-object One extends AdaptedActor {
- def act() {
- try {
- Two.start()
- var i = 0
- loopWhile (i < 10000) {
- i += 1
- Two ! 'MsgForTwo
- react {
- case 'MsgForOne =>
- if (i % 1000 == 0)
- println("One: OK")
- if (i == 10000)
- Test.executor.shutdown()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Two extends AdaptedActor {
- def act() {
- try {
- var i = 0
- loopWhile (i < 10000) {
- i += 1
- react {
- case 'MsgForTwo =>
- if (i % 1000 == 0)
- println("Two: OK")
- One ! 'MsgForOne
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- val executor =
- Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())
-
- val scheduler =
- new SchedulerAdapter {
- def execute(block: => Unit) {
- val task = new Runnable {
- def run() { block }
- }
- try {
- executor.execute(task)
- } catch {
- case ree: java.util.concurrent.RejectedExecutionException =>
- task.run()
- }
- }
- }
-
- def main(args: Array[String]) {
- One.start()
- }
-}
diff --git a/test/files/jvm/actor-executor2.check b/test/files/jvm/actor-executor2.check
deleted file mode 100644
index da78f45836..0000000000
--- a/test/files/jvm/actor-executor2.check
+++ /dev/null
@@ -1,21 +0,0 @@
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-One exited
diff --git a/test/files/jvm/actor-executor2.scala b/test/files/jvm/actor-executor2.scala
deleted file mode 100644
index 5badf2ae7e..0000000000
--- a/test/files/jvm/actor-executor2.scala
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, SchedulerAdapter, Exit}
-import Actor._
-import java.util.concurrent.{Executors, RejectedExecutionException}
-
-object One extends AdaptedActor {
- def act() {
- try {
- Two.start()
- var i = 0
- loopWhile (i < Test.NUM_MSG) {
- i += 1
- Two ! 'MsgForTwo
- react {
- case 'MsgForOne =>
- if (i % (Test.NUM_MSG/10) == 0)
- println("One: OK")
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Two extends AdaptedActor {
- def act() {
- try {
- var i = 0
- loopWhile (i < Test.NUM_MSG) {
- i += 1
- react {
- case 'MsgForTwo =>
- if (i % (Test.NUM_MSG/10) == 0)
- println("Two: OK")
- One ! 'MsgForOne
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-trait AdaptedActor extends Actor {
- override def scheduler =
- Test.scheduler
-}
-
- val NUM_MSG = 100000
-
- val executor =
- Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())
-
- val scheduler =
- new SchedulerAdapter {
- def execute(block: => Unit) {
- val task = new Runnable {
- def run() { block }
- }
- try {
- executor.execute(task)
- } catch {
- case ree: RejectedExecutionException =>
- task.run() // run task on current thread
- }
- }
- }
-
- def main(args: Array[String]) {
- try {
- self.trapExit = true
- link(One)
- One.start()
-
- receive {
- case Exit(from, reason) =>
- println("One exited")
- Test.executor.shutdown()
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
diff --git a/test/files/jvm/actor-executor3.check b/test/files/jvm/actor-executor3.check
deleted file mode 100644
index bdbdb5c6a2..0000000000
--- a/test/files/jvm/actor-executor3.check
+++ /dev/null
@@ -1,20 +0,0 @@
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
diff --git a/test/files/jvm/actor-executor3.scala b/test/files/jvm/actor-executor3.scala
deleted file mode 100644
index f8b57d84b3..0000000000
--- a/test/files/jvm/actor-executor3.scala
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.Actor
-import scala.actors.scheduler.ExecutorScheduler
-import java.util.concurrent.Executors
-
-object One extends AdaptedActor {
- def act() {
- try {
- Two.start()
- var i = 0
- loopWhile (i < Test.NUM_MSG) {
- i += 1
- Two ! 'MsgForTwo
- react {
- case 'MsgForOne =>
- if (i % (Test.NUM_MSG/10) == 0)
- println("One: OK")
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Two extends AdaptedActor {
- def act() {
- try {
- var i = 0
- loopWhile (i < Test.NUM_MSG) {
- i += 1
- react {
- case 'MsgForTwo =>
- if (i % (Test.NUM_MSG/10) == 0)
- println("Two: OK")
- One ! 'MsgForOne
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-trait AdaptedActor extends Actor {
- override def scheduler =
- Test.scheduler
-}
-
- val NUM_MSG = 100000
-
- val executor =
- Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())
-
- val scheduler = ExecutorScheduler(executor)
-
- def main(args: Array[String]) {
- One.start()
- }
-}
diff --git a/test/files/jvm/actor-getstate.check b/test/files/jvm/actor-getstate.check
deleted file mode 100644
index 2c94e48371..0000000000
--- a/test/files/jvm/actor-getstate.check
+++ /dev/null
@@ -1,2 +0,0 @@
-OK
-OK
diff --git a/test/files/jvm/actor-getstate.scala b/test/files/jvm/actor-getstate.scala
deleted file mode 100644
index 425efbe5e6..0000000000
--- a/test/files/jvm/actor-getstate.scala
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.{Reactor, Actor, TIMEOUT}
- import Actor._
-
- def assert(cond: => Boolean, hint: String) {
- if (!cond)
- println("FAIL ["+hint+"]")
- }
-
- def expectActorState(a: Reactor[T] forSome { type T }, s: Actor.State.Value) {
- var done = false
- var i = 0
- while (!done) {
- i = i + 1
- if (i == 10) { // only wait for 2 seconds total
- println("FAIL ["+a+": expected "+s+"]")
- done = true
- }
-
- Thread.sleep(200)
- if (a.getState == s) // success
- done = true
- }
- }
-
- def main(args: Array[String]) {
- actor {
- val a = new Reactor[Any] {
- def act() {
- assert(getState == Actor.State.Runnable, "runnable1")
- react {
- case 'go =>
- println("OK")
- }
- }
- }
- expectActorState(a, Actor.State.New)
-
- a.start()
- expectActorState(a, Actor.State.Suspended)
-
- a ! 'go
- expectActorState(a, Actor.State.Terminated)
-
- val b = new Actor {
- def act() {
- assert(getState == Actor.State.Runnable, "runnable2: "+getState)
- react {
- case 'go =>
- reactWithin(100000) {
- case TIMEOUT =>
- case 'go =>
- receive {
- case 'go =>
- }
- receiveWithin(100000) {
- case TIMEOUT =>
- case 'go =>
- println("OK")
- }
- }
- }
- }
- }
- expectActorState(b, Actor.State.New)
-
- b.start()
- expectActorState(b, Actor.State.Suspended)
-
- b ! 'go
- expectActorState(b, Actor.State.TimedSuspended)
-
- b ! 'go
- expectActorState(b, Actor.State.Blocked)
-
- b ! 'go
- expectActorState(b, Actor.State.TimedBlocked)
-
- b ! 'go
- expectActorState(b, Actor.State.Terminated)
- }
- }
-
-}
diff --git a/test/files/jvm/actor-link-getstate.check b/test/files/jvm/actor-link-getstate.check
deleted file mode 100644
index 9755447320..0000000000
--- a/test/files/jvm/actor-link-getstate.check
+++ /dev/null
@@ -1,2 +0,0 @@
-Done
-Terminated
diff --git a/test/files/jvm/actor-link-getstate.scala b/test/files/jvm/actor-link-getstate.scala
deleted file mode 100644
index d8b8ada1e6..0000000000
--- a/test/files/jvm/actor-link-getstate.scala
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.{Actor, Exit}
- import scala.actors.Actor._
-
-case class MyException(text: String) extends Exception(text) {
- override def fillInStackTrace() = this
-}
-
-object Slave extends Actor {
- def act() {
- try {
- loop {
- react {
- case 'doWork =>
- Console.out.println("Done")
- reply('done)
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Master extends Actor {
- override def toString = "Master"
- def act() {
- try {
- link(Slave)
- Slave ! 'doWork
- react {
- case 'done =>
- throw new MyException("Master crashed")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-
- def main(args: Array[String]) {
- actor {
- try {
- self.trapExit = true
- link(Slave)
- Slave.start()
- Master.start()
- react {
- case Exit(from, reason) if (from == Slave) =>
- Console.out.println(Slave.getState)
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
-}
diff --git a/test/files/jvm/actor-looping.check b/test/files/jvm/actor-looping.check
deleted file mode 100644
index a6f5c2e73a..0000000000
--- a/test/files/jvm/actor-looping.check
+++ /dev/null
@@ -1,5 +0,0 @@
-received A
-received A
-received A
-received A
-received last A
diff --git a/test/files/jvm/actor-looping.scala b/test/files/jvm/actor-looping.scala
deleted file mode 100644
index 7bc6f1e5c5..0000000000
--- a/test/files/jvm/actor-looping.scala
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Actor._
- case object A
-
- def main(args: Array[String]) {
- val a = actor {
- try {
- var cnt = 0
- loop {
- react {
- case A =>
- cnt += 1
- if (cnt % 2 != 0) continue
- if (cnt < 10)
- println("received A")
- else {
- println("received last A")
- exit()
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-
- for (i <- 0 until 10) a ! A
- }
-}
diff --git a/test/files/jvm/actor-normal-exit.check b/test/files/jvm/actor-normal-exit.check
deleted file mode 100644
index 6865f83b90..0000000000
--- a/test/files/jvm/actor-normal-exit.check
+++ /dev/null
@@ -1,2 +0,0 @@
-Done
-slave exited for reason 'normal
diff --git a/test/files/jvm/actor-normal-exit.scala b/test/files/jvm/actor-normal-exit.scala
deleted file mode 100644
index 90495866e2..0000000000
--- a/test/files/jvm/actor-normal-exit.scala
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.{Actor, Exit}
- object Master extends Actor {
- trapExit = true
- def act() {
- try {
- Slave.start()
- react {
- case Exit(from, reason) =>
- println("slave exited for reason " + reason)
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- object Slave extends Actor {
- def act() {
- try {
- link(Master)
- println("Done")
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- def main(args: Array[String]) {
- Master.start()
- }
-}
diff --git a/test/files/jvm/actor-receivewithin.check b/test/files/jvm/actor-receivewithin.check
deleted file mode 100644
index a6a3e88c61..0000000000
--- a/test/files/jvm/actor-receivewithin.check
+++ /dev/null
@@ -1,16 +0,0 @@
-'msg
-'msg
-'msg
-'msg
-'msg
-TIMEOUT
-TIMEOUT
-TIMEOUT
-TIMEOUT
-TIMEOUT
-'msg2
-'msg2
-'msg2
-'msg2
-'msg2
-TIMEOUT
diff --git a/test/files/jvm/actor-receivewithin.scala b/test/files/jvm/actor-receivewithin.scala
deleted file mode 100644
index 5982462502..0000000000
--- a/test/files/jvm/actor-receivewithin.scala
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, TIMEOUT}
-
-object A extends Actor {
- def act() {
- receive {
- case 'done =>
- var cnt = 0
- while (cnt < 500) {
- cnt += 1
- receiveWithin (0) {
- case 'msg =>
- if (cnt % 100 == 0)
- println("'msg")
- case TIMEOUT =>
- // should not happen
- println("FAIL1")
- }
- }
- cnt = 0
- while (cnt < 500) {
- cnt += 1
- receiveWithin (0) {
- case 'msg =>
- // should not happen
- println("FAIL2")
- case TIMEOUT =>
- if (cnt % 100 == 0)
- println("TIMEOUT")
- }
- }
- B ! 'next
- receive { case 'done => }
- cnt = 0
- while (cnt < 501) {
- cnt += 1
- receiveWithin (500) {
- case 'msg2 =>
- if (cnt % 100 == 0)
- println("'msg2")
- case TIMEOUT =>
- println("TIMEOUT")
- }
- }
- }
- }
-}
-
-object B extends Actor {
- def act() {
- A.start()
- for (_ <- 1 to 500) {
- A ! 'msg
- }
- A ! 'done
- receive {
- case 'next =>
- for (_ <- 1 to 500) {
- A ! 'msg2
- }
- A ! 'done
- }
- }
-}
-
- def main(args:Array[String]) {
- B.start()
- }
-}
diff --git a/test/files/jvm/actor-sync-send-timeout.scala b/test/files/jvm/actor-sync-send-timeout.scala
deleted file mode 100644
index 66a0b0a6ff..0000000000
--- a/test/files/jvm/actor-sync-send-timeout.scala
+++ /dev/null
@@ -1,48 +0,0 @@
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.Actor
-
-/* This test is a regression test for SI-4759.
- */
- val Runs = 5
-
- def main(args: Array[String]) = {
- var i = 0
- while (i < Runs) {
- i += 1
- A1 ! 1
- Thread.sleep(500)
- }
- //println("done sending to A1")
- }
-
-object A2 extends Actor {
- this.start()
- def act() {
- loop {
- react {
- case 'stop =>
- //println("A2 exiting")
- exit()
- case _ =>
- }
- }
- }
-}
-
-object A1 extends Actor {
- this.start()
- def act() {
- var i = 0
- loopWhile(i < Test.Runs) {
- i += 1
- react {
- case any =>
- A2 !? (500, any)
- if (i == Test.Runs)
- A2 ! 'stop
- }
- }
- }
-}
-}
diff --git a/test/files/jvm/actor-termination.check b/test/files/jvm/actor-termination.check
deleted file mode 100644
index e3f44d8b18..0000000000
--- a/test/files/jvm/actor-termination.check
+++ /dev/null
@@ -1,2 +0,0 @@
-I'm going to make you wait.
-Ok, I'm done.
diff --git a/test/files/jvm/actor-termination.scala b/test/files/jvm/actor-termination.scala
deleted file mode 100644
index 4a6bf92d48..0000000000
--- a/test/files/jvm/actor-termination.scala
+++ /dev/null
@@ -1,19 +0,0 @@
-
-/* Test that an actor that hasn't finished prevents termination */
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Actor
- def main(args: Array[String]) {
- Actor.actor {
- try {
- println("I'm going to make you wait.")
- Thread.sleep(5000)
- println("Ok, I'm done.")
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-}
diff --git a/test/files/jvm/actor-uncaught-exception.check b/test/files/jvm/actor-uncaught-exception.check
deleted file mode 100644
index 2c94e48371..0000000000
--- a/test/files/jvm/actor-uncaught-exception.check
+++ /dev/null
@@ -1,2 +0,0 @@
-OK
-OK
diff --git a/test/files/jvm/actor-uncaught-exception.scala b/test/files/jvm/actor-uncaught-exception.scala
deleted file mode 100644
index c28ad2fa3c..0000000000
--- a/test/files/jvm/actor-uncaught-exception.scala
+++ /dev/null
@@ -1,64 +0,0 @@
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, Exit}
-
-class MyException(msg: String) extends Exception(msg) {
- override def fillInStackTrace() = this
-}
-
-
- case object StartError extends Actor {
- def act() {
- try {
- throw new MyException("I don't want to run!")
- } catch {
- case e: Throwable if (!e.isInstanceOf[scala.util.control.ControlThrowable] &&
- !e.isInstanceOf[MyException]) =>
- e.printStackTrace()
- }
- }
- }
-
- case object MessageError extends Actor {
- def act() {
- try {
- react {
- case _ => throw new MyException("No message for me!")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- case object Supervisor extends Actor {
- def act() {
- try {
- trapExit = true
- link(StartError)
- link(MessageError)
- StartError.start()
- MessageError.start()
-
- Actor.loop {
- react {
- case Exit(actor, reason) =>
- println("OK")
- if (actor == StartError)
- MessageError ! 'ping
- else
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- def main(args: Array[String]) {
- Supervisor.start()
- }
-}
diff --git a/test/files/jvm/actor-uncaught-exception2.check b/test/files/jvm/actor-uncaught-exception2.check
deleted file mode 100644
index a54f374aed..0000000000
--- a/test/files/jvm/actor-uncaught-exception2.check
+++ /dev/null
@@ -1,2 +0,0 @@
-UncaughtException(StartError,None,None,Test$MyException: I don't want to run!)
-UncaughtException(MessageError,Some('ping),Some(Supervisor),Test$MyException: No message for me!)
diff --git a/test/files/jvm/actor-uncaught-exception2.scala b/test/files/jvm/actor-uncaught-exception2.scala
deleted file mode 100644
index 8327b4e19d..0000000000
--- a/test/files/jvm/actor-uncaught-exception2.scala
+++ /dev/null
@@ -1,63 +0,0 @@
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, Exit, Debug}
-
-class MyException(msg: String) extends Exception(msg) {
- override def fillInStackTrace() = this
-}
-
- case object StartError extends Actor {
- def act() {
- try {
- throw new MyException("I don't want to run!")
- } catch {
- case e: Throwable if (!e.isInstanceOf[scala.util.control.ControlThrowable] &&
- !e.isInstanceOf[MyException]) =>
- e.printStackTrace()
- }
- }
- }
-
- case object MessageError extends Actor {
- def act() {
- try {
- react {
- case _ => throw new MyException("No message for me!")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- case object Supervisor extends Actor {
- def act() {
- try {
- trapExit = true
- link(StartError)
- link(MessageError)
- StartError.start()
- MessageError.start()
-
- Actor.loop {
- react {
- case Exit(actor, reason) =>
- println(reason)
- if (actor == StartError)
- MessageError ! 'ping
- else
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- def main(args: Array[String]) {
- Supervisor.start()
- }
-}
diff --git a/test/files/jvm/daemon-actor-termination.check b/test/files/jvm/daemon-actor-termination.check
deleted file mode 100644
index b2ff72fd0b..0000000000
--- a/test/files/jvm/daemon-actor-termination.check
+++ /dev/null
@@ -1,2 +0,0 @@
-MSG1
-MSG2
diff --git a/test/files/jvm/daemon-actor-termination.scala b/test/files/jvm/daemon-actor-termination.scala
deleted file mode 100644
index 9bac6340ba..0000000000
--- a/test/files/jvm/daemon-actor-termination.scala
+++ /dev/null
@@ -1,40 +0,0 @@
-
-/* Test that a daemon Actor that hasn't finished does not prevent termination */
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-
- import scala.actors.{Actor, DaemonActor}
- class MyDaemon extends DaemonActor {
- def act() {
- try {
- react {
- case 'hello =>
- println("MSG1")
- reply(())
- react {
- case 'bye =>
- println("done")
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- def main(args: Array[String]) {
- val daemon = new MyDaemon
- daemon.start()
- Actor.actor {
- try {
- daemon !? 'hello
- println("MSG2")
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-}
diff --git a/test/files/jvm/future-alarm.check b/test/files/jvm/future-alarm.check
deleted file mode 100644
index 01a87d1c4c..0000000000
--- a/test/files/jvm/future-alarm.check
+++ /dev/null
@@ -1,20 +0,0 @@
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
-OK
diff --git a/test/files/jvm/future-alarm.scala b/test/files/jvm/future-alarm.scala
deleted file mode 100644
index 3e71fa681c..0000000000
--- a/test/files/jvm/future-alarm.scala
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Futures
- def main(args: Array[String]) {
- try {
- for (i <- 1 to 100000) {
- Futures.alarm(0)
- if (i % 10000 == 0)
- println("OK")
- }
- for (_ <- 1 to 10) {
- val ft = Futures.alarm(100)
- ft()
- println("OK")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
diff --git a/test/files/jvm/future-awaitall-zero.check b/test/files/jvm/future-awaitall-zero.check
deleted file mode 100644
index d86bac9de5..0000000000
--- a/test/files/jvm/future-awaitall-zero.check
+++ /dev/null
@@ -1 +0,0 @@
-OK
diff --git a/test/files/jvm/future-awaitall-zero.scala b/test/files/jvm/future-awaitall-zero.scala
deleted file mode 100644
index 56f4bab16f..0000000000
--- a/test/files/jvm/future-awaitall-zero.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Futures._
- import scala.actors.Actor._
- def main(args: Array[String]) {
- try {
- val ft1 = future { reactWithin(10000) {
- case _ => println("FAIL")
- } }
-
- val ft2 = future { reactWithin(20000) {
- case _ => println("FAIL")
- } }
-
- val res = awaitAll(0, ft1, ft2)
- println("OK")
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
diff --git a/test/files/jvm/future-spec.check b/test/files/jvm/future-spec.check
index df1629dd7e..50c5d446af 100644
--- a/test/files/jvm/future-spec.check
+++ b/test/files/jvm/future-spec.check
@@ -1 +1 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
+warning: there were 20 deprecation warnings; re-run with -deprecation for details
diff --git a/test/files/jvm/future-spec/FutureTests.scala b/test/files/jvm/future-spec/FutureTests.scala
index a290af9cd3..abcf1b4cbc 100644
--- a/test/files/jvm/future-spec/FutureTests.scala
+++ b/test/files/jvm/future-spec/FutureTests.scala
@@ -17,6 +17,19 @@ class FutureTests extends MinimalScalaTest {
case "NoReply" => Promise[String]().future
}
+ def fail(msg: String): Nothing = throw new AssertionError(msg)
+
+ def ECNotUsed[T](f: ExecutionContext => T): T = {
+ val p = Promise[Runnable]()
+ val unusedEC: ExecutionContext = new ExecutionContext {
+ def execute(r: Runnable) = p.success(r)
+ def reportFailure(t: Throwable): Unit = p.failure(t)
+ }
+ val t = f(unusedEC)
+ assert(p.future.value == None, "Future executed logic!")
+ t
+ }
+
val defaultTimeout = 5 seconds
/* future specification */
@@ -24,7 +37,7 @@ class FutureTests extends MinimalScalaTest {
"A future with custom ExecutionContext" should {
"shouldHandleThrowables" in {
val ms = new mutable.HashSet[Throwable] with mutable.SynchronizedSet[Throwable]
- implicit val ec = scala.concurrent.ExecutionContext.fromExecutor(new scala.concurrent.forkjoin.ForkJoinPool(), {
+ implicit val ec = scala.concurrent.ExecutionContext.fromExecutor(new java.util.concurrent.ForkJoinPool(), {
t =>
ms += t
})
@@ -68,6 +81,60 @@ class FutureTests extends MinimalScalaTest {
}
}
+ "Futures" should {
+ "have proper toString representations" in {
+ import ExecutionContext.Implicits.global
+ val s = 5
+ val f = new Exception("foo")
+ val t = Try(throw f)
+
+ val expectFailureString = "Future(Failure("+f+"))"
+ val expectSuccessString = "Future(Success(5))"
+ val expectNotCompleteString = "Future(<not completed>)"
+
+ Future.successful(s).toString mustBe expectSuccessString
+ Future.failed(f).toString mustBe expectFailureString
+ Future.fromTry(t).toString mustBe expectFailureString
+ val p = Promise[Int]()
+ p.toString mustBe expectNotCompleteString
+ Promise[Int]().success(s).toString mustBe expectSuccessString
+ Promise[Int]().failure(f).toString mustBe expectFailureString
+ Await.ready(Future { throw f }, 2000 millis).toString mustBe expectFailureString
+ Await.ready(Future { s }, 2000 millis).toString mustBe expectSuccessString
+
+ Future.never.toString mustBe "Future(<never>)"
+ Future.unit.toString mustBe "Future(Success(()))"
+ }
+
+ "have proper const representation for success" in {
+ val s = "foo"
+ val f = Future.successful(s)
+
+ ECNotUsed(ec => f.onFailure({ case _ => fail("onFailure should not have been called") })(ec))
+ assert( ECNotUsed(ec => f.recover({ case _ => fail("recover should not have been called")})(ec)) eq f)
+ assert( ECNotUsed(ec => f.recoverWith({ case _ => fail("flatMap should not have been called")})(ec)) eq f)
+ assert(f.fallbackTo(f) eq f, "Future.fallbackTo must be the same instance as Future.fallbackTo")
+ }
+
+ "have proper const representation for failure" in {
+ val e = new Exception("foo")
+ val f = Future.failed[Future[String]](e)
+
+ assert(f.mapTo[String] eq f, "Future.mapTo must be the same instance as Future.mapTo")
+ assert(f.zip(f) eq f, "Future.zip must be the same instance as Future.zip")
+ assert(f.flatten eq f, "Future.flatten must be the same instance as Future.flatten")
+ assert(f.failed eq f, "Future.failed must be the same instance as Future.failed")
+
+ ECNotUsed(ec => f.foreach(_ => fail("foreach should not have been called"))(ec))
+ ECNotUsed(ec => f.onSuccess({ case _ => fail("onSuccess should not have been called") })(ec))
+ assert( ECNotUsed(ec => f.map(_ => fail("map should not have been called"))(ec)) eq f)
+ assert( ECNotUsed(ec => f.flatMap(_ => fail("flatMap should not have been called"))(ec)) eq f)
+ assert( ECNotUsed(ec => f.filter(_ => fail("filter should not have been called"))(ec)) eq f)
+ assert( ECNotUsed(ec => f.collect({ case _ => fail("collect should not have been called")})(ec)) eq f)
+ assert( ECNotUsed(ec => f.zipWith(f)({ (_,_) => fail("zipWith should not have been called")})(ec)) eq f)
+ }
+ }
+
"The Future companion object" should {
"call ExecutionContext.prepare on apply" in {
val p = Promise[Boolean]()
@@ -85,6 +152,49 @@ class FutureTests extends MinimalScalaTest {
Await.result(f, defaultTimeout) mustBe ("foo")
Await.result(p.future, defaultTimeout) mustBe (true)
}
+
+ "have a unit member representing an already completed Future containing Unit" in {
+ assert(Future.unit ne null, "Future.unit must not be null")
+ assert(Future.unit eq Future.unit, "Future.unit must be the same instance as Future.unit")
+ assert(Future.unit.isCompleted, "Future.unit must already be completed")
+ assert(Future.unit.value.get == Success(()), "Future.unit must contain a Success(())")
+ }
+
+ "have a never member representing a never completed Future of Nothing" in {
+
+ val test: Future[Nothing] = Future.never
+
+ //Verify stable identifier
+ test match {
+ case Future.`never` =>
+ case _ => fail("Future.never did not match Future.`never`")
+ }
+
+ assert(test eq Future.never, "Future.never must be the same instance as Future.never")
+ assert(test ne null, "Future.never must not be null")
+ assert(!test.isCompleted && test.value.isEmpty, "Future.never must never be completed")
+ assert(test.failed eq test)
+ assert(test.asInstanceOf[Future[Future[Nothing]]].flatten eq test)
+ assert(test.zip(test) eq test)
+ assert(test.fallbackTo(test) eq test)
+ assert(test.mapTo[String] eq test)
+
+ ECNotUsed(ec => test.foreach(_ => fail("foreach should not have been called"))(ec))
+ ECNotUsed(ec => test.onSuccess({ case _ => fail("onSuccess should not have been called") })(ec))
+ ECNotUsed(ec => test.onFailure({ case _ => fail("onFailure should not have been called") })(ec))
+ ECNotUsed(ec => test.onComplete({ case _ => fail("onComplete should not have been called") })(ec))
+ ECNotUsed(ec => test.transform(identity, identity)(ec) eq test)
+ ECNotUsed(ec => test.transform(identity)(ec) eq test)
+ ECNotUsed(ec => test.transformWith(_ => fail("transformWith should not have been called"))(ec) eq test)
+ ECNotUsed(ec => test.map(identity)(ec) eq test)
+ ECNotUsed(ec => test.flatMap(_ => fail("flatMap should not have been called"))(ec) eq test)
+ ECNotUsed(ec => test.filter(_ => fail("filter should not have been called"))(ec) eq test)
+ ECNotUsed(ec => test.collect({ case _ => fail("collect should not have been called")})(ec) eq test)
+ ECNotUsed(ec => test.recover({ case _ => fail("recover should not have been called")})(ec) eq test)
+ ECNotUsed(ec => test.recoverWith({ case _ => fail("recoverWith should not have been called")})(ec) eq test)
+ ECNotUsed(ec => test.andThen({ case _ => fail("andThen should not have been called")})(ec) eq test)
+ ECNotUsed(ec => test.zipWith(test)({ (_,_) => fail("zipWith should not have been called")})(ec) eq test)
+ }
}
"The default ExecutionContext" should {
@@ -218,6 +328,142 @@ class FutureTests extends MinimalScalaTest {
} mustBe (r)
}
+ "transform results to results" in {
+ val f1 = Future.successful("foo").transform(_.map(_.toUpperCase))
+ val f2 = Future("bar").transform(_.map(_.toUpperCase))
+ Await.result(f1, defaultTimeout) mustBe "FOO"
+ Await.result(f2, defaultTimeout) mustBe "BAR"
+ }
+
+ "transform failures to failures" in {
+ val initial = new Exception("Initial")
+ val expected1 = new Exception("Expected1")
+ val expected2 = new Exception("Expected2")
+ val f1 = Future(throw initial) transform {
+ case Failure(`initial`) => Failure(expected1)
+ case x => x
+ }
+ val f2 = Future.failed(initial) transform {
+ case Failure(`initial`) => Failure(expected2)
+ case x => x
+ }
+
+ intercept[Exception] { Await.result(f1, defaultTimeout) } mustBe expected1
+ intercept[Exception] { Await.result(f2, defaultTimeout) } mustBe expected2
+ }
+
+ "transform failures to results" in {
+ val initial1 = new Exception("Initial1")
+ val initial2 = new Exception("Initial2")
+ val f1 = Future.failed[String](initial1) transform {
+ case Failure(`initial1`) => Success("foo")
+ case x => x
+ }
+ val f2 = Future[String](throw initial2) transform {
+ case Failure(`initial2`) => Success("bar")
+ case x => x
+ }
+ Await.result(f1, defaultTimeout) mustBe "foo"
+ Await.result(f2, defaultTimeout) mustBe "bar"
+ }
+
+ "transform results to failures" in {
+ val expected1 = new Exception("Expected1")
+ val expected2 = new Exception("Expected2")
+ val expected3 = new Exception("Expected3")
+ val f1 = Future.successful("foo") transform {
+ case Success("foo") => Failure(expected1)
+ case x => x
+ }
+ val f2 = Future("bar") transform {
+ case Success("bar") => Failure(expected2)
+ case x => x
+ }
+ val f3 = Future("bar") transform {
+ case Success("bar") => throw expected3
+ case x => x
+ }
+ intercept[Exception] { Await.result(f1, defaultTimeout) } mustBe expected1
+ intercept[Exception] { Await.result(f2, defaultTimeout) } mustBe expected2
+ intercept[Exception] { Await.result(f3, defaultTimeout) } mustBe expected3
+ }
+
+ "transformWith results" in {
+ val f1 = Future.successful("foo").transformWith {
+ case Success(r) => Future(r.toUpperCase)
+ case f @ Failure(_) => Future.fromTry(f)
+ }
+ val f2 = Future("bar").transformWith {
+ case Success(r) => Future(r.toUpperCase)
+ case f @ Failure(_) => Future.fromTry(f)
+ }
+ Await.result(f1, defaultTimeout) mustBe "FOO"
+ Await.result(f2, defaultTimeout) mustBe "BAR"
+ }
+
+ "transformWith failures" in {
+ val initial = new Exception("Initial")
+ val expected1 = new Exception("Expected1")
+ val expected2 = new Exception("Expected2")
+ val expected3 = new Exception("Expected3")
+
+ val f1 = Future[Int](throw initial).transformWith {
+ case Failure(`initial`) => Future failed expected1
+ case x => Future fromTry x
+ }
+ val f2 = Future.failed[Int](initial).transformWith {
+ case Failure(`initial`) => Future failed expected2
+ case x => Future fromTry x
+ }
+ val f3 = Future[Int](throw initial).transformWith {
+ case Failure(`initial`) => throw expected3
+ case x => Future fromTry x
+ }
+
+ intercept[Exception] { Await.result(f1, defaultTimeout) } mustBe expected1
+ intercept[Exception] { Await.result(f2, defaultTimeout) } mustBe expected2
+ intercept[Exception] { Await.result(f3, defaultTimeout) } mustBe expected3
+ }
+
+ "transformWith failures to future success" in {
+ val initial = new Exception("Initial")
+ val f1 = Future.failed[String](initial).transformWith {
+ case Failure(`initial`) => Future("FOO")
+ case _ => Future failed initial
+ }
+ val f2 = Future[String](throw initial).transformWith {
+ case Failure(`initial`) => Future("BAR")
+ case _ => Future failed initial
+ }
+ Await.result(f1, defaultTimeout) mustBe "FOO"
+ Await.result(f2, defaultTimeout) mustBe "BAR"
+ }
+
+ "transformWith results to future failures" in {
+ val initial = new Exception("Initial")
+ val expected1 = new Exception("Expected1")
+ val expected2 = new Exception("Expected2")
+ val expected3 = new Exception("Expected3")
+
+ val f1 = Future[String]("FOO") transformWith {
+ case Success("FOO") => Future failed expected1
+ case _ => Future successful "FOO"
+ }
+ val f2 = Future.successful("FOO") transformWith {
+ case Success("FOO") => Future failed expected2
+ case _ => Future successful "FOO"
+ }
+ val f3 = Future.successful("FOO") transformWith {
+ case Success("FOO") => throw expected3
+ case _ => Future successful "FOO"
+ }
+
+
+ intercept[Exception] { Await.result(f1, defaultTimeout) } mustBe expected1
+ intercept[Exception] { Await.result(f2, defaultTimeout) } mustBe expected2
+ intercept[Exception] { Await.result(f3, defaultTimeout) } mustBe expected3
+ }
+
"andThen like a boss" in {
val q = new java.util.concurrent.LinkedBlockingQueue[Int]
for (i <- 1 to 1000) {
@@ -281,6 +527,33 @@ class FutureTests extends MinimalScalaTest {
Await.result(successful, timeout) mustBe (("foo", "foo"))
}
+ "zipWith" in {
+ val timeout = 10000 millis
+ val f = new IllegalStateException("test")
+ intercept[IllegalStateException] {
+ val failed = Future.failed[String](f).zipWith(Future.successful("foo")) { _ -> _ }
+ Await.result(failed, timeout)
+ } mustBe (f)
+
+ intercept[IllegalStateException] {
+ val failed = Future.successful("foo").zipWith(Future.failed[String](f)) { _ -> _ }
+ Await.result(failed, timeout)
+ } mustBe (f)
+
+ intercept[IllegalStateException] {
+ val failed = Future.failed[String](f).zipWith(Future.failed[String](f)) { _ -> _ }
+ Await.result(failed, timeout)
+ } mustBe (f)
+
+ val successful = Future.successful("foo").zipWith(Future.successful("foo")) { _ -> _ }
+ Await.result(successful, timeout) mustBe (("foo", "foo"))
+
+ val failure = Future.successful("foo").zipWith(Future.successful("foo")) { (_,_) => throw f }
+ intercept[IllegalStateException] {
+ Await.result(failure, timeout)
+ } mustBe (f)
+ }
+
"fold" in {
val timeout = 10000 millis
def async(add: Int, wait: Int) = Future {
diff --git a/test/files/jvm/future-termination.check b/test/files/jvm/future-termination.check
deleted file mode 100644
index dc335465d4..0000000000
--- a/test/files/jvm/future-termination.check
+++ /dev/null
@@ -1 +0,0 @@
-I can't wait that long, bye.
diff --git a/test/files/jvm/future-termination.scala b/test/files/jvm/future-termination.scala
deleted file mode 100644
index 90ea336ce8..0000000000
--- a/test/files/jvm/future-termination.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-
-/* Test that unevaluated futures do not prevent program termination */
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Futures
- def main(args: Array[String]) {
- try {
- val meaningOfLife = Futures.future {
- Thread.sleep(5000) // pretend this is a harder problem than it is
- println("I have the answer!")
- 42
- }
- println("I can't wait that long, bye.")
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
diff --git a/test/files/jvm/innerClassAttribute.check b/test/files/jvm/innerClassAttribute.check
deleted file mode 100644
index 41448f359b..0000000000
--- a/test/files/jvm/innerClassAttribute.check
+++ /dev/null
@@ -1,54 +0,0 @@
-#partest !-Ydelambdafy:method
--- A4 --
-A4$$anonfun$f$1 / null / null / 17
-A4$$anonfun$f$1 / null / null / 17
-A4 / f / (Lscala/collection/immutable/List;)Lscala/collection/immutable/List;
--- A19 --
-A19$$anonfun$1 / null / null / 17
-A19$$anonfun$2 / null / null / 17
-A19$$anonfun$3 / null / null / 17
-A19$$anonfun$1 / null / null / 17
-A19$$anonfun$2 / null / null / 17
-A19$$anonfun$3 / null / null / 17
-A19 / null / null
-A19 / null / null
-A19 / null / null
--- A20 --
-A20$$anonfun$4 / null / null / 17
-fun1: attribute for itself and the two child closures `() => ()` and `() => () => 1`
-A20$$anonfun$4 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$1 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$2 / null / null / 17
-fun2 () => (): itself and the outer closure
-A20$$anonfun$4 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$1 / null / null / 17
-fun3 () => () => (): itself, the outer closure and its child closure
-A20$$anonfun$4 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$2 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$2$$anonfun$apply$3 / null / null / 17
-fun4: () => 1: itself and the two outer closures
-A20$$anonfun$4 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$2 / null / null / 17
-A20$$anonfun$4$$anonfun$apply$2$$anonfun$apply$3 / null / null / 17
-enclosing: nested closures have outer class defined, but no outer method
-A20 / null / null
-A20$$anonfun$4 / null / null
-A20$$anonfun$4 / null / null
-A20$$anonfun$4$$anonfun$apply$2 / null / null
-#partest -Ydelambdafy:method
--- A4 --
-null / null / null
--- A19 --
-null / null / null
-null / null / null
-null / null / null
--- A20 --
-fun1: attribute for itself and the two child closures `() => ()` and `() => () => 1`
-fun2 () => (): itself and the outer closure
-fun3 () => () => (): itself, the outer closure and its child closure
-fun4: () => 1: itself and the two outer closures
-enclosing: nested closures have outer class defined, but no outer method
-null / null / null
-null / null / null
-null / null / null
-null / null / null
diff --git a/test/files/jvm/innerClassAttribute/Classes_1.scala b/test/files/jvm/innerClassAttribute/Classes_1.scala
index 62c7d94d90..2b690bdd7b 100644
--- a/test/files/jvm/innerClassAttribute/Classes_1.scala
+++ b/test/files/jvm/innerClassAttribute/Classes_1.scala
@@ -187,41 +187,30 @@ trait A24 extends A24Base {
}
class SI_9105 {
- // the EnclosingMethod attributes depend on the delambdafy strategy (inline vs method)
-
- // outerClass-inline enclMeth-inline outerClass-method enclMeth-method
+ // outerClass enclMeth
val fun = (s: String) => {
- class A // closure null (*) SI_9105 null
- def m: Object = { class B; new B } // closure m$1 SI_9105 m$1
- val f: Object = { class C; new C } // closure null (*) SI_9105 null
+ class A // SI_9105 null
+ def m: Object = { class B; new B } // SI_9105 m$1
+ val f: Object = { class C; new C } // SI_9105 null
}
def met = (s: String) => {
- class D // closure null (*) SI_9105 met
- def m: Object = { class E; new E } // closure m$1 SI_9105 m$1
- val f: Object = { class F; new F } // closure null (*) SI_9105 met
+ class D // SI_9105 met
+ def m: Object = { class E; new E } // SI_9105 m$1
+ val f: Object = { class F; new F } // SI_9105 met
}
- // (*) the originalOwner chain of A (similar for D) is: SI_9105.fun.$anonfun-value.A
- // we can get to the anonfun-class (created by uncurry), but not to the apply method.
- //
- // for C and F, the originalOwner chain is fun.$anonfun-value.f.C. at later phases, the rawowner of f is
- // an apply$sp method of the closure class. we could use that as enclosing method, but it would be unsystematic
- // (A / D don't have an encl meth either), and also strange to use the $sp, which is a compilation artifact.
- // So using `null` looks more like the situation in the source code: C / F are nested classes of the anon-fun, and
- // there's no method in between.
-
def byName(op: => Any) = 0
val bnV = byName {
- class G // closure null (*) SI_9105 null
- def m: Object = { class H; new H } // closure m$1 SI_9105 m$1
- val f: Object = { class I; new I } // closure null (*) SI_9105 null
+ class G // SI_9105 null
+ def m: Object = { class H; new H } // SI_9105 m$1
+ val f: Object = { class I; new I } // SI_9105 null
""
}
def bnM = byName {
- class J // closure null (*) SI_9105 bnM
- def m: Object = { class K; new K } // closure m$1 SI_9105 m$1
- val f: Object = { class L; new L } // closure null (*) SI_9105 bnM
+ class J // SI_9105 bnM
+ def m: Object = { class K; new K } // SI_9105 m$1
+ val f: Object = { class L; new L } // SI_9105 bnM
""
}
}
diff --git a/test/files/jvm/innerClassAttribute/Test.scala b/test/files/jvm/innerClassAttribute/Test.scala
index 376b3c895b..702e5e279a 100644
--- a/test/files/jvm/innerClassAttribute/Test.scala
+++ b/test/files/jvm/innerClassAttribute/Test.scala
@@ -78,9 +78,9 @@ object Test extends BytecodeTest {
println(s"${e.outerClass} / ${e.name} / ${e.descriptor}")
}
- def lambdaClass(anonfunName: String, lambdaName: String): String = {
- if (classpath.findClass(anonfunName).isDefined) anonfunName else lambdaName
- }
+
+ val methodHandlesLookup = assertMember(_: InnerClassNode, "java/lang/invoke/MethodHandles", "Lookup", flags = publicStatic | Flags.ACC_FINAL)
+
def testA1() = {
val List(b1) = innerClassNodes("A1")
@@ -109,11 +109,7 @@ object Test extends BytecodeTest {
}
def testA4() = {
- println("-- A4 --")
- printInnerClassNodes("A4")
- val fun = lambdaClass("A4$$anonfun$f$1", "A4$lambda$$f$1")
- printInnerClassNodes(fun)
- printEnclosingMethod(fun)
+ testInner("A4", methodHandlesLookup)
}
def testA5() = {
@@ -149,9 +145,7 @@ object Test extends BytecodeTest {
def testA11() = {
val List(ann) = innerClassNodes("A11")
- // in the java class file, the INNERCLASS attribute has more flags (public | static | abstract | interface | annotation)
- // the scala compiler has its own interpretation of java annotations ant their flags.. it only emits publicStatic.
- assertMember(ann, "JavaAnnot_1", "Ann", flags = publicStatic)
+ assertMember(ann, "JavaAnnot_1", "Ann", flags = publicAbstractInterface | Flags.ACC_STATIC | Flags.ACC_ANNOTATION)
}
def testA13() = {
@@ -247,47 +241,11 @@ object Test extends BytecodeTest {
}
def testA19() = {
- println("-- A19 --")
-
- printInnerClassNodes("A19")
-
- val fun1 = lambdaClass("A19$$anonfun$1", "A19$lambda$1")
- val fun2 = lambdaClass("A19$$anonfun$2", "A19$lambda$2")
- val fun3 = lambdaClass("A19$$anonfun$3", "A19$lambda$3")
-
- printInnerClassNodes(fun1)
- printInnerClassNodes(fun2)
- printInnerClassNodes(fun3)
-
- printEnclosingMethod(fun1)
- printEnclosingMethod(fun2)
- printEnclosingMethod(fun3)
+ testInner("A19", methodHandlesLookup)
}
def testA20() = {
- println("-- A20 --")
-
- printInnerClassNodes("A20")
-
- val fun1 = lambdaClass("A20$$anonfun$4", "A20$lambda$1")
- val fun2 = lambdaClass("A20$$anonfun$4$$anonfun$apply$1", "A20$lambda$$$nestedInAnonfun$5$1")
- val fun3 = lambdaClass("A20$$anonfun$4$$anonfun$apply$2", "A20$lambda$$$nestedInAnonfun$5$2")
- val fun4 = lambdaClass("A20$$anonfun$4$$anonfun$apply$2$$anonfun$apply$3", "A20$lambda$$$nestedInAnonfun$7$1")
-
- println("fun1: attribute for itself and the two child closures `() => ()` and `() => () => 1`")
- printInnerClassNodes(fun1)
- println("fun2 () => (): itself and the outer closure")
- printInnerClassNodes(fun2)
- println("fun3 () => () => (): itself, the outer closure and its child closure")
- printInnerClassNodes(fun3)
- println("fun4: () => 1: itself and the two outer closures")
- printInnerClassNodes(fun4)
-
- println("enclosing: nested closures have outer class defined, but no outer method")
- printEnclosingMethod(fun1)
- printEnclosingMethod(fun2)
- printEnclosingMethod(fun3)
- printEnclosingMethod(fun4)
+ testInner("A20", methodHandlesLookup)
}
def testA21() = {
@@ -337,70 +295,30 @@ object Test extends BytecodeTest {
}
def testSI_9105() {
- val isDelambdafyMethod = classpath.findClass("SI_9105$lambda$1").isDefined
- if (isDelambdafyMethod) {
- assertEnclosingMethod ("SI_9105$A$3" , "SI_9105", null , null)
- assertEnclosingMethod ("SI_9105$B$5" , "SI_9105", "m$1", "()Ljava/lang/Object;")
- assertEnclosingMethod ("SI_9105$C$1" , "SI_9105", null , null)
- assertEnclosingMethod ("SI_9105$D$1" , "SI_9105", "met", "()Lscala/Function1;")
- assertEnclosingMethod ("SI_9105$E$1" , "SI_9105", "m$3", "()Ljava/lang/Object;")
- assertEnclosingMethod ("SI_9105$F$1" , "SI_9105", "met", "()Lscala/Function1;")
- assertNoEnclosingMethod("SI_9105$lambda$$met$1")
- assertNoEnclosingMethod("SI_9105$lambda$1")
- assertNoEnclosingMethod("SI_9105")
-
- assertLocal(innerClassNodes("SI_9105$A$3").head, "SI_9105$A$3", "A$3")
- assertLocal(innerClassNodes("SI_9105$B$5").head, "SI_9105$B$5", "B$5")
- assertLocal(innerClassNodes("SI_9105$C$1").head, "SI_9105$C$1", "C$1")
- assertLocal(innerClassNodes("SI_9105$D$1").head, "SI_9105$D$1", "D$1")
- assertLocal(innerClassNodes("SI_9105$E$1").head, "SI_9105$E$1", "E$1")
- assertLocal(innerClassNodes("SI_9105$F$1").head, "SI_9105$F$1", "F$1")
-
- // by-name
- assertEnclosingMethod("SI_9105$G$1", "SI_9105", null , null)
- assertEnclosingMethod("SI_9105$H$1", "SI_9105", "m$2", "()Ljava/lang/Object;")
- assertEnclosingMethod("SI_9105$I$1", "SI_9105", null , null)
- assertEnclosingMethod("SI_9105$J$1", "SI_9105", "bnM", "()I")
- assertEnclosingMethod("SI_9105$K$2", "SI_9105", "m$4", "()Ljava/lang/Object;")
- assertEnclosingMethod("SI_9105$L$1", "SI_9105", "bnM", "()I")
-
- assert(innerClassNodes("SI_9105$lambda$$met$1").isEmpty)
- assert(innerClassNodes("SI_9105$lambda$1").isEmpty)
- assert(innerClassNodes("SI_9105").length == 12) // the 12 local classes
- } else {
- // comment in innerClassAttribute/Classes_1.scala explains the difference between A / C and D / F.
- assertEnclosingMethod ("SI_9105$$anonfun$5$A$3" , "SI_9105$$anonfun$5" , null , null)
- assertEnclosingMethod ("SI_9105$$anonfun$5$B$5" , "SI_9105$$anonfun$5" , "m$1" , "()Ljava/lang/Object;")
- assertEnclosingMethod ("SI_9105$$anonfun$5$C$1" , "SI_9105$$anonfun$5" , null , null)
- assertEnclosingMethod ("SI_9105$$anonfun$met$1$D$1", "SI_9105$$anonfun$met$1", null , null)
- assertEnclosingMethod ("SI_9105$$anonfun$met$1$E$1", "SI_9105$$anonfun$met$1", "m$3" , "()Ljava/lang/Object;")
- assertEnclosingMethod ("SI_9105$$anonfun$met$1$F$1", "SI_9105$$anonfun$met$1", null , null)
- assertEnclosingMethod ("SI_9105$$anonfun$5" , "SI_9105" , null , null)
- assertEnclosingMethod ("SI_9105$$anonfun$met$1" , "SI_9105" , "met" , "()Lscala/Function1;")
- assertNoEnclosingMethod("SI_9105")
-
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$5$A$3"), "SI_9105$$anonfun$5$A$3" , "A$3")
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$5$B$5"), "SI_9105$$anonfun$5$B$5" , "B$5")
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$5$C$1"), "SI_9105$$anonfun$5$C$1" , "C$1")
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$met$1$D$1"), "SI_9105$$anonfun$met$1$D$1", "D$1")
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$met$1$E$1"), "SI_9105$$anonfun$met$1$E$1", "E$1")
- assertLocal(ownInnerClassNode("SI_9105$$anonfun$met$1$F$1"), "SI_9105$$anonfun$met$1$F$1", "F$1")
-
- // by-name
- assertEnclosingMethod("SI_9105$$anonfun$6$G$1", "SI_9105$$anonfun$6", null, null)
- assertEnclosingMethod("SI_9105$$anonfun$6$H$1", "SI_9105$$anonfun$6", "m$2", "()Ljava/lang/Object;")
- assertEnclosingMethod("SI_9105$$anonfun$6$I$1", "SI_9105$$anonfun$6", null, null)
- assertEnclosingMethod("SI_9105$$anonfun$bnM$1$J$1", "SI_9105$$anonfun$bnM$1", null, null)
- assertEnclosingMethod("SI_9105$$anonfun$bnM$1$K$2", "SI_9105$$anonfun$bnM$1", "m$4", "()Ljava/lang/Object;")
- assertEnclosingMethod("SI_9105$$anonfun$bnM$1$L$1", "SI_9105$$anonfun$bnM$1", null, null)
-
- assertAnonymous(ownInnerClassNode("SI_9105$$anonfun$5"), "SI_9105$$anonfun$5")
- assertAnonymous(ownInnerClassNode("SI_9105$$anonfun$met$1"), "SI_9105$$anonfun$met$1")
-
- assert(innerClassNodes("SI_9105$$anonfun$5").length == 4) // itself and three of the local classes
- assert(innerClassNodes("SI_9105$$anonfun$met$1").length == 4) // itself and three of the local classes
- assert(innerClassNodes("SI_9105").length == 4) // the four anon funs
- }
+ assertEnclosingMethod ("SI_9105$A$3" , "SI_9105", null , null)
+ assertEnclosingMethod ("SI_9105$B$5" , "SI_9105", "m$1", "()Ljava/lang/Object;")
+ assertEnclosingMethod ("SI_9105$C$1" , "SI_9105", null , null)
+ assertEnclosingMethod ("SI_9105$D$1" , "SI_9105", "met", "()Lscala/Function1;")
+ assertEnclosingMethod ("SI_9105$E$1" , "SI_9105", "m$3", "()Ljava/lang/Object;")
+ assertEnclosingMethod ("SI_9105$F$1" , "SI_9105", "met", "()Lscala/Function1;")
+ assertNoEnclosingMethod("SI_9105")
+
+ assertLocal(innerClassNodes("SI_9105$A$3").head, "SI_9105$A$3", "A$3")
+ assertLocal(innerClassNodes("SI_9105$B$5").head, "SI_9105$B$5", "B$5")
+ assertLocal(innerClassNodes("SI_9105$C$1").head, "SI_9105$C$1", "C$1")
+ assertLocal(innerClassNodes("SI_9105$D$1").head, "SI_9105$D$1", "D$1")
+ assertLocal(innerClassNodes("SI_9105$E$1").head, "SI_9105$E$1", "E$1")
+ assertLocal(innerClassNodes("SI_9105$F$1").head, "SI_9105$F$1", "F$1")
+
+ // by-name
+ assertEnclosingMethod("SI_9105$G$1", "SI_9105", null , null)
+ assertEnclosingMethod("SI_9105$H$1", "SI_9105", "m$2", "()Ljava/lang/Object;")
+ assertEnclosingMethod("SI_9105$I$1", "SI_9105", null , null)
+ assertEnclosingMethod("SI_9105$J$1", "SI_9105", "bnM", "()I")
+ assertEnclosingMethod("SI_9105$K$2", "SI_9105", "m$4", "()Ljava/lang/Object;")
+ assertEnclosingMethod("SI_9105$L$1", "SI_9105", "bnM", "()I")
+
+ assert(innerClassNodes("SI_9105").length == 13) // the 12 local classes, plus MethodHandles$Lookup
}
def testSI_9124() {
@@ -530,37 +448,8 @@ object Test extends BytecodeTest {
testInner("NestedInValueClass$A$B", am, b)
testInner("NestedInValueClass$A$C$2", am, c)
- val isDelambdafyMethod = classpath.findClass("NestedInValueClass$A$lambda$$f$extension$1").isDefined
- if (isDelambdafyMethod) {
- List(
- "NestedInValueClass$A$lambda$$g$2$1",
- "NestedInValueClass$A$lambda$$f$extension$1",
- "NestedInValueClass$A$lambda$$$nestedInAnonfun$13$1",
- "NestedInValueClass$A$lambda$$NestedInValueClass$A$$$nestedInAnonfun$15$1").foreach(assertNoEnclosingMethod)
- testInner("NestedInValueClass$A", a, am)
- testInner("NestedInValueClass$A$", a, am, b, c)
- testInner("NestedInValueClass$A$lambda$$g$2$1", am)
- testInner("NestedInValueClass$A$lambda$$f$extension$1", am)
- testInner("NestedInValueClass$A$lambda$$$nestedInAnonfun$13$1", am)
- testInner("NestedInValueClass$A$lambda$$NestedInValueClass$A$$$nestedInAnonfun$15$1", am)
- } else {
- assertEnclosingMethod("NestedInValueClass$A$$anonfun$g$2$1" , "NestedInValueClass$A" , null, null)
- assertEnclosingMethod("NestedInValueClass$A$$anonfun$g$2$1$$anonfun$apply$4" , "NestedInValueClass$A$$anonfun$g$2$1" , null, null)
- assertEnclosingMethod("NestedInValueClass$A$$anonfun$f$extension$1" , "NestedInValueClass$A" , "f", "()Lscala/collection/immutable/List;")
- assertEnclosingMethod("NestedInValueClass$A$$anonfun$f$extension$1$$anonfun$apply$5", "NestedInValueClass$A$$anonfun$f$extension$1", null, null)
-
- val gfun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$g$2$1")
- val ffun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$f$extension$1")
- val gfunfun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$g$2$1$$anonfun$apply$4")
- val ffunfun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$f$extension$1$$anonfun$apply$5")
-
- testInner("NestedInValueClass$A", a, am, ffun, gfun)
- testInner("NestedInValueClass$A$", a, am, ffun, gfun, b, c)
- testInner("NestedInValueClass$A$$anonfun$g$2$1", a, am, gfun, gfunfun)
- testInner("NestedInValueClass$A$$anonfun$g$2$1$$anonfun$apply$4", am, gfun, gfunfun)
- testInner("NestedInValueClass$A$$anonfun$f$extension$1", a, am, ffun, ffunfun)
- testInner("NestedInValueClass$A$$anonfun$f$extension$1$$anonfun$apply$5", am, ffun, ffunfun)
- }
+ testInner("NestedInValueClass$A", a, am)
+ testInner("NestedInValueClass$A$", a, am, b, c, methodHandlesLookup)
}
def show(): Unit = {
diff --git a/test/files/jvm/javaReflection.check b/test/files/jvm/javaReflection.check
index 8180ecff8a..5f7aafe77c 100644
--- a/test/files/jvm/javaReflection.check
+++ b/test/files/jvm/javaReflection.check
@@ -1,86 +1,3 @@
-#partest !-Ydelambdafy:method
-A$$anonfun$$lessinit$greater$1 / null (canon) / $anonfun$$lessinit$greater$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / public A(int) (constr) / null (meth)
-- properties : true (local) / false (member)
-A$$anonfun$$lessinit$greater$1$$anonfun$apply$1 / null (canon) / $anonfun$apply$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A$$anonfun$$lessinit$greater$1 (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-A$$anonfun$2 / null (canon) / $anonfun$2 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-A$$anonfun$3 / null (canon) / $anonfun$3 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-A$$anonfun$4 / null (canon) / $anonfun$4 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-A$$anonfun$f$1 / null (canon) / $anonfun$f$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / public java.lang.Object A.f() (meth)
-- properties : true (local) / false (member)
-A$$anonfun$f$2 / null (canon) / $anonfun$f$2 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A (cls) / null (constr) / public java.lang.Object A.f() (meth)
-- properties : true (local) / false (member)
-A$D$$anonfun$1 / null (canon) / anonfun$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class A$D$ (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-AO$$anonfun$5 / null (canon) / anonfun$5 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / class AO$ (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-AT$$anonfun$6 / null (canon) / $anonfun$6 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / interface AT (cls) / null (constr) / null (meth)
-- properties : true (local) / false (member)
-#partest -Ydelambdafy:method
-A$D$lambda$1 / A$D$lambda$1 (canon) / A$D$lambda$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$$$lessinit$greater$1 / A$lambda$$$lessinit$greater$1 (canon) / A$lambda$$$lessinit$greater$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$$$nestedInAnonfun$7$1 / A$lambda$$$nestedInAnonfun$7$1 (canon) / A$lambda$$$nestedInAnonfun$7$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$$f$1 / A$lambda$$f$1 (canon) / A$lambda$$f$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$$f$2 / A$lambda$$f$2 (canon) / A$lambda$$f$2 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$1 / A$lambda$1 (canon) / A$lambda$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$2 / A$lambda$2 (canon) / A$lambda$2 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-A$lambda$3 / A$lambda$3 (canon) / A$lambda$3 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-AO$lambda$1 / AO$lambda$1 (canon) / AO$lambda$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-AT$class$lambda$1 / AT$class$lambda$1 (canon) / AT$class$lambda$1 (simple)
-- declared cls: List()
-- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
-- properties : false (local) / false (member)
-#partest
A / A (canon) / A (simple)
- declared cls: List(class A$B, interface A$C, class A$D$)
- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth)
diff --git a/test/files/jvm/patmat_opt_ignore_underscore/test.scala b/test/files/jvm/patmat_opt_ignore_underscore/test.scala
index 6179101a7e..d6630e80a0 100644
--- a/test/files/jvm/patmat_opt_ignore_underscore/test.scala
+++ b/test/files/jvm/patmat_opt_ignore_underscore/test.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning; re-run with
+ */
import scala.tools.partest.BytecodeTest
import scala.tools.nsc.util.JavaClassPath
diff --git a/test/files/jvm/patmat_opt_no_nullcheck/test.scala b/test/files/jvm/patmat_opt_no_nullcheck/test.scala
index 2927e763d5..d02c929e01 100644
--- a/test/files/jvm/patmat_opt_no_nullcheck/test.scala
+++ b/test/files/jvm/patmat_opt_no_nullcheck/test.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning; re-run with
+ */
import scala.tools.partest.BytecodeTest
object Test extends BytecodeTest {
diff --git a/test/files/jvm/reactor-exceptionOnSend.check b/test/files/jvm/reactor-exceptionOnSend.check
deleted file mode 100644
index 45d62e26a7..0000000000
--- a/test/files/jvm/reactor-exceptionOnSend.check
+++ /dev/null
@@ -1,2 +0,0 @@
-receiver handles exception
-process
diff --git a/test/files/jvm/reactor-exceptionOnSend.scala b/test/files/jvm/reactor-exceptionOnSend.scala
deleted file mode 100644
index 6d79fc9d13..0000000000
--- a/test/files/jvm/reactor-exceptionOnSend.scala
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.Reactor
-import scala.actors.Actor._
-
-case class MyException(text: String) extends Exception(text)
-
-object A extends Reactor[Any] {
- override def exceptionHandler = {
- case MyException(text) =>
- println("receiver handles exception")
- }
-
- def guard(): Boolean =
- if (state == 0) {
- state = 1
- throw MyException("illegal state")
- } else
- true
-
- var state = 0
-
- def act() {
- try {
- loop {
- react {
- case 'hello if guard() =>
- println("process")
- exit()
- }
- }
- } catch {
- case e: Throwable if (!e.isInstanceOf[scala.util.control.ControlThrowable] &&
- !e.isInstanceOf[MyException]) =>
- e.printStackTrace()
- }
- }
-}
-
-object B extends Reactor[Any] {
- def act() {
- try {
- A.start()
- A ! 'hello
- A ! 'hello
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- B.start()
- }
-}
diff --git a/test/files/jvm/reactor-producer-consumer.check b/test/files/jvm/reactor-producer-consumer.check
deleted file mode 100644
index d971cea19e..0000000000
--- a/test/files/jvm/reactor-producer-consumer.check
+++ /dev/null
@@ -1,10 +0,0 @@
-42
-42
-42
-42
-42
-42
-42
-42
-42
-42
diff --git a/test/files/jvm/reactor-producer-consumer.scala b/test/files/jvm/reactor-producer-consumer.scala
deleted file mode 100644
index ec34febe01..0000000000
--- a/test/files/jvm/reactor-producer-consumer.scala
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Reactor
- case class Stop()
- case class Get(from: Reactor[Any])
- case class Put(x: Int)
-
- class UnboundedBuffer extends Reactor[Any] {
- def act() {
- try {
- react {
- case Stop() =>
- case Get(from) =>
- val consumer = from
- react {
- case msg @ Put(x) =>
- consumer ! x
- act()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- class Producer(buf: UnboundedBuffer, n: Int, delay: Long, parent: Reactor[Any]) extends Reactor[Any] {
- def act() {
- try {
- var i = 0
- while (i < n) {
- i += 1
- if (delay > 0) Thread.sleep(delay)
- buf ! Put(42)
- }
- parent ! Stop()
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- class Consumer(buf: UnboundedBuffer, n: Int, delay: Long, parent: Reactor[Any]) extends Reactor[Any] {
- val step = n / 10
- var i = 0
- def act() {
- try {
- if (i < n) {
- i += 1
- if (delay > 0) Thread.sleep(delay)
- buf ! Get(this)
- react {
- case res =>
- if (i % step == 0)
- println(res)
- act()
- }
- } else {
- parent ! Stop()
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- def main(args: Array[String]) {
- val parent = new Reactor[Any] {
- def act() {
- try {
- val buffer = new UnboundedBuffer
- buffer.start()
- val producer = new Producer(buffer, 10000, 0, this)
- producer.start()
- val consumer = new Consumer(buffer, 10000, 0, this)
- consumer.start()
- react {
- case Stop() =>
- react {
- case Stop() =>
- buffer ! Stop()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- parent.start()
- }
-}
diff --git a/test/files/jvm/reactor.check b/test/files/jvm/reactor.check
deleted file mode 100644
index 7b16085797..0000000000
--- a/test/files/jvm/reactor.check
+++ /dev/null
@@ -1,22 +0,0 @@
-Pong: ping 0
-Ping: pong
-Pong: ping 10000
-Ping: pong
-Pong: ping 20000
-Ping: pong
-Pong: ping 30000
-Ping: pong
-Pong: ping 40000
-Ping: pong
-Pong: ping 50000
-Ping: pong
-Pong: ping 60000
-Ping: pong
-Pong: ping 70000
-Ping: pong
-Pong: ping 80000
-Ping: pong
-Pong: ping 90000
-Ping: pong
-Ping: stop
-Pong: stop
diff --git a/test/files/jvm/reactor.scala b/test/files/jvm/reactor.scala
deleted file mode 100644
index 91ded27f07..0000000000
--- a/test/files/jvm/reactor.scala
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Ping pong example for Reactor.
- *
- * @author Philipp Haller
- */
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-
-import scala.actors.Reactor
-
-case class Ping(from: Reactor[Any])
-case object Pong
-case object Stop
-
- def main(args: Array[String]) {
- val pong = new PongActor
- val ping = new PingActor(100000, pong)
- ping.start
- pong.start
- }
-
-class PingActor(count: Int, pong: Reactor[Any]) extends Reactor[Any] {
- def act() {
- try {
- var pingsLeft = count - 1
- pong ! Ping(this)
- loop {
- react {
- case Pong =>
- if (pingsLeft % 10000 == 0)
- println("Ping: pong")
- if (pingsLeft > 0) {
- pong ! Ping(this)
- pingsLeft -= 1
- } else {
- println("Ping: stop")
- pong ! Stop
- exit()
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-class PongActor extends Reactor[Any] {
- def act() {
- try {
- var pongCount = 0
- loop {
- react {
- case Ping(from) =>
- if (pongCount % 10000 == 0)
- println("Pong: ping "+pongCount)
- from ! Pong
- pongCount += 1
- case Stop =>
- println("Pong: stop")
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-}
diff --git a/test/files/jvm/replyablereactor.check b/test/files/jvm/replyablereactor.check
deleted file mode 100644
index 0944b17279..0000000000
--- a/test/files/jvm/replyablereactor.check
+++ /dev/null
@@ -1,5 +0,0 @@
-'hello
-'hello
-'hello
-'hello
-'hello
diff --git a/test/files/jvm/replyablereactor.scala b/test/files/jvm/replyablereactor.scala
deleted file mode 100644
index 4c4e13d9ab..0000000000
--- a/test/files/jvm/replyablereactor.scala
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.ReplyReactor
-
-class MyActor extends ReplyReactor {
- def act() {
- try {
- loop {
- react {
- case 'hello =>
- sender ! 'hello
- case 'stop =>
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- val a = new MyActor
- a.start()
-
- val b = new ReplyReactor {
- def act() {
- try {
- react {
- case r: MyActor =>
- var i = 0
- loop {
- i += 1
- val ft = r !! 'hello
- ft.inputChannel.react {
- case msg =>
- if (i % 10000 == 0)
- println(msg)
- if (i >= 50000) {
- r ! 'stop
- exit()
- }
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- b ! a
- }
-}
diff --git a/test/files/jvm/replyablereactor2.check b/test/files/jvm/replyablereactor2.check
deleted file mode 100644
index 0944b17279..0000000000
--- a/test/files/jvm/replyablereactor2.check
+++ /dev/null
@@ -1,5 +0,0 @@
-'hello
-'hello
-'hello
-'hello
-'hello
diff --git a/test/files/jvm/replyablereactor2.scala b/test/files/jvm/replyablereactor2.scala
deleted file mode 100644
index 21f33cce56..0000000000
--- a/test/files/jvm/replyablereactor2.scala
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors._
-import scala.actors.Actor._
-
-class MyActor extends ReplyReactor {
- def act() {
- try {
- loop {
- react {
- case 'hello =>
- sender ! 'hello
- case 'stop =>
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- val a = new MyActor
- a.start()
-
- val b = new Reactor[Any] {
- def act() {
- try {
- react {
- case r: MyActor =>
- var i = 0
- loop {
- i += 1
- val ft = r !! 'hello
- val msg = ft()
- if (i % 10000 == 0)
- println(msg)
- if (i >= 50000) {
- r ! 'stop
- exit()
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- b ! a
- }
-}
diff --git a/test/files/jvm/replyablereactor3.check b/test/files/jvm/replyablereactor3.check
deleted file mode 100644
index 0944b17279..0000000000
--- a/test/files/jvm/replyablereactor3.check
+++ /dev/null
@@ -1,5 +0,0 @@
-'hello
-'hello
-'hello
-'hello
-'hello
diff --git a/test/files/jvm/replyablereactor3.scala b/test/files/jvm/replyablereactor3.scala
deleted file mode 100644
index 5810ed053f..0000000000
--- a/test/files/jvm/replyablereactor3.scala
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors._
-import scala.actors.Actor._
-
-class MyActor extends ReplyReactor {
- def act() {
- try {
- loop {
- react {
- case 'hello =>
- sender ! 'hello
- case 'stop =>
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- val a = new MyActor
- a.start()
-
- val b = new Reactor[Any] {
- def act() {
- try {
- react {
- case r: MyActor =>
- var i = 0
- loop {
- i += 1
- val msg = r !? 'hello
- if (i % 10000 == 0)
- println(msg)
- if (i >= 50000) {
- r ! 'stop
- exit()
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- b ! a
- }
-}
diff --git a/test/files/jvm/replyablereactor4.check b/test/files/jvm/replyablereactor4.check
deleted file mode 100644
index cac0fffe3b..0000000000
--- a/test/files/jvm/replyablereactor4.check
+++ /dev/null
@@ -1,5 +0,0 @@
-Some('hello)
-Some('hello)
-Some('hello)
-Some('hello)
-Some('hello)
diff --git a/test/files/jvm/replyablereactor4.scala b/test/files/jvm/replyablereactor4.scala
deleted file mode 100644
index 95d63684dd..0000000000
--- a/test/files/jvm/replyablereactor4.scala
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors._
-import scala.actors.Actor._
-
-class MyActor extends ReplyReactor {
- def act() {
- try {
- loop {
- react {
- case 'hello =>
- sender ! 'hello
- case 'stop =>
- exit()
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- val a = new MyActor
- a.start()
-
- val b = new Reactor[Any] {
- def act() {
- try {
- react {
- case r: MyActor =>
- var i = 0
- loop {
- i += 1
- val msg = r !? (500, 'hello)
- if (i % 200000 == 0)
- println(msg)
- if (i >= 1000000) {
- r ! 'stop
- exit()
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- b ! a
- }
-}
diff --git a/test/files/jvm/replyreactor-react-sender.check b/test/files/jvm/replyreactor-react-sender.check
deleted file mode 100644
index d86bac9de5..0000000000
--- a/test/files/jvm/replyreactor-react-sender.check
+++ /dev/null
@@ -1 +0,0 @@
-OK
diff --git a/test/files/jvm/replyreactor-react-sender.scala b/test/files/jvm/replyreactor-react-sender.scala
deleted file mode 100644
index fdcea09035..0000000000
--- a/test/files/jvm/replyreactor-react-sender.scala
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.ReplyReactor
- import scala.actors.Actor._
-
- val NUM = 2000
-
- def main(args: Array[String]) {
- var b: ReplyReactor = null
-
- val a = new ReplyReactor {
- def act() {
- try {
- var i = 0
- loopWhile (i < NUM) {
- i += 1
- react {
- case 'hello if sender == this => b ! 'fail
- case 'hello if sender == b => // do nothing
- }
- } andThen {
- b ! 'ok
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- a.start()
-
- b = new ReplyReactor {
- def act() {
- try {
- for (_ <- 0 until NUM)
- a ! 'hello
- react {
- case 'fail => println("FAIL")
- case 'ok => println("OK")
- case other => println(other)
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
- }
-
-}
diff --git a/test/files/jvm/replyreactor.check b/test/files/jvm/replyreactor.check
deleted file mode 100644
index 4b2fea867a..0000000000
--- a/test/files/jvm/replyreactor.check
+++ /dev/null
@@ -1 +0,0 @@
-'hello
diff --git a/test/files/jvm/replyreactor.scala b/test/files/jvm/replyreactor.scala
deleted file mode 100644
index 7512fb0eb2..0000000000
--- a/test/files/jvm/replyreactor.scala
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.ReplyReactor
- def main(args: Array[String]) {
- val a = new ReplyReactor {
- def act() {
- try {
- react {
- case 'hello =>
- sender ! 'hello
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- a.start()
-
- val b = new ReplyReactor {
- def act() {
- try {
- react {
- case r: ReplyReactor =>
- r ! 'hello
- react {
- case any =>
- println(any)
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- b ! a
- }
-}
diff --git a/test/files/jvm/scala-concurrent-tck.check b/test/files/jvm/scala-concurrent-tck.check
new file mode 100644
index 0000000000..9aef07d1e5
--- /dev/null
+++ b/test/files/jvm/scala-concurrent-tck.check
@@ -0,0 +1 @@
+warning: there were 73 deprecation warnings; re-run with -deprecation for details
diff --git a/test/files/jvm/scala-concurrent-tck.scala b/test/files/jvm/scala-concurrent-tck.scala
index ce86d4aef0..8069028cf5 100644
--- a/test/files/jvm/scala-concurrent-tck.scala
+++ b/test/files/jvm/scala-concurrent-tck.scala
@@ -165,6 +165,100 @@ def testTransformFailure(): Unit = once {
g onFailure { case e => done(e eq transformed) }
}
+ def testTransformResultToResult(): Unit = once {
+ done =>
+ Future("foo").transform {
+ case Success(s) => Success(s.toUpperCase)
+ case Failure(f) => throw new Exception("test failed")
+ } onComplete {
+ case Success("FOO") => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformResultToFailure(): Unit = once {
+ done =>
+ val e = new Exception("expected")
+ Future("foo").transform {
+ case Success(s) => Failure(e)
+ case Failure(f) => throw new Exception("test failed")
+ } onComplete {
+ case Failure(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformFailureToResult(): Unit = once {
+ done =>
+ val e = "foo"
+ Future(throw new Exception("initial")).transform {
+ case Success(s) => throw new Exception("test failed")
+ case Failure(f) => Success(e)
+ } onComplete {
+ case Success(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformFailureToFailure(): Unit = once {
+ done =>
+ val e = new Exception("expected")
+ Future(throw new Exception("initial")).transform {
+ case Success(s) => throw new Exception("test failed")
+ case Failure(f) => Failure(e)
+ } onComplete {
+ case Failure(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformWithResultToResult(): Unit = once {
+ done =>
+ Future("foo").transformWith {
+ case Success(s) => Future(s.toUpperCase)
+ case Failure(f) => throw new Exception("test failed")
+ } onComplete {
+ case Success("FOO") => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformWithResultToFailure(): Unit = once {
+ done =>
+ val e = new Exception("expected")
+ Future("foo").transformWith {
+ case Success(s) => Future(throw e)
+ case Failure(f) => throw new Exception("test failed")
+ } onComplete {
+ case Failure(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformWithFailureToResult(): Unit = once {
+ done =>
+ val e = "foo"
+ Future(throw new Exception("initial")).transformWith {
+ case Success(s) => throw new Exception("test failed")
+ case Failure(f) => Future(e)
+ } onComplete {
+ case Success(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
+ def testTransformWithFailureToFailure(): Unit = once {
+ done =>
+ val e = new Exception("expected")
+ Future(throw new Exception("initial")).transformWith {
+ case Success(s) => throw new Exception("test failed")
+ case Failure(f) => Future(throw e)
+ } onComplete {
+ case Failure(`e`) => done(true)
+ case _ => done(false)
+ }
+ }
+
def testFoldFailure(): Unit = once {
done =>
val f = Future[Unit] { throw new Exception("expected") }
@@ -352,6 +446,14 @@ def testTransformFailure(): Unit = once {
h onFailure { case e => done(e eq cause) }
}
+ def testFallbackToThis(): Unit = {
+ def check(f: Future[Int]) = assert((f fallbackTo f) eq f)
+
+ check(Future { 1 })
+ check(Future.successful(1))
+ check(Future.failed[Int](new Exception))
+ }
+
testMapSuccess()
testMapFailure()
testFlatMapSuccess()
@@ -373,6 +475,16 @@ def testTransformFailure(): Unit = once {
testFallbackToFailure()
testTransformSuccess()
testTransformSuccessPF()
+ testTransformFailure()
+ testTransformFailurePF()
+ testTransformResultToResult()
+ testTransformResultToFailure()
+ testTransformFailureToResult()
+ testTransformFailureToFailure()
+ testTransformWithResultToResult()
+ testTransformWithResultToFailure()
+ testTransformWithFailureToResult()
+ testTransformWithFailureToFailure()
}
@@ -517,7 +629,7 @@ trait BlockContexts extends TestBase {
// test BlockContext in our default ExecutionContext
def testDefaultFJP(): Unit = {
val bc = getBlockContext(BlockContext.current)
- assert(bc.isInstanceOf[scala.concurrent.forkjoin.ForkJoinWorkerThread])
+ assert(bc.isInstanceOf[java.util.concurrent.ForkJoinWorkerThread])
}
// test BlockContext inside BlockContext.withBlockContext
@@ -593,6 +705,17 @@ trait Exceptions extends TestBase {
}
+trait GlobalExecutionContext extends TestBase {
+ def testNameOfGlobalECThreads(): Unit = once {
+ done => Future({
+ val expectedName = "scala-execution-context-global-"+ Thread.currentThread.getId
+ done(expectedName == Thread.currentThread.getName)
+ })(ExecutionContext.global)
+ }
+
+ testNameOfGlobalECThreads()
+}
+
trait CustomExecutionContext extends TestBase {
import scala.concurrent.{ ExecutionContext, Awaitable }
@@ -772,6 +895,7 @@ with FutureProjections
with Promises
with BlockContexts
with Exceptions
+with GlobalExecutionContext
with CustomExecutionContext
with ExecutionContextPrepare
{
diff --git a/test/files/jvm/scheduler-adapter.check b/test/files/jvm/scheduler-adapter.check
deleted file mode 100644
index b278674cf0..0000000000
--- a/test/files/jvm/scheduler-adapter.check
+++ /dev/null
@@ -1,6 +0,0 @@
-before
-before
-before
-Two: received msg
-before
-One: received msg
diff --git a/test/files/jvm/scheduler-adapter.scala b/test/files/jvm/scheduler-adapter.scala
deleted file mode 100644
index 1c9cfe7019..0000000000
--- a/test/files/jvm/scheduler-adapter.scala
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, SchedulerAdapter}
-
-trait AdaptedActor extends Actor {
- override def scheduler =
- Test.adapted
-}
-
-object One extends AdaptedActor {
- def act() {
- try {
- Two.start()
- Two ! 'MsgForTwo
- react {
- case 'MsgForOne =>
- println("One: received msg")
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
-object Two extends AdaptedActor {
- def act() {
- try {
- react {
- case 'MsgForTwo =>
- println("Two: received msg")
- One ! 'MsgForOne
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- val adapted =
- new SchedulerAdapter {
- def execute(block: => Unit) {
- println("before")
- block
- }
- }
-
- def main(args: Array[String]) {
- One.start()
- }
-}
diff --git a/test/files/jvm/t1449.check b/test/files/jvm/t1449.check
deleted file mode 100644
index d81cc0710e..0000000000
--- a/test/files/jvm/t1449.check
+++ /dev/null
@@ -1 +0,0 @@
-42
diff --git a/test/files/jvm/t1449.scala b/test/files/jvm/t1449.scala
deleted file mode 100644
index 7917d6f6d5..0000000000
--- a/test/files/jvm/t1449.scala
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Actor._
- import scala.actors.Future
- import scala.actors.Futures._
- def main(args: Array[String]) {
- val a = actor {
- try {
- react {
- case ft: Future[a] =>
- println(ft())
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- try {
- val ft = future { 42 }
- a ! ft
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
diff --git a/test/files/jvm/t1948.scala b/test/files/jvm/t1948.scala
deleted file mode 100644
index 95777b8037..0000000000
--- a/test/files/jvm/t1948.scala
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors._
- import scala.actors.Actor._
-
- def main (args: Array[String]) {
- val actors = (1 to 1000).toList map { x => actor {
- try {
- loop { react {
- case x: Array[Int] => reply ("OK"); exit }}
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- } }
- try {
- actors foreach { x => x !? new Array[Int] (1000000) }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-
-}
diff --git a/test/files/jvm/t2359.check b/test/files/jvm/t2359.check
deleted file mode 100644
index 8a1218a102..0000000000
--- a/test/files/jvm/t2359.check
+++ /dev/null
@@ -1,5 +0,0 @@
-1
-2
-3
-4
-5
diff --git a/test/files/jvm/t2359.scala b/test/files/jvm/t2359.scala
deleted file mode 100644
index 76b78d44f7..0000000000
--- a/test/files/jvm/t2359.scala
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Futures._
- def main(args: Array[String]) {
- val x = future {
- try {
- System.out.println(1)
- future {
- try {
- System.out.println(2)
- future {
- try {
- System.out.println(3)
- future {
- try {
- System.out.println(4)
- future {
- try {
- System.out.println(5)
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }()
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }()
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }()
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }()
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }()
- }
-}
diff --git a/test/files/jvm/t2530.check b/test/files/jvm/t2530.check
deleted file mode 100644
index 0f1c02158d..0000000000
--- a/test/files/jvm/t2530.check
+++ /dev/null
@@ -1,21 +0,0 @@
- Iteration 1 succeeded
- Iteration 2 succeeded
- Iteration 3 succeeded
- Iteration 4 succeeded
- Iteration 5 succeeded
- Iteration 6 succeeded
- Iteration 7 succeeded
- Iteration 8 succeeded
- Iteration 9 succeeded
- Iteration 10 succeeded
- Iteration 11 succeeded
- Iteration 12 succeeded
- Iteration 13 succeeded
- Iteration 14 succeeded
- Iteration 15 succeeded
- Iteration 16 succeeded
- Iteration 17 succeeded
- Iteration 18 succeeded
- Iteration 19 succeeded
- Iteration 20 succeeded
-Test done with no deadlock. Try again, it will not occur...
diff --git a/test/files/jvm/t2530.scala b/test/files/jvm/t2530.scala
deleted file mode 100644
index b41661e623..0000000000
--- a/test/files/jvm/t2530.scala
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.{Future, Futures}
-
- def main(args:Array[String]) : Unit = {
- //scala.actors.Debug.level = 3
- val size = /*if (args.length > 0) Integer.parseInt(args(0)) else*/ 8
- val (m,n) = (size, size)
- def random = (for (i <- 0 until m*n) yield java.lang.Math.random).toArray
- val A = Matrix(m, n, random)
- val B = Matrix(m, n, random)
- val format = new java.text.DecimalFormat("000.00'ms'");
- var iter = 1
- val done = 21
- while (iter < done) {
- val start = System.nanoTime()
- val result = A * B
- val time = System.nanoTime() - start
- result match {
- case Some(result) => {
- printf(" Iteration %2d succeeded %n", iter/*, format.format(time / 1e6)*/)
- iter += 1
- }
- case None => {
- printf(">>>> Iteration %2d failed after %s <<<<< %n", iter, format.format(time / 1e6))
- iter = done
- }
- }
- }
- println("Test done with no deadlock. Try again, it will not occur...")
- }
-
-case class Matrix(numRows: Int, numCols: Int, values: Array[Double]) {
-
- def this(m:Int, n:Int) = this(m, n, new Array[Double](m*n))
-
- def offset(i:Int, j:Int) = i * numCols + j
- def apply(i:Int, j:Int) = values( offset(i,j) )
- def update(i:Int, j:Int, value:Double) = values(offset(i, j)) = value;
-
- def *(by:Matrix) = {
- val aM = numRows
- val aN = numCols
- assert(aM == by.numCols)
- assert(aN == by.numRows)
- val resultMatrix = new Matrix(aM, aM)
- val m = aM.asInstanceOf[Int]
- val n = aN.asInstanceOf[Int]
-
- val rows = for (j <- 0 until m) yield {
- Futures.future {
- try {
- val b_j = new Array[Double](n)
- var k = 0
- while (k < n) { // sadly, while loops are still faster than for loops
- b_j(k) = by(k,j)
- k += 1
- }
- var i = 0
- while (i < m) {
- var s = 0.0d;
- k = 0
- while (k < n) {
- s += Matrix.this(i,k) * b_j(k)
- k += 1
- }
- resultMatrix(i,j) = s
- i += 1
- }
- //printf("future %d of %d completed.%n", j, m)
- j
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-
- // rows.foreach { x=> x() } // This appears to force sequential execution, so use:
- // timeout is 10 years; see http://lampsvn.epfl.ch/trac/scala/ticket/2515
- val done: List[Option[Any]] = try {
- Futures.awaitAll(10*365*24*60*60*1000, rows.toArray : _*) // list to array, as varargs.
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- List()
- }
-
- if (done.contains(None))
- None
- else
- Some(resultMatrix)
- }
-
-}
-}
diff --git a/test/files/jvm/t3102.check b/test/files/jvm/t3102.check
deleted file mode 100644
index d705e0b20e..0000000000
--- a/test/files/jvm/t3102.check
+++ /dev/null
@@ -1,2 +0,0 @@
-42
-OK
diff --git a/test/files/jvm/t3102.scala b/test/files/jvm/t3102.scala
deleted file mode 100644
index d0e0704859..0000000000
--- a/test/files/jvm/t3102.scala
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.{Actor, TIMEOUT}
- import Actor._
-
- def main(args: Array[String]) {
- val a = actor {
- try {
- react {
- case 'hello =>
- reply(42)
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-
- val b = actor {
- try {
- self.trapExit = true
- val ft = a !! 'hello
- println(ft())
- // no message should be left over in mailbox
- reactWithin(0) {
- case TIMEOUT =>
- println("OK")
- case any =>
- println(any)
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
-}
diff --git a/test/files/jvm/t3356.check b/test/files/jvm/t3356.check
deleted file mode 100644
index 25f47b70c9..0000000000
--- a/test/files/jvm/t3356.check
+++ /dev/null
@@ -1,3 +0,0 @@
-sending download requests
-Couldn't download image because of java.lang.Exception: no connection
-Couldn't download image because of java.lang.Exception: no connection
diff --git a/test/files/jvm/t3356.scala b/test/files/jvm/t3356.scala
deleted file mode 100644
index 53bfd737cd..0000000000
--- a/test/files/jvm/t3356.scala
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{Actor, Exit, !, UncaughtException}
-import Actor._
-
-case class ImageInfo(text: String) {
- def downloadImage(): ImageData = {
- ImageData(text)
- }
-}
-
-case class ImageData(text: String)
-case class Download(info: ImageInfo)
-
-
- def scanForImageInfo(url: String): List[ImageInfo] =
- List(ImageInfo("A"), ImageInfo("B"))
-
- def renderImage(data: ImageData) {
- println("rendering image "+data.text)
- }
-
- def renderImages(url: String) {
- val imageInfos = scanForImageInfo(url)
- println("sending download requests")
- val dataFutures = for (info <- imageInfos) yield {
- val loader = link {
- react { case Download(info) =>
- throw new Exception("no connection")
- reply(info.downloadImage())
- }; {}
- }
- loader !! Download(info)
- }
- var i = 0
- loopWhile (i < imageInfos.size) {
- i += 1
- val FutureInput = dataFutures(i-1).inputChannel
- react {
- case FutureInput ! (data @ ImageData(_)) =>
- renderImage(data)
- case Exit(from, UncaughtException(_, Some(Download(info)), _, _, cause)) =>
- println("Couldn't download image because of "+cause)
- }
- }
- println("OK, all images rendered.")
- }
-
- def main(args: Array[String]) {
- actor {
- self.trapExit = true
- renderImages("panorama.epfl.ch")
- }
- }
-
-}
diff --git a/test/files/jvm/t3365.check b/test/files/jvm/t3365.check
deleted file mode 100644
index 0944b17279..0000000000
--- a/test/files/jvm/t3365.check
+++ /dev/null
@@ -1,5 +0,0 @@
-'hello
-'hello
-'hello
-'hello
-'hello
diff --git a/test/files/jvm/t3365.scala b/test/files/jvm/t3365.scala
deleted file mode 100644
index 8321428093..0000000000
--- a/test/files/jvm/t3365.scala
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-import scala.actors.{ReplyReactor, Channel, Actor, Future}
-
-case class ChannelMsg(chan: Channel[Any])
-
-class MyActor extends Actor {
- def act() {
- try {
- val chan = new Channel[Any](this)
- loop {
- react {
- case other: ReplyReactor =>
- other ! ChannelMsg(chan)
- loop {
- chan.react {
- case 'hello =>
- reply('hello)
- case 'stop =>
- exit()
- }
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
-}
-
- def main(args: Array[String]) {
- val a = new MyActor
- a.start()
-
- val b = new Actor {
- def act() {
- try {
- react {
- case ChannelMsg(c) =>
- var i = 0
- loop {
- i += 1
- val ft: Future[Any] = c !! 'hello
- ft.inputChannel.react {
- case msg =>
- if (i % 10000 == 0)
- println(msg)
- if (i >= 50000) {
- c ! 'stop
- exit()
- }
- }
- }
- }
- } catch {
- case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
- e.printStackTrace()
- }
- }
- }
- b.start()
-
- a ! b
- }
-}
diff --git a/test/files/jvm/t3407.check b/test/files/jvm/t3407.check
deleted file mode 100644
index a133c88bbe..0000000000
--- a/test/files/jvm/t3407.check
+++ /dev/null
@@ -1,10 +0,0 @@
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
-result: 42
diff --git a/test/files/jvm/t3407.scala b/test/files/jvm/t3407.scala
deleted file mode 100644
index 757fa3a438..0000000000
--- a/test/files/jvm/t3407.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors._, scala.actors.Actor._
-
- def main(args: Array[String]) {
- for (i <- 1 to 10) {
- val ft = Futures.future { 42 }
- println("result: " + ft())
- }
-
- for (i <- 1 to 10) {
- receiveWithin(0) {
- case TIMEOUT =>
- case msg => println("unexpected: " + msg)
- }
- }
- }
-
-}
diff --git a/test/files/jvm/t3412-channel.check b/test/files/jvm/t3412-channel.check
deleted file mode 100644
index 954c6e835d..0000000000
--- a/test/files/jvm/t3412-channel.check
+++ /dev/null
@@ -1,10 +0,0 @@
-6
-6
-6
-6
-6
-6
-6
-6
-6
-6
diff --git a/test/files/jvm/t3412-channel.scala b/test/files/jvm/t3412-channel.scala
deleted file mode 100644
index af319d2303..0000000000
--- a/test/files/jvm/t3412-channel.scala
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors._, scala.actors.Actor._, scala.actors.Futures._
-
- def main(args: Array[String]) {
-
- actor {
- val C: Channel[Int] = new Channel[Int](self)
-
- def respondAll(fts: List[Future[Int]], cnt: Int): Unit =
- fts match {
- case List() => C ! 0
- case ft :: rest =>
- if (cnt % 100 == 0)
- println(ft())
- respondAll(rest, cnt + 1)
- }
-
- actor {
- val fts = for (_ <- 1 to 1000)
- yield C !! (3, {case x: Int => x})
-
- actor {
- respondAll(fts.toList, 0)
- }
- }
-
- loop {
- C.react {
- case 0 => exit()
- case i => reply(i * 2)
- }
- }
- }
-
- }
-
-}
diff --git a/test/files/jvm/t3412.check b/test/files/jvm/t3412.check
deleted file mode 100644
index 954c6e835d..0000000000
--- a/test/files/jvm/t3412.check
+++ /dev/null
@@ -1,10 +0,0 @@
-6
-6
-6
-6
-6
-6
-6
-6
-6
-6
diff --git a/test/files/jvm/t3412.scala b/test/files/jvm/t3412.scala
deleted file mode 100644
index fde6c04cb7..0000000000
--- a/test/files/jvm/t3412.scala
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors._, scala.actors.Actor._, scala.actors.Futures._
-
- def main(args: Array[String]) {
-
- val a = actor {
- loop { react {
- case i: Int => reply(i * 2)
- case 'stop => exit()
- } }
- }
-
- val fts = for (_ <- 1 to 1000)
- yield a !! (3, {case x: Int => x})
-
- def respondAll(fts: List[Future[Int]], cnt: Int): Unit =
- fts match {
- case List() => a ! 'stop
- case ft :: rest =>
- if (cnt % 100 == 0)
- println(ft())
- respondAll(rest, cnt + 1)
- }
-
- actor {
- respondAll(fts.toList, 0)
- }
-
- }
-
-}
diff --git a/test/files/jvm/t3470.check b/test/files/jvm/t3470.check
deleted file mode 100644
index 94cb526756..0000000000
--- a/test/files/jvm/t3470.check
+++ /dev/null
@@ -1,3 +0,0 @@
-A: started: 1
-A: started: 2
-A: started: 3
diff --git a/test/files/jvm/t3470.scala b/test/files/jvm/t3470.scala
deleted file mode 100644
index bcb1d4f8de..0000000000
--- a/test/files/jvm/t3470.scala
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors._
-
- def expectActorState(a: Reactor[T] forSome { type T }, s: Actor.State.Value) {
- var done = false
- var i = 0
- while (!done) {
- i = i + 1
- if (i == 10) { // only wait for 2 seconds total
- println("FAIL ["+a+": expected "+s+"]")
- done = true
- }
-
- Thread.sleep(200)
- if (a.getState == s) // success
- done = true
- }
- }
-
- def main(args: Array[String]) {
- val a = new Actor { var c = 0; def act() = { c += 1; println("A: started: " + c) } }
- a.start()
- expectActorState(a, Actor.State.Terminated)
- a.restart()
- expectActorState(a, Actor.State.Terminated)
- a.restart()
- }
-
-}
diff --git a/test/files/jvm/t3838.check b/test/files/jvm/t3838.check
deleted file mode 100644
index 154227a350..0000000000
--- a/test/files/jvm/t3838.check
+++ /dev/null
@@ -1 +0,0 @@
-caught java.lang.RuntimeException: unhandled timeout
diff --git a/test/files/jvm/t3838.scala b/test/files/jvm/t3838.scala
deleted file mode 100644
index a1a71d1049..0000000000
--- a/test/files/jvm/t3838.scala
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-@deprecated("Suppress warnings", since="2.11")
-object Test {
- import scala.actors.Actor._
- def main(args: Array[String]) {
- actor {
- try {
- receiveWithin(1) {
- case str: String => println(str)
- }
- } catch {
- case e: Exception => println("caught "+e)
- }
- }
- }
-}
diff --git a/test/files/jvm/t7146.check b/test/files/jvm/t7146.check
index 7c76040205..b2c6e444f7 100644
--- a/test/files/jvm/t7146.check
+++ b/test/files/jvm/t7146.check
@@ -1,5 +1,4 @@
-should be scala.concurrent.impl.ExecutionContextImpl == true
-should be scala.concurrent.forkjoin.ForkJoinPool == true
+ExecutionContext.global is a scala.concurrent.impl.ExecutionContextImpl.
should have non-null UncaughtExceptionHandler == true
-should be a scala.concurrent.impl.ExecutionContextImpl UncaughtExceptionHandler == true
-should just print out on uncaught == true
+ExecutionContext.global.executor.getUncaughtExceptionHandler is a scala.concurrent.impl.ExecutionContextImpl.
+should just print out on uncaught: true
diff --git a/test/files/jvm/t7146.scala b/test/files/jvm/t7146.scala
index aaa3dc7ca4..89030730a9 100644
--- a/test/files/jvm/t7146.scala
+++ b/test/files/jvm/t7146.scala
@@ -5,21 +5,21 @@ import scala.concurrent._
import scala.util.control.NoStackTrace
object Test {
- def main(args: Array[String]) {
- println("should be scala.concurrent.impl.ExecutionContextImpl == " +
- ExecutionContext.global.toString.startsWith("scala.concurrent.impl.ExecutionContextImpl"))
- val i = ExecutionContext.global.asInstanceOf[{ def executor: Executor }]
- println("should be scala.concurrent.forkjoin.ForkJoinPool == " +
- i.executor.toString.startsWith("scala.concurrent.forkjoin.ForkJoinPool"))
- val u = i.executor.
+ def main(args: Array[String]): Unit = {
+ val ec = ExecutionContext.global.toString
+ if (ec startsWith "scala.concurrent.impl.ExecutionContextImpl")
+ println("ExecutionContext.global is a scala.concurrent.impl.ExecutionContextImpl.")
+ else println(s"!! ExecutionContext.global == $ec")
+
+ val u = ExecutionContext.global.asInstanceOf[{ def executor: Executor }].executor.
asInstanceOf[{ def getUncaughtExceptionHandler: Thread.UncaughtExceptionHandler }].
getUncaughtExceptionHandler
- println("should have non-null UncaughtExceptionHandler == " + (u ne null))
- println("should be a scala.concurrent.impl.ExecutionContextImpl UncaughtExceptionHandler == " +
- u.toString.startsWith("scala.concurrent.impl.ExecutionContextImpl"))
- print("should just print out on uncaught == ")
- u.uncaughtException(Thread.currentThread, new Throwable {
- override def printStackTrace() { println("true") }
- })
+ println(s"should have non-null UncaughtExceptionHandler == ${u ne null}")
+ if (u.toString startsWith "scala.concurrent.impl.ExecutionContextImpl")
+ println("ExecutionContext.global.executor.getUncaughtExceptionHandler is a scala.concurrent.impl.ExecutionContextImpl.")
+ else println(s"!! ExecutionContext.global.executor.getUncaughtExceptionHandler == $u")
+
+ print("should just print out on uncaught: ")
+ u.uncaughtException(Thread.currentThread, new Throwable { override def printStackTrace() { println("true") } })
}
}
diff --git a/test/files/jvm/t8582.check b/test/files/jvm/t8582.check
index e388366270..0e4da90398 100644
--- a/test/files/jvm/t8582.check
+++ b/test/files/jvm/t8582.check
@@ -1,3 +1,6 @@
+t8582.scala:17: warning: class BeanInfo in package beans is deprecated: the generation of BeanInfo classes is no longer supported
+ class C1
+ ^
getClass on module gives module class
class p1.p2.Singleton$Singleton$
diff --git a/test/files/jvm/t8582.flags b/test/files/jvm/t8582.flags
new file mode 100644
index 0000000000..dcc59ebe32
--- /dev/null
+++ b/test/files/jvm/t8582.flags
@@ -0,0 +1 @@
+-deprecation
diff --git a/test/files/jvm/t9105.check b/test/files/jvm/t9105.check
index 34750833f1..48439ee004 100644
--- a/test/files/jvm/t9105.check
+++ b/test/files/jvm/t9105.check
@@ -1,4 +1,4 @@
-#partest !-Ydelambdafy:method
+#partest -Ydelambdafy:inline
(class C$$anonfun$1$A$1,class C$$anonfun$1,null)
(class C$$anonfun$1$B$1,class C$$anonfun$1,private final java.lang.Object C$$anonfun$1.m$1())
(class C$$anonfun$1$C$1,class C$$anonfun$1,null)
@@ -7,7 +7,7 @@
(class C$$anonfun$met$1$F$1,class C$$anonfun$met$1,private final java.lang.Object C$$anonfun$met$1.m$2())
(class C$$anonfun$met$1$G$1,class C$$anonfun$met$1,null)
(class C$$anonfun$met$1$$anonfun$3$H$1,class C$$anonfun$met$1$$anonfun$3,null)
-#partest -Ydelambdafy:method
+#partest !-Ydelambdafy:inline
(class C$A$1,class C,null)
(class C$B$1,class C,private final java.lang.Object C.m$1())
(class C$C$1,class C,null)
diff --git a/test/files/jvm/try-type-tests.scala b/test/files/jvm/try-type-tests.scala
index 962afbd30f..b3926020f0 100644
--- a/test/files/jvm/try-type-tests.scala
+++ b/test/files/jvm/try-type-tests.scala
@@ -118,6 +118,44 @@ trait TryStandard {
assert(f.transform(succ, fail).get == 0)
}
+ def testSuccessEither(): Unit = {
+ val t = Success(1)
+ assert(t.toEither.isRight)
+ }
+
+ def testFailureEither(): Unit = {
+ val t = Failure(new Exception("foo"))
+ assert(t.toEither.isLeft)
+ }
+
+ def testFoldSuccess(): Unit = {
+ val t = Success(1)
+ val res = t.fold("Throws " + _, "Returns " + _)
+ assert(res == "Returns 1")
+ }
+
+ def testFoldFailure(): Unit = {
+ val t = Failure(new Exception("foo"))
+ val res = t.fold("Throws " + _, "Returns " + _)
+ assert(res == "Throws java.lang.Exception: foo")
+ }
+
+ def testFoldSuccessFailure(): Unit = {
+ val t = Success(1)
+ val res = t.fold("Throws " + _, _ => throw new Exception("foo"))
+ assert(res == "Throws java.lang.Exception: foo")
+ }
+
+ def testFoldFailureFailure(): Unit = {
+ val t = Failure(new Exception("foo"))
+ val res = try {
+ t.fold(_ => throw new Exception("bar"), "Returns " + _)
+ } catch {
+ case e: Throwable => "Throws " + e
+ }
+ assert(res == "Throws java.lang.Exception: bar")
+ }
+
testForeachSuccess()
testForeachFailure()
testFlatMapSuccess()
@@ -136,6 +174,11 @@ trait TryStandard {
testFailedFailure()
testSuccessTransform()
testFailureTransform()
+ testSuccessEither()
+ testFailureEither()
+ testFoldSuccess()
+ testFoldFailure()
+ testFoldSuccessFailure()
}
object Test
diff --git a/test/files/neg/beanInfoDeprecation.check b/test/files/neg/beanInfoDeprecation.check
new file mode 100644
index 0000000000..788b277818
--- /dev/null
+++ b/test/files/neg/beanInfoDeprecation.check
@@ -0,0 +1,6 @@
+beanInfoDeprecation.scala:2: warning: class BeanInfo in package beans is deprecated: the generation of BeanInfo classes is no longer supported
+class C
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/beanInfoDeprecation.flags b/test/files/neg/beanInfoDeprecation.flags
new file mode 100644
index 0000000000..c6bfaf1f64
--- /dev/null
+++ b/test/files/neg/beanInfoDeprecation.flags
@@ -0,0 +1 @@
+-deprecation -Xfatal-warnings
diff --git a/test/files/neg/beanInfoDeprecation.scala b/test/files/neg/beanInfoDeprecation.scala
new file mode 100644
index 0000000000..c7e3a86202
--- /dev/null
+++ b/test/files/neg/beanInfoDeprecation.scala
@@ -0,0 +1,2 @@
+@scala.beans.BeanInfo
+class C
diff --git a/test/files/neg/deprecated-target.check b/test/files/neg/deprecated-target.check
new file mode 100644
index 0000000000..307d3d25ab
--- /dev/null
+++ b/test/files/neg/deprecated-target.check
@@ -0,0 +1,4 @@
+warning: -target is deprecated: -target:jvm-1.7 is deprecated, forcing use of jvm-1.8
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/deprecated-target.flags b/test/files/neg/deprecated-target.flags
new file mode 100644
index 0000000000..458ded8123
--- /dev/null
+++ b/test/files/neg/deprecated-target.flags
@@ -0,0 +1 @@
+-target:jvm-1.7 -deprecation -Xfatal-warnings
diff --git a/test/files/neg/deprecated-target.scala b/test/files/neg/deprecated-target.scala
new file mode 100644
index 0000000000..9dccdd5e59
--- /dev/null
+++ b/test/files/neg/deprecated-target.scala
@@ -0,0 +1 @@
+class C \ No newline at end of file
diff --git a/test/files/neg/incompatibleSettings.check b/test/files/neg/incompatibleSettings.check
new file mode 100644
index 0000000000..0f28d41825
--- /dev/null
+++ b/test/files/neg/incompatibleSettings.check
@@ -0,0 +1,6 @@
+warning: Conflicting compiler settings were detected. Some settings will be ignored.
+Compiler settings for the 2.11 optimizer (-optimise) are incompatible with -Ybackend:GenBCode (which is the default in 2.12).
+The optimizer settings are ignored. See -Yopt:help for enabling the new optimizer in 2.12.
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/incompatibleSettings.flags b/test/files/neg/incompatibleSettings.flags
new file mode 100644
index 0000000000..00dd9c1c24
--- /dev/null
+++ b/test/files/neg/incompatibleSettings.flags
@@ -0,0 +1 @@
+-optimise -Ybackend:GenBCode -Xfatal-warnings
diff --git a/test/files/neg/incompatibleSettings.scala b/test/files/neg/incompatibleSettings.scala
new file mode 100644
index 0000000000..826a1a5bc2
--- /dev/null
+++ b/test/files/neg/incompatibleSettings.scala
@@ -0,0 +1 @@
+class C
diff --git a/test/files/neg/inlineIndyLambdaPrivate.check b/test/files/neg/inlineIndyLambdaPrivate.check
new file mode 100644
index 0000000000..dbd142f59e
--- /dev/null
+++ b/test/files/neg/inlineIndyLambdaPrivate.check
@@ -0,0 +1,16 @@
+Test_2.scala:2: warning: A_1::test()Ljava/lang/String; could not be inlined:
+The callee A_1::test()Ljava/lang/String; contains the instruction INVOKEDYNAMIC m()LA_1$Fun; [
+ // handle kind 0x6 : INVOKESTATIC
+ java/lang/invoke/LambdaMetafactory.metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
+ // arguments:
+ (Ljava/lang/String;)Ljava/lang/String;,
+ // handle kind 0x6 : INVOKESTATIC
+ A_1.lambda$test$0(Ljava/lang/String;)Ljava/lang/String;,
+ (Ljava/lang/String;)Ljava/lang/String;
+ ]
+that would cause an IllegalAccessError when inlined into class Test.
+ def foo = A_1.test
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/inlineIndyLambdaPrivate.flags b/test/files/neg/inlineIndyLambdaPrivate.flags
new file mode 100644
index 0000000000..01b466bd8c
--- /dev/null
+++ b/test/files/neg/inlineIndyLambdaPrivate.flags
@@ -0,0 +1 @@
+-Yopt:l:classpath -Yopt-inline-heuristics:everything -Yopt-warnings:_ -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/inlineIndyLambdaPrivate/A_1.java b/test/files/neg/inlineIndyLambdaPrivate/A_1.java
new file mode 100644
index 0000000000..a9144a9fa6
--- /dev/null
+++ b/test/files/neg/inlineIndyLambdaPrivate/A_1.java
@@ -0,0 +1,9 @@
+public class A_1 {
+ interface Fun {
+ String m(String s);
+ }
+ public static final String test() {
+ Fun f = s -> s.trim();
+ return f.m(" eh ");
+ }
+}
diff --git a/test/files/neg/inlineIndyLambdaPrivate/Test_2.scala b/test/files/neg/inlineIndyLambdaPrivate/Test_2.scala
new file mode 100644
index 0000000000..dd59c05176
--- /dev/null
+++ b/test/files/neg/inlineIndyLambdaPrivate/Test_2.scala
@@ -0,0 +1,3 @@
+class Test {
+ def foo = A_1.test
+}
diff --git a/test/files/neg/logImplicits.check b/test/files/neg/logImplicits.check
index 270882b71a..df7b359767 100644
--- a/test/files/neg/logImplicits.check
+++ b/test/files/neg/logImplicits.check
@@ -1,10 +1,10 @@
-logImplicits.scala:2: applied implicit conversion from xs.type to ?{def size: ?} = implicit def byteArrayOps(xs: Array[Byte]): scala.collection.mutable.ArrayOps[Byte]
+logImplicits.scala:2: applied implicit conversion from xs.type to ?{def size: ?} = implicit def _byteArrayOps(xs: Array[Byte]): scala.collection.mutable.ArrayOps.ofByte
def f(xs: Array[Byte]) = xs.size
^
logImplicits.scala:7: applied implicit conversion from String("abc") to ?{def map: ?} = implicit def augmentString(x: String): scala.collection.immutable.StringOps
def f = "abc" map (_ + 1)
^
-logImplicits.scala:15: inferred view from String("abc") to Int = C.this.convert:(p: String("abc"))Int
+logImplicits.scala:15: inferred view from String("abc") to Int = C.this.convert:(p: String)Int
math.max(122, x: Int)
^
logImplicits.scala:19: applied implicit conversion from Int(1) to ?{def ->: ?} = implicit def ArrowAssoc[A](self: A): ArrowAssoc[A]
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check
index a43bf66811..8a6aafd67a 100644
--- a/test/files/neg/names-defaults-neg.check
+++ b/test/files/neg/names-defaults-neg.check
@@ -118,68 +118,74 @@ names-defaults-neg.scala:93: warning: the parameter name y has been deprecated.
names-defaults-neg.scala:93: error: parameter 'b' is already specified at parameter position 1
deprNam3(y = 10, b = 2)
^
-names-defaults-neg.scala:98: error: unknown parameter name: m
+names-defaults-neg.scala:96: warning: naming parameter deprNam4Arg has been deprecated.
+ deprNam4(deprNam4Arg = null)
+ ^
+names-defaults-neg.scala:98: warning: naming parameter deprNam5Arg has been deprecated.
+ deprNam5(deprNam5Arg = null)
+ ^
+names-defaults-neg.scala:102: error: unknown parameter name: m
f3818(y = 1, m = 1)
^
-names-defaults-neg.scala:131: error: reference to var2 is ambiguous; it is both a method parameter and a variable in scope.
+names-defaults-neg.scala:135: error: reference to var2 is ambiguous; it is both a method parameter and a variable in scope.
delay(var2 = 40)
^
-names-defaults-neg.scala:134: error: missing parameter type for expanded function ((x$1) => a = x$1)
+names-defaults-neg.scala:138: error: missing parameter type for expanded function ((x$1) => a = x$1)
val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
^
-names-defaults-neg.scala:134: error: not found: value a
+names-defaults-neg.scala:138: error: not found: value a
val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
^
-names-defaults-neg.scala:134: error: not found: value get
+names-defaults-neg.scala:138: error: not found: value get
val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
^
-names-defaults-neg.scala:135: error: parameter 'a' is already specified at parameter position 1
+names-defaults-neg.scala:139: error: parameter 'a' is already specified at parameter position 1
val taf3 = testAnnFun(b = _: String, a = get(8))
^
-names-defaults-neg.scala:136: error: missing parameter type for expanded function ((x$3) => testAnnFun(x$3, ((x$4) => b = x$4)))
+names-defaults-neg.scala:140: error: missing parameter type for expanded function ((x$3) => testAnnFun(x$3, ((x$4) => b = x$4)))
val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
^
-names-defaults-neg.scala:136: error: missing parameter type for expanded function ((x$4) => b = x$4)
+names-defaults-neg.scala:140: error: missing parameter type for expanded function ((x$4) => b = x$4)
val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
^
-names-defaults-neg.scala:136: error: not found: value b
+names-defaults-neg.scala:140: error: not found: value b
val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
^
-names-defaults-neg.scala:144: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:148: error: variable definition needs type because 'x' is used as a named argument in its body.
def t3 { var x = t.f(x = 1) }
^
-names-defaults-neg.scala:147: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:151: error: variable definition needs type because 'x' is used as a named argument in its body.
object t6 { var x = t.f(x = 1) }
^
-names-defaults-neg.scala:147: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
+names-defaults-neg.scala:151: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
an explicit type is required for the definition mentioned in the error message above.
object t6 { var x = t.f(x = 1) }
^
-names-defaults-neg.scala:150: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:154: error: variable definition needs type because 'x' is used as a named argument in its body.
class t9 { var x = t.f(x = 1) }
^
-names-defaults-neg.scala:150: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
+names-defaults-neg.scala:154: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
an explicit type is required for the definition mentioned in the error message above.
class t9 { var x = t.f(x = 1) }
^
-names-defaults-neg.scala:164: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:168: error: variable definition needs type because 'x' is used as a named argument in its body.
def u3 { var x = u.f(x = 1) }
^
-names-defaults-neg.scala:167: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:171: error: variable definition needs type because 'x' is used as a named argument in its body.
def u6 { var x = u.f(x = "32") }
^
-names-defaults-neg.scala:170: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
+names-defaults-neg.scala:174: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
def u9 { var x: Int = u.f(x = 1) }
^
-names-defaults-neg.scala:177: error: variable definition needs type because 'x' is used as a named argument in its body.
+names-defaults-neg.scala:181: error: variable definition needs type because 'x' is used as a named argument in its body.
class u15 { var x = u.f(x = 1) }
^
-names-defaults-neg.scala:177: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
+names-defaults-neg.scala:181: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
an explicit type is required for the definition mentioned in the error message above.
class u15 { var x = u.f(x = 1) }
^
-names-defaults-neg.scala:180: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
+names-defaults-neg.scala:184: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
class u18 { var x: Int = u.f(x = 1) }
^
-four warnings found
+6 warnings found
46 errors found
diff --git a/test/files/neg/names-defaults-neg.scala b/test/files/neg/names-defaults-neg.scala
index a97b590bf2..b326d3b5bd 100644
--- a/test/files/neg/names-defaults-neg.scala
+++ b/test/files/neg/names-defaults-neg.scala
@@ -92,6 +92,10 @@ object Test extends App {
def deprNam3(@deprecatedName('x) a: Int, @deprecatedName('y) b: Int) = a + b
deprNam3(y = 10, b = 2)
+ def deprNam4(@deprecatedName('deprNam4Arg) deprNam4Arg: String) = 0
+ deprNam4(deprNam4Arg = null)
+ def deprNam5(@deprecatedName deprNam5Arg: String) = 0
+ deprNam5(deprNam5Arg = null)
// t3818
def f3818(x: Int = 1, y: Int, z: Int = 1) = 0
diff --git a/test/files/neg/sealed-final-neg.flags b/test/files/neg/sealed-final-neg.flags
index cfabf7a5b4..3f0fcd2201 100644
--- a/test/files/neg/sealed-final-neg.flags
+++ b/test/files/neg/sealed-final-neg.flags
@@ -1 +1 @@
--Xfatal-warnings -Yinline-warnings -optimise \ No newline at end of file
+-Xfatal-warnings -Ybackend:GenASM -Yinline-warnings -optimise \ No newline at end of file
diff --git a/test/files/neg/t4425.flags b/test/files/neg/t4425.flags
deleted file mode 100644
index 1182725e86..0000000000
--- a/test/files/neg/t4425.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimize \ No newline at end of file
diff --git a/test/files/neg/t5639b.flags b/test/files/neg/t5639b.flags
new file mode 100644
index 0000000000..90b87663af
--- /dev/null
+++ b/test/files/neg/t5639b.flags
@@ -0,0 +1 @@
+-Xsource:2.11 \ No newline at end of file
diff --git a/test/files/neg/t6013/Base.java b/test/files/neg/t6013/Base.java
index b73d7fd821..ce6ee47e64 100644
--- a/test/files/neg/t6013/Base.java
+++ b/test/files/neg/t6013/Base.java
@@ -2,7 +2,7 @@ abstract public class Base {
// This must considered to be overridden by Abstract#foo based
// on the erased signatures. This special case is handled by
// `javaErasedOverridingSym` in `RefChecks`.
- public abstract void bar(java.util.List<java.lang.String> foo) { return; }
+ public void bar(java.util.List<java.lang.String> foo) { return; }
// But, a concrete method in a Java superclass must not excuse
// a deferred method in the Java subclass!
diff --git a/test/files/neg/t6289.check b/test/files/neg/t6289.check
index 989932750f..7b2b4b2d32 100644
--- a/test/files/neg/t6289.check
+++ b/test/files/neg/t6289.check
@@ -1,9 +1,3 @@
-#partest java6
-t6289/J.java:2: method does not override or implement a method from a supertype
- @Override public void foo() { }
- ^
-1 error
-#partest !java6
t6289/J.java:2: error: method does not override or implement a method from a supertype
@Override public void foo() { }
^
diff --git a/test/files/neg/t8764.check b/test/files/neg/t8764.check
deleted file mode 100644
index 6d89ebe106..0000000000
--- a/test/files/neg/t8764.check
+++ /dev/null
@@ -1,6 +0,0 @@
-t8764.scala:8: error: type mismatch;
- found : AnyVal
- required: Double
- val d: Double = a.productElement(0)
- ^
-one error found
diff --git a/test/files/neg/t8764.flags b/test/files/neg/t8764.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/neg/t8764.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
diff --git a/test/files/neg/t8764.scala b/test/files/neg/t8764.scala
deleted file mode 100644
index dc5bfb0160..0000000000
--- a/test/files/neg/t8764.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-object Main {
-
- case class IntAndDouble(i: Int, d: Double)
-
- // a.productElement used to be Int => Double
- // now: Int => AnyVal
- val a = IntAndDouble(1, 5.0)
- val d: Double = a.productElement(0)
-}
diff --git a/test/files/neg/t8849.check b/test/files/neg/t8849.check
new file mode 100644
index 0000000000..15b00aee8b
--- /dev/null
+++ b/test/files/neg/t8849.check
@@ -0,0 +1,7 @@
+t8849.scala:8: error: ambiguous implicit values:
+ both value global in object Implicits of type => scala.concurrent.ExecutionContext
+ and value dummy of type scala.concurrent.ExecutionContext
+ match expected type scala.concurrent.ExecutionContext
+ require(implicitly[ExecutionContext] eq dummy)
+ ^
+one error found
diff --git a/test/files/neg/t8849.scala b/test/files/neg/t8849.scala
new file mode 100644
index 0000000000..336f16b40f
--- /dev/null
+++ b/test/files/neg/t8849.scala
@@ -0,0 +1,10 @@
+import scala.concurrent.ExecutionContext
+import ExecutionContext.Implicits.global
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ implicit val dummy: ExecutionContext = null
+ require(scala.concurrent.ExecutionContext.Implicits.global ne null)
+ require(implicitly[ExecutionContext] eq dummy)
+ }
+} \ No newline at end of file
diff --git a/test/files/neg/warn-unused-imports.check b/test/files/neg/warn-unused-imports.check
index 36c6dd03c3..0a53d7a9cd 100644
--- a/test/files/neg/warn-unused-imports.check
+++ b/test/files/neg/warn-unused-imports.check
@@ -1,33 +1,55 @@
-warn-unused-imports.scala:57: warning: Unused import
+warn-unused-imports_2.scala:133: error: type mismatch;
+ found : Int(42)
+ required: Sample.X
+ f(42) // error
+ ^
+warn-unused-imports_2.scala:57: warning: Unused import
import p1.A // warn
^
-warn-unused-imports.scala:62: warning: Unused import
+warn-unused-imports_2.scala:62: warning: Unused import
import p1.{ A, B } // warn on A
^
-warn-unused-imports.scala:67: warning: Unused import
+warn-unused-imports_2.scala:67: warning: Unused import
import p1.{ A, B } // warn on both
^
-warn-unused-imports.scala:67: warning: Unused import
+warn-unused-imports_2.scala:67: warning: Unused import
import p1.{ A, B } // warn on both
^
-warn-unused-imports.scala:73: warning: Unused import
+warn-unused-imports_2.scala:73: warning: Unused import
import c._ // warn
^
-warn-unused-imports.scala:78: warning: Unused import
+warn-unused-imports_2.scala:78: warning: Unused import
import p1._ // warn
^
-warn-unused-imports.scala:85: warning: Unused import
+warn-unused-imports_2.scala:85: warning: Unused import
import c._ // warn
^
-warn-unused-imports.scala:91: warning: Unused import
+warn-unused-imports_2.scala:91: warning: Unused import
import p1.c._ // warn
^
-warn-unused-imports.scala:98: warning: Unused import
+warn-unused-imports_2.scala:98: warning: Unused import
import p1._ // warn
^
-warn-unused-imports.scala:118: warning: Unused import
+warn-unused-imports_2.scala:118: warning: Unused import
import p1.A // warn
^
-error: No warnings can be incurred under -Xfatal-warnings.
-10 warnings found
+warn-unused-imports_2.scala:132: warning: Unused import
+ import Sample.Implicits._ // warn
+ ^
+warn-unused-imports_2.scala:143: warning: Unused import
+ import Sample.Implicits.useless // warn
+ ^
+warn-unused-imports_2.scala:147: warning: Unused import
+ import java.io.File // warn
+ ^
+warn-unused-imports_2.scala:148: warning: Unused import
+ import scala.concurrent.Future // warn
+ ^
+warn-unused-imports_2.scala:149: warning: Unused import
+ import scala.concurrent.ExecutionContext.Implicits.global // warn
+ ^
+warn-unused-imports_2.scala:150: warning: Unused import
+ import p1.A // warn
+ ^
+16 warnings found
one error found
diff --git a/test/files/neg/warn-unused-imports/sample_1.scala b/test/files/neg/warn-unused-imports/sample_1.scala
new file mode 100644
index 0000000000..d2f86239db
--- /dev/null
+++ b/test/files/neg/warn-unused-imports/sample_1.scala
@@ -0,0 +1,17 @@
+
+import language._
+
+object Sample {
+ trait X
+ trait Y
+
+ // import of the non-implicit should be unused
+ object Implicits {
+ def `int to X`(i: Int): X = null
+ implicit def `int to Y`(i: Int): Y = null
+ implicit def useless(i: Int): String = null
+ }
+
+ def f(x: X) = ???
+ def g(y: Y) = ???
+}
diff --git a/test/files/neg/warn-unused-imports.scala b/test/files/neg/warn-unused-imports/warn-unused-imports_2.scala
index b7a2f1c414..ded1186209 100644
--- a/test/files/neg/warn-unused-imports.scala
+++ b/test/files/neg/warn-unused-imports/warn-unused-imports_2.scala
@@ -123,3 +123,33 @@ trait Nested {
println(new Warn { })
}
}
+
+// test unusage of imports from other compilation units after implicit search
+trait Outsiders {
+ {
+ //implicit search should not disable warning
+ import Sample._
+ import Sample.Implicits._ // warn
+ f(42) // error
+ }
+ {
+ import Sample._
+ import Sample.Implicits._ // nowarn
+ g(42) // ok
+ }
+ {
+ import Sample._
+ import Sample.Implicits.`int to Y` // nowarn
+ import Sample.Implicits.useless // warn
+ g(42) // ok
+ }
+ {
+ import java.io.File // warn
+ import scala.concurrent.Future // warn
+ import scala.concurrent.ExecutionContext.Implicits.global // warn
+ import p1.A // warn
+ import p1.B // no warn
+ println("abc".bippy)
+ //Future("abc".bippy)
+ }
+}
diff --git a/test/files/pos/MailBox.scala b/test/files/pos/MailBox.scala
index 8e27bd362d..6bb25adb19 100644
--- a/test/files/pos/MailBox.scala
+++ b/test/files/pos/MailBox.scala
@@ -1,6 +1,6 @@
package test;
-import scala.actors.TIMEOUT;
+object TIMEOUT
class MailBox {
diff --git a/test/files/pos/alladin763.scala b/test/files/pos/alladin763.scala
new file mode 100644
index 0000000000..29c9b25318
--- /dev/null
+++ b/test/files/pos/alladin763.scala
@@ -0,0 +1,37 @@
+// Test from http://lrytz.github.io/scala-aladdin-bugtracker/displayItem.do%3Fid=763.html
+// and expanded with package object variants
+
+
+trait Foo { type T; def apply() : T }
+object e extends Foo { type T = Int; def apply() = 42 }
+
+package p {
+ trait T[X] { def O : { def apply(): X } }
+ object `package` extends T[Int] {
+ def O: { def apply(): Int } = new { def apply(): Int = 42 }
+ }
+
+ object Test {
+ val x: Int = O()
+ }
+}
+
+object Test {
+
+ val f = new Foo { type T = Int; def apply() = 42 }
+
+ def main(args: Array[String]): Unit = {
+ val g = new Foo { type T = Int; def apply() = 42 }
+
+ (e: Foo)()
+ val ee: Int = e()
+
+ (f: Foo)()
+ val ff: Int = f()
+
+ (g: Foo)()
+ val gg: Int = g()
+
+ val pp: Int = p.O()
+ }
+}
diff --git a/test/files/pos/functions.scala b/test/files/pos/functions.scala
index 0207523dde..25d1c46eac 100644
--- a/test/files/pos/functions.scala
+++ b/test/files/pos/functions.scala
@@ -1,4 +1,6 @@
-import scala.actors.Actor
+object Actor {
+ def receive[A](f: PartialFunction[Any, A]): A = ???
+}
object Test {
diff --git a/test/files/pos/inline-access-levels.flags b/test/files/pos/inline-access-levels.flags
index 882f40f050..9bda07eb6c 100644
--- a/test/files/pos/inline-access-levels.flags
+++ b/test/files/pos/inline-access-levels.flags
@@ -1 +1 @@
--optimise -Xfatal-warnings -Yinline-warnings
+-optimise -Ybackend:GenASM -Xfatal-warnings -Yinline-warnings
diff --git a/test/files/pos/inliner2.flags b/test/files/pos/inliner2.flags
index ea03113c66..bff4bb8afa 100644
--- a/test/files/pos/inliner2.flags
+++ b/test/files/pos/inliner2.flags
@@ -1 +1 @@
--optimise -Xfatal-warnings \ No newline at end of file
+-optimise -Ybackend:GenASM -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/sealed-final.flags b/test/files/pos/sealed-final.flags
index cfabf7a5b4..63f5e65527 100644
--- a/test/files/pos/sealed-final.flags
+++ b/test/files/pos/sealed-final.flags
@@ -1 +1 @@
--Xfatal-warnings -Yinline-warnings -optimise \ No newline at end of file
+-Xfatal-warnings -Yinline-warnings -Ybackend:GenASM -optimise \ No newline at end of file
diff --git a/test/files/pos/t3420.flags b/test/files/pos/t3420.flags
index ea03113c66..bff4bb8afa 100644
--- a/test/files/pos/t3420.flags
+++ b/test/files/pos/t3420.flags
@@ -1 +1 @@
--optimise -Xfatal-warnings \ No newline at end of file
+-optimise -Ybackend:GenASM -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/t533.scala b/test/files/pos/t533.scala
deleted file mode 100644
index 0a6515fed3..0000000000
--- a/test/files/pos/t533.scala
+++ /dev/null
@@ -1,11 +0,0 @@
-import scala.actors._
-
-object test extends Actor {
- def act() {
- receive {
- case TIMEOUT => Console.println("TIMEOUT")
- //case _ => Console.println("_")
- }
- }
-}
-
diff --git a/test/files/pos/t6778.scala b/test/files/pos/t6778.scala
new file mode 100644
index 0000000000..b7483c8fce
--- /dev/null
+++ b/test/files/pos/t6778.scala
@@ -0,0 +1,5 @@
+object test extends AnyRef with App {
+ // Check that random can be called with parenthesis.
+ scala.math.random()
+}
+
diff --git a/test/files/pos/t7784.scala b/test/files/pos/t7784.scala
new file mode 100644
index 0000000000..e6824a4203
--- /dev/null
+++ b/test/files/pos/t7784.scala
@@ -0,0 +1,13 @@
+object Test {
+ final val a = ""
+ var b: a.type = a
+ b = a
+
+ final val x = classOf[Object]
+ var y: x.type = x
+ y = x
+
+ final val e = Thread.State.NEW
+ var e1: e.type = e
+ e1 = e
+}
diff --git a/test/files/pos/t8410.flags b/test/files/pos/t8410.flags
index dcd5943c2f..2f32e3b26a 100644
--- a/test/files/pos/t8410.flags
+++ b/test/files/pos/t8410.flags
@@ -1 +1 @@
--optimise -Xfatal-warnings -deprecation:false -Yinline-warnings:false
+-optimise -Ybackend:GenASM -Xfatal-warnings -deprecation:false -Yinline-warnings:false
diff --git a/test/files/pos/t8462.scala b/test/files/pos/t8462.scala
new file mode 100644
index 0000000000..6946cf8e5e
--- /dev/null
+++ b/test/files/pos/t8462.scala
@@ -0,0 +1,11 @@
+
+trait ConstantOps {
+ def exprs = (
+ 1 << 2L : Int, // was: error: type mismatch; found : Long(4L)
+ 64 >> 2L : Int, // was: error: type mismatch; found : Long(4L)
+ 64 >>> 2L : Int, // was: error: type mismatch; found : Long(4L)
+ 'a' << 2L : Int,
+ 'a' >> 2L : Int,
+ 'a'>>> 2L : Int
+ )
+}
diff --git a/test/files/pos/t8862a.scala b/test/files/pos/t8862a.scala
new file mode 100644
index 0000000000..f9576707ba
--- /dev/null
+++ b/test/files/pos/t8862a.scala
@@ -0,0 +1,47 @@
+package p {
+
+ abstract class C[A] {
+ def x: A
+ implicit def oops: A = x
+ implicit def oopso: Option[A] = None
+ }
+
+ package q {
+
+ class Oops
+
+ object `package` extends C[Oops] {
+ override def x = new Oops
+ }
+
+ object Blah {
+ oops
+ oopso
+
+ // implicits found in enclosing context
+ implicitly[Oops]
+ implicitly[Option[Oops]]
+ }
+ }
+}
+
+package other {
+
+ object Blah {
+ // implicits found through this import
+ import p.q._
+
+ oops
+ oopso
+
+ implicitly[Oops]
+ implicitly[Option[Oops]]
+ }
+
+
+ object Blee {
+ // implicits found through the companion implicits
+ implicitly[p.q.Oops]
+ implicitly[Option[p.q.Oops]]
+ }
+}
diff --git a/test/files/pos/t8862b.scala b/test/files/pos/t8862b.scala
new file mode 100644
index 0000000000..8be7fb5fab
--- /dev/null
+++ b/test/files/pos/t8862b.scala
@@ -0,0 +1,12 @@
+package p {
+ trait T[X] { def O : { def apply(): X } }
+ object `package` extends T[Int] {
+ def O: { def apply(): Int } = new { def apply(): Int = 42 }
+ }
+
+ object Test {
+ def main(args: Array[String]): Unit = {
+ val x: Int = O()
+ }
+ }
+}
diff --git a/test/files/pos/t9074.scala b/test/files/pos/t9074.scala
new file mode 100644
index 0000000000..67db281f54
--- /dev/null
+++ b/test/files/pos/t9074.scala
@@ -0,0 +1,24 @@
+package blam {
+
+ package foo {
+
+ trait F[T] {
+ def f(d: Double, t: T): T = ???
+ def f(d: Int, t: T): T = ???
+ def f(d: String, t: T): T = ???
+
+ def g[A](a: T): T = ???
+ def g(a: Int) = ???
+ }
+ }
+
+ package object foo extends foo.F[Double] {
+ override def f(d: Double, t: Double): Double = ???
+ }
+}
+
+object Test {
+ import blam._
+ foo.f("3", 4.0)
+ foo.g[Any](1d) : Double
+}
diff --git a/test/files/pos/t9074b.scala b/test/files/pos/t9074b.scala
new file mode 100644
index 0000000000..dadcebf399
--- /dev/null
+++ b/test/files/pos/t9074b.scala
@@ -0,0 +1,15 @@
+trait Echo [T] {
+ def echo(t: T): Unit
+}
+
+trait IntEcho extends Echo[Int] {
+ def echo(t: Int) = println(t)
+}
+
+object echo extends IntEcho
+package object echo1 extends IntEcho
+
+object App extends App {
+ echo.echo(1)
+ echo1.echo(1)
+}
diff --git a/test/files/pos/t9131.scala b/test/files/pos/t9131.scala
new file mode 100644
index 0000000000..1a186a0a24
--- /dev/null
+++ b/test/files/pos/t9131.scala
@@ -0,0 +1,12 @@
+class Test {
+
+ def byNameFunc(f: (=> (() => Any)) => Any): Unit = ()
+
+ def test = {
+ // "value apply is not a member of => () => Any"
+ byNameFunc(z => z())
+ // okay
+ byNameFunc(z => z.apply())
+ byNameFunc(z => {val f = z; f()})
+ }
+}
diff --git a/test/files/pos/t9326a.scala b/test/files/pos/t9326a.scala
new file mode 100644
index 0000000000..aefc735585
--- /dev/null
+++ b/test/files/pos/t9326a.scala
@@ -0,0 +1,6 @@
+package p
+
+trait M[A]
+
+class C extends M[Tuple1[X] forSome { type X }]
+
diff --git a/test/files/pos/t9392/client_2.scala b/test/files/pos/t9392/client_2.scala
new file mode 100644
index 0000000000..6b706fea12
--- /dev/null
+++ b/test/files/pos/t9392/client_2.scala
@@ -0,0 +1,4 @@
+class Client {
+ Macro()
+}
+
diff --git a/test/files/pos/t9392/macro_1.scala b/test/files/pos/t9392/macro_1.scala
new file mode 100644
index 0000000000..3f67ac17b2
--- /dev/null
+++ b/test/files/pos/t9392/macro_1.scala
@@ -0,0 +1,16 @@
+import language.experimental.macros
+
+
+object Macro {
+
+ import reflect.macros.blackbox.Context
+ def impl(c: Context)(): c.Tree = {
+ import c.universe._
+ val tree = q"""class C; new C"""
+ val tree1 = c.typecheck(tree)
+ val tpe = tree1.tpe
+ val tree2 = c.typecheck(c.untypecheck(tree1))
+ q"""$tree2.asInstanceOf[$tpe]"""
+ }
+ def apply(): Any = macro impl
+}
diff --git a/test/files/pos/t9393/NamedImpl_1.java b/test/files/pos/t9393/NamedImpl_1.java
new file mode 100644
index 0000000000..02ec9b4671
--- /dev/null
+++ b/test/files/pos/t9393/NamedImpl_1.java
@@ -0,0 +1,15 @@
+/*
+ * Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+package bug;
+
+import bug.Named_1;
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+
+public class NamedImpl_1 implements Named_1 {
+
+ public Class<? extends Annotation> annotationType() {
+ return null;
+ }
+}
diff --git a/test/files/pos/t9393/NamedImpl_2.java b/test/files/pos/t9393/NamedImpl_2.java
new file mode 100644
index 0000000000..c87e94016d
--- /dev/null
+++ b/test/files/pos/t9393/NamedImpl_2.java
@@ -0,0 +1,15 @@
+/*
+ * Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
+ */
+package bug;
+
+import bug.Named_2;
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+
+public class NamedImpl_2 implements Named_2 {
+
+ public Class<? extends Annotation> annotationType() {
+ return null;
+ }
+}
diff --git a/test/files/pos/t9393/Named_1.java b/test/files/pos/t9393/Named_1.java
new file mode 100644
index 0000000000..30a6c9839a
--- /dev/null
+++ b/test/files/pos/t9393/Named_1.java
@@ -0,0 +1,3 @@
+package bug;
+
+public @interface Named_1 {}
diff --git a/test/files/pos/t9393/Named_2.java b/test/files/pos/t9393/Named_2.java
new file mode 100644
index 0000000000..3210fb636a
--- /dev/null
+++ b/test/files/pos/t9393/Named_2.java
@@ -0,0 +1,3 @@
+package bug;
+
+public @interface Named_2 {}
diff --git a/test/files/pos/t9393/test_2.scala b/test/files/pos/t9393/test_2.scala
new file mode 100644
index 0000000000..8ea346129d
--- /dev/null
+++ b/test/files/pos/t9393/test_2.scala
@@ -0,0 +1,4 @@
+class C {
+ new bug.NamedImpl_1 // separate compilation, testing the classfile parser
+ new bug.NamedImpl_2 // mixed compilation, testing the java source parser
+}
diff --git a/test/files/run/analyzerPlugins.check b/test/files/run/analyzerPlugins.check
index 9803465ddc..1bb7c6ceab 100644
--- a/test/files/run/analyzerPlugins.check
+++ b/test/files/run/analyzerPlugins.check
@@ -19,7 +19,7 @@ canAdaptAnnotations(Trees$Typed, Any) [1]
canAdaptAnnotations(Trees$Typed, Int) [1]
lub(List(Int @testAnn, Int)) [1]
pluginsPt(?, Trees$Annotated) [7]
-pluginsPt(?, Trees$Apply) [8]
+pluginsPt(?, Trees$Apply) [11]
pluginsPt(?, Trees$ApplyImplicitView) [2]
pluginsPt(?, Trees$Assign) [7]
pluginsPt(?, Trees$Block) [4]
@@ -31,7 +31,7 @@ pluginsPt(?, Trees$Literal) [16]
pluginsPt(?, Trees$New) [5]
pluginsPt(?, Trees$PackageDef) [1]
pluginsPt(?, Trees$Return) [1]
-pluginsPt(?, Trees$Select) [47]
+pluginsPt(?, Trees$Select) [50]
pluginsPt(?, Trees$Super) [2]
pluginsPt(?, Trees$This) [20]
pluginsPt(?, Trees$TypeApply) [3]
@@ -93,6 +93,7 @@ pluginsTypeSigAccessor(value x) [1]
pluginsTypeSigAccessor(value y) [1]
pluginsTypeSigAccessor(variable count) [2]
pluginsTyped( <: Int, Trees$TypeBoundsTree) [2]
+pluginsTyped(()Double, Trees$Select) [6]
pluginsTyped(()Object, Trees$Select) [1]
pluginsTyped(()String, Trees$Ident) [1]
pluginsTyped(()String, Trees$TypeApply) [1]
@@ -112,7 +113,7 @@ pluginsTyped(<notype>, Trees$PackageDef) [1]
pluginsTyped(<notype>, Trees$TypeDef) [1]
pluginsTyped(<notype>, Trees$ValDef) [21]
pluginsTyped(=> Boolean @testAnn, Trees$Select) [1]
-pluginsTyped(=> Double, Trees$Select) [4]
+pluginsTyped(=> Double, Trees$Select) [1]
pluginsTyped(=> Int, Trees$Select) [5]
pluginsTyped(=> Int, Trees$TypeApply) [1]
pluginsTyped(=> String @testAnn, Trees$Select) [1]
@@ -131,6 +132,7 @@ pluginsTyped(Boolean(false), Trees$Literal) [2]
pluginsTyped(Boolean, Trees$Apply) [1]
pluginsTyped(Boolean, Trees$Select) [4]
pluginsTyped(Char('c'), Trees$Literal) [2]
+pluginsTyped(Double, Trees$Apply) [3]
pluginsTyped(Double, Trees$Select) [6]
pluginsTyped(Int @testAnn, Trees$TypeTree) [2]
pluginsTyped(Int @testAnn, Trees$Typed) [2]
diff --git a/test/files/run/blame_eye_triple_eee-double.flags b/test/files/run/blame_eye_triple_eee-double.flags
deleted file mode 100644
index c9b68d70dc..0000000000
--- a/test/files/run/blame_eye_triple_eee-double.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise
diff --git a/test/files/run/blame_eye_triple_eee-float.flags b/test/files/run/blame_eye_triple_eee-float.flags
deleted file mode 100644
index c9b68d70dc..0000000000
--- a/test/files/run/blame_eye_triple_eee-float.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise
diff --git a/test/files/run/classfile-format-51.scala b/test/files/run/classfile-format-51.scala
index 81df2f08d9..3ef0640b84 100644
--- a/test/files/run/classfile-format-51.scala
+++ b/test/files/run/classfile-format-51.scala
@@ -1,6 +1,5 @@
import java.io.{File, FileOutputStream}
-import scala.tools.nsc.settings.ScalaVersion
import scala.tools.partest._
import scala.tools.asm
import asm.{AnnotationVisitor, ClassWriter, FieldVisitor, Handle, MethodVisitor, Opcodes}
@@ -17,7 +16,7 @@ import Opcodes._
// verify. So the test includes a version check that short-circuits the whole test
// on JDK 6
object Test extends DirectTest {
- override def extraSettings: String = "-optimise -usejavacp -d " + testOutput.path + " -cp " + testOutput.path
+ override def extraSettings: String = "-Yopt:l:classpath -usejavacp -d " + testOutput.path + " -cp " + testOutput.path
def generateClass() {
val invokerClassName = "DynamicInvoker"
diff --git a/test/files/run/classfile-format-52.scala b/test/files/run/classfile-format-52.scala
index 453f61ac84..ebd0826303 100644
--- a/test/files/run/classfile-format-52.scala
+++ b/test/files/run/classfile-format-52.scala
@@ -1,6 +1,5 @@
import java.io.{File, FileOutputStream}
-import scala.tools.nsc.settings.ScalaVersion
import scala.tools.partest._
import scala.tools.asm
import asm.{AnnotationVisitor, ClassWriter, FieldVisitor, Handle, MethodVisitor, Opcodes}
@@ -14,7 +13,7 @@ import Opcodes._
// By its nature the test can only work on JDK 8+ because under JDK 7- the
// interface won't verify.
object Test extends DirectTest {
- override def extraSettings: String = "-optimise -usejavacp -d " + testOutput.path + " -cp " + testOutput.path
+ override def extraSettings: String = "-Yopt:l:classpath -usejavacp -d " + testOutput.path + " -cp " + testOutput.path
def generateInterface() {
val interfaceName = "HasDefaultMethod"
diff --git a/test/files/run/concurrent-stream.check b/test/files/run/concurrent-stream.check
deleted file mode 100644
index d4adf84490..0000000000
--- a/test/files/run/concurrent-stream.check
+++ /dev/null
@@ -1,3 +0,0 @@
-Testing standard cons.
-Evaluation 0: List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
-Evaluation 1: List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
diff --git a/test/files/run/concurrent-stream.scala b/test/files/run/concurrent-stream.scala
deleted file mode 100644
index 9d5ba0428e..0000000000
--- a/test/files/run/concurrent-stream.scala
+++ /dev/null
@@ -1,37 +0,0 @@
-// test concurrent calls to Stream.tail
-@deprecated("Suppress warnings", since="2.11")
-object Test {
-
- def slowRange(from: Int, until: Int, cons: (Int, => Stream[Int]) => Stream[Int]): Stream[Int] = {
- var current = from
- def next: Stream[Int] = {
- Thread.sleep(100)
- if (current >= until) Stream.empty
- else {
- val stream = cons(current, next)
- current += 1
- stream
- }
- }
- next
- }
-
- def testCons(cons: (Int, => Stream[Int]) => Stream[Int]): Unit = {
- import scala.actors.Actor._
-
- val stream = slowRange(0, 10, cons)
- val main = self
- actor { main ! stream.toList }
- actor { main ! stream.toList }
- val eval0 = receive { case list: List[Int @unchecked] => list }
- val eval1 = receive { case list: List[Int @unchecked] => list }
- println("Evaluation 0: " + eval0)
- println("Evaluation 1: " + eval1)
- }
-
- def main(args: Array[String]) {
- println("Testing standard cons.")
- testCons(Stream.cons.apply(_, _))
- }
-}
-
diff --git a/test/files/run/constant-optimization.flags b/test/files/run/constant-optimization.flags
index c9b68d70dc..6c9965e749 100644
--- a/test/files/run/constant-optimization.flags
+++ b/test/files/run/constant-optimization.flags
@@ -1 +1 @@
--optimise
+-optimise -Ybackend:GenASM
diff --git a/test/files/run/dead-code-elimination.flags b/test/files/run/dead-code-elimination.flags
index 49d036a887..b9bb09167e 100644
--- a/test/files/run/dead-code-elimination.flags
+++ b/test/files/run/dead-code-elimination.flags
@@ -1 +1 @@
--optimize
+-optimize -Ybackend:GenASM
diff --git a/test/files/run/delambdafy-specialized.flags b/test/files/run/delambdafy-specialized.flags
index 48b438ddf8..d6278aa940 100644
--- a/test/files/run/delambdafy-specialized.flags
+++ b/test/files/run/delambdafy-specialized.flags
@@ -1 +1 @@
--Ydelambdafy:method
+-Ydelambdafy:method -Ybackend:GenASM
diff --git a/test/files/run/delambdafyLambdaClassNames.check b/test/files/run/delambdafyLambdaClassNames.check
deleted file mode 100644
index d425d15dd0..0000000000
--- a/test/files/run/delambdafyLambdaClassNames.check
+++ /dev/null
@@ -1 +0,0 @@
-A$$nestedInAnon$1$lambda$$run$1
diff --git a/test/files/run/delambdafyLambdaClassNames.flags b/test/files/run/delambdafyLambdaClassNames.flags
deleted file mode 100644
index b10233d322..0000000000
--- a/test/files/run/delambdafyLambdaClassNames.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ybackend:GenBCode -Ydelambdafy:method \ No newline at end of file
diff --git a/test/files/run/delambdafyLambdaClassNames/A_1.scala b/test/files/run/delambdafyLambdaClassNames/A_1.scala
deleted file mode 100644
index 10489414b7..0000000000
--- a/test/files/run/delambdafyLambdaClassNames/A_1.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-class A {
- def f = new Runnable {
- def run(): Unit = List(1,2).foreach(println)
- }
-}
diff --git a/test/files/run/delambdafyLambdaClassNames/Test.scala b/test/files/run/delambdafyLambdaClassNames/Test.scala
deleted file mode 100644
index 49a397d1d2..0000000000
--- a/test/files/run/delambdafyLambdaClassNames/Test.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-object Test extends App {
- val c = Class.forName("A$$nestedInAnon$1$lambda$$run$1")
- println(c.getName)
-}
diff --git a/test/files/run/delambdafy_t6028.check b/test/files/run/delambdafy_t6028.check
index 419e7043a3..9ff1d0e78e 100644
--- a/test/files/run/delambdafy_t6028.check
+++ b/test/files/run/delambdafy_t6028.check
@@ -21,7 +21,7 @@ package <empty> {
def tryy(tryyParam: String): Function0 = {
var tryyLocal: runtime.ObjectRef = scala.runtime.ObjectRef.create("");
{
- (new <$anon: Function0>(T.this, tryyParam, tryyLocal): Function0)
+ (() => T.this.$anonfun$2(tryyParam, tryyLocal)).$asInstanceOf[Function0]()
}
};
final <artifact> private[this] def $anonfun$1(methodParam$1: String, methodLocal$1: String): String = T.this.classParam.+(T.this.field()).+(methodParam$1).+(methodLocal$1);
@@ -48,24 +48,9 @@ package <empty> {
};
scala.this.Predef.print(barParam$1)
};
- @SerialVersionUID(value = 0) final <synthetic> class $anonfun$tryy$1 extends scala.runtime.AbstractFunction0$mcV$sp with Serializable {
- def <init>($outer: T, tryyParam$1: String, tryyLocal$1: runtime.ObjectRef): <$anon: Function0> = {
- $anonfun$tryy$1.super.<init>();
- ()
- };
- final def apply(): Unit = $anonfun$tryy$1.this.apply$mcV$sp();
- <specialized> def apply$mcV$sp(): Unit = try {
- $anonfun$tryy$1.this.tryyLocal$1.elem = $anonfun$tryy$1.this.tryyParam$1
- } finally ();
- <synthetic> <paramaccessor> <artifact> private[this] val $outer: T = _;
- <synthetic> <stable> <artifact> def $outer(): T = $anonfun$tryy$1.this.$outer;
- final <bridge> <artifact> def apply(): Object = {
- $anonfun$tryy$1.this.apply();
- scala.runtime.BoxedUnit.UNIT
- };
- <synthetic> <paramaccessor> private[this] val tryyParam$1: String = _;
- <synthetic> <paramaccessor> private[this] val tryyLocal$1: runtime.ObjectRef = _
- }
+ final <artifact> private[this] def $anonfun$2(tryyParam$1: String, tryyLocal$1: runtime.ObjectRef): Unit = try {
+ tryyLocal$1.elem = tryyParam$1
+ } finally ()
}
}
diff --git a/test/files/run/duration-coarsest.scala b/test/files/run/duration-coarsest.scala
index 51cb79287a..81fbb3cc84 100644
--- a/test/files/run/duration-coarsest.scala
+++ b/test/files/run/duration-coarsest.scala
@@ -25,4 +25,7 @@ object Test extends App {
23 hours,
40 days
) foreach (x => assert(x == x.toCoarsest, x))
-} \ No newline at end of file
+
+ // toCoarsest on a FiniteDuration should return a FiniteDuration
+ val finite: FiniteDuration = 1.second.toCoarsest
+}
diff --git a/test/files/run/elidable-opt.flags b/test/files/run/elidable-opt.flags
index 62897ff218..6537d2f57a 100644
--- a/test/files/run/elidable-opt.flags
+++ b/test/files/run/elidable-opt.flags
@@ -1 +1 @@
--optimise -Xelide-below 900
+-optimise -Ybackend:GenASM -Xelide-below 900
diff --git a/test/files/run/elidable-opt.scala b/test/files/run/elidable-opt.scala
index a2f29d2caf..ebada46de8 100644
--- a/test/files/run/elidable-opt.scala
+++ b/test/files/run/elidable-opt.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warnings; re-run with
+ */
import annotation._
import elidable._
diff --git a/test/files/run/finalvar.flags b/test/files/run/finalvar.flags
index aee3039bec..8d9be3d62e 100644
--- a/test/files/run/finalvar.flags
+++ b/test/files/run/finalvar.flags
@@ -1 +1 @@
--Yoverride-vars -Yinline \ No newline at end of file
+-Yoverride-vars -Yinline -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/run/future-flatmap-exec-count.check b/test/files/run/future-flatmap-exec-count.check
index dd9dce64ed..7065c133e0 100644
--- a/test/files/run/future-flatmap-exec-count.check
+++ b/test/files/run/future-flatmap-exec-count.check
@@ -1,3 +1,4 @@
+warning: there was one deprecation warning; re-run with -deprecation for details
mapping
execute()
flatmapping
diff --git a/test/files/run/icode-reader-dead-code.scala b/test/files/run/icode-reader-dead-code.scala
index 00ba58829f..535ef2a2e2 100644
--- a/test/files/run/icode-reader-dead-code.scala
+++ b/test/files/run/icode-reader-dead-code.scala
@@ -36,7 +36,7 @@ object Test extends DirectTest {
// If inlining fails, the compiler will issue an inliner warning that is not present in the
// check file
- compileString(newCompiler("-usejavacp", "-optimise"))(bCode)
+ compileString(newCompiler("-usejavacp", "-optimise", "-Ybackend:GenASM"))(bCode)
}
def readClass(file: String) = {
diff --git a/test/files/run/inline-ex-handlers.check b/test/files/run/inline-ex-handlers.check
index 7c885d2cc9..36fc2eefa4 100644
--- a/test/files/run/inline-ex-handlers.check
+++ b/test/files/run/inline-ex-handlers.check
@@ -30,7 +30,7 @@
-
- 7:
92 LOAD_LOCAL(value x1)
-@@ -390,5 +386,5 @@
+@@ -408,5 +404,5 @@
def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
- locals: value args, variable result, value ex6, value x4, value x5, value message, value x
+ locals: value args, variable result, value ex6, value x4, value x5, value x
@@ -38,7 +38,7 @@
- blocks: [1,2,3,4,5,8,10,11,13]
+ blocks: [1,2,3,5,8,10,11,13,14]
-@@ -416,4 +412,13 @@
+@@ -434,4 +430,13 @@
103 CALL_METHOD MyException.<init> (static-instance)
- 103 THROW(MyException)
+ ? STORE_LOCAL(value ex6)
@@ -53,13 +53,13 @@
+ 106 CZJUMP (BOOL)NE ? 5 : 8
+
13:
-@@ -429,5 +434,2 @@
+@@ -447,5 +452,2 @@
101 SCOPE_ENTER value x4
- 101 JUMP 4
-
- 4:
106 LOAD_LOCAL(value x4)
-@@ -441,8 +443,5 @@
+@@ -459,8 +461,5 @@
106 SCOPE_ENTER value x5
- 106 LOAD_LOCAL(value x5)
- 106 CALL_METHOD MyException.message (dynamic)
@@ -70,12 +70,12 @@
+ ? LOAD_LOCAL(value x5)
+ 106 CALL_METHOD MyException.message (dynamic)
106 CALL_METHOD scala.Predef.println (dynamic)
-@@ -518,3 +517,3 @@
+@@ -536,3 +535,3 @@
startBlock: 1
- blocks: [1,2,3,4,6,7,9,10]
+ blocks: [1,3,4,6,7,9,10,11,12,13]
-@@ -547,4 +546,9 @@
+@@ -565,4 +564,9 @@
306 CALL_METHOD MyException.<init> (static-instance)
- 306 THROW(MyException)
+ ? JUMP 11
@@ -86,12 +86,12 @@
+ ? JUMP 12
+
9:
-@@ -553,3 +557,3 @@
+@@ -571,3 +575,3 @@
305 MONITOR_EXIT
- ? THROW(Throwable)
+ ? JUMP 12
-@@ -559,4 +563,11 @@
+@@ -577,4 +581,11 @@
304 MONITOR_EXIT
- ? THROW(Throwable)
+ ? STORE_LOCAL(value t)
@@ -104,7 +104,7 @@
+ ? JUMP 13
+
3:
-@@ -573,5 +584,14 @@
+@@ -591,5 +602,14 @@
310 CALL_METHOD scala.Predef.println (dynamic)
- 310 JUMP 2
+ 300 RETURN(UNIT)
@@ -121,21 +121,21 @@
+ 310 CALL_PRIMITIVE(EndConcat)
+ 310 CALL_METHOD scala.Predef.println (dynamic)
300 RETURN(UNIT)
-@@ -583,6 +603,6 @@
+@@ -601,6 +621,6 @@
with finalizer: null
-- catch (Throwable) in ArrayBuffer(7, 9, 10) starting at: 6
-+ catch (Throwable) in ArrayBuffer(7, 9, 10, 11) starting at: 6
+- catch (Throwable) in Vector(7, 9, 10) starting at: 6
++ catch (Throwable) in Vector(7, 9, 10, 11) starting at: 6
consisting of blocks: List(6)
with finalizer: null
-- catch (Throwable) in ArrayBuffer(4, 6, 7, 9, 10) starting at: 3
-+ catch (Throwable) in ArrayBuffer(4, 6, 7, 9, 10, 11, 12) starting at: 3
+- catch (Throwable) in Vector(4, 6, 7, 9, 10) starting at: 3
++ catch (Throwable) in Vector(4, 6, 7, 9, 10, 11, 12) starting at: 3
consisting of blocks: List(3)
-@@ -618,3 +638,3 @@
+@@ -636,3 +656,3 @@
startBlock: 1
- blocks: [1,3,4,5,6,8,9]
+ blocks: [1,3,4,5,6,8,9,10,11]
-@@ -642,4 +662,10 @@
+@@ -660,4 +680,10 @@
78 CALL_METHOD java.lang.IllegalArgumentException.<init> (static-instance)
- 78 THROW(IllegalArgumentException)
+ ? STORE_LOCAL(value e)
@@ -147,13 +147,13 @@
+ ? JUMP 11
+
8:
-@@ -668,3 +694,4 @@
+@@ -686,3 +712,4 @@
81 LOAD_LOCAL(value e)
- 81 THROW(Exception)
+ ? STORE_LOCAL(variable exc1)
+ ? JUMP 11
-@@ -685,2 +712,15 @@
+@@ -703,2 +730,15 @@
+ 11:
+ 83 LOAD_MODULE object Predef
@@ -169,12 +169,12 @@
+ 84 THROW(Throwable)
+
}
-@@ -690,3 +730,3 @@
+@@ -708,3 +748,3 @@
with finalizer: null
-- catch (<none>) in ArrayBuffer(4, 5, 6, 8) starting at: 3
-+ catch (<none>) in ArrayBuffer(4, 5, 6, 8, 10) starting at: 3
+- catch (<none>) in Vector(4, 5, 6, 8) starting at: 3
++ catch (<none>) in Vector(4, 5, 6, 8, 10) starting at: 3
consisting of blocks: List(3)
-@@ -714,5 +754,5 @@
+@@ -732,5 +772,5 @@
def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
- locals: value args, variable result, value ex6, variable exc2, value x4, value x5, value message, value x, value ex6, value x4, value x5, value message, value x
+ locals: value args, variable result, value ex6, variable exc2, value x4, value x5, value x, value ex6, value x4, value x5, value x
@@ -182,7 +182,7 @@
- blocks: [1,3,4,5,6,9,13,14,15,18,20,21,23,24]
+ blocks: [1,3,4,5,6,9,13,14,15,18,20,21,23,24,25,26,27]
-@@ -740,4 +780,11 @@
+@@ -758,4 +798,11 @@
172 CALL_METHOD MyException.<init> (static-instance)
- 172 THROW(MyException)
+ ? STORE_LOCAL(value ex6)
@@ -195,7 +195,7 @@
+ 170 JUMP 14
+
23:
-@@ -780,8 +827,5 @@
+@@ -798,8 +845,5 @@
175 SCOPE_ENTER value x5
- 175 LOAD_LOCAL(value x5)
- 175 CALL_METHOD MyException.message (dynamic)
@@ -206,7 +206,7 @@
+ ? LOAD_LOCAL(value x5)
+ 176 CALL_METHOD MyException.message (dynamic)
176 CALL_METHOD scala.Predef.println (dynamic)
-@@ -789,5 +833,7 @@
+@@ -807,5 +851,7 @@
177 DUP(REF(class MyException))
- 177 LOAD_LOCAL(value message)
+ ? LOAD_LOCAL(value x5)
@@ -216,13 +216,13 @@
+ ? STORE_LOCAL(value ex6)
+ ? JUMP 26
-@@ -795,3 +841,4 @@
+@@ -813,3 +859,4 @@
170 LOAD_LOCAL(value ex6)
- 170 THROW(Throwable)
+ ? STORE_LOCAL(value ex6)
+ ? JUMP 26
-@@ -805,2 +852,8 @@
+@@ -823,2 +870,8 @@
+ 26:
+ 169 LOAD_LOCAL(value ex6)
@@ -231,7 +231,7 @@
+ 169 JUMP 5
+
5:
-@@ -815,8 +868,5 @@
+@@ -833,8 +886,5 @@
180 SCOPE_ENTER value x5
- 180 LOAD_LOCAL(value x5)
- 180 CALL_METHOD MyException.message (dynamic)
@@ -242,7 +242,7 @@
+ ? LOAD_LOCAL(value x5)
+ 181 CALL_METHOD MyException.message (dynamic)
181 CALL_METHOD scala.Predef.println (dynamic)
-@@ -824,5 +874,7 @@
+@@ -842,5 +892,7 @@
182 DUP(REF(class MyException))
- 182 LOAD_LOCAL(value message)
+ ? LOAD_LOCAL(value x5)
@@ -252,13 +252,13 @@
+ ? STORE_LOCAL(variable exc2)
+ ? JUMP 27
-@@ -830,3 +882,4 @@
+@@ -848,3 +900,4 @@
169 LOAD_LOCAL(value ex6)
- 169 THROW(Throwable)
+ ? STORE_LOCAL(variable exc2)
+ ? JUMP 27
-@@ -847,2 +900,15 @@
+@@ -865,2 +918,15 @@
+ 27:
+ 184 LOAD_MODULE object Predef
@@ -274,16 +274,16 @@
+ 185 THROW(Throwable)
+
}
-@@ -852,6 +918,6 @@
+@@ -870,6 +936,6 @@
with finalizer: null
-- catch (Throwable) in ArrayBuffer(13, 14, 15, 18, 20, 21, 23) starting at: 4
-+ catch (Throwable) in ArrayBuffer(13, 14, 15, 18, 20, 21, 23, 25) starting at: 4
+- catch (Throwable) in Vector(13, 14, 15, 18, 20, 21, 23) starting at: 4
++ catch (Throwable) in Vector(13, 14, 15, 18, 20, 21, 23, 25) starting at: 4
consisting of blocks: List(9, 8, 6, 5, 4)
with finalizer: null
-- catch (<none>) in ArrayBuffer(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23) starting at: 3
-+ catch (<none>) in ArrayBuffer(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23, 25, 26) starting at: 3
+- catch (<none>) in Vector(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23) starting at: 3
++ catch (<none>) in Vector(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23, 25, 26) starting at: 3
consisting of blocks: List(3)
-@@ -879,5 +945,5 @@
+@@ -897,5 +963,5 @@
def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
- locals: value args, variable result, value e, value ex6, value x4, value x5, value message, value x
+ locals: value args, variable result, value e, value ex6, value x4, value x5, value x
@@ -291,7 +291,7 @@
- blocks: [1,2,3,6,7,8,11,13,14,16]
+ blocks: [1,2,3,6,7,8,11,13,14,16,17]
-@@ -905,4 +971,11 @@
+@@ -923,4 +989,11 @@
124 CALL_METHOD MyException.<init> (static-instance)
- 124 THROW(MyException)
+ ? STORE_LOCAL(value ex6)
@@ -304,7 +304,7 @@
+ 122 JUMP 7
+
16:
-@@ -930,8 +1003,5 @@
+@@ -948,8 +1021,5 @@
127 SCOPE_ENTER value x5
- 127 LOAD_LOCAL(value x5)
- 127 CALL_METHOD MyException.message (dynamic)
@@ -315,12 +315,12 @@
+ ? LOAD_LOCAL(value x5)
+ 127 CALL_METHOD MyException.message (dynamic)
127 CALL_METHOD scala.Predef.println (dynamic)
-@@ -964,3 +1034,3 @@
+@@ -982,3 +1052,3 @@
with finalizer: null
-- catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 13, 14, 16) starting at: 3
-+ catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 13, 14, 16, 17) starting at: 3
+- catch (IllegalArgumentException) in Vector(6, 7, 8, 11, 13, 14, 16) starting at: 3
++ catch (IllegalArgumentException) in Vector(6, 7, 8, 11, 13, 14, 16, 17) starting at: 3
consisting of blocks: List(3)
-@@ -988,5 +1058,5 @@
+@@ -1006,5 +1076,5 @@
def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
- locals: value args, variable result, value ex6, value x4, value x5, value message, value x, value e
+ locals: value args, variable result, value ex6, value x4, value x5, value x, value e
@@ -328,7 +328,7 @@
- blocks: [1,2,3,4,5,8,12,13,14,16]
+ blocks: [1,2,3,5,8,12,13,14,16,17]
-@@ -1014,4 +1084,13 @@
+@@ -1032,4 +1102,13 @@
148 CALL_METHOD MyException.<init> (static-instance)
- 148 THROW(MyException)
+ ? STORE_LOCAL(value ex6)
@@ -343,13 +343,13 @@
+ 154 CZJUMP (BOOL)NE ? 5 : 8
+
16:
-@@ -1035,5 +1114,2 @@
+@@ -1053,5 +1132,2 @@
145 SCOPE_ENTER value x4
- 145 JUMP 4
-
- 4:
154 LOAD_LOCAL(value x4)
-@@ -1047,8 +1123,5 @@
+@@ -1065,8 +1141,5 @@
154 SCOPE_ENTER value x5
- 154 LOAD_LOCAL(value x5)
- 154 CALL_METHOD MyException.message (dynamic)
@@ -360,12 +360,12 @@
+ ? LOAD_LOCAL(value x5)
+ 154 CALL_METHOD MyException.message (dynamic)
154 CALL_METHOD scala.Predef.println (dynamic)
-@@ -1269,3 +1342,3 @@
+@@ -1287,3 +1360,3 @@
startBlock: 1
- blocks: [1,2,3,4,5,7]
+ blocks: [1,2,3,4,5,7,8]
-@@ -1293,4 +1366,11 @@
+@@ -1311,4 +1384,11 @@
38 CALL_METHOD java.lang.IllegalArgumentException.<init> (static-instance)
- 38 THROW(IllegalArgumentException)
+ ? STORE_LOCAL(value e)
@@ -378,7 +378,7 @@
+ 42 JUMP 2
+
7:
-@@ -1340,5 +1420,5 @@
+@@ -1358,5 +1438,5 @@
def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
- locals: value args, variable result, value ex6, value x4, value x5, value message, value x
+ locals: value args, variable result, value ex6, value x4, value x5, value x
@@ -386,13 +386,13 @@
- blocks: [1,2,3,4,5,8,10,11,13,14,16]
+ blocks: [1,2,3,5,8,10,11,13,14,16,17]
-@@ -1366,3 +1446,4 @@
+@@ -1384,3 +1464,4 @@
203 CALL_METHOD MyException.<init> (static-instance)
- 203 THROW(MyException)
+ ? STORE_LOCAL(value ex6)
+ ? JUMP 17
-@@ -1386,4 +1467,13 @@
+@@ -1404,4 +1485,13 @@
209 CALL_METHOD MyException.<init> (static-instance)
- 209 THROW(MyException)
+ ? STORE_LOCAL(value ex6)
@@ -407,13 +407,13 @@
+ 212 CZJUMP (BOOL)NE ? 5 : 8
+
16:
-@@ -1399,5 +1489,2 @@
+@@ -1417,5 +1507,2 @@
200 SCOPE_ENTER value x4
- 200 JUMP 4
-
- 4:
212 LOAD_LOCAL(value x4)
-@@ -1411,8 +1498,5 @@
+@@ -1429,8 +1516,5 @@
212 SCOPE_ENTER value x5
- 212 LOAD_LOCAL(value x5)
- 212 CALL_METHOD MyException.message (dynamic)
@@ -424,12 +424,12 @@
+ ? LOAD_LOCAL(value x5)
+ 213 CALL_METHOD MyException.message (dynamic)
213 CALL_METHOD scala.Predef.println (dynamic)
-@@ -1460,3 +1544,3 @@
+@@ -1478,3 +1562,3 @@
startBlock: 1
- blocks: [1,2,3,4,5,7]
+ blocks: [1,2,3,4,5,7,8]
-@@ -1484,4 +1568,11 @@
+@@ -1502,4 +1586,11 @@
58 CALL_METHOD java.lang.IllegalArgumentException.<init> (static-instance)
- 58 THROW(IllegalArgumentException)
+ ? STORE_LOCAL(value e)
@@ -442,12 +442,12 @@
+ 62 JUMP 2
+
7:
-@@ -1533,3 +1624,3 @@
+@@ -1551,3 +1642,3 @@
startBlock: 1
- blocks: [1,3,4]
+ blocks: [1,3,4,5]
-@@ -1553,4 +1644,9 @@
+@@ -1571,4 +1662,9 @@
229 CALL_METHOD MyException.<init> (static-instance)
- 229 THROW(MyException)
+ ? JUMP 5
@@ -458,12 +458,12 @@
+ 228 THROW(Throwable)
+
3:
-@@ -1559,3 +1655,3 @@
+@@ -1577,3 +1673,3 @@
228 MONITOR_EXIT
- ? THROW(Throwable)
+ 228 THROW(Throwable)
-@@ -1587,5 +1683,5 @@
+@@ -1605,5 +1701,5 @@
def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
- locals: value args, variable result, variable monitor2, variable monitorResult1
+ locals: value exception$1, value args, variable result, variable monitor2, variable monitorResult1
@@ -471,7 +471,7 @@
- blocks: [1,3,4]
+ blocks: [1,3,4,5]
-@@ -1612,4 +1708,12 @@
+@@ -1630,4 +1726,12 @@
245 CALL_METHOD MyException.<init> (static-instance)
- 245 THROW(MyException)
+ ? STORE_LOCAL(value exception$1)
@@ -485,7 +485,7 @@
+ 244 THROW(Throwable)
+
3:
-@@ -1618,3 +1722,3 @@
+@@ -1636,3 +1740,3 @@
244 MONITOR_EXIT
- ? THROW(Throwable)
+ 244 THROW(Throwable)
diff --git a/test/files/run/inline-ex-handlers.scala b/test/files/run/inline-ex-handlers.scala
index 964594d258..4095d54e36 100644
--- a/test/files/run/inline-ex-handlers.scala
+++ b/test/files/run/inline-ex-handlers.scala
@@ -1,7 +1,7 @@
import scala.tools.partest.IcodeComparison
object Test extends IcodeComparison {
- override def printIcodeAfterPhase = "inlinehandlers"
+ override def printIcodeAfterPhase = "inlinehandlers"; override def extraSettings: String = super.extraSettings + " -Ybackend:GenASM" // same line to minimize check file changs
}
import scala.util.Random._
diff --git a/test/files/run/large_class.check b/test/files/run/large_class.check
index 0585c267ac..babe24db94 100644
--- a/test/files/run/large_class.check
+++ b/test/files/run/large_class.check
@@ -1,3 +1 @@
-newSource1.scala:1: error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Class file too large!
-class BigEnoughToFail {
- ^
+error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Class file too large!
diff --git a/test/files/run/large_code.check b/test/files/run/large_code.check
index 6ad50967bc..42bf490942 100644
--- a/test/files/run/large_code.check
+++ b/test/files/run/large_code.check
@@ -1,3 +1 @@
-newSource1.scala:1: error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Method tooLong's code too large!
-class BigEnoughToFail {
- ^
+error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Method tooLong's code too large!
diff --git a/test/files/run/lub-visibility.check b/test/files/run/lub-visibility.check
index 757f0f5917..61dca979a1 100644
--- a/test/files/run/lub-visibility.check
+++ b/test/files/run/lub-visibility.check
@@ -4,6 +4,6 @@ scala> // should infer List[scala.collection.immutable.Seq[Nothing]]
scala> // but reverted that for SI-5534.
scala> val x = List(List(), Vector())
-x: List[scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing] with java.io.Serializable] = List(List(), Vector())
+x: List[scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing] with Serializable] = List(List(), Vector())
scala> :quit
diff --git a/test/files/run/macroPlugins-namerHooks.check b/test/files/run/macroPlugins-namerHooks.check
index c2db5935d4..56b170cbd9 100644
--- a/test/files/run/macroPlugins-namerHooks.check
+++ b/test/files/run/macroPlugins-namerHooks.check
@@ -28,7 +28,7 @@ enterStat(<synthetic> val C$1: C = x$1.asInstanceOf[C])
enterSym(def <init>() = { super.<init>(); () })
enterSym(final override <synthetic> def toString() = "C")
enterSym(case <synthetic> def apply(x: Int, y: Int): C = new C(x, y))
-enterSym(case <synthetic> def unapply(x$0: C) = if (x$0.==(null)) scala.this.None else Some(scala.Tuple2(x$0.x, x$0.y)))
+enterSym(case <synthetic> def unapply(x$0: C): _root_.scala.Option[scala.Tuple2[Int, Int]] = if (x$0.==(null)) scala.this.None else Some(scala.Tuple2(x$0.x, x$0.y)))
enterStat(def <init>() = { super.<init>(); () })
enterStat(final override <synthetic> def toString() = "C")
enterSym(def <init>() = { super.<init>(); () })
diff --git a/test/files/run/noInlineUnknownIndy.check b/test/files/run/noInlineUnknownIndy.check
new file mode 100644
index 0000000000..7cc6d1b675
--- /dev/null
+++ b/test/files/run/noInlineUnknownIndy.check
@@ -0,0 +1,13 @@
+newSource1.scala:1: warning: A_1::test()Ljava/lang/String; could not be inlined:
+Failed to check if A_1::test()Ljava/lang/String; can be safely inlined to T without causing an IllegalAccessError. Checking instruction INVOKEDYNAMIC m()LA_1$Fun; [
+ // handle kind 0x6 : INVOKESTATIC
+ not/java/lang/SomeLambdaMetafactory.notAMetaFactoryMethod(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;
+ // arguments:
+ (Ljava/lang/String;)Ljava/lang/String;,
+ // handle kind 0x6 : INVOKESTATIC
+ A_1.lambda$test$0(Ljava/lang/String;)Ljava/lang/String;,
+ (Ljava/lang/String;)Ljava/lang/String;
+ ] failed:
+The callee contains an InvokeDynamic instruction with an unknown bootstrap method (not a LambdaMetaFactory).
+class T { def foo = A_1.test }
+ ^
diff --git a/test/files/run/noInlineUnknownIndy/A_1.java b/test/files/run/noInlineUnknownIndy/A_1.java
new file mode 100644
index 0000000000..a9144a9fa6
--- /dev/null
+++ b/test/files/run/noInlineUnknownIndy/A_1.java
@@ -0,0 +1,9 @@
+public class A_1 {
+ interface Fun {
+ String m(String s);
+ }
+ public static final String test() {
+ Fun f = s -> s.trim();
+ return f.m(" eh ");
+ }
+}
diff --git a/test/files/run/noInlineUnknownIndy/Test.scala b/test/files/run/noInlineUnknownIndy/Test.scala
new file mode 100644
index 0000000000..16d8126543
--- /dev/null
+++ b/test/files/run/noInlineUnknownIndy/Test.scala
@@ -0,0 +1,28 @@
+import java.io.File
+
+import scala.collection.convert.decorateAsScala._
+import scala.tools.asm.tree.{ClassNode, InvokeDynamicInsnNode}
+import scala.tools.asm.{Handle, Opcodes}
+import scala.tools.partest.BytecodeTest.modifyClassFile
+import scala.tools.partest._
+
+object Test extends DirectTest {
+ def code = ???
+
+ def compileCode(code: String) = {
+ val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator")
+ compileString(newCompiler("-cp", classpath, "-d", testOutput.path, "-Yopt:l:classpath", "-Yopt-inline-heuristics:everything", "-Yopt-warnings:_"))(code)
+ }
+
+ def show(): Unit = {
+ val unknownBootstrapMethod = new Handle(Opcodes.H_INVOKESTATIC, "not/java/lang/SomeLambdaMetafactory", "notAMetaFactoryMethod", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;")
+ modifyClassFile(new File(testOutput.toFile, "A_1.class"))((cn: ClassNode) => {
+ val testMethod = cn.methods.iterator.asScala.find(_.name == "test").head
+ val indy = testMethod.instructions.iterator.asScala.collect({ case i: InvokeDynamicInsnNode => i }).next()
+ indy.bsm = unknownBootstrapMethod
+ cn
+ })
+
+ compileCode("class T { def foo = A_1.test }")
+ }
+}
diff --git a/test/files/run/nothingTypeDce.flags b/test/files/run/nothingTypeDce.flags
index d85321ca0e..fde52cc7df 100644
--- a/test/files/run/nothingTypeDce.flags
+++ b/test/files/run/nothingTypeDce.flags
@@ -1 +1 @@
--target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code
+-Ybackend:GenBCode -Yopt:unreachable-code
diff --git a/test/files/run/nothingTypeDce.scala b/test/files/run/nothingTypeDce.scala
index 5f3692fd33..92d3ca6f89 100644
--- a/test/files/run/nothingTypeDce.scala
+++ b/test/files/run/nothingTypeDce.scala
@@ -1,7 +1,6 @@
// See comment in BCodeBodyBuilder
-// -target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code
-// target enables stack map frames generation
+// -Ybackend:GenBCode -Yopt:unreachable-code
class C {
// can't just emit a call to ???, that returns value of type Nothing$ (not Int).
diff --git a/test/files/run/nothingTypeNoFramesNoDce.check b/test/files/run/nothingTypeNoFramesNoDce.check
deleted file mode 100644
index b1d08b45ff..0000000000
--- a/test/files/run/nothingTypeNoFramesNoDce.check
+++ /dev/null
@@ -1 +0,0 @@
-warning: -target:jvm-1.5 is deprecated: use target for Java 1.6 or above.
diff --git a/test/files/run/nothingTypeNoFramesNoDce.flags b/test/files/run/nothingTypeNoFramesNoDce.flags
deleted file mode 100644
index a035c86179..0000000000
--- a/test/files/run/nothingTypeNoFramesNoDce.flags
+++ /dev/null
@@ -1 +0,0 @@
--target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none -deprecation
diff --git a/test/files/run/nothingTypeNoFramesNoDce.scala b/test/files/run/nothingTypeNoFramesNoDce.scala
deleted file mode 100644
index 7f63faeaa7..0000000000
--- a/test/files/run/nothingTypeNoFramesNoDce.scala
+++ /dev/null
@@ -1,61 +0,0 @@
-// See comment in BCodeBodyBuilder
-
-// -target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none
-// target disables stack map frame generation. in this mode, the ClssWriter just emits dead code as is.
-
-class C {
- // can't just emit a call to ???, that returns value of type Nothing$ (not Int).
- def f1: Int = ???
-
- def f2: Int = throw new Error("")
-
- def f3(x: Boolean) = {
- var y = 0
- // cannot assign an object of type Nothing$ to Int
- if (x) y = ???
- else y = 1
- y
- }
-
- def f4(x: Boolean) = {
- var y = 0
- // tests that whatever is emitted after the throw is valid (what? depends on opts, presence of stack map frames)
- if (x) y = throw new Error("")
- else y = 1
- y
- }
-
- def f5(x: Boolean) = {
- // stack heights need to be the same. ??? looks to the jvm like returning a value of
- // type Nothing$, need to drop or throw it.
- println(
- if (x) { ???; 10 }
- else 20
- )
- }
-
- def f6(x: Boolean) = {
- println(
- if (x) { throw new Error(""); 10 }
- else 20
- )
- }
-
- def f7(x: Boolean) = {
- println(
- if (x) throw new Error("")
- else 20
- )
- }
-
- def f8(x: Boolean) = {
- println(
- if (x) throw new Error("")
- else 20
- )
- }
-}
-
-object Test extends App {
- new C()
-}
diff --git a/test/files/run/nothingTypeNoOpt.flags b/test/files/run/nothingTypeNoOpt.flags
index b3b518051b..d3e4d61e19 100644
--- a/test/files/run/nothingTypeNoOpt.flags
+++ b/test/files/run/nothingTypeNoOpt.flags
@@ -1 +1 @@
--target:jvm-1.6 -Ybackend:GenBCode -Yopt:l:none
+-Ybackend:GenBCode -Yopt:l:none
diff --git a/test/files/run/optimizer-array-load.flags b/test/files/run/optimizer-array-load.flags
index eb4d19bcb9..99bd6c895d 100644
--- a/test/files/run/optimizer-array-load.flags
+++ b/test/files/run/optimizer-array-load.flags
@@ -1 +1 @@
--optimise \ No newline at end of file
+-optimise -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/run/repl-javap-app.check b/test/files/run/repl-javap-app.check
deleted file mode 100644
index bace9534da..0000000000
--- a/test/files/run/repl-javap-app.check
+++ /dev/null
@@ -1,60 +0,0 @@
-#partest java6
-Welcome to Scala
-Type in expressions for evaluation. Or try :help.
-
-scala> :javap -app MyApp$
-public final void delayedEndpoint$MyApp$1();
- Code:
- Stack=2, Locals=1, Args_size=1
- 0: getstatic #XX; //Field scala/Console$.MODULE$:Lscala/Console$;
- 3: ldc #XX; //String Hello, delayed world.
- 5: invokevirtual #XX; //Method scala/Console$.println:(Ljava/lang/Object;)V
- 8: return
- LocalVariableTable:
- Start Length Slot Name Signature
- 0 9 0 this LMyApp$;
-
-scala> :quit
-#partest java7
-Welcome to Scala
-Type in expressions for evaluation. Or try :help.
-
-scala> :javap -app MyApp$
- public final void delayedEndpoint$MyApp$1();
- flags: ACC_PUBLIC, ACC_FINAL
- Code:
- stack=2, locals=1, args_size=1
- 0: getstatic #XX // Field scala/Console$.MODULE$:Lscala/Console$;
- 3: ldc #XX // String Hello, delayed world.
- 5: invokevirtual #XX // Method scala/Console$.println:(Ljava/lang/Object;)V
- 8: return
- LocalVariableTable:
- Start Length Slot Name Signature
- 0 9 0 this LMyApp$;
- LineNumberTable:
- line 5: 0
-}
-
-scala> :quit
-#partest java8
-Welcome to Scala
-Type in expressions for evaluation. Or try :help.
-
-scala> :javap -app MyApp$
- public final void delayedEndpoint$MyApp$1();
- descriptor: ()V
- flags: ACC_PUBLIC, ACC_FINAL
- Code:
- stack=2, locals=1, args_size=1
- 0: getstatic #XX // Field scala/Console$.MODULE$:Lscala/Console$;
- 3: ldc #XX // String Hello, delayed world.
- 5: invokevirtual #XX // Method scala/Console$.println:(Ljava/lang/Object;)V
- 8: return
- LocalVariableTable:
- Start Length Slot Name Signature
- 0 9 0 this LMyApp$;
- LineNumberTable:
- line 5: 0
-}
-
-scala> :quit
diff --git a/test/files/run/repl-javap-app.scala b/test/files/run/repl-javap-app.scala
deleted file mode 100644
index ad6076c2d5..0000000000
--- a/test/files/run/repl-javap-app.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-
-import scala.tools.partest.ReplTest
-
-object MyApp extends App {
- Console println "Hello, delayed world."
-}
-
-object Test extends ReplTest {
- def code = ":javap -app MyApp$"
-
- override def welcoming = true
-
- // The constant pool indices are not the same for GenASM / GenBCode, so
- // replacing the exact numbers by XX.
- lazy val hasConstantPoolRef = """(.*)(#\d\d)(.*)""".r
-
- override def normalize(s: String) = s match {
- case hasConstantPoolRef(start, ref, end) => start + "#XX" + end
- case _ => super.normalize(s)
- }
-}
diff --git a/test/files/run/repl-javap-def.scala b/test/files/run/repl-javap-def.scala
index dbd769613a..3994f06767 100644
--- a/test/files/run/repl-javap-def.scala
+++ b/test/files/run/repl-javap-def.scala
@@ -3,7 +3,7 @@ import scala.tools.partest.JavapTest
object Test extends JavapTest {
def code = """
|def f = 7
- |:javap -public -raw f
+ |:javap -public f
""".stripMargin
// it should find f wrapped in repl skins. replstiltskin.
diff --git a/test/files/run/repl-javap-fun.scala b/test/files/run/repl-javap-fun.scala
deleted file mode 100644
index 5c9a6b7691..0000000000
--- a/test/files/run/repl-javap-fun.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-import scala.tools.partest.JavapTest
-
-object Test extends JavapTest {
- def code = """
- |object Betty {
- | List(1,2,3) filter (_ % 2 != 0) map (_ * 2)
- |}
- |:javap -fun Betty
- """.stripMargin
-
- // two anonfuns of Betty
- override def yah(res: Seq[String]) = {
- def filtered = res filter (_ contains "public final class Betty")
- 2 == filtered.size
- }
-}
diff --git a/test/files/run/repl-javap-lambdas.scala b/test/files/run/repl-javap-lambdas.scala
deleted file mode 100644
index 76a6ec8450..0000000000
--- a/test/files/run/repl-javap-lambdas.scala
+++ /dev/null
@@ -1,23 +0,0 @@
-import scala.tools.partest.JavapTest
-import scala.tools.nsc.Settings
-
-// see repl-javap-memfun.java for the complementary version
-object Test extends JavapTest {
- override def transformSettings(s: Settings) = { s.Ydelambdafy.value = "method" ; s }
- def code = """
- |object Betty {
- | List(1,2,3) count (_ % 2 != 0)
- | def f = List(1,2,3) filter ((x: Any) => true) map (x => "m1")
- | def g = List(1,2,3) filter ((x: Any) => true) map (x => "m1") map (x => "m2")
- |}
- |:javap -fun Betty#g
- """.stripMargin
-
- // three anonfuns of Betty#g
- override def yah(res: Seq[String]) = {
- import PartialFunction.{ cond => when }
- val r = """.*final .* .*\$anonfun\$\d+\(.*""".r
- def filtered = res filter (when(_) { case r(_*) => true })
- 3 == filtered.size
- }
-}
diff --git a/test/files/run/repl-javap-memfun.scala b/test/files/run/repl-javap-memfun.scala
deleted file mode 100644
index d10ebcb399..0000000000
--- a/test/files/run/repl-javap-memfun.scala
+++ /dev/null
@@ -1,22 +0,0 @@
-import scala.tools.partest.JavapTest
-import scala.tools.nsc.Settings
-
-// see repl-javap-lambdas.scala for the complementary version
-object Test extends JavapTest {
- // asserting the default
- override def transformSettings(s: Settings) = { s.Ydelambdafy.value = "inline" ; s }
- def code = """
- |object Betty {
- | List(1,2,3) count (_ % 2 != 0)
- | def f = List(1,2,3) filter (_ % 2 != 0) map (_ * 2)
- | def g = List(1,2,3) filter (_ % 2 == 0) map (_ * 3) map (_ + 1)
- |}
- |:javap -fun Betty#g
- """.stripMargin
-
- // three anonfuns of Betty#g
- override def yah(res: Seq[String]) = {
- def filtered = res filter (_ contains "public final class Betty")
- 3 == filtered.size
- }
-}
diff --git a/test/files/run/repl-javap-more-fun.scala b/test/files/run/repl-javap-more-fun.scala
deleted file mode 100644
index e603faf75a..0000000000
--- a/test/files/run/repl-javap-more-fun.scala
+++ /dev/null
@@ -1,17 +0,0 @@
-import scala.tools.partest.JavapTest
-
-object Test extends JavapTest {
- def code = """
- |object Betty {
- | val ds = List(1,2,3) filter (_ % 2 == 0) map (_ * 3)
- | def m(vs: List[Int]) = vs filter (_ % 2 != 0) map (_ * 2)
- |}
- |:javap -fun Betty
- """.stripMargin
-
- // two anonfuns of Betty
- override def yah(res: Seq[String]) = {
- def filtered = res filter (_ contains "public final class Betty")
- 4 == filtered.size
- }
-}
diff --git a/test/files/run/repl-javap-outdir-funs.flags b/test/files/run/repl-javap-outdir-funs.flags
deleted file mode 100644
index ac96850b69..0000000000
--- a/test/files/run/repl-javap-outdir-funs.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ydelambdafy:inline \ No newline at end of file
diff --git a/test/files/run/repl-javap-outdir-funs/foo_1.scala b/test/files/run/repl-javap-outdir-funs/foo_1.scala
deleted file mode 100644
index 9b98e94733..0000000000
--- a/test/files/run/repl-javap-outdir-funs/foo_1.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-
-package disktest
-
-class Foo {
- def m(vs: List[Int]) = vs map (_ + 1)
-}
diff --git a/test/files/run/repl-javap-outdir-funs/run-repl_7.scala b/test/files/run/repl-javap-outdir-funs/run-repl_7.scala
deleted file mode 100644
index af9651a8a3..0000000000
--- a/test/files/run/repl-javap-outdir-funs/run-repl_7.scala
+++ /dev/null
@@ -1,20 +0,0 @@
-import scala.tools.partest.JavapTest
-
-object Test extends JavapTest {
- // note the '-fun': it makes :javap search for some anonfun.
- // for that reason, this test has a flags file that forces delambdafy:inline (doesn't allow :method)
- def code = """
- |:javap -fun disktest/Foo.class
- """.stripMargin
-
- override def yah(res: Seq[String]) =
- // It's currently unknown why this test fails on Avian with
- // “Failed: No anonfuns found.”, skip it for now. See SI-7630.
- if (scala.tools.partest.utils.Properties.isAvian)
- true
- else {
- val r = "public final class disktest.Foo.*extends scala.runtime.AbstractFunction1".r
- def filtered = res filter (r.findFirstIn(_).nonEmpty)
- 1 == filtered.size
- }
-}
diff --git a/test/files/run/repl-javap.scala b/test/files/run/repl-javap.scala
index 7a19852d4e..25e72f3b13 100644
--- a/test/files/run/repl-javap.scala
+++ b/test/files/run/repl-javap.scala
@@ -7,7 +7,8 @@ object Test extends JavapTest {
""".stripMargin
override def yah(res: Seq[String]) = {
- def filtered = res filter (_ contains "public class Betty")
+ val r = """public class \S*Betty""".r.unanchored
+ def filtered = res filter { case r(_*) => true ; case _ => false }
1 == filtered.size
}
}
diff --git a/test/files/run/repl-parens.scala b/test/files/run/repl-parens.scala
index e25933b1a2..43e642a806 100644
--- a/test/files/run/repl-parens.scala
+++ b/test/files/run/repl-parens.scala
@@ -26,4 +26,11 @@ foo(5)(10)(15)+foo(5)(10)(15)
List(1) ++ List('a')
""".trim
+
+ // replace indylambda function names by <function0>
+ override def eval() = {
+ val lines = super.eval
+ val r = """\$\$Lambda.*""".r
+ lines.map(l => r.replaceAllIn(l, "<function0>"))
+ }
}
diff --git a/test/files/run/run-bug4840.flags b/test/files/run/run-bug4840.flags
deleted file mode 100644
index eb4d19bcb9..0000000000
--- a/test/files/run/run-bug4840.flags
+++ /dev/null
@@ -1 +0,0 @@
--optimise \ No newline at end of file
diff --git a/test/files/run/scalapInvokedynamic.check b/test/files/run/scalapInvokedynamic.check
new file mode 100644
index 0000000000..8e4b08f234
--- /dev/null
+++ b/test/files/run/scalapInvokedynamic.check
@@ -0,0 +1,5 @@
+class C extends scala.AnyRef {
+ def this() = { /* compiled code */ }
+ def m: java.lang.String = { /* compiled code */ }
+}
+
diff --git a/test/files/run/scalapInvokedynamic.scala b/test/files/run/scalapInvokedynamic.scala
new file mode 100644
index 0000000000..670cf26662
--- /dev/null
+++ b/test/files/run/scalapInvokedynamic.scala
@@ -0,0 +1,11 @@
+class C {
+ def m = {
+ val f = (x: String) => x.trim
+ f(" H ae i ")
+ }
+}
+
+object Test extends App {
+ val testClassesDir = System.getProperty("partest.output")
+ scala.tools.scalap.Main.main(Array("-cp", testClassesDir, "C"))
+} \ No newline at end of file
diff --git a/test/files/run/synchronized.flags b/test/files/run/synchronized.flags
index 49d036a887..b9bb09167e 100644
--- a/test/files/run/synchronized.flags
+++ b/test/files/run/synchronized.flags
@@ -1 +1 @@
--optimize
+-optimize -Ybackend:GenASM
diff --git a/test/files/run/t2106.check b/test/files/run/t2106.check
index 66a0e707b3..b19165824b 100644
--- a/test/files/run/t2106.check
+++ b/test/files/run/t2106.check
@@ -1,13 +1,5 @@
-#partest -Ybackend:GenBCode
t2106.scala:7: warning: A::foo()Ljava/lang/Object; is annotated @inline but could not be inlined:
The callee A::foo()Ljava/lang/Object; contains the instruction INVOKEVIRTUAL java/lang/Object.clone ()Ljava/lang/Object;
that would cause an IllegalAccessError when inlined into class Test$.
def main(args: Array[String]): Unit = x.foo
^
-#partest !-Ybackend:GenBCode
-t2106.scala:7: warning: Could not inline required method foo because access level required by callee not matched by caller.
- def main(args: Array[String]): Unit = x.foo
- ^
-t2106.scala:7: warning: At the end of the day, could not inline @inline-marked method foo
- def main(args: Array[String]): Unit = x.foo
- ^
diff --git a/test/files/run/t2106.flags b/test/files/run/t2106.flags
index a2e413bb22..5d6ee831df 100644
--- a/test/files/run/t2106.flags
+++ b/test/files/run/t2106.flags
@@ -1 +1 @@
--optimise -Yinline-warnings -Yopt:l:classpath
+-Yinline-warnings -Yopt:l:classpath
diff --git a/test/files/run/t2251b.check b/test/files/run/t2251b.check
index 4231fc6ea6..b60698d605 100644
--- a/test/files/run/t2251b.check
+++ b/test/files/run/t2251b.check
@@ -1,4 +1,4 @@
-TypeTag[List[scala.collection.immutable.LinearSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with scala.collection.AbstractSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with java.io.Serializable]]
+TypeTag[List[scala.collection.immutable.LinearSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with scala.collection.AbstractSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with Serializable]]
TypeTag[List[scala.collection.immutable.Iterable[B[_ >: F with E with D with C <: B[_ >: F with E with D with C <: A]]] with F with Int => Any]]
TypeTag[List[scala.collection.immutable.Seq[B[_ >: D with C <: B[_ >: D with C <: A]]] with scala.collection.AbstractSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with Serializable]]
TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G with F <: A]]]]]
@@ -6,6 +6,6 @@ TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G w
TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G with F <: A]]]]]
TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]]
TypeTag[List[scala.collection.Map[_ >: F with C <: B[_ >: F with C <: B[_ >: F with C <: A]], B[_ >: G with D <: B[_ >: G with D <: A]]]]]
-TypeTag[List[scala.collection.AbstractSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with scala.collection.LinearSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with java.io.Serializable]]
+TypeTag[List[scala.collection.AbstractSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with scala.collection.LinearSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with Serializable]]
TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]]
TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]]
diff --git a/test/files/run/t3158.scala b/test/files/run/t3158.scala
index c824b62e96..1e5ec186f5 100644
--- a/test/files/run/t3158.scala
+++ b/test/files/run/t3158.scala
@@ -1,6 +1,6 @@
object Test {
def main(args: Array[String]) {
- println(args.map(_ => foo _).deep)
+ println(args.map(_ => foo _).map(_ => "<function1>").deep)
}
def foo(xs: String*) {
diff --git a/test/files/run/t3368-c.check b/test/files/run/t3368-c.check
index e0c10cc0dd..4cbe98c577 100644
--- a/test/files/run/t3368-c.check
+++ b/test/files/run/t3368-c.check
@@ -6,8 +6,8 @@ package <empty> {
};
def x = {
val $buf = new _root_.scala.xml.NodeBuffer();
- $buf.$amp$plus(new _root_.scala.xml.Text("hi & bye"));
- $buf.$amp$plus(new _root_.scala.xml.Text("red & black"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hi & bye"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("red & black"));
$buf
}
};
@@ -24,7 +24,8 @@ package <empty> {
new _root_.scala.xml.Elem(null, "b", _root_.scala.xml.Null, $scope, true)
}
});
- $buf.$amp$plus(new _root_.scala.xml.Text("starthi & bye"));
+ $buf.$amp$plus(new _root_.scala.xml.Text("start"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hi & bye"));
$buf.$amp$plus({
{
new _root_.scala.xml.Elem(null, "c", _root_.scala.xml.Null, $scope, true)
@@ -36,7 +37,8 @@ package <empty> {
new _root_.scala.xml.Elem(null, "d", _root_.scala.xml.Null, $scope, true)
}
});
- $buf.$amp$plus(new _root_.scala.xml.Text("stuffred & black"));
+ $buf.$amp$plus(new _root_.scala.xml.Text("stuff"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("red & black"));
$buf
}: _*))
}
@@ -46,18 +48,19 @@ package <empty> {
def $init$() = {
()
};
- def d = new _root_.scala.xml.Text("hello, world");
+ def d = new _root_.scala.xml.PCData("hello, world");
def e = {
val $buf = new _root_.scala.xml.NodeBuffer();
- $buf.$amp$plus(new _root_.scala.xml.Text("hello, world"));
- $buf.$amp$plus(new _root_.scala.xml.Text("hello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
$buf
};
def f = {
{
new _root_.scala.xml.Elem(null, "foo", _root_.scala.xml.Null, $scope, false, ({
val $buf = new _root_.scala.xml.NodeBuffer();
- $buf.$amp$plus(new _root_.scala.xml.Text("xhello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.Text("x"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
$buf
}: _*))
}
@@ -66,7 +69,7 @@ package <empty> {
{
new _root_.scala.xml.Elem(null, "foo", _root_.scala.xml.Null, $scope, false, ({
val $buf = new _root_.scala.xml.NodeBuffer();
- $buf.$amp$plus(new _root_.scala.xml.Text("hello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
$buf
}: _*))
}
@@ -75,7 +78,8 @@ package <empty> {
{
new _root_.scala.xml.Elem(null, "foo", _root_.scala.xml.Null, $scope, false, ({
val $buf = new _root_.scala.xml.NodeBuffer();
- $buf.$amp$plus(new _root_.scala.xml.Text("hello, worldhello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
+ $buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
$buf
}: _*))
}
diff --git a/test/files/run/t3509.flags b/test/files/run/t3509.flags
index 6933d924d3..9c59981aa9 100644
--- a/test/files/run/t3509.flags
+++ b/test/files/run/t3509.flags
@@ -1 +1 @@
--Yinline \ No newline at end of file
+-Yinline -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/run/t3569.flags b/test/files/run/t3569.flags
index 6933d924d3..9c59981aa9 100644
--- a/test/files/run/t3569.flags
+++ b/test/files/run/t3569.flags
@@ -1 +1 @@
--Yinline \ No newline at end of file
+-Yinline -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/run/t4285.flags b/test/files/run/t4285.flags
index eb4d19bcb9..99bd6c895d 100644
--- a/test/files/run/t4285.flags
+++ b/test/files/run/t4285.flags
@@ -1 +1 @@
--optimise \ No newline at end of file
+-optimise -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/run/t4332.scala b/test/files/run/t4332.scala
index 5a67922911..1c7e7d73de 100644
--- a/test/files/run/t4332.scala
+++ b/test/files/run/t4332.scala
@@ -12,7 +12,7 @@ object Test extends DirectTest {
}
def isExempt(sym: Symbol) = {
- val exempt = Set("view", "repr", "sliceWithKnownDelta", "sliceWithKnownBound", "transform")
+ val exempt = Set("view", "repr", "sliceWithKnownDelta", "sliceWithKnownBound", "transform", "filterImpl")
(exempt contains sym.name.decoded)
}
diff --git a/test/files/run/t4935.flags b/test/files/run/t4935.flags
index 49d036a887..b9bb09167e 100644
--- a/test/files/run/t4935.flags
+++ b/test/files/run/t4935.flags
@@ -1 +1 @@
--optimize
+-optimize -Ybackend:GenASM
diff --git a/test/files/run/t5313.scala b/test/files/run/t5313.scala
index 7f5af74c3f..24ed334816 100644
--- a/test/files/run/t5313.scala
+++ b/test/files/run/t5313.scala
@@ -3,7 +3,7 @@ import scala.tools.partest.IcodeComparison
object Test extends IcodeComparison {
override def printIcodeAfterPhase = "dce"
- override def extraSettings: String = super.extraSettings + " -optimize"
+ override def extraSettings: String = super.extraSettings + " -optimize -Ybackend:GenASM"
override def code =
"""class Foo {
diff --git a/test/files/run/t5535.scala b/test/files/run/t5535.scala
index 7bc12f3470..2833b9c94b 100644
--- a/test/files/run/t5535.scala
+++ b/test/files/run/t5535.scala
@@ -7,4 +7,11 @@ println(h()(5))
val f = h() _
println(f(10))
"""
+
+ // replace indylambda function names by <function1>
+ override def eval() = {
+ val lines = super.eval
+ val r = """\$\$Lambda.*""".r
+ lines.map(l => r.replaceAllIn(l, "<function1>"))
+ }
}
diff --git a/test/files/run/t5789.scala b/test/files/run/t5789.scala
index 461f6a4aae..c8d95f2153 100644
--- a/test/files/run/t5789.scala
+++ b/test/files/run/t5789.scala
@@ -5,10 +5,17 @@ import scala.tools.partest.ReplTest
object Test extends ReplTest {
- override def extraSettings = "-Yinline"
+ override def extraSettings = "-Yinline -Ybackend:GenASM"
def code = """
val n = 2
() => n
"""
+
+ // replace indylambda function names by <function0>
+ override def eval() = {
+ val lines = super.eval
+ val r = """\$\$Lambda.*""".r
+ lines.map(l => r.replaceAllIn(l, "<function0>"))
+ }
}
diff --git a/test/files/run/t6102.check b/test/files/run/t6102.check
index 07378f5ed4..ce01362503 100644
--- a/test/files/run/t6102.check
+++ b/test/files/run/t6102.check
@@ -1,37 +1 @@
-[running phase parser on t6102.scala]
-[running phase namer on t6102.scala]
-[running phase packageobjects on t6102.scala]
-[running phase typer on t6102.scala]
-[running phase patmat on t6102.scala]
-[running phase superaccessors on t6102.scala]
-[running phase extmethods on t6102.scala]
-[running phase pickler on t6102.scala]
-[running phase refchecks on t6102.scala]
-[running phase uncurry on t6102.scala]
-[running phase tailcalls on t6102.scala]
-[running phase specialize on t6102.scala]
-[running phase explicitouter on t6102.scala]
-[running phase erasure on t6102.scala]
-[running phase posterasure on t6102.scala]
-[running phase lazyvals on t6102.scala]
-[running phase lambdalift on t6102.scala]
-[running phase constructors on t6102.scala]
-[running phase flatten on t6102.scala]
-[running phase mixin on t6102.scala]
-[running phase cleanup on t6102.scala]
-[running phase delambdafy on t6102.scala]
-[running phase icode on t6102.scala]
-#partest -optimise
-[running phase inliner on t6102.scala]
-[running phase inlinehandlers on t6102.scala]
-[running phase closelim on t6102.scala]
-[running phase constopt on t6102.scala]
-#partest
-[running phase dce on t6102.scala]
-#partest !-Ybackend:GenBCode
-[running phase jvm on icode]
-#partest -Ybackend:GenBCode
-[running phase jvm on t6102.scala]
-[running phase jvm on t6102.scala]
-#partest
hello
diff --git a/test/files/run/t6102.flags b/test/files/run/t6102.flags
index 726e2a997f..db58cf3b4c 100644
--- a/test/files/run/t6102.flags
+++ b/test/files/run/t6102.flags
@@ -1 +1 @@
--Ydead-code -Ydebug -Xfatal-warnings
+-Yopt:l:classpath -Xfatal-warnings
diff --git a/test/files/run/t6188.flags b/test/files/run/t6188.flags
index 0ebca3e7af..b9bb09167e 100644
--- a/test/files/run/t6188.flags
+++ b/test/files/run/t6188.flags
@@ -1 +1 @@
- -optimize
+-optimize -Ybackend:GenASM
diff --git a/test/files/run/t6260-delambdafy.check b/test/files/run/t6260-delambdafy.check
index b2a7bed988..2fea68afb1 100644
--- a/test/files/run/t6260-delambdafy.check
+++ b/test/files/run/t6260-delambdafy.check
@@ -1,4 +1,4 @@
f(C@2e)
-Test$lambda$1$$apply
apply
+writeReplace
diff --git a/test/files/run/t6260-delambdafy.flags b/test/files/run/t6260-delambdafy.flags
deleted file mode 100644
index 48b438ddf8..0000000000
--- a/test/files/run/t6260-delambdafy.flags
+++ /dev/null
@@ -1 +0,0 @@
--Ydelambdafy:method
diff --git a/test/files/run/t6260c.check b/test/files/run/t6260c.check
index 78e9b27371..388f6690d6 100644
--- a/test/files/run/t6260c.check
+++ b/test/files/run/t6260c.check
@@ -1,9 +1,5 @@
f(C@2e)
-#partest !-Ydelambdafy:method
-Test$$anonfun$$apply
-#partest -Ydelambdafy:method
-Test$lambda$1$$apply
-#partest
apply
+writeReplace
g(C@2e)
diff --git a/test/files/run/t6288b-jump-position.check b/test/files/run/t6288b-jump-position.check
deleted file mode 100644
index ece88b18f0..0000000000
--- a/test/files/run/t6288b-jump-position.check
+++ /dev/null
@@ -1,76 +0,0 @@
-object Case3 extends Object {
- // fields:
-
- // methods
- def unapply(z: Object (REF(class Object))): Option {
- locals: value z
- startBlock: 1
- blocks: [1]
-
- 1:
- 2 NEW REF(class Some)
- 2 DUP(REF(class Some))
- 2 CONSTANT(-1)
- 2 BOX INT
- 2 CALL_METHOD scala.Some.<init> (static-instance)
- 2 RETURN(REF(class Option))
-
- }
- Exception handlers:
-
- def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
- locals: value args, value x1, value x
- startBlock: 1
- blocks: [1,2,3,6,7]
-
- 1:
- 4 CONSTANT("")
- 4 STORE_LOCAL(value x1)
- 4 SCOPE_ENTER value x1
- 4 JUMP 2
-
- 2:
- 5 LOAD_LOCAL(value x1)
- 5 IS_INSTANCE REF(class String)
- 5 CZJUMP (BOOL)NE ? 3 : 6
-
- 3:
- 6 LOAD_MODULE object Predef
- 6 CONSTANT("case 0")
- 6 CALL_METHOD scala.Predef.println (dynamic)
- 6 LOAD_FIELD scala.runtime.BoxedUnit.UNIT
- 6 STORE_LOCAL(value x)
- 6 JUMP 7
-
- 6:
- 8 LOAD_MODULE object Predef
- 8 CONSTANT("default")
- 8 CALL_METHOD scala.Predef.println (dynamic)
- 8 LOAD_FIELD scala.runtime.BoxedUnit.UNIT
- 8 STORE_LOCAL(value x)
- 8 JUMP 7
-
- 7:
- 10 LOAD_MODULE object Predef
- 10 CONSTANT("done")
- 10 CALL_METHOD scala.Predef.println (dynamic)
- 10 RETURN(UNIT)
-
- }
- Exception handlers:
-
- def <init>(): Case3.type {
- locals:
- startBlock: 1
- blocks: [1]
-
- 1:
- 12 THIS(Case3)
- 12 CALL_METHOD java.lang.Object.<init> (super())
- 12 RETURN(UNIT)
-
- }
- Exception handlers:
-
-
-}
diff --git a/test/files/run/t6288b-jump-position.scala b/test/files/run/t6288b-jump-position.scala
deleted file mode 100644
index c5f3bbe788..0000000000
--- a/test/files/run/t6288b-jump-position.scala
+++ /dev/null
@@ -1,19 +0,0 @@
-import scala.tools.partest.IcodeComparison
-
-object Test extends IcodeComparison {
- override def code =
- """object Case3 { // 01
- | def unapply(z: Any): Option[Int] = Some(-1) // 02
- | def main(args: Array[String]) { // 03
- | ("": Any) match { // 04
- | case x : String => // 05 Read: <linenumber> JUMP <target basic block id>
- | println("case 0") // 06 expecting "6 JUMP 7", was "8 JUMP 7"
- | case _ => // 07
- | println("default") // 08 expecting "8 JUMP 7"
- | } // 09
- | println("done") // 10
- | }
- |}""".stripMargin
-
- override def show() = showIcode()
-}
diff --git a/test/files/run/t6434.scala b/test/files/run/t6434.scala
index e4a4579613..6b6a783299 100644
--- a/test/files/run/t6434.scala
+++ b/test/files/run/t6434.scala
@@ -5,4 +5,11 @@ object Test extends ReplTest {
"""def f(x: => Int): Int = x
f _
"""
+
+ // replace indylambda function names by <function1>
+ override def eval() = {
+ val lines = super.eval
+ val r = """\$\$Lambda.*""".r
+ lines.map(l => r.replaceAllIn(l, "<function1>"))
+ }
}
diff --git a/test/files/run/t6546.flags b/test/files/run/t6546.flags
index eb4d19bcb9..6015e7c61f 100644
--- a/test/files/run/t6546.flags
+++ b/test/files/run/t6546.flags
@@ -1 +1 @@
--optimise \ No newline at end of file
+-Ybackend:GenASM -optimise \ No newline at end of file
diff --git a/test/files/run/t6827.check b/test/files/run/t6827.check
index 3a3a71c67d..4889e05be8 100644
--- a/test/files/run/t6827.check
+++ b/test/files/run/t6827.check
@@ -1,6 +1,6 @@
-start at -5: java.lang.IllegalArgumentException: requirement failed: start -5 out of range 10
-start at -1: java.lang.IllegalArgumentException: requirement failed: start -1 out of range 10
-start at limit: java.lang.IllegalArgumentException: requirement failed: start 10 out of range 10
+start at -5: java.lang.ArrayIndexOutOfBoundsException: -5
+start at -1: java.lang.ArrayIndexOutOfBoundsException: -1
+start at limit: ok
start at limit-1: ok
first 10: ok
read all: ok
@@ -8,8 +8,8 @@ test huge len: ok
5 from 5: ok
20 from 5: ok
test len overflow: ok
-start beyond limit: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10
+start beyond limit: ok
read 0: ok
read -1: ok
-invalid read 0: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10
-invalid read -1: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10
+invalid read 0: ok
+invalid read -1: ok
diff --git a/test/files/run/t6827.scala b/test/files/run/t6827.scala
index 8e17af09e2..eb020711bb 100644
--- a/test/files/run/t6827.scala
+++ b/test/files/run/t6827.scala
@@ -31,4 +31,24 @@ object Test extends App {
// okay, see SI-7128
"...".toIterator.copyToArray(new Array[Char](0), 0, 0)
+
+
+ // Bonus test from @som-snytt to check for overflow in
+ // index calculations.
+ def testOverflow(start: Int, len: Int, expected: List[Char]) {
+ def copyFromIterator = {
+ val arr = Array.fill[Char](3)('-')
+ "abc".toIterator.copyToArray(arr, start, len)
+ arr.toList
+ }
+ def copyFromArray = {
+ val arr = Array.fill[Char](3)('-')
+ "abc".toArray.copyToArray(arr, start, len)
+ arr.toList
+ }
+ assert(copyFromIterator == expected)
+ assert(copyFromArray == expected)
+ }
+ testOverflow(1, Int.MaxValue - 1, "-ab".toList)
+ testOverflow(1, Int.MaxValue, "-ab".toList)
}
diff --git a/test/files/run/t6955.scala b/test/files/run/t6955.scala
index 329af688e4..9ee3ef6bc5 100644
--- a/test/files/run/t6955.scala
+++ b/test/files/run/t6955.scala
@@ -21,6 +21,8 @@ class Switches {
}
object Test extends IcodeComparison {
+ override def extraSettings: String = super.extraSettings + " -Ybackend:GenASM"
+
// ensure we get two switches out of this -- ignore the rest of the output for robustness
// exclude the constant we emit for the "SWITCH ..." string below (we get the icode for all the code you see in this file)
override def show() = {
diff --git a/test/files/run/t6956.scala b/test/files/run/t6956.scala
index 3569adf483..594f5c9194 100644
--- a/test/files/run/t6956.scala
+++ b/test/files/run/t6956.scala
@@ -19,6 +19,8 @@ class Switches {
}
object Test extends IcodeComparison {
+ override def extraSettings: String = super.extraSettings + " -Ybackend:GenASM"
+
// ensure we get two switches out of this -- ignore the rest of the output for robustness
// exclude the constant we emit for the "SWITCH ..." string below (we get the icode for all the code you see in this file)
override def show() = {
diff --git a/test/files/run/t7008-scala-defined/Test_3.scala b/test/files/run/t7008-scala-defined/Test_3.scala
index ee7b9d9cde..26178142ab 100644
--- a/test/files/run/t7008-scala-defined/Test_3.scala
+++ b/test/files/run/t7008-scala-defined/Test_3.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning; re-run with
+ */
import scala.reflect.runtime.universe._
object Test extends App {
diff --git a/test/files/run/t7459b-optimize.flags b/test/files/run/t7459b-optimize.flags
index 49d036a887..b9bb09167e 100644
--- a/test/files/run/t7459b-optimize.flags
+++ b/test/files/run/t7459b-optimize.flags
@@ -1 +1 @@
--optimize
+-optimize -Ybackend:GenASM
diff --git a/test/files/run/t7521/Test.scala b/test/files/run/t7521/Test.scala
new file mode 100644
index 0000000000..e9816ad6cb
--- /dev/null
+++ b/test/files/run/t7521/Test.scala
@@ -0,0 +1,5 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ new Wrapper(new Array[Int](1))
+ }
+}
diff --git a/test/files/run/t7521/Wrapper.scala b/test/files/run/t7521/Wrapper.scala
new file mode 100644
index 0000000000..0b923f8924
--- /dev/null
+++ b/test/files/run/t7521/Wrapper.scala
@@ -0,0 +1 @@
+class Wrapper[Repr](val xs: Repr) extends AnyVal
diff --git a/test/files/run/t7521b.check b/test/files/run/t7521b.check
new file mode 100644
index 0000000000..4d96df106d
--- /dev/null
+++ b/test/files/run/t7521b.check
@@ -0,0 +1,7 @@
+= Java Erased Signatures =
+public int C.a(Wrapper)
+public int C.b(Wrapper)
+
+= Java Generic Signatures =
+public int C.a(Wrapper<int[]>)
+public int C.b(Wrapper<java.lang.Object>)
diff --git a/test/files/run/t7521b.scala b/test/files/run/t7521b.scala
new file mode 100644
index 0000000000..c9e27f28b4
--- /dev/null
+++ b/test/files/run/t7521b.scala
@@ -0,0 +1,20 @@
+class Wrapper[X](x: X)
+
+class C {
+ def a(w: Wrapper[Array[Int]]) = 0
+ def b(w: Wrapper[Int]) = 0
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val c = new C
+ c.a(new Wrapper(Array(1, 2)))
+ c.b(new Wrapper(1))
+
+ val methods = classOf[C].getDeclaredMethods.sortBy(_.getName)
+ println("= Java Erased Signatures =")
+ println(methods.mkString("\n"))
+ println("\n= Java Generic Signatures =")
+ println(methods.map(_.toGenericString).mkString("\n"))
+ }
+}
diff --git a/test/files/run/t7582.flags b/test/files/run/t7582.flags
index 1182725e86..2cd4b38726 100644
--- a/test/files/run/t7582.flags
+++ b/test/files/run/t7582.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-optimize -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/run/t7582b.flags b/test/files/run/t7582b.flags
index 1182725e86..2cd4b38726 100644
--- a/test/files/run/t7582b.flags
+++ b/test/files/run/t7582b.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-optimize -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/run/t7747-repl.scala b/test/files/run/t7747-repl.scala
index 141c2d9844..9b2d1c40be 100644
--- a/test/files/run/t7747-repl.scala
+++ b/test/files/run/t7747-repl.scala
@@ -8,6 +8,13 @@ object Test extends ReplTest {
s
}
+ // replace indylambda function names by <function0>
+ override def eval() = {
+ val lines = super.eval
+ val r = """\$Lambda.*""".r
+ lines.map(l => r.replaceAllIn(l, "<function0>"))
+ }
+
def code = """
|var x = 10
|var y = 11
diff --git a/test/files/run/t7775.scala b/test/files/run/t7775.scala
index 48b0d89974..bc69064e17 100644
--- a/test/files/run/t7775.scala
+++ b/test/files/run/t7775.scala
@@ -1,3 +1,45 @@
+import scala.concurrent._, duration._
+import ExecutionContext.Implicits.global
+import scala.tools.reflect.WrappedProperties.AccessControl._
+import java.util.concurrent.CyclicBarrier
+
+object Test extends App {
+ @volatile var done = false
+ val barrier = new CyclicBarrier(2)
+
+ val probe = Future {
+ val attempts = 1024 // previously, failed after a few
+ def fail(i: Int) = s"Failed at $i"
+ barrier.await()
+ for (i <- 1 to attempts ; p <- systemProperties)
+ p match { case (k, v) => assert (k != null && v != null, fail(i)) }
+ }
+ probe onComplete {
+ case _ => done = true
+ }
+
+ System.setProperty("foo", "fooz")
+ System.setProperty("bar", "barz")
+ barrier.await() // just for fun, wait to start mucking with properties
+
+ // continually modify properties trying to break live iteration over sys props
+ // hint: don't iterate lively over sys props
+ var alt = true
+ while (!done) {
+ if (alt) {
+ System.getProperties.remove("foo")
+ System.setProperty("bar", "barz")
+ alt = false
+ } else {
+ System.getProperties.remove("bar")
+ System.setProperty("foo", "fooz")
+ alt = true
+ }
+ }
+ Await.result(probe, Duration.Inf)
+}
+
+/*
import scala.concurrent.{duration, Future, Await, ExecutionContext}
import scala.tools.nsc.Settings
import ExecutionContext.Implicits.global
@@ -15,3 +57,4 @@ object Test {
Await.result(compiler, duration.Duration.Inf)
}
}
+*/
diff --git a/test/files/run/t8549.scala b/test/files/run/t8549.scala
index cb254e3810..2d3f33537d 100644
--- a/test/files/run/t8549.scala
+++ b/test/files/run/t8549.scala
@@ -79,7 +79,7 @@ object Test extends App {
}
}
- // Generated on 20141010-14:01:28 with Scala version 2.11.2)
+ // Generated on 20150330-15:20:14 with Scala version 2.12.0-20150330-143836-a91b76ea6c)
overwrite.foreach(updateComment)
check(Some(1))("rO0ABXNyAApzY2FsYS5Tb21lESLyaV6hi3QCAAFMAAF4dAASTGphdmEvbGFuZy9PYmplY3Q7eHIADHNjYWxhLk9wdGlvbv5pN/3bDmZ0AgAAeHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAQ==")
@@ -115,6 +115,19 @@ object Test extends App {
// TODO SI-8576 unstable under -Xcheckinit
check(collection.convert.Wrappers)( "rO0ABXNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcA==")
+
+ check(new collection.convert.Wrappers.SetWrapper(immutable.Set()))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkU2V0V3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkU2V0V3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL1NldDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyAChzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkRW1wdHlTZXQk8Hk3TFN0uDYCAAB4cA==")
+ check(new collection.convert.Wrappers.SetWrapper(immutable.Set(1, 2, 3)))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkU2V0V3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkU2V0V3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL1NldDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACNzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5TZXQkU2V0M84syT0560SgAgADTAAFZWxlbTF0ABJMamF2YS9sYW5nL09iamVjdDtMAAVlbGVtMnEAfgAZTAAFZWxlbTNxAH4AGXhwc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+ABsAAAACc3EAfgAbAAAAAw==")
+ check(new collection.convert.Wrappers.SetWrapper(mutable.Set()))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkU2V0V3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkU2V0V3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL1NldDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaFNldAAAAAAAAAABAwAAeHB3DQAAAcIAAAAAAAAABQB4")
+ check(new collection.convert.Wrappers.SetWrapper(mutable.Set(1, 2, 3)))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkU2V0V3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkU2V0V3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL1NldDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaFNldAAAAAAAAAABAwAAeHB3DQAAAcIAAAADAAAABQBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AGgAAAAJzcQB+ABoAAAADeA==")
+ check(new collection.convert.Wrappers.MutableSetWrapper(mutable.Set()))("rO0ABXNyADNzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXK9XXTONonwwgIAAUwACnVuZGVybHlpbmd0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1NldDt4cgAsc2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJFNldFdyYXBwZXIAAAAAAAAAAQIAAkwABiRvdXRlcnQAI0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnM7TAA4c2NhbGEkY29sbGVjdGlvbiRjb252ZXJ0JFdyYXBwZXJzJFNldFdyYXBwZXIkJHVuZGVybHlpbmd0ABZMc2NhbGEvY29sbGVjdGlvbi9TZXQ7eHBzcgAic2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJK60s4os2ryBAgASTAAYRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA2THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyREaWN0aW9uYXJ5V3JhcHBlciQ7TAAWSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSXRlcmFibGVXcmFwcGVyJDtMABZJdGVyYXRvcldyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYXRvcldyYXBwZXIkO0wAGUpDb2xsZWN0aW9uV3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpDb2xsZWN0aW9uV3JhcHBlciQ7TAAcSkNvbmN1cnJlbnRNYXBXcmFwcGVyJG1vZHVsZXQAOkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbmN1cnJlbnRNYXBXcmFwcGVyJDtMABlKRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRGljdGlvbmFyeVdyYXBwZXIkO0wAGkpFbnVtZXJhdGlvbldyYXBwZXIkbW9kdWxldAA4THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRW51bWVyYXRpb25XcmFwcGVyJDtMABdKSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhYmxlV3JhcHBlciQ7TAAXSkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpJdGVyYXRvcldyYXBwZXIkO0wAE0pMaXN0V3JhcHBlciRtb2R1bGV0ADFMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpMaXN0V3JhcHBlciQ7TAASSk1hcFdyYXBwZXIkbW9kdWxldAAwTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKTWFwV3JhcHBlciQ7TAAZSlByb3BlcnRpZXNXcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlByb3BlcnRpZXNXcmFwcGVyJDtMABJKU2V0V3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpTZXRXcmFwcGVyJDtMABtNdXRhYmxlQnVmZmVyV3JhcHBlciRtb2R1bGV0ADlMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVCdWZmZXJXcmFwcGVyJDtMABhNdXRhYmxlTWFwV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVNYXBXcmFwcGVyJDtMABhNdXRhYmxlU2VxV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXFXcmFwcGVyJDtMABhNdXRhYmxlU2V0V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXRXcmFwcGVyJDtMABFTZXFXcmFwcGVyJG1vZHVsZXQAL0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkU2VxV3JhcHBlciQ7eHBwcHBwcHBwcHBwcHBwcHBwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hTZXQAAAAAAAAAAQMAAHhwdw0AAAHCAAAAAAAAAAUAeHEAfgAb")
+ check(new collection.convert.Wrappers.MutableSetWrapper(mutable.Set(1, 2, 3)))("rO0ABXNyADNzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXK9XXTONonwwgIAAUwACnVuZGVybHlpbmd0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1NldDt4cgAsc2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJFNldFdyYXBwZXIAAAAAAAAAAQIAAkwABiRvdXRlcnQAI0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnM7TAA4c2NhbGEkY29sbGVjdGlvbiRjb252ZXJ0JFdyYXBwZXJzJFNldFdyYXBwZXIkJHVuZGVybHlpbmd0ABZMc2NhbGEvY29sbGVjdGlvbi9TZXQ7eHBzcgAic2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJK60s4os2ryBAgASTAAYRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA2THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyREaWN0aW9uYXJ5V3JhcHBlciQ7TAAWSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSXRlcmFibGVXcmFwcGVyJDtMABZJdGVyYXRvcldyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYXRvcldyYXBwZXIkO0wAGUpDb2xsZWN0aW9uV3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpDb2xsZWN0aW9uV3JhcHBlciQ7TAAcSkNvbmN1cnJlbnRNYXBXcmFwcGVyJG1vZHVsZXQAOkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbmN1cnJlbnRNYXBXcmFwcGVyJDtMABlKRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRGljdGlvbmFyeVdyYXBwZXIkO0wAGkpFbnVtZXJhdGlvbldyYXBwZXIkbW9kdWxldAA4THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRW51bWVyYXRpb25XcmFwcGVyJDtMABdKSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhYmxlV3JhcHBlciQ7TAAXSkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpJdGVyYXRvcldyYXBwZXIkO0wAE0pMaXN0V3JhcHBlciRtb2R1bGV0ADFMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpMaXN0V3JhcHBlciQ7TAASSk1hcFdyYXBwZXIkbW9kdWxldAAwTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKTWFwV3JhcHBlciQ7TAAZSlByb3BlcnRpZXNXcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlByb3BlcnRpZXNXcmFwcGVyJDtMABJKU2V0V3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpTZXRXcmFwcGVyJDtMABtNdXRhYmxlQnVmZmVyV3JhcHBlciRtb2R1bGV0ADlMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVCdWZmZXJXcmFwcGVyJDtMABhNdXRhYmxlTWFwV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVNYXBXcmFwcGVyJDtMABhNdXRhYmxlU2VxV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXFXcmFwcGVyJDtMABhNdXRhYmxlU2V0V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXRXcmFwcGVyJDtMABFTZXFXcmFwcGVyJG1vZHVsZXQAL0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkU2VxV3JhcHBlciQ7eHBwcHBwcHBwcHBwcHBwcHBwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hTZXQAAAAAAAAAAQMAAHhwdw0AAAHCAAAAAwAAAAUAc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+ABwAAAACc3EAfgAcAAAAA3hxAH4AGw==")
+ check(new collection.convert.Wrappers.MapWrapper(immutable.Map()))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTWFwV3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkTWFwV3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL01hcDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyAChzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5NYXAkRW1wdHlNYXAknTcK54mVQiQCAAB4cA==")
+ check(new collection.convert.Wrappers.MapWrapper(immutable.Map[Int, Int](1 -> 2, 2 -> 3, 3 -> 4)))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTWFwV3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkTWFwV3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL01hcDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACNzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5NYXAkTWFwM6csFD+HjyRxAgAGTAAEa2V5MXQAEkxqYXZhL2xhbmcvT2JqZWN0O0wABGtleTJxAH4AGUwABGtleTNxAH4AGUwABnZhbHVlMXEAfgAZTAAGdmFsdWUycQB+ABlMAAZ2YWx1ZTNxAH4AGXhwc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+ABsAAAACc3EAfgAbAAAAA3EAfgAecQB+AB9zcQB+ABsAAAAE")
+ check(new collection.convert.Wrappers.MapWrapper(mutable.Map()))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTWFwV3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkTWFwV3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL01hcDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAAAAAAABAB4")
+ check(new collection.convert.Wrappers.MapWrapper(mutable.Map[Int, Int](1 -> 2, 2 -> 3, 3 -> 4)))("rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTWFwV3JhcHBlcgAAAAAAAAABAgACTAAGJG91dGVydAAjTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycztMADhzY2FsYSRjb2xsZWN0aW9uJGNvbnZlcnQkV3JhcHBlcnMkTWFwV3JhcHBlciQkdW5kZXJseWluZ3QAFkxzY2FsYS9jb2xsZWN0aW9uL01hcDt4cHNyACJzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkrrSziizavIECABJMABhEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJERpY3Rpb25hcnlXcmFwcGVyJDtMABZJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYWJsZVdyYXBwZXIkO0wAFkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADRMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEl0ZXJhdG9yV3JhcHBlciQ7TAAZSkNvbGxlY3Rpb25XcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbGxlY3Rpb25XcmFwcGVyJDtMABxKQ29uY3VycmVudE1hcFdyYXBwZXIkbW9kdWxldAA6THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKQ29uY3VycmVudE1hcFdyYXBwZXIkO0wAGUpEaWN0aW9uYXJ5V3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpEaWN0aW9uYXJ5V3JhcHBlciQ7TAAaSkVudW1lcmF0aW9uV3JhcHBlciRtb2R1bGV0ADhMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpFbnVtZXJhdGlvbldyYXBwZXIkO0wAF0pJdGVyYWJsZVdyYXBwZXIkbW9kdWxldAA1THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKSXRlcmFibGVXcmFwcGVyJDtMABdKSXRlcmF0b3JXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhdG9yV3JhcHBlciQ7TAATSkxpc3RXcmFwcGVyJG1vZHVsZXQAMUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkxpc3RXcmFwcGVyJDtMABJKTWFwV3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpNYXBXcmFwcGVyJDtMABlKUHJvcGVydGllc1dyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKUHJvcGVydGllc1dyYXBwZXIkO0wAEkpTZXRXcmFwcGVyJG1vZHVsZXQAMExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlNldFdyYXBwZXIkO0wAG011dGFibGVCdWZmZXJXcmFwcGVyJG1vZHVsZXQAOUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZUJ1ZmZlcldyYXBwZXIkO0wAGE11dGFibGVNYXBXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXIkO0wAGE11dGFibGVTZXFXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNlcVdyYXBwZXIkO0wAGE11dGFibGVTZXRXcmFwcGVyJG1vZHVsZXQANkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkTXV0YWJsZVNldFdyYXBwZXIkO0wAEVNlcVdyYXBwZXIkbW9kdWxldAAvTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRTZXFXcmFwcGVyJDt4cHBwcHBwcHBwcHBwcHBwcHBwcHNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAADAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAnNxAH4AGgAAAANzcQB+ABoAAAABcQB+ABxxAH4AHXNxAH4AGgAAAAR4")
+ check(new collection.convert.Wrappers.MutableMapWrapper(mutable.Map()))("rO0ABXNyADNzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXJ4TG6ffKy11wIAAUwACnVuZGVybHlpbmd0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL01hcDt4cgAsc2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJE1hcFdyYXBwZXIAAAAAAAAAAQIAAkwABiRvdXRlcnQAI0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnM7TAA4c2NhbGEkY29sbGVjdGlvbiRjb252ZXJ0JFdyYXBwZXJzJE1hcFdyYXBwZXIkJHVuZGVybHlpbmd0ABZMc2NhbGEvY29sbGVjdGlvbi9NYXA7eHBzcgAic2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJK60s4os2ryBAgASTAAYRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA2THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyREaWN0aW9uYXJ5V3JhcHBlciQ7TAAWSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSXRlcmFibGVXcmFwcGVyJDtMABZJdGVyYXRvcldyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYXRvcldyYXBwZXIkO0wAGUpDb2xsZWN0aW9uV3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpDb2xsZWN0aW9uV3JhcHBlciQ7TAAcSkNvbmN1cnJlbnRNYXBXcmFwcGVyJG1vZHVsZXQAOkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbmN1cnJlbnRNYXBXcmFwcGVyJDtMABlKRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRGljdGlvbmFyeVdyYXBwZXIkO0wAGkpFbnVtZXJhdGlvbldyYXBwZXIkbW9kdWxldAA4THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRW51bWVyYXRpb25XcmFwcGVyJDtMABdKSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhYmxlV3JhcHBlciQ7TAAXSkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpJdGVyYXRvcldyYXBwZXIkO0wAE0pMaXN0V3JhcHBlciRtb2R1bGV0ADFMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpMaXN0V3JhcHBlciQ7TAASSk1hcFdyYXBwZXIkbW9kdWxldAAwTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKTWFwV3JhcHBlciQ7TAAZSlByb3BlcnRpZXNXcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlByb3BlcnRpZXNXcmFwcGVyJDtMABJKU2V0V3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpTZXRXcmFwcGVyJDtMABtNdXRhYmxlQnVmZmVyV3JhcHBlciRtb2R1bGV0ADlMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVCdWZmZXJXcmFwcGVyJDtMABhNdXRhYmxlTWFwV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVNYXBXcmFwcGVyJDtMABhNdXRhYmxlU2VxV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXFXcmFwcGVyJDtMABhNdXRhYmxlU2V0V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXRXcmFwcGVyJDtMABFTZXFXcmFwcGVyJG1vZHVsZXQAL0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkU2VxV3JhcHBlciQ7eHBwcHBwcHBwcHBwcHBwcHBwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hNYXAAAAAAAAAAAQMAAHhwdw0AAALuAAAAAAAAAAQAeHEAfgAb")
+ check(new collection.convert.Wrappers.MutableMapWrapper(mutable.Map[Int, Int](1 -> 2, 2 -> 3, 3 -> 4)))("rO0ABXNyADNzY2FsYS5jb2xsZWN0aW9uLmNvbnZlcnQuV3JhcHBlcnMkTXV0YWJsZU1hcFdyYXBwZXJ4TG6ffKy11wIAAUwACnVuZGVybHlpbmd0AB5Mc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL01hcDt4cgAsc2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJE1hcFdyYXBwZXIAAAAAAAAAAQIAAkwABiRvdXRlcnQAI0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnM7TAA4c2NhbGEkY29sbGVjdGlvbiRjb252ZXJ0JFdyYXBwZXJzJE1hcFdyYXBwZXIkJHVuZGVybHlpbmd0ABZMc2NhbGEvY29sbGVjdGlvbi9NYXA7eHBzcgAic2NhbGEuY29sbGVjdGlvbi5jb252ZXJ0LldyYXBwZXJzJK60s4os2ryBAgASTAAYRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA2THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyREaWN0aW9uYXJ5V3JhcHBlciQ7TAAWSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANExzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSXRlcmFibGVXcmFwcGVyJDtMABZJdGVyYXRvcldyYXBwZXIkbW9kdWxldAA0THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRJdGVyYXRvcldyYXBwZXIkO0wAGUpDb2xsZWN0aW9uV3JhcHBlciRtb2R1bGV0ADdMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpDb2xsZWN0aW9uV3JhcHBlciQ7TAAcSkNvbmN1cnJlbnRNYXBXcmFwcGVyJG1vZHVsZXQAOkxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkNvbmN1cnJlbnRNYXBXcmFwcGVyJDtMABlKRGljdGlvbmFyeVdyYXBwZXIkbW9kdWxldAA3THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRGljdGlvbmFyeVdyYXBwZXIkO0wAGkpFbnVtZXJhdGlvbldyYXBwZXIkbW9kdWxldAA4THNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKRW51bWVyYXRpb25XcmFwcGVyJDtMABdKSXRlcmFibGVXcmFwcGVyJG1vZHVsZXQANUxzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSkl0ZXJhYmxlV3JhcHBlciQ7TAAXSkl0ZXJhdG9yV3JhcHBlciRtb2R1bGV0ADVMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpJdGVyYXRvcldyYXBwZXIkO0wAE0pMaXN0V3JhcHBlciRtb2R1bGV0ADFMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpMaXN0V3JhcHBlciQ7TAASSk1hcFdyYXBwZXIkbW9kdWxldAAwTHNjYWxhL2NvbGxlY3Rpb24vY29udmVydC9XcmFwcGVycyRKTWFwV3JhcHBlciQ7TAAZSlByb3BlcnRpZXNXcmFwcGVyJG1vZHVsZXQAN0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkSlByb3BlcnRpZXNXcmFwcGVyJDtMABJKU2V0V3JhcHBlciRtb2R1bGV0ADBMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJEpTZXRXcmFwcGVyJDtMABtNdXRhYmxlQnVmZmVyV3JhcHBlciRtb2R1bGV0ADlMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVCdWZmZXJXcmFwcGVyJDtMABhNdXRhYmxlTWFwV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVNYXBXcmFwcGVyJDtMABhNdXRhYmxlU2VxV3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXFXcmFwcGVyJDtMABhNdXRhYmxlU2V0V3JhcHBlciRtb2R1bGV0ADZMc2NhbGEvY29sbGVjdGlvbi9jb252ZXJ0L1dyYXBwZXJzJE11dGFibGVTZXRXcmFwcGVyJDtMABFTZXFXcmFwcGVyJG1vZHVsZXQAL0xzY2FsYS9jb2xsZWN0aW9uL2NvbnZlcnQvV3JhcHBlcnMkU2VxV3JhcHBlciQ7eHBwcHBwcHBwcHBwcHBwcHBwcHBzcgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkhhc2hNYXAAAAAAAAAAAQMAAHhwdw0AAALuAAAAAwAAAAQAc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAJzcQB+ABwAAAADc3EAfgAcAAAAAXEAfgAecQB+AB9zcQB+ABwAAAAEeHEAfgAb")
check(immutable.BitSet(1, 2, 3))( "rO0ABXNyAClzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5CaXRTZXQkQml0U2V0MR9dg8JGRI8UAgABSgAFZWxlbXN4cgAhc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuQml0U2V0Flz5Ms3qxsoCAAB4cAAAAAAAAAAO")
check(immutable.HashMap())( "rO0ABXNyADVzY2FsYS5jb2xsZWN0aW9uLmltbXV0YWJsZS5IYXNoTWFwJFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAACAwAAeHB3BAAAAAB4")
@@ -163,6 +176,9 @@ object Test extends App {
check(mutable.HashMap())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAAAAAAABAB4")
check(mutable.HashMap(1 -> 1))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAABAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXEAfgAEeA==")
check(mutable.HashSet(1, 2, 3))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaFNldAAAAAAAAAABAwAAeHB3DQAAAcIAAAADAAAABQBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJzcQB+AAIAAAADeA==")
+ check(mutable.TreeMap())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZU1hcNx8qC229ZvwAgACTAAIb3JkZXJpbmd0ABVMc2NhbGEvbWF0aC9PcmRlcmluZztMACZzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkVHJlZU1hcCQkdHJlZXQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQkC4BMdr1Z51wCAAB4cHNyACpzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuUmVkQmxhY2tUcmVlJFRyZWUATKc08DWmFQIAAkkABHNpemVMAARyb290dAAsTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9SZWRCbGFja1RyZWUkTm9kZTt4cAAAAABw")
+ check(mutable.TreeMap(1 -> 1, 3 -> 6))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZU1hcNx8qC229ZvwAgACTAAIb3JkZXJpbmd0ABVMc2NhbGEvbWF0aC9PcmRlcmluZztMACZzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkVHJlZU1hcCQkdHJlZXQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQkC4BMdr1Z51wCAAB4cHNyACpzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuUmVkQmxhY2tUcmVlJFRyZWUATKc08DWmFQIAAkkABHNpemVMAARyb290dAAsTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9SZWRCbGFja1RyZWUkTm9kZTt4cAAAAAJzcgAqc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlJlZEJsYWNrVHJlZSROb2RlGxHsFtValgACAAZaAANyZWRMAANrZXl0ABJMamF2YS9sYW5nL09iamVjdDtMAARsZWZ0cQB+AAdMAAZwYXJlbnRxAH4AB0wABXJpZ2h0cQB+AAdMAAV2YWx1ZXEAfgAKeHAAc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFwcHNxAH4ACQFzcQB+AAwAAAADcHEAfgALcHNxAH4ADAAAAAZxAH4ADg==")
+ check(mutable.TreeMap(1 -> 1, 3 -> 6).range(1, 2))( "rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZU1hcCRUcmVlTWFwVmlldx7MCZxLhVQ8AgADTAAGJG91dGVydAAiTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9UcmVlTWFwO0wABGZyb210AA5Mc2NhbGEvT3B0aW9uO0wABXVudGlscQB+AAJ4cgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlRyZWVNYXDcfKgttvWb8AIAAkwACG9yZGVyaW5ndAAVTHNjYWxhL21hdGgvT3JkZXJpbmc7TAAmc2NhbGEkY29sbGVjdGlvbiRtdXRhYmxlJFRyZWVNYXAkJHRyZWV0ACxMc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1JlZEJsYWNrVHJlZSRUcmVlO3hwc3IAGHNjYWxhLm1hdGguT3JkZXJpbmckSW50JAuATHa9WedcAgAAeHBzcgAqc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlJlZEJsYWNrVHJlZSRUcmVlAEynNPA1phUCAAJJAARzaXplTAAEcm9vdHQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJE5vZGU7eHAAAAACc3IAKnNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5SZWRCbGFja1RyZWUkTm9kZRsR7BbVWpYAAgAGWgADcmVkTAADa2V5dAASTGphdmEvbGFuZy9PYmplY3Q7TAAEbGVmdHEAfgAKTAAGcGFyZW50cQB+AApMAAVyaWdodHEAfgAKTAAFdmFsdWVxAH4ADXhwAHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABcHBzcQB+AAwBc3EAfgAPAAAAA3BxAH4ADnBzcQB+AA8AAAAGcQB+ABFzcQB+AANxAH4ACHEAfgALc3IACnNjYWxhLlNvbWURIvJpXqGLdAIAAUwAAXhxAH4ADXhyAAxzY2FsYS5PcHRpb27+aTf92w5mdAIAAHhwcQB+ABFzcQB+ABZzcQB+AA8AAAAC")
// TODO SI-8576 Uninitialized field under -Xcheckinit
// check(new mutable.History())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGlzdG9yeUhuXxDIFJrsAgACSQAKbWF4SGlzdG9yeUwAA2xvZ3QAIExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUXVldWU7eHAAAAPoc3IAHnNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5RdWV1ZbjMURVfOuHHAgAAeHIAJHNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5NdXRhYmxlTGlzdFJpnjJ+gFbAAgADSQADbGVuTAAGZmlyc3QwdAAlTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9MaW5rZWRMaXN0O0wABWxhc3QwcQB+AAV4cAAAAABzcgAjc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkxpbmtlZExpc3Sak+nGCZHaUQIAAkwABGVsZW10ABJMamF2YS9sYW5nL09iamVjdDtMAARuZXh0dAAeTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9TZXE7eHBwcQB+AApxAH4ACg==")
check(mutable.LinkedHashMap(1 -> 2))( "rO0ABXNyACZzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuTGlua2VkSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAABAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJ4")
diff --git a/test/files/run/t8575.scala b/test/files/run/t8575.scala
new file mode 100644
index 0000000000..fb8f603f3e
--- /dev/null
+++ b/test/files/run/t8575.scala
@@ -0,0 +1,32 @@
+class E[F]
+class A
+class B
+class C
+
+trait TypeMember {
+ type X
+
+ // This call throws an AbstractMethodError, because it invokes the erasure of
+ // consume(X): Unit that is consume(Object): Unit. But the corresponding
+ // bridge method is not generated.
+ consume(value)
+
+ def value: X
+ def consume(x: X): Unit
+}
+
+object Test extends TypeMember {
+ type F = A with B
+
+ // works if replaced by type X = E[A with B with C]
+ type X = E[F with C]
+
+ def value = new E[F with C]
+
+ // This call passes, since it invokes consume(E): Unit
+ def consume(x: X) {}
+
+ def main(args: Array[String]) {
+ consume(value)
+ }
+}
diff --git a/test/files/run/t8575b.scala b/test/files/run/t8575b.scala
new file mode 100644
index 0000000000..0d731ccf9f
--- /dev/null
+++ b/test/files/run/t8575b.scala
@@ -0,0 +1,17 @@
+class A
+class B
+class C
+
+object Test {
+ type F = A with B
+
+ def main(args: Array[String]) {
+ import reflect.runtime.universe._
+ val t1 = typeOf[F with C]
+ val t2 = typeOf[(A with B) with C]
+ val t3 = typeOf[A with B with C]
+ assert(t1 =:= t2)
+ assert(t2 =:= t3)
+ assert(t3 =:= t1)
+ }
+}
diff --git a/test/files/run/t8575c.scala b/test/files/run/t8575c.scala
new file mode 100644
index 0000000000..8219952299
--- /dev/null
+++ b/test/files/run/t8575c.scala
@@ -0,0 +1,23 @@
+class C
+
+trait TypeMember {
+ type X
+ type Y
+ type Z
+}
+
+object Test extends TypeMember {
+ type A = X with Y
+ type B = Z with A
+ type F = A with B
+
+ def main(args: Array[String]) {
+ import reflect.runtime.universe._
+ val t1 = typeOf[F with C]
+ val t2 = typeOf[(A with B) with C]
+ val t3 = typeOf[A with B with C]
+ assert(t1 =:= t2)
+ assert(t2 =:= t3)
+ assert(t3 =:= t1)
+ }
+}
diff --git a/test/files/run/t8601.flags b/test/files/run/t8601.flags
index 1182725e86..2cd4b38726 100644
--- a/test/files/run/t8601.flags
+++ b/test/files/run/t8601.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-optimize -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/run/t8601b.flags b/test/files/run/t8601b.flags
index 1182725e86..2cd4b38726 100644
--- a/test/files/run/t8601b.flags
+++ b/test/files/run/t8601b.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-optimize -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/run/t8601c.flags b/test/files/run/t8601c.flags
index 1182725e86..2cd4b38726 100644
--- a/test/files/run/t8601c.flags
+++ b/test/files/run/t8601c.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-optimize -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/run/t8601d.flags b/test/files/run/t8601d.flags
index 1182725e86..2cd4b38726 100644
--- a/test/files/run/t8601d.flags
+++ b/test/files/run/t8601d.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-optimize -Ybackend:GenASM \ No newline at end of file
diff --git a/test/files/run/t8601e.flags b/test/files/run/t8601e.flags
index 49d036a887..b9bb09167e 100644
--- a/test/files/run/t8601e.flags
+++ b/test/files/run/t8601e.flags
@@ -1 +1 @@
--optimize
+-optimize -Ybackend:GenASM
diff --git a/test/files/run/t8710.scala b/test/files/run/t8710.scala
new file mode 100644
index 0000000000..15aab5b8a4
--- /dev/null
+++ b/test/files/run/t8710.scala
@@ -0,0 +1,17 @@
+class Bar(val x: Int) extends AnyVal {
+ def f: String = f(0)
+ private def f(x: Int): String = ""
+}
+
+class Baz(val x: Int) extends AnyVal {
+ def f: String = "123"
+ private def f(x: Int): String = ""
+}
+object Baz {
+ def x(b: Baz) = b.f(0)
+}
+
+object Test extends App {
+ new Bar(23).f
+ new Baz(23).f
+}
diff --git a/test/files/run/t8764.check b/test/files/run/t8764.check
deleted file mode 100644
index 6260069602..0000000000
--- a/test/files/run/t8764.check
+++ /dev/null
@@ -1,5 +0,0 @@
-IntOnly: should return an unboxed int
-Int: int
-IntAndDouble: should just box and return Anyval
-Double: class java.lang.Double
-Int: class java.lang.Integer
diff --git a/test/files/run/t8764.flags b/test/files/run/t8764.flags
deleted file mode 100644
index 48fd867160..0000000000
--- a/test/files/run/t8764.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xexperimental
diff --git a/test/files/run/t8764.scala b/test/files/run/t8764.scala
deleted file mode 100644
index decc658f6e..0000000000
--- a/test/files/run/t8764.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-object Test extends App {
-case class IntOnly(i: Int, j: Int)
-
-println("IntOnly: should return an unboxed int")
-val a = IntOnly(1, 2)
-val i: Int = a.productElement(0)
-println(s"Int: ${a.productElement(0).getClass}")
-
-case class IntAndDouble(i: Int, d: Double)
-
-println("IntAndDouble: should just box and return Anyval")
-val b = IntAndDouble(1, 2.0)
-val j: AnyVal = b.productElement(0)
-println(s"Double: ${b.productElement(1).getClass}")
-println(s"Int: ${b.productElement(0).getClass}")
-}
diff --git a/test/files/run/t8918-unary-ids.check b/test/files/run/t8918-unary-ids.check
new file mode 100644
index 0000000000..92f02371c7
--- /dev/null
+++ b/test/files/run/t8918-unary-ids.check
@@ -0,0 +1,7 @@
+Expected 41 lines, got 39
+--- expected
++++ actual
+@@ -1,3 +1,1 @@
+-Type in expressions to have them evaluated.
+-Type :help for more information.
+
diff --git a/test/files/run/t8918-unary-ids.scala b/test/files/run/t8918-unary-ids.scala
new file mode 100644
index 0000000000..3aa990f72c
--- /dev/null
+++ b/test/files/run/t8918-unary-ids.scala
@@ -0,0 +1,49 @@
+
+
+import scala.tools.partest.SessionTest
+
+// Taking unary ids as plain
+object Test extends SessionTest {
+ def session =
+"""Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala> val - = 42
+-: Int = 42
+
+scala> val i = -
+i: Int = 42
+
+scala> - { 42 }
+res0: Int = -42
+
+scala> - if (true) 1 else 2
+<console>:1: error: illegal start of simple expression
+- if (true) 1 else 2
+ ^
+
+scala> - - 1
+<console>:1: error: ';' expected but integer literal found.
+- - 1
+ ^
+
+scala> -.-(1)
+res1: Int = 41
+
+scala> -
+res2: Int = 42
+
+scala> - -
+res3: Int = -42
+
+scala> + -
+res4: Int = 42
+
+scala> object X { def -(i: Int) = 42 - i ; def f(g: Int => Int) = g(7) ; def j = f(-) }
+defined object X
+
+scala> X.j
+res5: Int = 35
+
+scala> :quit"""
+}
diff --git a/test/files/run/t8944/A_1.scala b/test/files/run/t8944/A_1.scala
new file mode 100644
index 0000000000..7ff80327b0
--- /dev/null
+++ b/test/files/run/t8944/A_1.scala
@@ -0,0 +1 @@
+case class A(private val x: String)
diff --git a/test/files/run/t8944/A_2.scala b/test/files/run/t8944/A_2.scala
new file mode 100644
index 0000000000..3dcdea1583
--- /dev/null
+++ b/test/files/run/t8944/A_2.scala
@@ -0,0 +1,6 @@
+case class Other(private val x: String) // consume a fresh name suffix
+
+// the param accessor will now be called "x$2",
+// whereas the previously compiled client expects it to be called
+// x$1
+case class A(private val x: String)
diff --git a/test/files/run/t8944/Test_1.scala b/test/files/run/t8944/Test_1.scala
new file mode 100644
index 0000000000..fe466693cf
--- /dev/null
+++ b/test/files/run/t8944/Test_1.scala
@@ -0,0 +1,3 @@
+object Test extends App {
+ val A("") = new A("")
+}
diff --git a/test/files/run/t8944b.scala b/test/files/run/t8944b.scala
new file mode 100644
index 0000000000..f469122ce6
--- /dev/null
+++ b/test/files/run/t8944b.scala
@@ -0,0 +1,9 @@
+case class A(private var foo: Any) {
+ def m = { def foo = 42 /*will be lamba lifted to `A#foo$1`*/ }
+}
+object Test {
+ def main(args: Array[String]): Unit = {
+ val A("") = new A("")
+ new A("").m
+ }
+}
diff --git a/test/files/run/t8944c.check b/test/files/run/t8944c.check
new file mode 100644
index 0000000000..7738f76980
--- /dev/null
+++ b/test/files/run/t8944c.check
@@ -0,0 +1,5 @@
+private java.lang.Object Foo.ant()
+public java.lang.Object Foo.ant$access$0()
+private scala.collection.Seq Foo.cat()
+public scala.collection.Seq Foo.cat$access$2()
+public java.lang.Object Foo.elk()
diff --git a/test/files/run/t8944c.scala b/test/files/run/t8944c.scala
new file mode 100644
index 0000000000..95c2143851
--- /dev/null
+++ b/test/files/run/t8944c.scala
@@ -0,0 +1,8 @@
+case class Foo[A](private val ant: Any, elk: Any, private val cat: A*)
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ def pred(name: String) = Set("ant", "elk", "cat").exists(name contains _)
+ println(classOf[Foo[_]].getDeclaredMethods.filter(m => pred(m.getName)).sortBy(_.getName).mkString("\n"))
+ }
+}
diff --git a/test/files/run/t8955.scala b/test/files/run/t8955.scala
new file mode 100644
index 0000000000..afa31aa5d7
--- /dev/null
+++ b/test/files/run/t8955.scala
@@ -0,0 +1,12 @@
+import scala.collection.parallel.immutable.ParSet
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ for (i <- 1 to 2000) test()
+ }
+
+ def test() {
+ ParSet[Int]((1 to 10000): _*) foreach (x => ()) // hangs non deterministically
+ }
+}
+
diff --git a/test/files/run/t8960.scala b/test/files/run/t8960.scala
index a58ac53d33..a43d5679d8 100644
--- a/test/files/run/t8960.scala
+++ b/test/files/run/t8960.scala
@@ -1,5 +1,5 @@
object Test extends App {
- def test(o: AnyRef, sp: Boolean = false) = {
+ def testAnonFunClass(o: AnyRef, sp: Boolean = false) = {
val isSpecialized = o.getClass.getSuperclass.getName contains "$sp"
val isDelambdafyMethod = o.getClass.getName contains "$lambda$"
assert(
@@ -11,62 +11,68 @@ object Test extends App {
assert(f.getLong(null) == 0l)
}
- test(() => (), sp = true)
- test(() => 1, sp = true)
- test(() => "")
+ def testIndyLambda(o: AnyRef, sp: Boolean = false) = {
+ val isSpecialized = o.getClass.getInterfaces.exists(_.getName contains "$sp")
+ assert(sp == isSpecialized, o.getClass.getName)
+ }
+
+
+ testIndyLambda(() => (), sp = true)
+ testIndyLambda(() => 1, sp = true)
+ testIndyLambda(() => "")
- test((x: Int) => x, sp = true)
- test((x: Boolean) => x)
- test((x: Int) => "")
+ testIndyLambda((x: Int) => x, sp = true)
+ testIndyLambda((x: Boolean) => x)
+ testIndyLambda((x: Int) => "")
- test((x1: Int, x2: Int) => 0d, sp = true)
- test((x1: Int, x2: AnyRef) => 0d)
- test((x1: Any, x2: Any) => x1)
+ testIndyLambda((x1: Int, x2: Int) => 0d, sp = true)
+ testIndyLambda((x1: Int, x2: AnyRef) => 0d)
+ testIndyLambda((x1: Any, x2: Any) => x1)
- // scala> println((for (i <- 3 to 22) yield (for (j <- 1 to i) yield s"x$j: Int").mkString(" test((", ", ", ") => x1)")).mkString("\n"))
+ // scala> println((for (i <- 3 to 22) yield (for (j <- 1 to i) yield s"x$j: Int").mkString(" testIndyLambda((", ", ", ") => x1)")).mkString("\n"))
- test((x1: Int, x2: Int, x3: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int) => x1)
- test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int) => x1)
+ testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int) => x1)
- test({
+ testAnonFunClass({
case x: Int => x
}: PartialFunction[Int, Int], sp = true)
- test({
+ testAnonFunClass({
case x: Int => x
}: PartialFunction[Any, Any])
- test({
+ testAnonFunClass({
case x: Int => ()
}: PartialFunction[Int, Unit], sp = true)
- test({
+ testAnonFunClass({
case x: String => 1
}: PartialFunction[String, Int])
- test({
+ testAnonFunClass({
case x: String => ()
}: PartialFunction[String, Unit])
- test({
+ testAnonFunClass({
case x: String => x
}: PartialFunction[String, String])
}
diff --git a/test/files/run/t9003.flags b/test/files/run/t9003.flags
index 49d036a887..b9bb09167e 100644
--- a/test/files/run/t9003.flags
+++ b/test/files/run/t9003.flags
@@ -1 +1 @@
--optimize
+-optimize -Ybackend:GenASM
diff --git a/test/files/run/t9097.scala b/test/files/run/t9097.scala
index aa2b23bbac..2b5cf66a75 100644
--- a/test/files/run/t9097.scala
+++ b/test/files/run/t9097.scala
@@ -29,6 +29,6 @@ object Test extends StoreReporterDirectTest {
assert(!storeReporter.hasErrors, message = filteredInfos map (_.msg) mkString "; ")
val out = baos.toString("UTF-8")
// was 2 before the fix, the two PackageDefs for a would both contain the ClassDef for the closure
- assert(out.lines.count(_ contains "class hihi$1") == 1, out)
+ assert(out.lines.count(_ contains "def $anonfun$1(x$1: Int): String") == 1, out)
}
}
diff --git a/test/files/run/t9174.check b/test/files/run/t9174.check
new file mode 100644
index 0000000000..14d6bc10db
--- /dev/null
+++ b/test/files/run/t9174.check
@@ -0,0 +1,17 @@
+
+scala> import scala.util.{Success, Failure}
+import scala.util.{Success, Failure}
+
+scala> def f1(b: Boolean) = if (b) Left(1) else Right(2)
+f1: (b: Boolean)scala.util.Either[Int,Int]
+
+scala> def f2(b: Boolean) = if (b) Nil else 1 :: Nil
+f2: (b: Boolean)List[Int]
+
+scala> def f3(b: Boolean) = if (b) Stream.Empty else new Stream.Cons(1, Stream.Empty)
+f3: (b: Boolean)scala.collection.immutable.Stream[Int]
+
+scala> def f4(b: Boolean) = if (b) Success(1) else Failure(new Exception(""))
+f4: (b: Boolean)scala.util.Try[Int]
+
+scala> :quit
diff --git a/test/files/run/t9174.scala b/test/files/run/t9174.scala
new file mode 100644
index 0000000000..0c70e9bca9
--- /dev/null
+++ b/test/files/run/t9174.scala
@@ -0,0 +1,11 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+ |import scala.util.{Success, Failure}
+ |def f1(b: Boolean) = if (b) Left(1) else Right(2)
+ |def f2(b: Boolean) = if (b) Nil else 1 :: Nil
+ |def f3(b: Boolean) = if (b) Stream.Empty else new Stream.Cons(1, Stream.Empty)
+ |def f4(b: Boolean) = if (b) Success(1) else Failure(new Exception(""))
+ |""".stripMargin
+}
diff --git a/test/files/run/t9200/Test.java b/test/files/run/t9200/Test.java
new file mode 100644
index 0000000000..8ff0314f6c
--- /dev/null
+++ b/test/files/run/t9200/Test.java
@@ -0,0 +1,6 @@
+public class Test {
+ public static void main(String[] args) {
+ new C1(new C2()); // Was NoSuchMethodError
+ }
+}
+
diff --git a/test/files/run/t9200/test.scala b/test/files/run/t9200/test.scala
new file mode 100644
index 0000000000..6fa7e91571
--- /dev/null
+++ b/test/files/run/t9200/test.scala
@@ -0,0 +1,12 @@
+trait W
+
+trait T1
+trait T2 extends T1
+
+object O1 {
+ type t = T1 with T2
+}
+
+class C1[w<:W](o: O1.t)
+
+class C2 extends T1 with T2
diff --git a/test/files/run/t9387.scala b/test/files/run/t9387.scala
new file mode 100644
index 0000000000..3e33d19fd2
--- /dev/null
+++ b/test/files/run/t9387.scala
@@ -0,0 +1,20 @@
+class G[T]
+object G {
+ def v[T](x: T): G[T] = null
+}
+
+class A[T]
+object A {
+ def apply[T](x: => G[T]): A[T] = null
+}
+
+object T {
+ A[Unit](G.v(() => ())) // Was VerifyError
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ T
+ }
+
+} \ No newline at end of file
diff --git a/test/files/run/t9387b.check b/test/files/run/t9387b.check
new file mode 100644
index 0000000000..6a452c185a
--- /dev/null
+++ b/test/files/run/t9387b.check
@@ -0,0 +1 @@
+()
diff --git a/test/files/run/t9387b.scala b/test/files/run/t9387b.scala
new file mode 100644
index 0000000000..6339f4caba
--- /dev/null
+++ b/test/files/run/t9387b.scala
@@ -0,0 +1,16 @@
+object T {
+ val f: Unit = () => ()
+ println(f)
+}
+
+object U {
+ def f[T](t: T): T = t
+ f[Unit](() => ())
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ T
+ U
+ }
+}
diff --git a/test/files/run/t9408.scala b/test/files/run/t9408.scala
new file mode 100644
index 0000000000..231dca4ce7
--- /dev/null
+++ b/test/files/run/t9408.scala
@@ -0,0 +1,61 @@
+class Outer {
+ def assertNoFields(c: Class[_]) {
+ assert(c.getDeclaredFields.isEmpty)
+ }
+ def assertHasOuter(c: Class[_]) {
+ assert(c.getDeclaredFields.exists(_.getName.contains("outer")))
+ }
+ class Member
+ final class FinalMember
+
+ def test {
+ assertHasOuter(classOf[Member])
+ assertNoFields(classOf[FinalMember])
+ final class C
+ assertNoFields(classOf[C])
+ class D
+ assertNoFields(classOf[D])
+ (() => {class E; assertNoFields(classOf[E])}).apply()
+
+ // The outer reference elision currently runs on a class-by-class basis. If it cannot rule out that a class has
+ // subclasses, it will not remove the outer reference. A smarter analysis here could detect if no members of
+ // a sealed (or effectively sealed) hierarchy use the outer reference, the optimization could be performed.
+ class Parent
+ class Child extends Parent
+ assertHasOuter(classOf[Parent])
+
+ // Note: outer references (if they haven't been elided) are used in pattern matching as follows.
+ // This isn't relevant to term-owned classes, as you can't refer to them with a prefix that includes
+ // the outer class.
+ val outer1 = new Outer
+ val outer2 = new Outer
+ (new outer1.Member: Any) match {
+ case _: outer2.Member => sys.error("wrong match!")
+ case _: outer1.Member => // okay
+ }
+
+ // ... continuing on that theme, note that `Member` isn't considered as a local class, it is owned by a the class
+ // `LocalOuter`, which itself happens to be term-owned. So we expect that it has an outer reference, and that this
+ // is respected in type tests.
+ class LocalOuter {
+ class Member
+ final class FinalMember
+ }
+ assertNoFields(classOf[LocalOuter])
+ assertHasOuter(classOf[LocalOuter#Member])
+ val localOuter1 = new LocalOuter
+ val localOuter2 = new LocalOuter
+ (new localOuter1.Member: Any) match {
+ case _: localOuter2.Member => sys.error("wrong match!")
+ case _: localOuter1.Member => // okay
+ }
+ // Final member classes still lose the outer reference.
+ assertNoFields(classOf[LocalOuter#FinalMember])
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ new Outer().test
+ }
+}
diff --git a/test/files/run/test-cpp.check b/test/files/run/test-cpp.check
index 13f4c64be3..40c10e3350 100644
--- a/test/files/run/test-cpp.check
+++ b/test/files/run/test-cpp.check
@@ -1,11 +1,11 @@
--- a
+++ b
-@@ -36,3 +36,3 @@
+@@ -54,3 +54,3 @@
def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
- locals: value args, value x, value y
+ locals: value args
startBlock: 1
-@@ -41,10 +41,6 @@
+@@ -59,10 +59,6 @@
1:
- 52 CONSTANT(2)
- 52 STORE_LOCAL(value x)
@@ -17,12 +17,12 @@
- 54 LOAD_LOCAL(value y)
+ 54 CONSTANT(2)
54 BOX INT
-@@ -91,3 +87,3 @@
+@@ -109,3 +105,3 @@
def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
- locals: value args, value x, value y
+ locals: value args, value x
startBlock: 1
-@@ -100,7 +96,5 @@
+@@ -118,7 +114,5 @@
81 SCOPE_ENTER value x
- 82 LOAD_LOCAL(value x)
- 82 STORE_LOCAL(value y)
@@ -31,12 +31,12 @@
- 83 LOAD_LOCAL(value y)
+ 83 LOAD_LOCAL(value x)
83 BOX INT
-@@ -134,3 +128,3 @@
+@@ -152,3 +146,3 @@
def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
- locals: value args, value x, value y
+ locals: value args
startBlock: 1
-@@ -139,10 +133,6 @@
+@@ -157,10 +151,6 @@
1:
- 66 THIS(TestAliasChainDerefThis)
- 66 STORE_LOCAL(value x)
@@ -48,12 +48,12 @@
- 68 LOAD_LOCAL(value y)
+ 68 THIS(Object)
68 CALL_METHOD scala.Predef.println (dynamic)
-@@ -175,3 +165,3 @@
+@@ -193,3 +183,3 @@
def test(x: Int (INT)): Unit {
- locals: value x, value y
+ locals: value x
startBlock: 1
-@@ -180,7 +170,5 @@
+@@ -198,7 +188,5 @@
1:
- 29 LOAD_LOCAL(value x)
- 29 STORE_LOCAL(value y)
@@ -62,7 +62,7 @@
- 30 LOAD_LOCAL(value y)
+ 30 LOAD_LOCAL(value x)
30 BOX INT
-@@ -222,7 +210,5 @@
+@@ -240,7 +228,5 @@
96 SCOPE_ENTER variable x
- 97 LOAD_LOCAL(variable x)
- 97 STORE_LOCAL(variable y)
@@ -71,7 +71,7 @@
- 98 LOAD_LOCAL(variable y)
+ 98 LOAD_LOCAL(variable x)
98 BOX INT
-@@ -232,6 +218,4 @@
+@@ -250,6 +236,4 @@
100 STORE_LOCAL(variable y)
- 101 LOAD_LOCAL(variable y)
- 101 STORE_LOCAL(variable x)
diff --git a/test/files/run/test-cpp.scala b/test/files/run/test-cpp.scala
index 4fca67d51e..80163deb66 100644
--- a/test/files/run/test-cpp.scala
+++ b/test/files/run/test-cpp.scala
@@ -15,7 +15,7 @@
import scala.tools.partest.IcodeComparison
object Test extends IcodeComparison {
- override def printIcodeAfterPhase = "dce"
+ override def printIcodeAfterPhase = "dce"; override def extraSettings: String = super.extraSettings + " -Ybackend:GenASM" // same line to minimize check file changs
}
import scala.util.Random._
diff --git a/test/files/scalacheck/MutableTreeMap.scala b/test/files/scalacheck/MutableTreeMap.scala
new file mode 100644
index 0000000000..b072307a63
--- /dev/null
+++ b/test/files/scalacheck/MutableTreeMap.scala
@@ -0,0 +1,329 @@
+import java.io._
+
+import org.scalacheck._
+import org.scalacheck.Arbitrary._
+import org.scalacheck.Prop.forAll
+
+import scala.collection.generic.CanBuildFrom
+import scala.collection.mutable
+import scala.util.Try
+import scala.collection.mutable.{RedBlackTree => RB}
+
+package scala.collection.mutable {
+
+ trait Generators {
+
+ def genRedBlackTree[A: Arbitrary: Ordering, B: Arbitrary]: Gen[RB.Tree[A, B]] = {
+ import org.scalacheck.Gen._
+ for { entries <- listOf(arbitrary[(A, B)]) } yield {
+ val tree = RB.Tree.empty[A, B]
+ entries.foreach { case (k, v) => RB.insert(tree, k, v) }
+ tree
+ }
+ }
+
+ // Note: in scalacheck 1.12.2 tree maps can be automatically generated without the need for custom
+ // machinery
+ def genTreeMap[A: Arbitrary: Ordering, B: Arbitrary]: Gen[mutable.TreeMap[A, B]] = {
+ import org.scalacheck.Gen._
+ for {
+ keys <- listOf(arbitrary[A])
+ values <- listOfN(keys.size, arbitrary[B])
+ } yield mutable.TreeMap(keys zip values: _*)
+ }
+
+ implicit def arbRedBlackTree[A: Arbitrary: Ordering, B: Arbitrary] = Arbitrary(genRedBlackTree[A, B])
+ implicit def arbTreeMap[A: Arbitrary: Ordering, B: Arbitrary] = Arbitrary(genTreeMap[A, B])
+ }
+
+ object RedBlackTreeProperties extends Properties("mutable.RedBlackTree") with Generators {
+ type K = String
+ type V = Int
+
+ property("initial invariants") = forAll { (tree: RB.Tree[K, V]) =>
+ RB.isValid(tree)
+ }
+
+ property("insert") = forAll { (tree: RB.Tree[K, V], entries: Seq[(K, V)]) =>
+ entries.foreach { case (k, v) => RB.insert(tree, k, v) }
+ RB.isValid(tree) && entries.toMap.forall { case (k, v) => RB.get(tree, k) == Some(v) }
+ }
+
+ property("delete") = forAll { (tree: RB.Tree[K, V], ks: Seq[K]) =>
+ ks.foreach { k => RB.delete(tree, k) }
+ RB.isValid(tree) && ks.toSet.forall { k => RB.get(tree, k) == None }
+ }
+
+ property("insert & delete") = forAll { (tree: RB.Tree[K, V], ops: Seq[Either[(K, V), K]]) =>
+ ops.foreach {
+ case Left((k, v)) => RB.insert(tree, k, v)
+ case Right(k) => RB.delete(tree, k)
+ }
+ RB.isValid(tree)
+ }
+
+ property("min") = forAll { (entries: Seq[(K, V)]) =>
+ val tree = RB.Tree.empty[K, V]
+ entries.foreach { case (k, v) => RB.insert(tree, k, v) }
+ RB.min(tree) == (if (entries.isEmpty) None else Some(entries.toMap.min))
+ }
+
+ property("max") = forAll { (entries: Seq[(K, V)]) =>
+ val tree = RB.Tree.empty[K, V]
+ entries.foreach { case (k, v) => RB.insert(tree, k, v) }
+ RB.max(tree) == (if (entries.isEmpty) None else Some(entries.toMap.max))
+ }
+ }
+
+ object MutableTreeMapProperties extends Properties("mutable.TreeMap") with Generators {
+ type K = String
+ type V = Int
+
+ property("get, contains") = forAll { (allEntries: Map[K, V]) =>
+ val entries = allEntries.take(allEntries.size / 2)
+
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+
+ allEntries.forall { case (k, v) =>
+ map.contains(k) == entries.contains(k) &&
+ map.get(k) == entries.get(k)
+ }
+ }
+
+ property("size, isEmpty") = forAll { (entries: Map[K, V]) =>
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+ map.size == entries.size && map.isEmpty == entries.isEmpty
+ }
+
+ property("+=") = forAll { (map: mutable.TreeMap[K, V], k: K, v: V) =>
+ val oldSize = map.size
+ val containedKeyBefore = map.contains(k)
+ val newExpectedSize = if(containedKeyBefore) oldSize else oldSize + 1
+
+ map += (k -> v)
+ map.contains(k) && map.get(k) == Some(v) && map.size == newExpectedSize
+ }
+
+ property("++=") = forAll { (map: mutable.TreeMap[K, V], entries: Seq[(K, V)]) =>
+ map ++= entries
+ entries.toMap.forall { case (k, v) => map.get(k) == Some(v) }
+ }
+
+ property("-=") = forAll { (map: mutable.TreeMap[K, V], k: K) =>
+ val oldSize = map.size
+ val containedKeyBefore = map.contains(k)
+ val newExpectedSize = if(containedKeyBefore) oldSize - 1 else oldSize
+
+ map -= k
+ !map.contains(k) && map.get(k) == None && map.size == newExpectedSize
+ }
+
+ property("--=") = forAll { (map: mutable.TreeMap[K, V], ks: Seq[K]) =>
+ map --= ks
+ ks.toSet.forall { k => map.get(k) == None }
+ }
+
+ property("iterator") = forAll { (entries: Map[K, V]) =>
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+
+ map.iterator.toSeq == entries.toSeq.sorted
+ }
+
+ property("iteratorFrom") = forAll { (entries: Map[K, V], k: K) =>
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+
+ map.iteratorFrom(k).toSeq == entries.filterKeys(_ >= k).toSeq.sorted
+ }
+
+ property("keysIteratorFrom") = forAll { (entries: Map[K, V], k: K) =>
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+
+ map.keysIteratorFrom(k).toSeq == entries.keysIterator.filter(_ >= k).toSeq.sorted
+ }
+
+ property("valuesIteratorFrom") = forAll { (entries: Map[K, V], k: K) =>
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+
+ map.valuesIteratorFrom(k).toSeq == entries.filterKeys(_ >= k).toSeq.sorted.map(_._2)
+ }
+
+ property("headOption") = forAll { (map: mutable.TreeMap[K, V]) =>
+ map.headOption == Try(map.iterator.next()).toOption
+ }
+
+ property("lastOption") = forAll { (map: mutable.TreeMap[K, V]) =>
+ map.lastOption == Try(map.iterator.max).toOption
+ }
+
+ property("clear") = forAll { (map: mutable.TreeMap[K, V]) =>
+ map.clear()
+ map.isEmpty && map.size == 0
+ }
+
+ property("serializable") = forAll { (map: mutable.TreeMap[K, V]) =>
+ val bytesOut = new ByteArrayOutputStream()
+ val out = new ObjectOutputStream(bytesOut)
+ out.writeObject(map)
+ val bytes = bytesOut.toByteArray
+
+ val in = new ObjectInputStream(new ByteArrayInputStream(bytes))
+ val sameMap = in.readObject().asInstanceOf[mutable.TreeMap[K, V]]
+ map.iterator.toSeq == sameMap.iterator.toSeq
+ }
+ }
+
+ object MutableTreeMapViewProperties extends Properties("mutable.TreeMapView") with Generators {
+ type K = String
+ type V = Int
+
+ implicit val ord = implicitly[Ordering[K]]
+
+ def in(key: K, from: Option[K], until: Option[K]) =
+ from.fold(true)(_ <= key) && until.fold(true)(_ > key)
+
+ def entriesInView[This <: TraversableOnce[(K, V)], That](entries: This, from: Option[K], until: Option[K])(implicit bf: CanBuildFrom[This, (K, V), That]) = {
+ (bf.apply(entries) ++= entries.filter { case (k, _) => in(k, from, until) }).result()
+ }
+
+ property("get, contains") = forAll { (allEntries: Map[K, V], from: Option[K], until: Option[K]) =>
+ val entries = allEntries.take(allEntries.size / 2)
+
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+
+ val mapView = map.rangeImpl(from, until)
+ allEntries.forall { case (k, v) =>
+ mapView.contains(k) == (in(k, from, until) && entries.contains(k)) &&
+ mapView.get(k) == (if(in(k, from, until)) entries.get(k) else None)
+ }
+ }
+
+ property("size, isEmpty") = forAll { (entries: Map[K, V], from: Option[K], until: Option[K]) =>
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+
+ val mapView = map.rangeImpl(from, until)
+ mapView.size == entriesInView(entries, from, until).size &&
+ mapView.isEmpty == !entries.exists { kv => in(kv._1, from, until) }
+ }
+
+ property("+=") = forAll { (map: mutable.TreeMap[K, V], k: K, v: V, from: Option[K], until: Option[K]) =>
+ val oldSize = map.size
+ val containedKeyBefore = map.contains(k)
+ val newExpectedSize = if(containedKeyBefore) oldSize else oldSize + 1
+ val isInRange = in(k, from, until)
+
+ val mapView = map.rangeImpl(from, until)
+ mapView += (k -> v)
+
+ map.contains(k) && map.get(k) == Some(v) && map.size == newExpectedSize &&
+ mapView.contains(k) == isInRange &&
+ mapView.get(k) == (if(isInRange) Some(v) else None)
+ }
+
+ property("++=") = forAll { (map: mutable.TreeMap[K, V], entries: Seq[(K, V)], from: Option[K], until: Option[K]) =>
+ val mapView = map.rangeImpl(from, until)
+ mapView ++= entries
+ entries.toMap.forall { case (k, v) =>
+ map.get(k) == Some(v) &&
+ mapView.get(k) == (if (in(k, from, until)) Some(v) else None)
+ }
+ }
+
+ property("-=") = forAll { (map: mutable.TreeMap[K, V], k: K, from: Option[K], until: Option[K]) =>
+ val oldSize = map.size
+ val containedKeyBefore = map.contains(k)
+ val newExpectedSize = if(containedKeyBefore) oldSize - 1 else oldSize
+
+ val mapView = map.rangeImpl(from, until)
+ mapView -= k
+
+ !map.contains(k) && map.get(k) == None && map.size == newExpectedSize &&
+ !mapView.contains(k) &&
+ mapView.get(k) == None
+ }
+
+ property("--=") = forAll { (map: mutable.TreeMap[K, V], ks: Seq[K], from: Option[K], until: Option[K]) =>
+ val mapView = map.rangeImpl(from, until)
+ mapView --= ks
+ ks.toSet.forall { k => map.get(k) == None && mapView.get(k) == None }
+ }
+
+ property("iterator") = forAll { (entries: Map[K, V], from: Option[K], until: Option[K]) =>
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+
+ val mapView = map.rangeImpl(from, until)
+ mapView.iterator.toSeq == entriesInView(entries, from, until).toSeq.sorted
+ }
+
+ property("iteratorFrom") = forAll { (entries: Map[K, V], k: K, from: Option[K], until: Option[K]) =>
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+
+ val mapView = map.rangeImpl(from, until)
+ val newLower = Some(from.fold(k)(ord.max(_, k)))
+ mapView.iteratorFrom(k).toSeq == entriesInView(entries, newLower, until).toSeq.sorted
+ }
+
+ property("keysIteratorFrom") = forAll { (entries: Map[K, V], k: K, from: Option[K], until: Option[K]) =>
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+
+ val mapView = map.rangeImpl(from, until)
+ val newLower = Some(from.fold(k)(ord.max(_, k)))
+ mapView.keysIteratorFrom(k).toSeq == entriesInView(entries, newLower, until).toSeq.sorted.map(_._1)
+ }
+
+ property("valuesIteratorFrom") = forAll { (entries: Map[K, V], k: K, from: Option[K], until: Option[K]) =>
+ val map = mutable.TreeMap[K, V]()
+ map ++= entries
+
+ val mapView = map.rangeImpl(from, until)
+ val newLower = Some(from.fold(k)(ord.max(_, k)))
+ mapView.valuesIteratorFrom(k).toSeq == entriesInView(entries, newLower, until).toSeq.sorted.map(_._2)
+ }
+
+ property("headOption") = forAll { (map: mutable.TreeMap[K, V], from: Option[K], until: Option[K]) =>
+ val mapView = map.rangeImpl(from, until)
+ mapView.headOption == Try(entriesInView(map.iterator, from, until).next()).toOption
+ }
+
+ property("lastOption") = forAll { (map: mutable.TreeMap[K, V], from: Option[K], until: Option[K]) =>
+ val mapView = map.rangeImpl(from, until)
+ mapView.lastOption == Try(entriesInView(map.iterator, from, until).max).toOption
+ }
+
+ property("clear") = forAll { (map: mutable.TreeMap[K, V], from: Option[K], until: Option[K]) =>
+ val mapView = map.rangeImpl(from, until)
+ mapView.clear()
+ map.isEmpty && mapView.isEmpty && map.size == 0 && mapView.size == 0
+ }
+
+ property("serializable") = forAll { (map: mutable.TreeMap[K, V], from: Option[K], until: Option[K]) =>
+ val mapView = map.rangeImpl(from, until)
+
+ val bytesOut = new ByteArrayOutputStream()
+ val out = new ObjectOutputStream(bytesOut)
+ out.writeObject(mapView)
+ val bytes = bytesOut.toByteArray
+
+ val in = new ObjectInputStream(new ByteArrayInputStream(bytes))
+ val sameMapView = in.readObject().asInstanceOf[mutable.TreeMap[K, V]]
+ mapView.iterator.toSeq == sameMapView.iterator.toSeq
+ }
+ }
+}
+
+object Test extends Properties("mutable.TreeMap") {
+ import scala.collection.mutable._
+ include(RedBlackTreeProperties)
+ include(MutableTreeMapProperties)
+ include(MutableTreeMapViewProperties)
+}
diff --git a/test/files/scalacheck/concurrent-map.scala b/test/files/scalacheck/concurrent-map.scala
new file mode 100755
index 0000000000..7c9b8d4169
--- /dev/null
+++ b/test/files/scalacheck/concurrent-map.scala
@@ -0,0 +1,76 @@
+
+
+
+import java.util.concurrent._
+import scala.collection._
+import scala.collection.JavaConverters._
+import org.scalacheck._
+import org.scalacheck.Prop._
+import org.scalacheck.Gen._
+
+
+
+case class Wrap(i: Int) {
+ override def hashCode = i * 0x9e3775cd
+}
+
+
+object Test extends Properties("concurrent.TrieMap") {
+
+ /* generators */
+
+ val sizes = choose(0, 20000)
+
+ val threadCounts = choose(2, 16)
+
+ val threadCountsAndSizes = for {
+ p <- threadCounts
+ sz <- sizes
+ } yield (p, sz);
+
+
+ /* helpers */
+
+ def inParallel[T](totalThreads: Int)(body: Int => T): Seq[T] = {
+ val threads = for (idx <- 0 until totalThreads) yield new Thread {
+ setName("ParThread-" + idx)
+ private var res: T = _
+ override def run() {
+ res = body(idx)
+ }
+ def result = {
+ this.join()
+ res
+ }
+ }
+
+ threads foreach (_.start())
+ threads map (_.result)
+ }
+
+ property("concurrent getOrElseUpdate insertions") = forAll(threadCounts, sizes) {
+ (p, sz) =>
+ val chm = new ConcurrentHashMap[Wrap, Int]().asScala
+
+ val results = inParallel(p) {
+ idx =>
+ for (i <- 0 until sz) yield chm.getOrElseUpdate(new Wrap(i), idx)
+ }
+
+ val resultSets = for (i <- 0 until sz) yield results.map(_(i)).toSet
+ val largerThanOne = resultSets.zipWithIndex.find(_._1.size != 1)
+ val allThreadsAgreeOnWhoInserted = {
+ largerThanOne == None
+ } :| s"$p threads agree on who inserted [disagreement (differentResults, position) = $largerThanOne]"
+
+ allThreadsAgreeOnWhoInserted
+ }
+
+
+}
+
+
+
+
+
+
diff --git a/test/junit/scala/collection/IteratorTest.scala b/test/junit/scala/collection/IteratorTest.scala
index 1c1e50aed9..b0639ef365 100644
--- a/test/junit/scala/collection/IteratorTest.scala
+++ b/test/junit/scala/collection/IteratorTest.scala
@@ -135,6 +135,20 @@ class IteratorTest {
assertEquals(3, List(1, 2, 3, 4, 5).iterator.indexWhere { x: Int => x >= 4 })
assertEquals(-1, List(1, 2, 3, 4, 5).iterator.indexWhere { x: Int => x >= 16 })
}
+ @Test def indexOfFrom(): Unit = {
+ assertEquals(1, List(1, 2, 3, 4, 5).iterator.indexOf(2, 0))
+ assertEquals(1, List(1, 2, 3, 4, 5).iterator.indexOf(2, 1))
+ assertEquals(-1, List(1, 2, 3, 4, 5).iterator.indexOf(2, 2))
+ assertEquals(4, List(1, 2, 3, 2, 1).iterator.indexOf(1, 1))
+ assertEquals(1, List(1, 2, 3, 2, 1).iterator.indexOf(2, 1))
+ }
+ @Test def indexWhereFrom(): Unit = {
+ assertEquals(1, List(1, 2, 3, 4, 5).iterator.indexWhere(_ == 2, 0))
+ assertEquals(1, List(1, 2, 3, 4, 5).iterator.indexWhere(_ == 2, 1))
+ assertEquals(-1, List(1, 2, 3, 4, 5).iterator.indexWhere(_ == 2, 2))
+ assertEquals(4, List(1, 2, 3, 2, 1).iterator.indexWhere(_ < 2, 1))
+ assertEquals(1, List(1, 2, 3, 2, 1).iterator.indexWhere(_ <= 2, 1))
+ }
// iterator-iterate-lazy.scala
// was java.lang.UnsupportedOperationException: tail of empty list
@Test def iterateIsSufficientlyLazy(): Unit = {
@@ -154,6 +168,14 @@ class IteratorTest {
results += (Stream from 1).toIterator.drop(10).toStream.drop(10).toIterator.next()
assertSameElements(List(1,1,21), results)
}
+ // SI-8552
+ @Test def indexOfShouldWorkForTwoParams(): Unit = {
+ assertEquals(1, List(1, 2, 3).iterator.indexOf(2, 0))
+ assertEquals(-1, List(5 -> 0).iterator.indexOf(5, 0))
+ assertEquals(0, List(5 -> 0).iterator.indexOf((5, 0)))
+ assertEquals(-1, List(5 -> 0, 9 -> 2, 0 -> 3).iterator.indexOf(9, 2))
+ assertEquals(1, List(5 -> 0, 9 -> 2, 0 -> 3).iterator.indexOf(9 -> 2))
+ }
// SI-9332
@Test def spanExhaustsLeadingIterator(): Unit = {
def it = Iterator.iterate(0)(_ + 1).take(6)
diff --git a/test/junit/scala/collection/SeqViewTest.scala b/test/junit/scala/collection/SeqViewTest.scala
new file mode 100644
index 0000000000..24474fc4b9
--- /dev/null
+++ b/test/junit/scala/collection/SeqViewTest.scala
@@ -0,0 +1,16 @@
+package scala.collection
+
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+import org.junit.Assert._
+import org.junit.Test
+
+@RunWith(classOf[JUnit4])
+class SeqViewTest {
+
+ @Test
+ def test_SI8691() {
+ // Really just testing to make sure ++: doesn't throw an exception
+ assert( Seq(1,2) ++: Seq(3,4).view == Seq(1,2,3,4) )
+ }
+}
diff --git a/test/junit/scala/collection/SetMapConsistencyTest.scala b/test/junit/scala/collection/SetMapConsistencyTest.scala
index 261c11a98b..5f14af7c37 100644
--- a/test/junit/scala/collection/SetMapConsistencyTest.scala
+++ b/test/junit/scala/collection/SetMapConsistencyTest.scala
@@ -66,6 +66,8 @@ class SetMapConsistencyTest {
def boxMhm[A] = new BoxMutableMap[A, cm.HashMap[A, Int]](new cm.HashMap[A, Int], "mutable.HashMap")
def boxMohm[A] = new BoxMutableMap[A, cm.OpenHashMap[A, Int]](new cm.OpenHashMap[A, Int], "mutable.OpenHashMap")
+
+ def boxMtm[A: Ordering] = new BoxMutableMap[A, cm.TreeMap[A, Int]](new cm.TreeMap[A, Int], "mutable.TreeMap")
def boxMarm[A <: AnyRef] = new BoxMutableMap[A, cm.AnyRefMap[A, Int]](new cm.AnyRefMap[A, Int](_ => -1), "mutable.AnyRefMap") {
private def arm: cm.AnyRefMap[A, Int] = m.asInstanceOf[cm.AnyRefMap[A, Int]]
@@ -315,7 +317,7 @@ class SetMapConsistencyTest {
@Test
def churnIntMaps() {
val maps = Array[() => MapBox[Int]](
- () => boxMlm[Int], () => boxMhm[Int], () => boxMohm[Int], () => boxJavaM[Int],
+ () => boxMlm[Int], () => boxMhm[Int], () => boxMohm[Int], () => boxMtm[Int], () => boxJavaM[Int],
() => boxIim, () => boxIhm[Int], () => boxIlm[Int], () => boxItm[Int]
)
assert( maps.sliding(2).forall{ ms => churn(ms(0)(), ms(1)(), intKeys, 2000) } )
@@ -325,7 +327,7 @@ class SetMapConsistencyTest {
def churnLongMaps() {
val maps = Array[() => MapBox[Long]](
() => boxMjm, () => boxIjm, () => boxJavaM[Long],
- () => boxMlm[Long], () => boxMhm[Long], () => boxMohm[Long], () => boxIhm[Long], () => boxIlm[Long]
+ () => boxMlm[Long], () => boxMhm[Long], () => boxMtm[Long], () => boxMohm[Long], () => boxIhm[Long], () => boxIlm[Long]
)
assert( maps.sliding(2).forall{ ms => churn(ms(0)(), ms(1)(), longKeys, 10000) } )
}
@@ -529,4 +531,15 @@ class SetMapConsistencyTest {
assert(nit == 4)
assert(nfe == 4)
}
+
+ @Test
+ def test_SI8727() {
+ import scala.tools.testing.AssertUtil._
+ type NSEE = NoSuchElementException
+ val map = Map(0 -> "zero", 1 -> "one")
+ val m = map.filterKeys(i => if (map contains i) true else throw new NSEE)
+ assert{ (m contains 0) && (m get 0).nonEmpty }
+ assertThrows[NSEE]{ m contains 2 }
+ assertThrows[NSEE]{ m get 2 }
+ }
}
diff --git a/test/junit/scala/collection/convert/NullSafetyTest.scala b/test/junit/scala/collection/convert/NullSafetyTest.scala
new file mode 100644
index 0000000000..de5481d9e2
--- /dev/null
+++ b/test/junit/scala/collection/convert/NullSafetyTest.scala
@@ -0,0 +1,279 @@
+package scala.collection.convert
+
+import java.{util => ju, lang => jl}
+import ju.{concurrent => juc}
+
+import org.junit.Test
+import org.junit.experimental.runners.Enclosed
+import org.junit.runner.RunWith
+
+import scala.collection.JavaConversions._
+import scala.collection.JavaConverters._
+import scala.collection.{mutable, concurrent}
+
+@RunWith(classOf[Enclosed])
+object NullSafetyTest {
+
+ /*
+ * Pertinent: SI-9113
+ * Tests to insure that wrappers return null instead of wrapping it as a collection
+ */
+
+ class ToScala {
+
+ @Test def testIteratorWrapping(): Unit = {
+ val nullJIterator: ju.Iterator[AnyRef] = null
+ val iterator: Iterator[AnyRef] = nullJIterator
+
+ assert(iterator == null)
+ }
+
+ @Test def testEnumerationWrapping(): Unit = {
+ val nullJEnumeration: ju.Enumeration[AnyRef] = null
+ val enumeration: Iterator[AnyRef] = nullJEnumeration
+
+ assert(enumeration == null)
+ }
+
+ @Test def testIterableWrapping(): Unit = {
+ val nullJIterable: jl.Iterable[AnyRef] = null
+ val iterable: Iterable[AnyRef] = nullJIterable
+
+ assert(iterable == null)
+ }
+
+ @Test def testCollectionWrapping(): Unit = {
+ val nullJCollection: ju.Collection[AnyRef] = null
+ val collection: Iterable[AnyRef] = nullJCollection
+
+ assert(collection == null)
+ }
+
+ @Test def testBufferWrapping(): Unit = {
+ val nullJList: ju.List[AnyRef] = null
+ val buffer: mutable.Buffer[AnyRef] = nullJList
+
+ assert(buffer == null)
+ }
+
+ @Test def testSetWrapping(): Unit = {
+ val nullJSet: ju.Set[AnyRef] = null
+ val set: mutable.Set[AnyRef] = nullJSet
+
+ assert(set == null)
+ }
+
+ @Test def testMapWrapping(): Unit = {
+ val nullJMap: ju.Map[AnyRef, AnyRef] = null
+ val map: mutable.Map[AnyRef, AnyRef] = nullJMap
+
+ assert(map == null)
+ }
+
+ @Test def testConcurrentMapWrapping(): Unit = {
+ val nullJConMap: juc.ConcurrentMap[AnyRef, AnyRef] = null
+ val conMap: concurrent.Map[AnyRef, AnyRef] = nullJConMap
+
+ assert(conMap == null)
+ }
+
+ @Test def testDictionaryWrapping(): Unit = {
+ val nullJDict: ju.Dictionary[AnyRef, AnyRef] = null
+ val dict: mutable.Map[AnyRef, AnyRef] = nullJDict
+
+ assert(dict == null)
+ }
+
+
+ @Test def testPropertyWrapping(): Unit = {
+ val nullJProps: ju.Properties = null
+ val props: mutable.Map[String, String] = nullJProps
+
+ assert(props == null)
+ }
+
+ @Test def testIteratorDecoration(): Unit = {
+ val nullJIterator: ju.Iterator[AnyRef] = null
+
+ assert(nullJIterator.asScala == null)
+ }
+
+ @Test def testEnumerationDecoration(): Unit = {
+ val nullJEnumeration: ju.Enumeration[AnyRef] = null
+
+ assert(nullJEnumeration.asScala == null)
+ }
+
+ @Test def testIterableDecoration(): Unit = {
+ val nullJIterable: jl.Iterable[AnyRef] = null
+
+ assert(nullJIterable.asScala == null)
+ }
+
+ @Test def testCollectionDecoration(): Unit = {
+ val nullJCollection: ju.Collection[AnyRef] = null
+
+ assert(nullJCollection.asScala == null)
+ }
+
+ @Test def testBufferDecoration(): Unit = {
+ val nullJBuffer: ju.List[AnyRef] = null
+
+ assert(nullJBuffer.asScala == null)
+ }
+
+ @Test def testSetDecoration(): Unit = {
+ val nullJSet: ju.Set[AnyRef] = null
+
+ assert(nullJSet.asScala == null)
+ }
+
+ @Test def testMapDecoration(): Unit = {
+ val nullJMap: ju.Map[AnyRef, AnyRef] = null
+
+ assert(nullJMap.asScala == null)
+ }
+
+ @Test def testConcurrentMapDecoration(): Unit = {
+ val nullJConMap: juc.ConcurrentMap[AnyRef, AnyRef] = null
+
+ assert(nullJConMap.asScala == null)
+ }
+
+ @Test def testDictionaryDecoration(): Unit = {
+ val nullJDict: ju.Dictionary[AnyRef, AnyRef] = null
+
+ assert(nullJDict.asScala == null)
+ }
+
+ @Test def testPropertiesDecoration(): Unit = {
+ val nullJProperties: ju.Properties = null
+
+ assert(nullJProperties.asScala == null)
+ }
+ }
+
+ class ToJava {
+
+ @Test def testIteratorWrapping(): Unit = {
+ val nullIterator: Iterator[AnyRef] = null
+ val jIterator: ju.Iterator[AnyRef] = nullIterator
+
+ assert(jIterator == null)
+ }
+
+ @Test def testEnumerationWrapping(): Unit = {
+ val nullEnumeration: Iterator[AnyRef] = null
+ val enumeration: ju.Iterator[AnyRef] = nullEnumeration
+
+ assert(enumeration == null)
+ }
+
+ @Test def testIterableWrapping(): Unit = {
+ val nullIterable: Iterable[AnyRef] = null
+ val iterable: jl.Iterable[AnyRef] = asJavaIterable(nullIterable)
+
+ assert(iterable == null)
+ }
+
+ @Test def testCollectionWrapping(): Unit = {
+ val nullCollection: Iterable[AnyRef] = null
+ val collection: ju.Collection[AnyRef] = nullCollection
+
+ assert(collection == null)
+ }
+
+ @Test def testBufferWrapping(): Unit = {
+ val nullList: mutable.Buffer[AnyRef] = null
+ val buffer: ju.List[AnyRef] = nullList
+
+ assert(buffer == null)
+ }
+
+ @Test def testSetWrapping(): Unit = {
+ val nullSet: mutable.Set[AnyRef] = null
+ val set: ju.Set[AnyRef] = nullSet
+
+ assert(set == null)
+ }
+
+ @Test def testMapWrapping(): Unit = {
+ val nullMap: mutable.Map[AnyRef, AnyRef] = null
+ val map: ju.Map[AnyRef, AnyRef] = nullMap
+
+ assert(map == null)
+ }
+
+ @Test def testConcurrentMapWrapping(): Unit = {
+ val nullConMap: concurrent.Map[AnyRef, AnyRef] = null
+ val conMap: juc.ConcurrentMap[AnyRef, AnyRef] = nullConMap
+
+ assert(conMap == null)
+ }
+
+ @Test def testDictionaryWrapping(): Unit = {
+ val nullDict: mutable.Map[AnyRef, AnyRef] = null
+ val dict: ju.Dictionary[AnyRef, AnyRef] = nullDict
+
+ assert(dict == null)
+ }
+
+ // Implicit conversion to ju.Properties is not available
+
+ @Test def testIteratorDecoration(): Unit = {
+ val nullIterator: Iterator[AnyRef] = null
+
+ assert(nullIterator.asJava == null)
+ }
+
+ @Test def testEnumerationDecoration(): Unit = {
+ val nullEnumeration: Iterator[AnyRef] = null
+
+ assert(nullEnumeration.asJavaEnumeration == null)
+ }
+
+ @Test def testIterableDecoration(): Unit = {
+ val nullIterable: Iterable[AnyRef] = null
+
+ assert(nullIterable.asJava == null)
+ }
+
+ @Test def testCollectionDecoration(): Unit = {
+ val nullCollection: Iterable[AnyRef] = null
+
+ assert(nullCollection.asJavaCollection == null)
+ }
+
+ @Test def testBufferDecoration(): Unit = {
+ val nullBuffer: mutable.Buffer[AnyRef] = null
+
+ assert(nullBuffer.asJava == null)
+ }
+
+ @Test def testSetDecoration(): Unit = {
+ val nullSet: Set[AnyRef] = null
+
+ assert(nullSet.asJava == null)
+ }
+
+ @Test def testMapDecoration(): Unit = {
+ val nullMap: mutable.Map[AnyRef, AnyRef] = null
+
+ assert(nullMap.asJava == null)
+ }
+
+ @Test def testConcurrentMapDecoration(): Unit = {
+ val nullConMap: concurrent.Map[AnyRef, AnyRef] = null
+
+ assert(nullConMap.asJava == null)
+ }
+
+ @Test def testDictionaryDecoration(): Unit = {
+ val nullDict: mutable.Map[AnyRef, AnyRef] = null
+
+ assert(nullDict.asJavaDictionary == null)
+ }
+
+ // Decorator conversion to ju.Properties is not available
+ }
+}
diff --git a/test/junit/scala/collection/convert/WrapperSerializationTest.scala b/test/junit/scala/collection/convert/WrapperSerializationTest.scala
new file mode 100644
index 0000000000..d398be806a
--- /dev/null
+++ b/test/junit/scala/collection/convert/WrapperSerializationTest.scala
@@ -0,0 +1,29 @@
+package scala.collection.convert
+
+import org.junit.Assert._
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(classOf[JUnit4])
+class WrapperSerializationTest {
+ def ser(a: AnyRef) = {
+ val baos = new java.io.ByteArrayOutputStream
+ (new java.io.ObjectOutputStream(baos)).writeObject(a)
+ baos
+ }
+ def des(baos: java.io.ByteArrayOutputStream): AnyRef = {
+ val bais = new java.io.ByteArrayInputStream(baos.toByteArray)
+ (new java.io.ObjectInputStream(bais)).readObject()
+ }
+ def serdes(a: AnyRef): Boolean = a == des(ser(a))
+
+ @Test
+ def test_SI8911() {
+ import scala.collection.JavaConverters._
+ assert( serdes(scala.collection.mutable.ArrayBuffer(1,2).asJava) )
+ assert( serdes(Seq(1,2).asJava) )
+ assert( serdes(Set(1,2).asJava) )
+ assert( serdes(Map(1 -> "one", 2 -> "two").asJava) )
+ }
+}
diff --git a/test/junit/scala/collection/immutable/StreamTest.scala b/test/junit/scala/collection/immutable/StreamTest.scala
new file mode 100644
index 0000000000..fad4e502eb
--- /dev/null
+++ b/test/junit/scala/collection/immutable/StreamTest.scala
@@ -0,0 +1,110 @@
+package scala.collection.immutable
+
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+import org.junit.Test
+import org.junit.Assert._
+
+import scala.ref.WeakReference
+import scala.util.Try
+
+@RunWith(classOf[JUnit4])
+class StreamTest {
+
+ @Test
+ def t6727_and_t6440_and_8627(): Unit = {
+ assertTrue(Stream.continually(()).filter(_ => true).take(2) == Seq((), ()))
+ assertTrue(Stream.continually(()).filterNot(_ => false).take(2) == Seq((), ()))
+ assertTrue(Stream(1,2,3,4,5).filter(_ < 4) == Seq(1,2,3))
+ assertTrue(Stream(1,2,3,4,5).filterNot(_ > 4) == Seq(1,2,3,4))
+ assertTrue(Stream.from(1).filter(_ > 4).take(3) == Seq(5,6,7))
+ assertTrue(Stream.from(1).filterNot(_ <= 4).take(3) == Seq(5,6,7))
+ }
+
+ /** Test helper to verify that the given Stream operation allows
+ * GC of the head during processing of the tail.
+ */
+ def assertStreamOpAllowsGC(op: (=> Stream[Int], Int => Unit) => Any, f: Int => Unit): Unit = {
+ val msgSuccessGC = "GC success"
+ val msgFailureGC = "GC failure"
+
+ // A stream of 500 elements at most. We will test that the head can be collected
+ // while processing the tail. After each element we will GC and wait 10 ms, so a
+ // failure to collect will take roughly 5 seconds.
+ val ref = WeakReference( Stream.from(1).take(500) )
+
+ def gcAndThrowIfCollected(n: Int): Unit = {
+ System.gc() // try to GC
+ Thread.sleep(10) // give it 10 ms
+ if (ref.get.isEmpty) throw new RuntimeException(msgSuccessGC) // we're done if head collected
+ f(n)
+ }
+
+ val res = Try { op(ref(), gcAndThrowIfCollected) }.failed // success is indicated by an
+ val msg = res.map(_.getMessage).getOrElse(msgFailureGC) // exception with expected message
+ // failure is indicated by no
+ assertTrue(msg == msgSuccessGC) // exception, or one with different message
+ }
+
+ @Test
+ def foreach_allows_GC() {
+ assertStreamOpAllowsGC(_.foreach(_), _ => ())
+ }
+
+ @Test
+ def filter_all_foreach_allows_GC() {
+ assertStreamOpAllowsGC(_.filter(_ => true).foreach(_), _ => ())
+ }
+
+ @Test // SI-8990
+ def withFilter_after_first_foreach_allows_GC: Unit = {
+ assertStreamOpAllowsGC(_.withFilter(_ > 1).foreach(_), _ => ())
+ }
+
+ @Test // SI-8990
+ def withFilter_after_first_withFilter_foreach_allows_GC: Unit = {
+ assertStreamOpAllowsGC(_.withFilter(_ > 1).withFilter(_ < 100).foreach(_), _ => ())
+ }
+
+ @Test // SI-8990
+ def withFilter_can_retry_after_exception_thrown_in_filter: Unit = {
+ // use mutable state to control an intermittent failure in filtering the Stream
+ var shouldThrow = true
+
+ val wf = Stream.from(1).take(10).withFilter { n =>
+ if (shouldThrow && n == 5) throw new RuntimeException("n == 5") else n > 5
+ }
+
+ assertTrue( Try { wf.map(identity) }.isFailure ) // throws on n == 5
+
+ shouldThrow = false // won't throw next time
+
+ assertTrue( wf.map(identity).length == 5 ) // success instead of NPE
+ }
+
+ /** Test helper to verify that the given Stream operation is properly lazy in the tail */
+ def assertStreamOpLazyInTail(op: (=> Stream[Int]) => Stream[Int], expectedEvaluated: List[Int]): Unit = {
+ // mutable state to record every strict evaluation
+ var evaluated: List[Int] = Nil
+
+ def trackEffectsOnNaturals: Stream[Int] = {
+ def loop(i: Int): Stream[Int] = { evaluated ++= List(i); i #:: loop(i + 1) }
+ loop(1)
+ }
+
+ // call op on a stream which records every strict evaluation
+ val result = op(trackEffectsOnNaturals)
+
+ assertTrue( evaluated == expectedEvaluated )
+ }
+
+ @Test // SI-9134
+ def filter_map_properly_lazy_in_tail: Unit = {
+ assertStreamOpLazyInTail(_.filter(_ % 2 == 0).map(identity), List(1, 2))
+ }
+
+ @Test // SI-9134
+ def withFilter_map_properly_lazy_in_tail: Unit = {
+ assertStreamOpLazyInTail(_.withFilter(_ % 2 == 0).map(identity), List(1, 2))
+ }
+}
diff --git a/test/junit/scala/collection/immutable/StringLikeTest.scala b/test/junit/scala/collection/immutable/StringLikeTest.scala
index 3722bdfe4d..50be638b89 100644
--- a/test/junit/scala/collection/immutable/StringLikeTest.scala
+++ b/test/junit/scala/collection/immutable/StringLikeTest.scala
@@ -28,10 +28,16 @@ class StringLikeTest {
@Test
def testSplitEdgeCases: Unit = {
+ val high = 0xD852.toChar
+ val low = 0xDF62.toChar
+ val surrogatepair = List(high, low).mkString
+ val twopairs = surrogatepair + "_" + surrogatepair
+
AssertUtil.assertSameElements("abcd".split('d'), Array("abc")) // not Array("abc", "")
AssertUtil.assertSameElements("abccc".split('c'), Array("ab")) // not Array("ab", "", "", "")
AssertUtil.assertSameElements("xxx".split('x'), Array[String]()) // not Array("", "", "", "")
AssertUtil.assertSameElements("".split('x'), Array("")) // not Array()
AssertUtil.assertSameElements("--ch--omp--".split("-"), Array("", "", "ch", "", "omp")) // All the cases!
+ AssertUtil.assertSameElements(twopairs.split(high), Array(twopairs)) //don't split on characters that are half a surrogate pair
}
}
diff --git a/test/junit/scala/io/SourceTest.scala b/test/junit/scala/io/SourceTest.scala
index 3138a4589c..3fe48940a0 100644
--- a/test/junit/scala/io/SourceTest.scala
+++ b/test/junit/scala/io/SourceTest.scala
@@ -28,6 +28,10 @@ class SourceTest {
@Test def canIterateLines() = {
assertEquals(sampler.lines.size, (Source fromString sampler).getLines.size)
}
+ @Test def loadFromResource() = {
+ val res = Source.fromResource("rootdoc.txt")
+ assertTrue("No classpath resource found", res.getLines().size > 5)
+ }
@Test def canCustomizeReporting() = {
class CapitalReporting(is: InputStream) extends BufferedSource(is) {
override def report(pos: Int, msg: String, out: PrintStream): Unit = {
diff --git a/test/junit/scala/issues/BytecodeTests.scala b/test/junit/scala/issues/BytecodeTests.scala
index d4ed063a03..7c446894df 100644
--- a/test/junit/scala/issues/BytecodeTests.scala
+++ b/test/junit/scala/issues/BytecodeTests.scala
@@ -9,10 +9,17 @@ import scala.tools.nsc.backend.jvm.CodeGenTools._
import org.junit.Assert._
import scala.collection.JavaConverters._
import scala.tools.partest.ASMConverters._
+import scala.tools.testing.ClearAfterClass
+
+object BytecodeTests extends ClearAfterClass.Clearable {
+ var compiler = newCompiler()
+ def clear(): Unit = { compiler = null }
+}
@RunWith(classOf[JUnit4])
-class BytecodeTests {
- val compiler = newCompiler()
+class BytecodeTests extends ClearAfterClass {
+ ClearAfterClass.stateToClear = BytecodeTests
+ val compiler = BytecodeTests.compiler
@Test
def t8731(): Unit = {
@@ -59,7 +66,6 @@ class BytecodeTests {
|@AnnotB class B
""".stripMargin
- val compiler = newCompiler()
val run = new compiler.Run()
run.compileSources(List(new BatchSourceFile("AnnotA.java", annotA), new BatchSourceFile("AnnotB.java", annotB), new BatchSourceFile("Test.scala", scalaSrc)))
val outDir = compiler.settings.outputDirs.getSingleOutput.get
@@ -77,4 +83,55 @@ class BytecodeTests {
// a @Retention annotation are currently emitted as RUNTIME.
check("B.class", "AnnotB")
}
+
+ @Test
+ def t6288bJumpPosition(): Unit = {
+ val code =
+ """object Case3 { // 01
+ | def unapply(z: Any): Option[Int] = Some(-1) // 02
+ | def main(args: Array[String]) { // 03
+ | ("": Any) match { // 04
+ | case x : String => // 05
+ | println("case 0") // 06 println and jump at 6
+ | case _ => // 07
+ | println("default") // 08 println and jump at 8
+ | } // 09
+ | println("done") // 10
+ | }
+ |}
+ """.stripMargin
+ val List(mirror, module) = compileClasses(compiler)(code)
+
+ val unapplyLineNumbers = getSingleMethod(module, "unapply").instructions.filter(_.isInstanceOf[LineNumber])
+ assert(unapplyLineNumbers == List(LineNumber(2, Label(0))), unapplyLineNumbers)
+
+ import Opcodes._
+ val expected = List(
+ LineNumber(3, Label(0)),
+ LineNumber(4, Label(0)),
+ LineNumber(5, Label(5)),
+ Jump(IFNE, Label(11)),
+ Jump(GOTO, Label(20)),
+
+ LineNumber(6, Label(11)),
+ Invoke(INVOKEVIRTUAL, "scala/Predef$", "println", "(Ljava/lang/Object;)V", false),
+ Jump(GOTO, Label(33)),
+
+ LineNumber(5, Label(20)),
+ Jump(GOTO, Label(24)),
+
+ LineNumber(8, Label(24)),
+ Invoke(INVOKEVIRTUAL, "scala/Predef$", "println", "(Ljava/lang/Object;)V", false),
+ Jump(GOTO, Label(33)),
+
+ LineNumber(10, Label(33)),
+ Invoke(INVOKEVIRTUAL, "scala/Predef$", "println", "(Ljava/lang/Object;)V", false)
+ )
+
+ val mainIns = getSingleMethod(module, "main").instructions filter {
+ case _: LineNumber | _: Invoke | _: Jump => true
+ case _ => false
+ }
+ assertSameCode(mainIns, expected)
+ }
}
diff --git a/test/junit/scala/runtime/LambdaDeserializerTest.java b/test/junit/scala/runtime/LambdaDeserializerTest.java
new file mode 100644
index 0000000000..069eb4aab6
--- /dev/null
+++ b/test/junit/scala/runtime/LambdaDeserializerTest.java
@@ -0,0 +1,193 @@
+package scala.runtime;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.Serializable;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.SerializedLambda;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.HashMap;
+
+public final class LambdaDeserializerTest {
+ private LambdaHost lambdaHost = new LambdaHost();
+
+ @Test
+ public void serializationPrivate() {
+ F1<Boolean, String> f1 = lambdaHost.lambdaBackedByPrivateImplMethod();
+ Assert.assertEquals(f1.apply(true), reconstitute(f1).apply(true));
+ }
+
+ @Test
+ public void serializationStatic() {
+ F1<Boolean, String> f1 = lambdaHost.lambdaBackedByStaticImplMethod();
+ Assert.assertEquals(f1.apply(true), reconstitute(f1).apply(true));
+ }
+
+ @Test
+ public void serializationVirtualMethodReference() {
+ F1<Boolean, String> f1 = lambdaHost.lambdaBackedByVirtualMethodReference();
+ Assert.assertEquals(f1.apply(true), reconstitute(f1).apply(true));
+ }
+
+ @Test
+ public void serializationInterfaceMethodReference() {
+ F1<I, Object> f1 = lambdaHost.lambdaBackedByInterfaceMethodReference();
+ I i = new I() {
+ };
+ Assert.assertEquals(f1.apply(i), reconstitute(f1).apply(i));
+ }
+
+ @Test
+ public void serializationStaticMethodReference() {
+ F1<Boolean, String> f1 = lambdaHost.lambdaBackedByStaticMethodReference();
+ Assert.assertEquals(f1.apply(true), reconstitute(f1).apply(true));
+ }
+
+ @Test
+ public void serializationNewInvokeSpecial() {
+ F0<Object> f1 = lambdaHost.lambdaBackedByConstructorCall();
+ Assert.assertEquals(f1.apply(), reconstitute(f1).apply());
+ }
+
+ @Test
+ public void uncached() {
+ F0<Object> f1 = lambdaHost.lambdaBackedByConstructorCall();
+ F0<Object> reconstituted1 = reconstitute(f1);
+ F0<Object> reconstituted2 = reconstitute(f1);
+ Assert.assertNotEquals(reconstituted1.getClass(), reconstituted2.getClass());
+ }
+
+ @Test
+ public void cached() {
+ HashMap<String, MethodHandle> cache = new HashMap<>();
+ F0<Object> f1 = lambdaHost.lambdaBackedByConstructorCall();
+ F0<Object> reconstituted1 = reconstitute(f1, cache);
+ F0<Object> reconstituted2 = reconstitute(f1, cache);
+ Assert.assertEquals(reconstituted1.getClass(), reconstituted2.getClass());
+ }
+
+ @Test
+ public void cachedStatic() {
+ HashMap<String, MethodHandle> cache = new HashMap<>();
+ F1<Boolean, String> f1 = lambdaHost.lambdaBackedByStaticImplMethod();
+ // Check that deserialization of a static lambda always returns the
+ // same instance.
+ Assert.assertSame(reconstitute(f1, cache), reconstitute(f1, cache));
+
+ // (as is the case with regular invocation.)
+ Assert.assertSame(f1, lambdaHost.lambdaBackedByStaticImplMethod());
+ }
+
+ @Test
+ public void implMethodNameChanged() {
+ F1<Boolean, String> f1 = lambdaHost.lambdaBackedByStaticImplMethod();
+ SerializedLambda sl = writeReplace(f1);
+ checkIllegalAccess(copySerializedLambda(sl, sl.getImplMethodName() + "___", sl.getImplMethodSignature()));
+ }
+
+ @Test
+ public void implMethodSignatureChanged() {
+ F1<Boolean, String> f1 = lambdaHost.lambdaBackedByStaticImplMethod();
+ SerializedLambda sl = writeReplace(f1);
+ checkIllegalAccess(copySerializedLambda(sl, sl.getImplMethodName(), sl.getImplMethodSignature().replace("Boolean", "Integer")));
+ }
+
+ private void checkIllegalAccess(SerializedLambda serialized) {
+ try {
+ LambdaDeserializer.deserializeLambda(MethodHandles.lookup(), null, serialized);
+ throw new AssertionError();
+ } catch (IllegalArgumentException iae) {
+ if (!iae.getMessage().contains("Illegal lambda deserialization")) {
+ Assert.fail("Unexpected message: " + iae.getMessage());
+ }
+ }
+ }
+
+ private SerializedLambda copySerializedLambda(SerializedLambda sl, String implMethodName, String implMethodSignature) {
+ Object[] captures = new Object[sl.getCapturedArgCount()];
+ for (int i = 0; i < captures.length; i++) {
+ captures[i] = sl.getCapturedArg(i);
+ }
+ return new SerializedLambda(loadClass(sl.getCapturingClass()), sl.getFunctionalInterfaceClass(), sl.getFunctionalInterfaceMethodName(),
+ sl.getFunctionalInterfaceMethodSignature(), sl.getImplMethodKind(), sl.getImplClass(), implMethodName, implMethodSignature,
+ sl.getInstantiatedMethodType(), captures);
+ }
+
+ private Class<?> loadClass(String className) {
+ try {
+ return Class.forName(className.replace('/', '.'));
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ private <A, B> A reconstitute(A f1) {
+ return reconstitute(f1, null);
+ }
+
+ @SuppressWarnings("unchecked")
+ private <A, B> A reconstitute(A f1, java.util.HashMap<String, MethodHandle> cache) {
+ try {
+ return (A) LambdaDeserializer.deserializeLambda(LambdaHost.lookup(), cache, writeReplace(f1));
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private <A> SerializedLambda writeReplace(A f1) {
+ try {
+ Method writeReplace = f1.getClass().getDeclaredMethod("writeReplace");
+ writeReplace.setAccessible(true);
+ return (SerializedLambda) writeReplace.invoke(f1);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
+
+
+interface F1<A, B> extends Serializable {
+ B apply(A a);
+}
+
+interface F0<A> extends Serializable {
+ A apply();
+}
+
+class LambdaHost {
+ public F1<Boolean, String> lambdaBackedByPrivateImplMethod() {
+ int local = 42;
+ return (b) -> Arrays.asList(local, b ? "true" : "false", LambdaHost.this).toString();
+ }
+
+ @SuppressWarnings("Convert2MethodRef")
+ public F1<Boolean, String> lambdaBackedByStaticImplMethod() {
+ return (b) -> String.valueOf(b);
+ }
+
+ public F1<Boolean, String> lambdaBackedByStaticMethodReference() {
+ return String::valueOf;
+ }
+
+ public F1<Boolean, String> lambdaBackedByVirtualMethodReference() {
+ return Object::toString;
+ }
+
+ public F1<I, Object> lambdaBackedByInterfaceMethodReference() {
+ return I::i;
+ }
+
+ public F0<Object> lambdaBackedByConstructorCall() {
+ return String::new;
+ }
+
+ public static MethodHandles.Lookup lookup() {
+ return MethodHandles.lookup();
+ }
+}
+
+interface I {
+ default String i() { return "i"; };
+}
diff --git a/test/junit/scala/sys/process/t7350.scala b/test/junit/scala/sys/process/t7350.scala
new file mode 100644
index 0000000000..7f3e8897f2
--- /dev/null
+++ b/test/junit/scala/sys/process/t7350.scala
@@ -0,0 +1,298 @@
+
+package scala.sys.process
+
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+import org.junit.Test
+import java.io.{InputStream, OutputStream, PipedInputStream, PipedOutputStream, ByteArrayInputStream,
+ ByteArrayOutputStream, IOException, Closeable}
+import java.lang.reflect.InvocationTargetException
+import scala.concurrent.{Await, Future}
+import scala.concurrent.duration.{Duration, SECONDS}
+import scala.concurrent.ExecutionContext.Implicits.global
+import scala.util.control.Exception.ignoring
+
+// Each test normally ends in a moment, but for failure cases, waits until one second.
+
+@RunWith(classOf[JUnit4])
+class PipedProcessTest {
+ class ProcessMock(error: Boolean) extends Process {
+ var destroyCount = 0
+ def exitValue(): Int = {
+ if (error) {
+ throw new InterruptedException()
+ }
+ 0
+ }
+ def destroy(): Unit = { destroyCount += 1 }
+ }
+
+ class ProcessBuilderMock(process: Process, error: Boolean) extends ProcessBuilder.AbstractBuilder {
+ override def run(io: ProcessIO): Process = {
+ if (error) {
+ throw new IOException()
+ }
+ process
+ }
+ }
+
+ class PipeSinkMock extends Process.PipeSink("PipeSinkMock") {
+ var releaseCount = 0
+ override val pipe = null
+ override val sink = null
+ override def run(): Unit = {}
+ override def connectOut(out: OutputStream): Unit = {}
+ override def connectIn(pipeOut: PipedOutputStream): Unit = {}
+ override def release(): Unit = { releaseCount += 1 }
+ }
+
+ class PipeSourceMock extends Process.PipeSource("PipeSourceMock") {
+ var releaseCount = 0
+ override val pipe = null
+ override val source = null
+ override def run(): Unit = {}
+ override def connectIn(in: InputStream): Unit = {}
+ override def connectOut(sink: Process.PipeSink): Unit = {}
+ override def release(): Unit = { releaseCount += 1 }
+ }
+
+ class PipedProcesses(a: ProcessBuilder, b: ProcessBuilder, defaultIO: ProcessIO, toError: Boolean)
+ extends Process.PipedProcesses(a, b, defaultIO, toError) {
+ def callRunAndExitValue(source: Process.PipeSource, sink: Process.PipeSink) = {
+ val m = classOf[Process.PipedProcesses].getDeclaredMethod("runAndExitValue", classOf[Process.PipeSource], classOf[Process.PipeSink])
+ m.setAccessible(true)
+ try m.invoke(this, source, sink).asInstanceOf[Option[Int]]
+ catch {
+ case err: InvocationTargetException => throw err.getTargetException
+ }
+ }
+ }
+
+ // PipedProcesses need not to release resources when it normally end
+ @Test
+ def normallyEnd() {
+ val io = BasicIO(false, ProcessLogger(_ => ()))
+ val source = new PipeSourceMock
+ val sink = new PipeSinkMock
+ val a = new ProcessMock(error = false)
+ val b = new ProcessMock(error = false)
+ val p = new PipedProcesses(new ProcessBuilderMock(a, error = false), new ProcessBuilderMock(b, error = false), io, false)
+ val f = Future {
+ p.callRunAndExitValue(source, sink)
+ }
+ Await.result(f, Duration(1, SECONDS))
+ assert(source.releaseCount == 0)
+ assert(sink.releaseCount == 0)
+ assert(a.destroyCount == 0)
+ assert(b.destroyCount == 0)
+ }
+
+ // PipedProcesses must release resources when b.run() failed
+ @Test
+ def bFailed() {
+ val io = BasicIO(false, ProcessLogger(_ => ()))
+ val source = new PipeSourceMock
+ val sink = new PipeSinkMock
+ val a = new ProcessMock(error = false)
+ val b = new ProcessMock(error = false)
+ val p = new PipedProcesses(new ProcessBuilderMock(a, error = false), new ProcessBuilderMock(b, error = true), io, false)
+ val f = Future {
+ ignoring(classOf[IOException]) {
+ p.callRunAndExitValue(source, sink)
+ }
+ }
+ Await.result(f, Duration(1, SECONDS))
+ assert(source.releaseCount == 1)
+ assert(sink.releaseCount == 1)
+ assert(a.destroyCount == 0)
+ assert(b.destroyCount == 0)
+ }
+
+ // PipedProcesses must release resources when a.run() failed
+ @Test
+ def aFailed() {
+ val io = BasicIO(false, ProcessLogger(_ => ()))
+ val source = new PipeSourceMock
+ val sink = new PipeSinkMock
+ val a = new ProcessMock(error = false)
+ val b = new ProcessMock(error = false)
+ val p = new PipedProcesses(new ProcessBuilderMock(a, error = true), new ProcessBuilderMock(b, error = false), io, false)
+ val f = Future {
+ ignoring(classOf[IOException]) {
+ p.callRunAndExitValue(source, sink)
+ }
+ }
+ Await.result(f, Duration(1, SECONDS))
+ assert(source.releaseCount == 1)
+ assert(sink.releaseCount == 1)
+ assert(a.destroyCount == 0)
+ assert(b.destroyCount == 1)
+ }
+
+ // PipedProcesses must release resources when interrupted during waiting for first.exitValue()
+ @Test
+ def firstInterrupted() {
+ val io = BasicIO(false, ProcessLogger(_ => ()))
+ val source = new PipeSourceMock
+ val sink = new PipeSinkMock
+ val a = new ProcessMock(error = true)
+ val b = new ProcessMock(error = false)
+ val p = new PipedProcesses(new ProcessBuilderMock(a, error = false), new ProcessBuilderMock(b, error = false), io, false)
+ val f = Future {
+ p.callRunAndExitValue(source, sink)
+ }
+ Await.result(f, Duration(1, SECONDS))
+ assert(source.releaseCount == 1)
+ assert(sink.releaseCount == 1)
+ assert(a.destroyCount == 1)
+ assert(b.destroyCount == 1)
+ }
+
+ // PipedProcesses must release resources when interrupted during waiting for second.exitValue()
+ @Test
+ def secondInterrupted() {
+ val io = BasicIO(false, ProcessLogger(_ => ()))
+ val source = new PipeSourceMock
+ val sink = new PipeSinkMock
+ val a = new ProcessMock(error = false)
+ val b = new ProcessMock(error = true)
+ val p = new PipedProcesses(new ProcessBuilderMock(a, error = false), new ProcessBuilderMock(b, error = false), io, false)
+ val f = Future {
+ p.callRunAndExitValue(source, sink)
+ }
+ Await.result(f, Duration(1, SECONDS))
+ assert(source.releaseCount == 1)
+ assert(sink.releaseCount == 1)
+ assert(a.destroyCount == 1)
+ assert(b.destroyCount == 1)
+ }
+}
+
+@RunWith(classOf[JUnit4])
+class PipeSourceSinkTest {
+ def throwsIOException(f: => Unit) = {
+ try { f; false }
+ catch { case _: IOException => true }
+ }
+
+ class PipeSink extends Process.PipeSink("TestPipeSink") {
+ def ensureRunloopStarted() = {
+ while (sink.size() > 0) {
+ Thread.sleep(1)
+ }
+ }
+ def isReleased = {
+ val field = classOf[Process.PipeSink].getDeclaredField("pipe")
+ field.setAccessible(true)
+ val pipe = field.get(this).asInstanceOf[PipedInputStream]
+ !this.isAlive && throwsIOException { pipe.read() }
+ }
+ }
+
+ class PipeSource extends Process.PipeSource("TestPipeSource") {
+ def ensureRunloopStarted() = {
+ while (source.size() > 0) {
+ Thread.sleep(1)
+ }
+ }
+ def isReleased = {
+ val field = classOf[Process.PipeSource].getDeclaredField("pipe")
+ field.setAccessible(true)
+ val pipe = field.get(this).asInstanceOf[PipedOutputStream]
+ !this.isAlive && throwsIOException { pipe.write(1) }
+ }
+ }
+
+ trait CloseChecking extends Closeable {
+ var closed = false
+ override def close() = closed = true
+ }
+ class DebugOutputStream extends ByteArrayOutputStream with CloseChecking
+ class DebugInputStream(s: String) extends ByteArrayInputStream(s.getBytes()) with CloseChecking
+ class DebugInfinityInputStream extends InputStream with CloseChecking {
+ def read() = 1
+ }
+
+ def sourceSink() = {
+ val source = new PipeSource
+ val sink = new PipeSink
+ source connectOut sink
+ source.start()
+ sink.start()
+ (source, sink)
+ }
+
+ // PipeSource and PipeSink must release resources when it normally end
+ @Test
+ def normallyEnd() {
+ val in = new DebugInputStream("aaa")
+ val (source, sink) = sourceSink()
+ val out = new DebugOutputStream
+ source connectIn in
+ sink connectOut out
+ val f = Future {
+ source.join()
+ sink.join()
+ }
+ Await.result(f, Duration(1, SECONDS))
+ assert(in.closed == true)
+ assert(out.closed == true)
+ assert(source.isReleased == true)
+ assert(sink.isReleased == true)
+ }
+
+ // PipeSource and PipeSink must release resources when interrupted during waiting for source.take()
+ @Test
+ def sourceInterrupted() {
+ val (source, sink) = sourceSink()
+ val out = new DebugOutputStream
+ sink connectOut out
+ val f = Future {
+ sink.ensureRunloopStarted()
+ source.release()
+ sink.release()
+ }
+ Await.result(f, Duration(1, SECONDS))
+ assert(out.closed == true)
+ assert(source.isReleased == true)
+ assert(sink.isReleased == true)
+ }
+
+ // PipeSource and PipeSink must release resources when interrupted during waiting for sink.take()
+ @Test
+ def sinkInterrupted() {
+ val in = new DebugInputStream("aaa")
+ val (source, sink) = sourceSink()
+ source connectIn in
+ val f = Future {
+ source.ensureRunloopStarted()
+ source.release()
+ sink.release()
+ }
+ Await.result(f, Duration(1, SECONDS))
+ assert(in.closed == true)
+ assert(source.isReleased == true)
+ assert(sink.isReleased == true)
+ }
+
+ // PipeSource and PipeSink must release resources when interrupted during copy streams"
+ @Test
+ def runloopInterrupted() {
+ val in = new DebugInfinityInputStream
+ val (source, sink) = sourceSink()
+ val out = new DebugOutputStream
+ source connectIn in
+ sink connectOut out
+ val f = Future {
+ source.ensureRunloopStarted()
+ sink.ensureRunloopStarted()
+ source.release()
+ sink.release()
+ }
+ Await.result(f, Duration(1, SECONDS))
+ assert(in.closed == true)
+ assert(out.closed == true)
+ assert(source.isReleased == true)
+ assert(sink.isReleased == true)
+ }
+}
diff --git a/test/junit/scala/tools/nsc/backend/jvm/IndyLambdaTest.scala b/test/junit/scala/tools/nsc/backend/jvm/IndyLambdaTest.scala
new file mode 100644
index 0000000000..f5f93fef5c
--- /dev/null
+++ b/test/junit/scala/tools/nsc/backend/jvm/IndyLambdaTest.scala
@@ -0,0 +1,55 @@
+package scala.tools.nsc.backend.jvm
+
+import org.junit.Assert._
+import org.junit.{Assert, Test}
+
+import scala.tools.asm.{Handle, Opcodes}
+import scala.tools.asm.tree.InvokeDynamicInsnNode
+import scala.tools.nsc.backend.jvm.AsmUtils._
+import scala.tools.nsc.backend.jvm.CodeGenTools._
+import scala.tools.testing.ClearAfterClass
+import scala.collection.JavaConverters._
+
+object IndyLambdaTest extends ClearAfterClass.Clearable {
+ var compiler = newCompiler(extraArgs = "-Ybackend:GenBCode")
+
+ def clear(): Unit = {
+ compiler = null
+ }
+}
+
+class IndyLambdaTest extends ClearAfterClass {
+ ClearAfterClass.stateToClear = IndyLambdaTest
+ val compiler = IndyLambdaTest.compiler
+
+ @Test def boxingBridgeMethodUsedSelectively(): Unit = {
+ def implMethodDescriptorFor(code: String): String = {
+ val method = compileMethods(compiler)(s"""def f = $code """).find(_.name == "f").get
+ val x = method.instructions.iterator.asScala.toList
+ x.flatMap {
+ case insn : InvokeDynamicInsnNode => insn.bsmArgs.collect { case h : Handle => h.getDesc }
+ case _ => Nil
+ }.head
+ }
+ // unspecialized functions that have a primitive in parameter or return position
+ // give rise to a "boxing bridge" method (which has the suffix `$adapted`).
+ // This is because Scala's unboxing of null values gives zero, whereas Java's throw a NPE.
+
+ // 1. Here we show that we are calling the boxing bridge (the lambda bodies here are compiled into
+ // methods of `(I)Ljava/lang/Object;` / `(I)Ljava/lang/Object;` respectively.)
+ assertEquals("(Ljava/lang/Object;)Ljava/lang/Object;", implMethodDescriptorFor("(x: Int) => new Object"))
+ assertEquals("(Ljava/lang/Object;)Ljava/lang/Object;", implMethodDescriptorFor("(x: Object) => 0"))
+
+ // 2a. We don't need such adaptations for parameters or return values with types that differ
+ // from Object due to other generic substitution, LambdaMetafactory will downcast the arguments.
+ assertEquals("(Ljava/lang/String;)Ljava/lang/String;", implMethodDescriptorFor("(x: String) => x"))
+
+ // 2b. Testing 2a. in combination with 1.
+ assertEquals("(Ljava/lang/Object;)Ljava/lang/String;", implMethodDescriptorFor("(x: Int) => \"\""))
+ assertEquals("(Ljava/lang/String;)Ljava/lang/Object;", implMethodDescriptorFor("(x: String) => 0"))
+
+ // 3. Specialized functions, don't need any of this as they implement a method like `apply$mcII$sp`,
+ // and the (un)boxing is handled in the base class in code emitted by scalac.
+ assertEquals("(I)I", implMethodDescriptorFor("(x: Int) => x"))
+ }
+}
diff --git a/test/junit/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerTest.scala b/test/junit/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerTest.scala
index 9af9ef54fc..a5b3faced8 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerTest.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerTest.scala
@@ -246,4 +246,46 @@ class ProdConsAnalyzerTest extends ClearAfterClass {
testSingleInsn(a.consumersOfOutputsFrom(l2i), "IRETURN")
testSingleInsn(a.producersForInputsOf(ret), "L2I")
}
+
+ @Test
+ def cyclicProdCons(): Unit = {
+ import Opcodes._
+ val m = genMethod(descriptor = "(I)I")(
+ Label(1),
+ VarOp(ILOAD, 1),
+ IntOp(BIPUSH, 10),
+ Op(IADD), // consumer of the above ILOAD
+
+ Op(ICONST_0),
+ Jump(IF_ICMPNE, Label(2)),
+
+ VarOp(ILOAD, 1),
+ VarOp(ISTORE, 1),
+ Jump(GOTO, Label(1)),
+
+ Label(2),
+ IntOp(BIPUSH, 9),
+ Op(IRETURN)
+ )
+ m.maxLocals = 2
+ m.maxStack = 2
+ val a = new ProdConsAnalyzer(m, "C")
+
+ val List(iadd) = findInstr(m, "IADD")
+ val firstLoad = iadd.getPrevious.getPrevious
+ assert(firstLoad.getOpcode == ILOAD)
+ val secondLoad = findInstr(m, "ISTORE").head.getPrevious
+ assert(secondLoad.getOpcode == ILOAD)
+
+ testSingleInsn(a.producersForValueAt(iadd, 2), "ILOAD")
+ testSingleInsn(a.initialProducersForValueAt(iadd, 2), "ParameterProducer(1)")
+ testMultiInsns(a.producersForInputsOf(firstLoad), List("ParameterProducer", "ISTORE"))
+ testMultiInsns(a.producersForInputsOf(secondLoad), List("ParameterProducer", "ISTORE"))
+
+ testSingleInsn(a.ultimateConsumersOfOutputsFrom(firstLoad), "IADD")
+ testSingleInsn(a.ultimateConsumersOfOutputsFrom(secondLoad), "IADD")
+
+ testSingleInsn(a.consumersOfOutputsFrom(firstLoad), "IADD")
+ testSingleInsn(a.consumersOfOutputsFrom(secondLoad), "ISTORE")
+ }
}
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/ClosureOptimizerTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/ClosureOptimizerTest.scala
new file mode 100644
index 0000000000..69eed1f75d
--- /dev/null
+++ b/test/junit/scala/tools/nsc/backend/jvm/opt/ClosureOptimizerTest.scala
@@ -0,0 +1,74 @@
+package scala.tools.nsc
+package backend.jvm
+package opt
+
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+import org.junit.Test
+import scala.collection.generic.Clearable
+import scala.collection.mutable.ListBuffer
+import scala.reflect.internal.util.BatchSourceFile
+import scala.tools.asm.Opcodes._
+import org.junit.Assert._
+
+import scala.tools.asm.tree._
+import scala.tools.asm.tree.analysis._
+import scala.tools.nsc.backend.jvm.opt.BytecodeUtils.AsmAnalyzer
+import scala.tools.nsc.io._
+import scala.tools.nsc.reporters.StoreReporter
+import scala.tools.testing.AssertUtil._
+
+import CodeGenTools._
+import scala.tools.partest.ASMConverters
+import ASMConverters._
+import AsmUtils._
+
+import BackendReporting._
+
+import scala.collection.convert.decorateAsScala._
+import scala.tools.testing.ClearAfterClass
+
+object ClosureOptimizerTest extends ClearAfterClass.Clearable {
+ var compiler = newCompiler(extraArgs = "-Yopt:l:classpath -Yopt-warnings")
+ def clear(): Unit = { compiler = null }
+}
+
+@RunWith(classOf[JUnit4])
+class ClosureOptimizerTest extends ClearAfterClass {
+ ClearAfterClass.stateToClear = ClosureOptimizerTest
+
+ val compiler = ClosureOptimizerTest.compiler
+
+ @Test
+ def nothingTypedClosureBody(): Unit = {
+ val code =
+ """abstract class C {
+ | def isEmpty: Boolean
+ | @inline final def getOrElse[T >: C](f: => T) = if (isEmpty) f else this
+ | def t = getOrElse(throw new Error(""))
+ |}
+ """.stripMargin
+
+ val List(c) = compileClasses(compiler)(code)
+ val t = c.methods.asScala.toList.find(_.name == "t").get
+ val List(bodyCall) = findInstr(t, "INVOKESTATIC C.C$$$anonfun$1 ()Lscala/runtime/Nothing$")
+ assert(bodyCall.getNext.getOpcode == ATHROW)
+ }
+
+ @Test
+ def nullTypedClosureBody(): Unit = {
+ val code =
+ """abstract class C {
+ | def isEmpty: Boolean
+ | @inline final def getOrElse[T >: C](f: => T) = if (isEmpty) f else this
+ | def t = getOrElse(null)
+ |}
+ """.stripMargin
+
+ val List(c) = compileClasses(compiler)(code)
+ val t = c.methods.asScala.toList.find(_.name == "t").get
+ val List(bodyCall) = findInstr(t, "INVOKESTATIC C.C$$$anonfun$1 ()Lscala/runtime/Null$")
+ assert(bodyCall.getNext.getOpcode == POP)
+ assert(bodyCall.getNext.getNext.getOpcode == ACONST_NULL)
+ }
+}
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/CompactLocalVariablesTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/CompactLocalVariablesTest.scala
index 76492cfa23..cd298f822a 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/opt/CompactLocalVariablesTest.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/opt/CompactLocalVariablesTest.scala
@@ -17,8 +17,8 @@ class CompactLocalVariablesTest {
// recurse-unreachable-jumps is required for eliminating catch blocks, in the first dce round they
// are still live.only after eliminating the empty handler the catch blocks become unreachable.
- val methodOptCompiler = newCompiler(extraArgs = "-target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code,compact-locals")
- val noCompactVarsCompiler = newCompiler(extraArgs = "-target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code")
+ val methodOptCompiler = newCompiler(extraArgs = "-Ybackend:GenBCode -Yopt:unreachable-code,compact-locals")
+ val noCompactVarsCompiler = newCompiler(extraArgs = "-Ybackend:GenBCode -Yopt:unreachable-code")
@Test
def compactUnused(): Unit = {
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala
index 57088bdd2f..5ccb940415 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/opt/InlineInfoTest.scala
@@ -27,7 +27,9 @@ object InlineInfoTest extends ClearAfterClass.Clearable {
}
@RunWith(classOf[JUnit4])
-class InlineInfoTest {
+class InlineInfoTest extends ClearAfterClass {
+ ClearAfterClass.stateToClear = InlineInfoTest
+
val compiler = InlineInfoTest.compiler
def compile(code: String) = {
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala
index 0309bb97cc..617eced560 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala
@@ -991,4 +991,41 @@ class InlinerTest extends ClearAfterClass {
assert(2 == t.collect({case Ldc(_, "hai!") => }).size) // twice the body of f
assert(1 == t.collect({case Jump(IFNONNULL, _) => }).size) // one single null check
}
+
+ @Test
+ def inlineIndyLambda(): Unit = {
+ val code =
+ """object M {
+ | @inline def m(s: String) = {
+ | val f = (x: String) => x.trim
+ | f(s)
+ | }
+ |}
+ |class C {
+ | @inline final def m(s: String) = {
+ | val f = (x: String) => x.trim
+ | f(s)
+ | }
+ | def t1 = m("foo")
+ | def t2 = M.m("bar")
+ |}
+ """.stripMargin
+
+ val List(c, _, _) = compile(code)
+
+ val t1 = getSingleMethod(c, "t1")
+ assert(t1.instructions exists {
+ case _: InvokeDynamic => true
+ case _ => false
+ })
+ // the indy call is inlined into t, and the closure elimination rewrites the closure invocation to the body method
+ assertInvoke(t1, "C", "C$$$anonfun$2")
+
+ val t2 = getSingleMethod(c, "t2")
+ assert(t2.instructions exists {
+ case _: InvokeDynamic => true
+ case _ => false
+ })
+ assertInvoke(t2, "M$", "M$$$anonfun$1")
+ }
}
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/MethodLevelOpts.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/MethodLevelOpts.scala
index 5ef2458c0a..8d910629ca 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/opt/MethodLevelOpts.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/opt/MethodLevelOpts.scala
@@ -16,7 +16,7 @@ import ASMConverters._
import scala.tools.testing.ClearAfterClass
object MethodLevelOpts extends ClearAfterClass.Clearable {
- var methodOptCompiler = newCompiler(extraArgs = "-target:jvm-1.6 -Ybackend:GenBCode -Yopt:l:method")
+ var methodOptCompiler = newCompiler(extraArgs = "-Ybackend:GenBCode -Yopt:l:method")
def clear(): Unit = { methodOptCompiler = null }
}
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/UnreachableCodeTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/UnreachableCodeTest.scala
index 902af7b7fa..0ac206669a 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/opt/UnreachableCodeTest.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/opt/UnreachableCodeTest.scala
@@ -18,18 +18,14 @@ import scala.tools.testing.ClearAfterClass
object UnreachableCodeTest extends ClearAfterClass.Clearable {
// jvm-1.6 enables emitting stack map frames, which impacts the code generation wrt dead basic blocks,
// see comment in BCodeBodyBuilder
- var methodOptCompiler = newCompiler(extraArgs = "-target:jvm-1.6 -Ybackend:GenBCode -Yopt:l:method")
- var dceCompiler = newCompiler(extraArgs = "-target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code")
- var noOptCompiler = newCompiler(extraArgs = "-target:jvm-1.6 -Ybackend:GenBCode -Yopt:l:none")
-
- // jvm-1.5 disables computing stack map frames, and it emits dead code as-is. note that this flag triggers a deprecation warning
- var noOptNoFramesCompiler = newCompiler(extraArgs = "-target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none -deprecation")
+ var methodOptCompiler = newCompiler(extraArgs = "-Ybackend:GenBCode -Yopt:l:method")
+ var dceCompiler = newCompiler(extraArgs = "-Ybackend:GenBCode -Yopt:unreachable-code")
+ var noOptCompiler = newCompiler(extraArgs = "-Ybackend:GenBCode -Yopt:l:none")
def clear(): Unit = {
methodOptCompiler = null
dceCompiler = null
noOptCompiler = null
- noOptNoFramesCompiler = null
}
}
@@ -40,7 +36,6 @@ class UnreachableCodeTest extends ClearAfterClass {
val methodOptCompiler = UnreachableCodeTest.methodOptCompiler
val dceCompiler = UnreachableCodeTest.dceCompiler
val noOptCompiler = UnreachableCodeTest.noOptCompiler
- val noOptNoFramesCompiler = UnreachableCodeTest.noOptNoFramesCompiler
def assertEliminateDead(code: (Instruction, Boolean)*): Unit = {
val method = genMethod()(code.map(_._1): _*)
@@ -152,11 +147,6 @@ class UnreachableCodeTest extends ClearAfterClass {
// Finally, instructions in the dead basic blocks are replaced by ATHROW, as explained in
// a comment in BCodeBodyBuilder.
assertSameCode(noDce.dropNonOp, List(Op(ICONST_1), Op(IRETURN), Op(ATHROW), Op(ATHROW)))
-
- // when NOT computing stack map frames, ASM's ClassWriter does not replace dead code by NOP/ATHROW
- val warn = "target:jvm-1.5 is deprecated"
- val noDceNoFrames = singleMethodInstructions(noOptNoFramesCompiler)(code, allowMessage = _.msg contains warn)
- assertSameCode(noDceNoFrames.dropNonOp, List(Op(ICONST_1), Op(IRETURN), Op(ICONST_2), Op(IRETURN)))
}
@Test
diff --git a/test/junit/scala/tools/nsc/settings/ScalaVersionTest.scala b/test/junit/scala/tools/nsc/settings/ScalaVersionTest.scala
index 77a2da828e..3717f80362 100644
--- a/test/junit/scala/tools/nsc/settings/ScalaVersionTest.scala
+++ b/test/junit/scala/tools/nsc/settings/ScalaVersionTest.scala
@@ -13,6 +13,57 @@ class ScalaVersionTest {
@Test def versionUnparse() {
val v = "2.11.3"
- assertEquals(ScalaVersion(v).unparse, v)
+ assertEquals(v, ScalaVersion(v).unparse)
+ assertEquals("2.11.3-RC4", ScalaVersion("2.11.3-rc4").unparse)
+ }
+
+ // SI-9167
+ @Test def `version parses with rigor`() {
+ import settings.{ SpecificScalaVersion => V }
+ import ScalaVersion._
+
+ // no-brainers
+ assertEquals(V(2,11,7,Final), ScalaVersion("2.11.7"))
+ assertEquals(V(2,11,7,Final), ScalaVersion("2.11.7-FINAL"))
+ assertEquals(V(2,11,7,Milestone(3)), ScalaVersion("2.11.7-M3"))
+ assertEquals(V(2,11,7,RC(3)), ScalaVersion("2.11.7-RC3"))
+ assertEquals(V(2,11,7,Development("devbuild")), ScalaVersion("2.11.7-devbuild"))
+
+ // partial-brainers
+ assertEquals(V(2,11,7,Milestone(3)), ScalaVersion("2.11.7-m3"))
+ assertEquals(V(2,11,7,RC(3)), ScalaVersion("2.11.7-rc3"))
+ assertEquals(V(2,11,7,Development("maybegood")), ScalaVersion("2.11.7-maybegood"))
+ assertEquals(V(2,11,7,Development("RCCola")), ScalaVersion("2.11.7-RCCola"))
+ assertEquals(V(2,11,7,Development("RC1.5")), ScalaVersion("2.11.7-RC1.5"))
+ assertEquals(V(2,11,7,Development("")), ScalaVersion("2.11.7-"))
+ assertEquals(V(2,11,7,Development("0.5")), ScalaVersion("2.11.7-0.5"))
+ assertEquals(V(2,11,7,Development("devbuild\nSI-9167")), ScalaVersion("2.11.7-devbuild\nSI-9167"))
+ assertEquals(V(2,11,7,Development("final")), ScalaVersion("2.11.7-final"))
+
+ // oh really
+ assertEquals(NoScalaVersion, ScalaVersion("none"))
+ assertEquals(AnyScalaVersion, ScalaVersion("any"))
+
+ assertThrows[NumberFormatException] { ScalaVersion("2.11.7.2") }
+ assertThrows[NumberFormatException] { ScalaVersion("2.11.7.beta") }
+ assertThrows[NumberFormatException] { ScalaVersion("2.x.7") }
+ assertThrows[NumberFormatException] { ScalaVersion("2.-11.7") }
+ assertThrows[NumberFormatException] { ScalaVersion("2. ") }
+ assertThrows[NumberFormatException] { ScalaVersion("2.1 .7") }
+ assertThrows[NumberFormatException] { ScalaVersion("2.") }
+ assertThrows[NumberFormatException] { ScalaVersion("2..") }
+ assertThrows[NumberFormatException] { ScalaVersion("2...") }
+ assertThrows[NumberFormatException] { ScalaVersion("2-") }
+ assertThrows[NumberFormatException] { ScalaVersion("2-.") } // scalacheck territory
+ assertThrows[NumberFormatException] { ScalaVersion("any.7") }
+
+ assertThrows[NumberFormatException] ( ScalaVersion("2.11-ok"), _ ==
+ "Bad version (2.11-ok) not major[.minor[.revision[-suffix]]]" )
+
+ }
+
+ // SI-9377
+ @Test def `missing version is as good as none`() {
+ assertEquals(NoScalaVersion, ScalaVersion(""))
}
}
diff --git a/test/junit/scala/tools/nsc/settings/SettingsTest.scala b/test/junit/scala/tools/nsc/settings/SettingsTest.scala
index 96f83c4c2f..a0015f4465 100644
--- a/test/junit/scala/tools/nsc/settings/SettingsTest.scala
+++ b/test/junit/scala/tools/nsc/settings/SettingsTest.scala
@@ -172,12 +172,12 @@ class SettingsTest {
assert(residual.isEmpty)
assertTrue(s.source.value == ScalaVersion(expected))
}
- check(expected = "2.11.0") // default
+ check(expected = "2.12.0") // default
check(expected = "2.11.0", "-Xsource:2.11")
check(expected = "2.10", "-Xsource:2.10.0")
check(expected = "2.12", "-Xsource:2.12")
assertThrows[IllegalArgumentException](check(expected = "2.11", "-Xsource"), _ == "-Xsource requires an argument, the syntax is -Xsource:<version>")
assertThrows[IllegalArgumentException](check(expected = "2.11", "-Xsource", "2.11"), _ == "-Xsource requires an argument, the syntax is -Xsource:<version>")
- assertThrows[IllegalArgumentException](check(expected = "2.11", "-Xsource:2.invalid"), _ contains "There was a problem parsing 2.invalid")
+ assertThrows[IllegalArgumentException](check(expected = "2.11", "-Xsource:2.invalid"), _ contains "Bad version (2.invalid)")
}
}
diff --git a/test/junit/scala/tools/nsc/symtab/FlagsTest.scala b/test/junit/scala/tools/nsc/symtab/FlagsTest.scala
new file mode 100644
index 0000000000..08a37fcb3c
--- /dev/null
+++ b/test/junit/scala/tools/nsc/symtab/FlagsTest.scala
@@ -0,0 +1,96 @@
+package scala.tools.nsc
+package symtab
+
+import org.junit.Assert._
+import scala.tools.testing.AssertUtil._
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(classOf[JUnit4])
+class FlagsTest {
+ object symbolTable extends SymbolTableForUnitTesting
+ import symbolTable._
+ import Flags._
+
+ def sym = NoSymbol.newTermSymbol(nme.EMPTY)
+
+ def withFlagMask[A](mask: Long)(body: => A): A = enteringPhase(new Phase(NoPhase) {
+ override def flagMask = mask
+ def name = ""
+ def run() = ()
+ })(body)
+
+ def testTimedFlag(flag: Long, test: Symbol => Boolean, enabling: Boolean) = {
+ assertEquals(withFlagMask(InitialFlags)(test(sym.setFlag(flag))), !enabling)
+ assertEquals(withFlagMask(InitialFlags | flag)(test(sym.setFlag(flag))), enabling)
+ }
+
+ def testLate(flag: Long, test: Symbol => Boolean) = testTimedFlag(flag, test, enabling = true)
+ def testNot(flag: Long, test: Symbol => Boolean) = testTimedFlag(flag, test, enabling = false)
+
+ @Test
+ def testTimedFlags(): Unit = {
+ testLate(lateDEFERRED, _.isDeferred)
+ testLate(lateFINAL, _.isFinal)
+ testLate(lateINTERFACE, _.isInterface)
+ testLate(lateMETHOD, _.isMethod)
+ testLate(lateMODULE, _.isModule)
+ testNot(PROTECTED | notPROTECTED, _.isProtected)
+ testNot(OVERRIDE | notOVERRIDE, _.isOverride)
+ testNot(PRIVATE | notPRIVATE, _.isPrivate)
+
+ assertFalse(withFlagMask(AllFlags)(sym.setFlag(PRIVATE | notPRIVATE).isPrivate))
+
+ assertEquals(withFlagMask(InitialFlags)(sym.setFlag(PRIVATE | notPRIVATE).flags & PRIVATE), PRIVATE)
+ assertEquals(withFlagMask(AllFlags)(sym.setFlag(PRIVATE | notPRIVATE).flags & PRIVATE), 0)
+ }
+
+ @Test
+ def normalLateOverlap(): Unit = {
+ // late flags are shifted by LateShift == 47.
+ // however, the first late flag is lateDEFERRED, which is DEFERRED << 47 == (1 << 4) << 47 == 1 << 51
+ // the flags from 1 << 47 to 1 << 50 are not late flags. this is ensured by the LateFlags mask.
+
+ for (i <- 0 to 3) {
+ val f = 1L << i
+ assertEquals(withFlagMask(AllFlags)(sym.setFlag(f << LateShift).flags & f), 0) // not treated as late flag
+ }
+ for (i <- 4 to 8) {
+ val f = 1L << i
+ assertEquals(withFlagMask(AllFlags)(sym.setFlag(f << LateShift).flags & f), f) // treated as late flag
+ }
+ }
+
+ @Test
+ def normalAnti(): Unit = {
+ for (i <- 0 to 2) {
+ val f = 1L << i
+ assertEquals(withFlagMask(AllFlags)(sym.setFlag(f | (f << AntiShift)).flags & f), 0) // negated flags
+ }
+ for (i <- 3 to 7) {
+ val f = 1L << i
+ assertEquals(withFlagMask(AllFlags)(sym.setFlag(f | (f << AntiShift)).flags & f), f) // not negated
+ }
+ }
+
+ @Test
+ def lateAntiCrossCheck(): Unit = {
+ val allButNegatable = AllFlags & ~(PROTECTED | OVERRIDE | PRIVATE)
+ val lateable = 0L | DEFERRED | FINAL | INTERFACE | METHOD | MODULE
+ val lateFlags = lateable << LateShift
+ val allButLateable = AllFlags & ~lateable
+
+ assertEquals(withFlagMask(AllFlags)(sym.setFlag(AllFlags).flags), allButNegatable)
+ assertEquals(withFlagMask(AllFlags)(sym.setFlag(allButLateable).flags), allButNegatable)
+
+ assertEquals(withFlagMask(AllFlags)(sym.setFlag(lateFlags).flags), lateFlags | lateable)
+ }
+
+ @Test
+ def javaClassMirrorAnnotationFlag(): Unit = {
+ import scala.reflect.runtime.universe._
+ val dep = typeOf[java.lang.Deprecated].typeSymbol
+ assertTrue(dep.isJavaAnnotation && dep.isJava)
+ }
+}
diff --git a/test/long-running/jvm/memleak2_actor.scala b/test/long-running/jvm/memleak2_actor.scala
deleted file mode 100644
index 1673b12dac..0000000000
--- a/test/long-running/jvm/memleak2_actor.scala
+++ /dev/null
@@ -1,39 +0,0 @@
-import scala.actors._
-import Actor._
-
-case object Start
-case object EndMe
-
-class A extends Actor {
- def act = loop {
- react {
- case Start =>
- case EndMe =>
- exit()
- }
- }
-}
-
-object Test {
-
- def z(in: Long) = if (in / 1024L == 0L) in
- else if (in / (1024L * 1024L) == 0L) (in / 1024L).toString + "K"
- else (in / (1024L * 1024L)).toString + "M"
-
- def main(args: Array[String]) {
- val rt = Runtime.getRuntime()
- for (o <- 1 to 300000) {
- println("Outer [2AN] "+o)
- var a: List[A] = Nil
- for (i <- 1 to 10000) {
- var t = new A
- a = t :: a
- t.start
- t ! Start
- }
- for (act <- a) act ! EndMe
- //rt.gc()
- println("Free "+z(rt.freeMemory())+" total "+z(rt.totalMemory()))
- }
- }
-}
diff --git a/test/partest b/test/partest
index f396459c6d..7e19c92165 100755
--- a/test/partest
+++ b/test/partest
@@ -117,8 +117,7 @@ fi
# last arg wins, so if JAVA_OPTS already contains -Xmx or -Xms the
# supplied argument will be used.
-# At this writing it is reported test/partest --all requires 108m permgen.
-JAVA_OPTS="-Xmx1024M -Xms64M -XX:MaxPermSize=128M $JAVA_OPTS"
+JAVA_OPTS="-Xmx1024M -Xms64M $JAVA_OPTS"
# the ant task doesn't supply any options by default,
# so don't do that here either -- note that you may want to pass -optimise
diff --git a/test/pending/jvm/actor-executor4.check b/test/pending/jvm/actor-executor4.check
deleted file mode 100644
index da78f45836..0000000000
--- a/test/pending/jvm/actor-executor4.check
+++ /dev/null
@@ -1,21 +0,0 @@
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-Two: OK
-One: OK
-One exited
diff --git a/test/pending/jvm/actor-executor4.scala b/test/pending/jvm/actor-executor4.scala
deleted file mode 100644
index a912d76094..0000000000
--- a/test/pending/jvm/actor-executor4.scala
+++ /dev/null
@@ -1,64 +0,0 @@
-import scala.actors.{Actor, Exit}
-import scala.actors.scheduler.ExecutorScheduler
-import java.util.concurrent.Executors
-
-object One extends AdaptedActor {
- def act() {
- Two.start()
- var i = 0
- loopWhile (i < Test.NUM_MSG) {
- i += 1
- Two ! 'MsgForTwo
- react {
- case 'MsgForOne =>
- if (i % (Test.NUM_MSG/10) == 0)
- println("One: OK")
- }
- }
- }
-}
-
-object Two extends AdaptedActor {
- def act() {
- var i = 0
- loopWhile (i < Test.NUM_MSG) {
- i += 1
- react {
- case 'MsgForTwo =>
- if (i % (Test.NUM_MSG/10) == 0)
- println("Two: OK")
- One ! 'MsgForOne
- }
- }
- }
-}
-
-trait AdaptedActor extends Actor {
- override def scheduler =
- Test.scheduler
-}
-
-object Test {
- val NUM_MSG = 100000
-
- val scheduler =
- ExecutorScheduler(
- Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()),
- false)
-
- def main(args: Array[String]) {
- (new AdaptedActor {
- def act() {
- trapExit = true
- link(One)
- One.start()
-
- receive {
- case Exit(from, reason) =>
- println("One exited")
- Test.scheduler.shutdown()
- }
- }
- }).start()
- }
-}
diff --git a/test/pending/jvm/actor-receive-sender.check b/test/pending/jvm/actor-receive-sender.check
deleted file mode 100644
index 2c94e48371..0000000000
--- a/test/pending/jvm/actor-receive-sender.check
+++ /dev/null
@@ -1,2 +0,0 @@
-OK
-OK
diff --git a/test/pending/jvm/actor-receive-sender.scala b/test/pending/jvm/actor-receive-sender.scala
deleted file mode 100644
index ea7c40cced..0000000000
--- a/test/pending/jvm/actor-receive-sender.scala
+++ /dev/null
@@ -1,51 +0,0 @@
-import scala.actors.{Actor, TIMEOUT, Exit}
-import scala.actors.Actor._
-
-object Test {
-
- val NUM = 2000
-
- def main(args: Array[String]) {
- var b: Actor = null
- var c: Actor = null
-
- val a = actor {
- for (_ <- 0 until NUM)
- receive {
- case 'hello if sender == b => // do nothing
- }
- b ! 'ok
- for (_ <- 0 until NUM)
- receiveWithin (1000) {
- case 'bye if sender == b => // do nothing
- case TIMEOUT => b ! 'fail
- }
- b ! 'ok
- }
-
- b = actor {
- self.trapExit = true
- link(a)
-
- for (_ <- 0 until NUM)
- a ! 'hello
-
- val proceed = receive {
- case Exit(from, reason) => println("FAIL"); false
- case 'ok => println("OK"); true
- case other => println(other); false
- }
-
- if (proceed) {
- for (_ <- 0 until NUM)
- a ! 'bye
- receive {
- case Exit(from, reason) => println("FAIL")
- case 'ok => println("OK")
- case other => println(other)
- }
- }
- }
- }
-
-}
diff --git a/test/pending/jvm/actorgc_leak.check b/test/pending/jvm/actorgc_leak.check
deleted file mode 100644
index a965a70ed4..0000000000
--- a/test/pending/jvm/actorgc_leak.check
+++ /dev/null
@@ -1 +0,0 @@
-Done
diff --git a/test/pending/jvm/actorgc_leak.scala b/test/pending/jvm/actorgc_leak.scala
deleted file mode 100644
index de3e04f1e8..0000000000
--- a/test/pending/jvm/actorgc_leak.scala
+++ /dev/null
@@ -1,63 +0,0 @@
-
-import scala.actors.Actor
-
-object Test {
- class FatActorFactory extends Actor {
- def act() {
- var cnt = 0
- Actor.loopWhile(cnt < fatActors) {
- //if ((cnt % 5) == 0) println(cnt)
- val fa = new FatActor()
- fa.start()
- cnt += 1
- if (cnt == fatActors) Monitor ! 'done
- }
- }
- }
-
- class FatActor extends Actor {
- def act() {
- fat = new Array[Int](fatness)
- react {
- case 'hi => exit()
- }
- }
- private var fat: Array[Int] = _
- }
-
- object Monitor extends Actor {
- private var cnt = 0
- def act() {
- Actor.loop {
- react {
- case 'done => {
- cnt += 1
- if (cnt == factories) System.exit(0) // once GC pressure stops FatActors stop being collected, and as
- } // a result ActorGC never finds out that they are defunct
- }
- }
- }
- }
-
- val factories = 4 // the number of factories to start
- val fatActors = 50 // the number of FatActors for each factory to produce
- val fatness = 1024*1024*10
-
- def main(args: Array[String]) {
- scala.actors.Scheduler.impl.shutdown()
- val sched = {
- val s = new scala.actors.FJTaskScheduler2
- s.start()
- s
- }
- scala.actors.Scheduler.impl = sched
-
- Monitor.start()
- for(i <- 1 to factories) {
- //if ((i % 50) == 0) println(i)
- val fa = new FatActorFactory()
- fa.start()
- }
- println("Done")
- }
-}
diff --git a/test/pending/jvm/reactWithinZero.check b/test/pending/jvm/reactWithinZero.check
deleted file mode 100644
index cf2a2facf9..0000000000
--- a/test/pending/jvm/reactWithinZero.check
+++ /dev/null
@@ -1,2 +0,0 @@
-TIMEOUT
-'ack
diff --git a/test/pending/jvm/reactWithinZero.scala b/test/pending/jvm/reactWithinZero.scala
deleted file mode 100644
index 0786ce271d..0000000000
--- a/test/pending/jvm/reactWithinZero.scala
+++ /dev/null
@@ -1,18 +0,0 @@
-import scala.actors.{Actor, TIMEOUT}
-
-class A extends Actor {
- def act() = reactWithin(0) {
- case TIMEOUT =>
- println("TIMEOUT")
- reply('ack)
- act()
- case x => println(x)
- }
-}
-
-object Test {
- def main(args: Array[String]): Unit = {
- val a = new A
- a.start()
- }
-}
diff --git a/test/pending/jvm/receiveWithinZero.check b/test/pending/jvm/receiveWithinZero.check
deleted file mode 100644
index cf2a2facf9..0000000000
--- a/test/pending/jvm/receiveWithinZero.check
+++ /dev/null
@@ -1,2 +0,0 @@
-TIMEOUT
-'ack
diff --git a/test/pending/jvm/receiveWithinZero.scala b/test/pending/jvm/receiveWithinZero.scala
deleted file mode 100644
index 315dd9c86a..0000000000
--- a/test/pending/jvm/receiveWithinZero.scala
+++ /dev/null
@@ -1,18 +0,0 @@
-import scala.actors.{Actor, TIMEOUT}
-
-class A extends Actor {
- def act() = receiveWithin(0) {
- case TIMEOUT =>
- println("TIMEOUT")
- reply('ack)
- act()
- case x => println(x)
- }
-}
-
-object Test {
- def main(args: Array[String]): Unit = {
- val a = new A
- a.start()
- }
-}
diff --git a/test/pending/jvm/t1801.check b/test/pending/jvm/t1801.check
deleted file mode 100644
index bf78a99db9..0000000000
--- a/test/pending/jvm/t1801.check
+++ /dev/null
@@ -1,6 +0,0 @@
-0
-100
-200
-300
-400
-done!
diff --git a/test/pending/jvm/t1801.scala b/test/pending/jvm/t1801.scala
deleted file mode 100644
index 6ed7c56336..0000000000
--- a/test/pending/jvm/t1801.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-import scala.actors.Actor._
-
-object Test {
- val rt = Runtime.getRuntime()
- val sender = actor {
- var cnt = 0
- while(cnt < 500) {
- if ((cnt % 100) == 0) println(cnt)
- receiver ! new Array[Int] (148576)
- cnt += 1
- //println ("Used Mem: " + (((rt.totalMemory() - rt.freeMemory()) / 1048576.) formatted "%.2f") + " Mb")
- }
- receiver ! 'exit
- }
-
- val receiver = actor {
- loop {
- react {
- case x: Array[Int] => ()//println ("received " + x.length)
- case 'exit => {
- println("done!")
- exit()
- }
- }
- }
- }
-
- def main (args: Array[String]) {
- sender
- }
-}
diff --git a/test/pending/jvm/t2515.check b/test/pending/jvm/t2515.check
deleted file mode 100644
index 8cb8bde11e..0000000000
--- a/test/pending/jvm/t2515.check
+++ /dev/null
@@ -1,10 +0,0 @@
-Iteration 1 succeeded
-Iteration 2 succeeded
-Iteration 3 succeeded
-Iteration 4 succeeded
-Iteration 5 succeeded
-Iteration 6 succeeded
-Iteration 7 succeeded
-Iteration 8 succeeded
-Iteration 9 succeeded
-Iteration 10 succeeded
diff --git a/test/pending/jvm/t2515.scala b/test/pending/jvm/t2515.scala
deleted file mode 100644
index ee655967f3..0000000000
--- a/test/pending/jvm/t2515.scala
+++ /dev/null
@@ -1,43 +0,0 @@
-import scala.actors.{Futures, TIMEOUT}
-import scala.actors.Actor._
-
-object Test {
-
- def compute(): Option[Boolean] = {
- val fts = for (j <- 0 until 5) yield Futures.future {
- receiveWithin (100) {
- case TIMEOUT => true
- case other => false
- }
- }
- val done = Futures.awaitAll(2000, fts.toArray: _*) // list to array, as varargs
- if (done.contains(None))
- None
- else
- Some(true)
- }
-
- def main(args:Array[String]) : Unit = {
- val ft = Futures.future {
- val format = new java.text.DecimalFormat("000.00'ms'")
- var iter = 1
- val done = 11
- while (iter < done) {
- val start = System.nanoTime()
- val result = compute()
- val time = System.nanoTime() - start
- result match {
- case Some(result) =>
- //printf("Iteration %2d succeeded after %s %n", iter, format.format(time / 1e6))
- printf("Iteration %2d succeeded%n", iter)
- iter += 1
- case None =>
- printf(">>>> Iteration %2d failed after %s <<<<< %n", iter, format.format(time / 1e6))
- iter = done
- }
- }
- }
- ft()
- }
-
-}
diff --git a/test/pending/jvm/terminateLinked.check b/test/pending/jvm/terminateLinked.check
deleted file mode 100644
index a965a70ed4..0000000000
--- a/test/pending/jvm/terminateLinked.check
+++ /dev/null
@@ -1 +0,0 @@
-Done
diff --git a/test/pending/jvm/terminateLinked.scala b/test/pending/jvm/terminateLinked.scala
deleted file mode 100644
index 2a3b7fb49e..0000000000
--- a/test/pending/jvm/terminateLinked.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-import scala.actors.Actor
-import Actor._
-
-object Test {
- def main(args: Array[String]) {
- val a = actor {
- for (_ <- 1 to 10)
- receive {
- case b: Actor => link(b)
- }
- throw new Exception
- }
-
- for (_ <- 1 to 10)
- actor {
- a ! self
- react {
- case _ =>
- }
- }
-
- println("Done")
- }
-}
diff --git a/test/pending/jvm/timeout.check b/test/pending/jvm/timeout.check
deleted file mode 100644
index d86bac9de5..0000000000
--- a/test/pending/jvm/timeout.check
+++ /dev/null
@@ -1 +0,0 @@
-OK
diff --git a/test/pending/jvm/timeout.scala b/test/pending/jvm/timeout.scala
deleted file mode 100644
index 8f29f8ddbe..0000000000
--- a/test/pending/jvm/timeout.scala
+++ /dev/null
@@ -1,38 +0,0 @@
-// Test is in pending because although it succeeds locally,
-// it takes too long on the machine which runs nightly tests.
-//
-// [partest] EXPECTED: 100 < x < 900
-// [partest] ACTUAL: 1519
-
-import scala.actors.Actor._
-import scala.actors.TIMEOUT
-
-object Test extends Application {
- case class Timing(time: Long)
-
- actor {
- val a = actor {
- react {
- case 'doTiming =>
- val s = sender
- reactWithin(500) {
- case TIMEOUT =>
- s ! Timing(System.currentTimeMillis)
- }
- }
- }
-
- val start = System.currentTimeMillis
- (a !? 'doTiming) match {
- case Timing(end) =>
- val delay = end - start
-
- if (delay > 100 && delay < 900)
- println("OK")
- else {
- println("EXPECTED: 100 < x < 900")
- println("ACTUAL: "+delay)
- }
- }
- }
-}
diff --git a/test/files/run/private-inline.check b/test/pending/run/private-inline.check
index e71aec2fcf..e71aec2fcf 100644
--- a/test/files/run/private-inline.check
+++ b/test/pending/run/private-inline.check
diff --git a/test/files/run/private-inline.flags b/test/pending/run/private-inline.flags
index c550fdce16..c550fdce16 100644
--- a/test/files/run/private-inline.flags
+++ b/test/pending/run/private-inline.flags
diff --git a/test/files/run/private-inline.scala b/test/pending/run/private-inline.scala
index 60fef9efca..60fef9efca 100644
--- a/test/files/run/private-inline.scala
+++ b/test/pending/run/private-inline.scala
diff --git a/test/pending/run/t5698/client.scala b/test/pending/run/t5698/client.scala
deleted file mode 100644
index de672c1809..0000000000
--- a/test/pending/run/t5698/client.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-package client
-
-
-
-object Client extends App {
- val peer = actors.remote.Node("localhost", 23456)
- val a = actors.remote.RemoteActor.select(peer, 'test)
- a ! server.TestMsg
-}
diff --git a/test/pending/run/t5698/server.scala b/test/pending/run/t5698/server.scala
deleted file mode 100644
index e8f3cea225..0000000000
--- a/test/pending/run/t5698/server.scala
+++ /dev/null
@@ -1,22 +0,0 @@
-package server
-
-
-
-object Server extends App {
-
- class ServerActor extends actors.Actor {
- def act() {
- actors.remote.RemoteActor.alive(23456)
- actors.remote.RemoteActor.register('test, actors.Actor.self)
- loop {
- react {
- case TestMsg => println("Yay!")
- }
- }
- }
- }
-
- val a = new ServerActor
- a.start()
-
-}
diff --git a/test/pending/run/t5698/testmsg.scala b/test/pending/run/t5698/testmsg.scala
deleted file mode 100644
index 004ff0b8c7..0000000000
--- a/test/pending/run/t5698/testmsg.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-package server
-
-
-
-case object TestMsg
diff --git a/test/scaladoc/run/t7905.check b/test/scaladoc/run/t7905.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/t7905.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/t7905.scala b/test/scaladoc/run/t7905.scala
new file mode 100644
index 0000000000..8570724470
--- /dev/null
+++ b/test/scaladoc/run/t7905.scala
@@ -0,0 +1,36 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+
+object Test extends ScaladocModelTest {
+ override def code = """
+ object A {
+ val foo = new B {
+ val bar = new C {
+ val baz: A.this.type = A.this
+ }
+ }
+ }
+
+ trait B {
+ type E = bar.D
+
+ val bar: C
+ }
+
+ trait C {
+ trait D
+ }
+
+ trait G {
+ type F = A.foo.E
+
+ def m(f: F) = f match {
+ case _: A.foo.bar.D => // error here
+ }
+ }
+ """
+
+ def scaladocSettings = ""
+
+ def testModel(root: Package) = ()
+}
diff --git a/test/scaladoc/scalacheck/HtmlFactoryTest.scala b/test/scaladoc/scalacheck/HtmlFactoryTest.scala
index 578e0382eb..913667b79b 100644
--- a/test/scaladoc/scalacheck/HtmlFactoryTest.scala
+++ b/test/scaladoc/scalacheck/HtmlFactoryTest.scala
@@ -779,6 +779,11 @@ object Test extends Properties("HtmlFactory") {
linkElement \@ "href" == expectedUrl && linkElement \@ "target" == "_top"
}
+ def assertValuesLink(memberName: String, expectedUrl: String): Boolean = {
+ val linkElement: NodeSeq = node \\ "div" \@ ("class", "values members") \\ "li" \@ ("name", memberName) \\ "span" \@ ("class", "permalink") \ "a"
+ linkElement \@ "href" == expectedUrl && linkElement \@ "target" == "_top"
+ }
+
}
val files = createTemplates("SI-8144.scala")
@@ -791,12 +796,12 @@ object Test extends Properties("HtmlFactory") {
property("SI-8144: Members' permalink - package") = check("some/package.html") { node =>
("type link" |: node.assertTypeLink("../index.html#some.package")) &&
- ("member: some.pack" |: node.assertMemberLink("values")("some.pack", "../index.html#some.package@pack"))
+ ("member: some.pack" |: node.assertValuesLink("some.pack", "../index.html#some.package@pack"))
}
property("SI-8144: Members' permalink - inner package") = check("some/pack/package.html") { node =>
("type link" |: node.assertTypeLink("../../index.html#some.pack.package")) &&
- ("member: SomeType (object)" |: node.assertMemberLink("values")("some.pack.SomeType", "../../index.html#some.pack.package@SomeType")) &&
+ ("member: SomeType (object)" |: node.assertValuesLink("some.pack.SomeType", "../../index.html#some.pack.package@SomeType")) &&
("member: SomeType (class)" |: node.assertMemberLink("types")("some.pack.SomeType", "../../index.html#some.pack.package@SomeTypeextendsAnyRef"))
}
@@ -809,8 +814,8 @@ object Test extends Properties("HtmlFactory") {
("type link" |: node.assertTypeLink("../../index.html#some.pack.SomeType")) &&
("constructor " |: node.assertMemberLink("constructors")("some.pack.SomeType#<init>", "../../index.html#some.pack.SomeType@<init>(arg:String):some.pack.SomeType")) &&
( "member: type TypeAlias" |: node.assertMemberLink("types")("some.pack.SomeType.TypeAlias", "../../index.html#some.pack.SomeType@TypeAlias=String")) &&
- ( "member: def >#<():Int " |: node.assertMemberLink("values")("some.pack.SomeType#>#<", "../../index.html#some.pack.SomeType@>#<():Int")) &&
- ( "member: def >@<():TypeAlias " |: node.assertMemberLink("values")("some.pack.SomeType#>@<", "../../index.html#some.pack.SomeType@>@<():SomeType.this.TypeAlias"))
+ ( "member: def >#<():Int " |: node.assertValuesLink("some.pack.SomeType#>#<", "../../index.html#some.pack.SomeType@>#<():Int")) &&
+ ( "member: def >@<():TypeAlias " |: node.assertValuesLink("some.pack.SomeType#>@<", "../../index.html#some.pack.SomeType@>@<():SomeType.this.TypeAlias"))
}
}
diff --git a/versions.properties b/versions.properties
index 529365c9f9..9f8031d3ba 100644
--- a/versions.properties
+++ b/versions.properties
@@ -1,14 +1,14 @@
-#Wed, 23 Jul 2014 08:37:26 +0200
+#Fri, 01 May 2015 16:27:16 +0000
# NOTE: this file determines the content of the scala-distribution
# via scala-dist-pom.xml and scala-library-all-pom.xml
# when adding new properties that influence a release,
# also add them to the update.versions mechanism in build.xml,
# which is used by the release script scripts/jobs/integrate/bootstrap
-# The scala version used for boostrapping. This has no impact on the final classfiles:
+# The scala version used for bootstrapping. This has no impact on the final classfiles:
# there are two stages (locker and quick), so compiler and library are always built
# with themselves. Stability is ensured by building a third stage (strap).
-starr.version=2.11.7
+starr.version=2.12.0-M2
# These are the versions of the modules that go with this release.
# These properties are used during PR validation and in dbuild builds.
@@ -18,25 +18,19 @@ starr.version=2.11.7
# It has to be set in the following way:
# - After 2.x.0 is released, the binary version is 2.x.
# - During milestones and RCs, modules are cross-built against the full version.
-# So the value is the full version (e.g. 2.12.0-M1).
-scala.binary.version=2.11
-# e.g. 2.11.0-RC1, 2.11.0, 2.11.1-RC1, 2.11.1
-# this defines the dependency on scala-continuations-plugin in scala-dist's pom
-scala.full.version=2.11.7
+# So the value is the full version (e.g. 2.12.0-M2).
+scala.binary.version=2.12.0-M2
# external modules shipped with distribution, as specified by scala-library-all's pom
-scala-xml.version.number=1.0.4
+scala-xml.version.number=1.0.5
scala-parser-combinators.version.number=1.0.4
-scala-continuations-plugin.version.number=1.0.2
-scala-continuations-library.version.number=1.0.2
-scala-swing.version.number=1.0.2
-akka-actor.version.number=2.3.10
-actors-migration.version.number=1.1.0
+scala-swing.version.number=2.0.0-M2
+scala-swing.version.osgi=2.0.0.M2
jline.version=2.12.1
scala-asm.version=5.0.4-scala-2
# external modules, used internally (not shipped)
-partest.version.number=1.0.7
+partest.version.number=1.0.9
scalacheck.version.number=1.11.6
# TODO: modularize the compiler