summaryrefslogtreecommitdiff
path: root/src/actors
Commit message (Collapse)AuthorAgeFilesLines
* Remove scala.actors and the actors migration module dependencyLukas Rytz2015-04-2390-17766/+0
|
* Fix many typos in docs and commentsmpociecha2014-12-146-7/+7
| | | | | | | | | | | | | This commit corrects many typos found in scaladocs, comments and documentation. It should reduce a bit number of PRs which fix one typo. There are no changes in the 'real' code except one corrected name of a JUnit test method and some error messages in exceptions. In the case of typos in other method or field names etc., I just skipped them. Obviously this commit doesn't fix all existing typos. I just generated in IntelliJ the list of potential typos and looked through it quickly.
* deprecate Pair and TripleDen Shabalin2013-11-205-19/+19
|
* SI-7886 unsoundness in pattern matcher.Paul Phillips2013-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I tracked down what was behind the issue described here: // TODO: fix the illegal type bound in pos/t602 -- type inference // messes up before we get here: /*override def equals(x$1: Any): Boolean = ... // Span[Any] --> Any is not a legal type argument for Span! val o5: Option[com.mosol.sl.Span[Any]] = */ ...which led straight to the unsoundness seen in neg/t7886. It is dangerous to have an expected type of "Any" because the type system will blithely ignore kind errors, since "Any" can absorb anything. The consequence in this instance was that inferring the case constructor for a type like Foo[T <: Bound] if done with expected type Any, this would come up with Foo[Any]. I altered it to use expected type Foo[T], which lets the dummy type parameter survive to carry the bound forward and restores sense to the inference. The before/after output for -Xprint:patmat on pos/t602.scala is: 15c15 < if (x1.isInstanceOf[com.mosol.sl.Span[Any]]) --- > if (x1.isInstanceOf[com.mosol.sl.Span[K]]) 17c17 < <synthetic> val x2: com.mosol.sl.Span[Any] = \ (x1.asInstanceOf[com.mosol.sl.Span[Any]]: com.mosol.sl.Span[Any]); --- > <synthetic> val x2: com.mosol.sl.Span[K] = \ (x1.asInstanceOf[com.mosol.sl.Span[K]]: com.mosol.sl.Span[K]); 19,20c19,20 < val low$0: Option[Any] = x2.low; < val high$0: Option[Any] = x2.high; --- > val low$0: Option[K] = x2.low; > val high$0: Option[K] = x2.high; A file in the library depended (needlessly) on the unsoundness. It was easy to fix but reminds us this may affect existing code.
* Cull extraneous whitespace.Paul Phillips2013-09-183-4/+0
| | | | | | | | | | | | | | | | | | | | | One last flurry with the broom before I leave you slobs to code in your own filth. Eliminated all the trailing whitespace I could manage, with special prejudice reserved for the test cases which depended on the preservation of trailing whitespace. Was reminded I cannot figure out how to eliminate the trailing space on the "scala> " prompt in repl transcripts. At least reduced the number of such empty prompts by trimming transcript code on the way in. Routed ConsoleReporter's "printMessage" through a trailing whitespace stripping method which might help futureproof against the future of whitespace diseases. Deleted the up-to-40 lines of trailing whitespace found in various library files. It seems like only yesterday we performed whitespace surgery on the whole repo. Clearly it doesn't stick very well. I suggest it would work better to enforce a few requirements on the way in.
* SI-7624 Fix a few remaining -Xlint warnings ...Simon Ochsenreither2013-08-152-2/+1
| | | | | in various places. This includes actors, compiler (mostly some new macro parts) continuations, partest, scaladoc, scalap.
* Merge branch 'pr/merge-2.10.2' into masterPaul Phillips2013-06-041-4/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pr/merge-2.10.2: SI-7375 ClassTag for value class aliases SI-7507 Fix lookup of private[this] member in presence of self type. SI-7532 Fix regression in Java inner classfile reader SI-7517 Fix higher kinded type inference regression SI-7516 Revert "SI-7234 Make named args play nice w. depmet types" A test case for a recent LUB progression. SI-7421 remove unneeded extra-attachement in maven deploy SI-7486 Regressions in implicit search. SI-7509 Avoid crasher as erronous args flow through NamesDefaults SI-6138 Centralize and refine detection of `getClass` calls SI-7497 Fix scala.util.Properties.isMac SI-7473 Bad for expr crashes postfix Increase build.number to 2.10.3 SI-7391 Always use ForkJoin in Scala actors on ... ... Java 6 and above (except when the porperty actors.enableForkJoin says otherwise) Reimplementing much of the DefaultPromise methods Optimizations: 1) Avoiding to call 'synchronized' in tryComplete and in tryAwait 2) Implementing blocking by using an optimized latch so no blocking ops for non-blockers 3) Reducing method size of isCompleted to be cheaper to inline 4) 'result' to use Try.get instead of patmat c.typeCheck(silent = true) now suppresses ambiguous errors Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/reflect/macros/contexts/Typers.scala src/compiler/scala/reflect/reify/package.scala src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/compiler/scala/tools/reflect/ToolBoxFactory.scala src/library/scala/concurrent/impl/Promise.scala src/reflect/scala/reflect/internal/Types.scala
| * SI-7391 Always use ForkJoin in Scala actors on ...Simon Ochsenreither2013-05-201-4/+1
| | | | | | | | | | | | | | | | | | | | | | ... Java 6 and above (except when the porperty actors.enableForkJoin says otherwise) Like SI-7236 and SI-7237, the logic in scala.actors.scheduler.ThreadPoolConfig.useForkJoin (which resulted in a different thread pool implementation being chosen) was causing random hangs in the test concurrent-stream.scala when running on Avian.
* | Make all numeric coercions explicit.Paul Phillips2013-05-273-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Optimistically, this is preparation for a day when we don't let numeric types drift with the winds. Even without the optimism it's a good idea. It flushed out an undocumented change in the math package object relative to the methods being forwarded (a type is widened from what is returned in java) so I documented the intentionality of it. Managing type coercions manually is a bit tedious, no doubt, but it's not tedious enough to warrant abandoning type safety just because java did it.
* | Merge v2.10.1-326-g4f8c306' into merge/v2.10.1-326-g4f8c306-to-masterJason Zaugg2013-05-1730-3/+39
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ================================================================ Merge commit 'v2.10.1-326-g4f8c306' into merge/v2.10.1-326-g4f8c306-to-master Conflicts: src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala src/reflect/scala/reflect/runtime/JavaMirrors.scala ================================================================ Merge -s ours 4e64a27 ([nomaster commit range]) ================================================================ Merge commit '0ae7e55' into merge/v2.10.1-326-g4f8c306-to-master Conflicts: src/compiler/scala/tools/nsc/typechecker/Macros.scala
| * SI-6807 Deprecating the Actors library.Vojin Jovanovic2013-02-0730-2/+38
| | | | | | | | | | | | | | | | All public classes, traits and objects marked as deprecated. Added deprecation note on the package object. Embedded external libraries (ThreadPool etc.) are not deprecated as they are intended for internal use only. Review by: @phaller
| * Merge commit 'refs/pull/1574/head' into merge-210Paul Phillips2012-11-0545-124/+50
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'refs/pull/1574/head': (24 commits) Fixing issue where OSGi bundles weren't getting used for distribution. Fixes example in Type.asSeenFrom Fix for SI-6600, regression with ScalaNumber. SI-6562 Fix crash with class nested in @inline method Brings copyrights in Scaladoc footer and manpage up-to-date, from 2011/12 to 2013 Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013 SI-6606 Drops new icons in, replaces abstract types placeholder icons SI-6132 Revisited, cleaned-up, links fixed, spelling errors fixed, rewordings Labeling scala.reflect and scala.reflect.macros experimental in the API docs Typo-fix in scala.concurrent.Future, thanks to @pavelpavlov Remove implementation details from Position (they are still under reflection.internal). It probably needs more cleanup of the api wrt to ranges etc but let's leave it for later SI-6399 Adds API docs for Any and AnyVal Removing actors-migration from main repository so it can live on elsewhere. Fix for SI-6597, implicit case class crasher. SI-6578 Harden against synthetics being added more than once. SI-6556 no assert for surprising ctor result type Removing actors-migration from main repository so it can live on elsewhere. Fixes SI-6500 by making erasure more regular. Modification to SI-6534 patch. Fixes SI-6559 - StringContext not using passed in escape function. ... Conflicts: src/actors-migration/scala/actors/migration/StashingActor.scala src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala src/compiler/scala/tools/nsc/settings/AestheticSettings.scala src/compiler/scala/tools/nsc/transform/Erasure.scala src/library/scala/Application.scala src/library/scala/collection/immutable/GenIterable.scala.disabled src/library/scala/collection/immutable/GenMap.scala.disabled src/library/scala/collection/immutable/GenSeq.scala.disabled src/library/scala/collection/immutable/GenSet.scala.disabled src/library/scala/collection/immutable/GenTraversable.scala.disabled src/library/scala/collection/mutable/GenIterable.scala.disabled src/library/scala/collection/mutable/GenMap.scala.disabled src/library/scala/collection/mutable/GenSeq.scala.disabled src/library/scala/collection/mutable/GenSet.scala.disabled src/library/scala/collection/mutable/GenTraversable.scala.disabled src/library/scala/collection/parallel/immutable/ParNumericRange.scala.disabled
| * | Removing unused locals and making vars into vals.Paul Phillips2012-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to "git diff" the difference from master to this commit includes: Minus: 112 vals, 135 vars Plus: 165 vals, 2 vars Assuming all the removed ones were vals, which is true from 10K feet, it suggests I removed 80 unused vals and turned 133 vars into vals. There are a few other -Xlint driven improvements bundled with this, like putting double-parentheses around Some((x, y)) so it doesn't trigger the "adapting argument list" warning.
* | | SI-5734 Allow setting of socket timeout for remote actorsMartin McNulty2013-05-031-2/+27
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | TcpService is locked while connections are being established, preventing messages being sent to remote nodes. There was no way to specify a connect timeout, so the service was waiting for a ConnectException to be thrown if the remote node was unavailable (which can take several minutes). Added a system property to allow setting a socket connect timeout to prevent the TcpService from being locked for minutes at a time. Default behaviour is unchanged, all tests pass and the patch has been running in production without issue.
* | Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-0244-44/+44
| |
* | Removing actors-migration from main repository so it can live on elsewhere.Josh Suereth2012-11-011-74/+0
| | | | | | | | | | | | | | * Removes actors-migration hooks from partest * Removes actors-migration code * removes actors-migration tests * removes actors-migration distribution packaging.
* | SI-6581 fixed by inlining `Actor.self`.Vojin Jovanovic2012-10-302-6/+6
|/ | | | | | This avoids the necessary type cast that was preventing leakage of internal migration classes. Review by @phaller
* SI-6449 Adds version arg to @deprecated usages (non-compiler sources)Simon Ochsenreither2012-09-291-1/+1
|
* Support for scala.concurrent for the ActorRef.Vojin Jovanovic2012-09-251-8/+15
| | | | Review by @phaller
* move Duration (incl. DSL) into scala.concurrent.duration packageRoland2012-09-191-1/+1
| | | | | | | | | so that the full package can be imported naturally: import scala.concurrent.duration._ will give you all the types (Duration, FiniteDuration, Deadline) and the DSL for constructing these.
* More relative path elimination.Paul Phillips2012-09-151-1/+1
| | | | | | | | | | | | | | | | Some names I missed in 55b609458fd . How one might know when one is done: mkdir scratch && cd scratch mkdir annotation beans collection compat concurrent io \ math parallel ref reflect runtime scala sys testing \ text tools util xml scalac $(find ../src/library -name '*.scala') Until recently that would fail with about a billion errors. When it compiles, that's when you're done. And that's where this commit takes us, for src/library at least.
* Eliminate breaking relative names in source.Paul Phillips2012-09-147-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These things are killing me. Constructions like package scala.foo.bar.baz import foo.Other DO NOT WORK in general. Such files are not really in the "scala" package, because it is not declared package scala package foo.bar.baz And there is a second problem: using a relative path name means compilation will fail in the presence of a directory of the same name, e.g. % mkdir reflect % scalac src/reflect/scala/reflect/internal/util/Position.scala src/reflect/scala/reflect/internal/util/Position.scala:9: error: object ClassTag is not a member of package reflect import reflect.ClassTag ^ src/reflect/scala/reflect/internal/util/Position.scala:10: error: object base is not a member of package reflect import reflect.base.Attachments ^ As a rule, do not use relative package paths unless you have explicitly imported the path to which you think you are relative. Better yet, don't use them at all. Unfortunately they mostly work because scala variously thinks everything scala.* is in the scala package and/or because you usually aren't bootstrapping and it falls through to an existing version of the class already on the classpath. Making the paths explicit is not a complete solution - in particular, we remain enormously vulnerable to any directory or package called "scala" which isn't ours - but it greatly limts the severity of the problem.
* Eliminated all the current feature warnings.Paul Phillips2012-07-276-5/+9
| | | | This pretty much takes us down to deprecation and inliner warnings.
* Minor fixes for the Actor Migration KitVojin Jovanovic2012-05-231-5/+2
| | | | | | | Fixed behavior of the StashingActor in case of unhandeled message. Fixed a typo in deprecated annotation. Fixed comments. Fixed copyright.
* Adding the Actor Migration Kit.Vojin Jovanovic2012-05-185-11/+186
| | | | | | | | | | | | Kit consists of: 1) The StashingActor which adopts an interface similar to Akka. 2) Props mockup for creating Akka like code 3) Pattern mockup 4) Test cases for every step in the migration. 5) MigrationSystem which will paired on the Akka side. Review of the code : @phaller Review of the build: @jsuereth
* Small documentation fixes & small fix to Scaladoc @see formattingHeather Miller2012-05-151-1/+1
|
* a fast, functional PartialFunction implementationPavel Pavlov2012-03-303-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | runtime.AbstractPartialFunction provides a default implementation for the new-style partial function. In principle this class is only subclassed by compiler-generated partial functions arising from matches. Either - the apply method (old-style partialfun) or - the applyOrElse method (current scheme) must be overridden, and the isDefinedAt method implemented. The applyOrElse method implementation is provided to ease the transition from the old scheme, since starr still generates old-style PartialFunctions, but locker's library has the new AbstractPartialFunction. Thus, this implementation is intended as a drop-in replacement for the old partial function, and does not require changes to the compiler. (compiler patches, both for old and new-style pattern matching, follow) - runtime.AbstractPartialFunction is based on PartialFunction.WithDefault Original version of FunctionWithDefault by Odersky (http://article.gmane.org/gmane.comp.lang.scala.internals/4032) - better performance for OrElse#applyOrElse, OrElse#lift, PF.cond - new combinator methods: PF#run, PF#runWith, PF.apply authored by @pavelpavlov, refactored by @adriaanm, review by @paulp
* Prepared actors hierarchy for migration.Vojin Jovanovic2012-03-2014-646/+702
| | | | | | Internal nodes added so methods relevant to akka can be overridden. Review by: @phaller
* Added updated ForkJoinPool, w/ necessary updates to Scala Actors.Heather Miller2012-02-252-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes Doug Lea's updates to ForkJoinPool, as of January 25th, 2012. Details of the changes and performance improvements available at: http://markmail.org/message/323vxzn6irkk5yrg. The ForkJoinPool used in this commit comes from the most recent JSR166y. Additionally, also included are minimal changes to parts of the Scala Actors library which interface with the ForkJoinPool, as the ForkJoinPool's interface has changed (prior to the release of Java 7) since we last updated it for the Scala 2.8 release. Of note- this is part of the planned overhaul of scala.concurrent, and corresponds to ticket SI-5523. For testing this was built on JDK 1.6, and passes all tests on both JDK 1.5 and 1.6. A new forkjoin.jar is necessary prior to applying these changes. Using this source, the new jar can be built by running: ant newforkjoin forkjoin.done This creates a new forkjoin.jar in build/libs/. It must replace lib/forkjoin.jar.
* Changed shadowed constructor parameter names.Paul Phillips2011-12-072-6/+20
| | | | | | | | | | | | | | | | | One of my more recent warnings tells us this a bunch of places if we compile with -Xlint, one example: scala/actors/ReplyReactorTask.scala:26: warning: private[this] value reactor in class ReplyReactorTask shadows mutable reactor inherited from class ReactorTask. Changes to reactor will not be visible within class ReplyReactorTask - you may want to give them distinct names. In some cases (like that one) I was not confident whether the shadowing was intentional, in which case I left the semantics but changed the name anyway because it will be eternally confusing otherwise. Review by @phaller.
* Fast PartialFunction # orElse.Martin Odersky2011-11-243-3/+3
|
* Changes the fork join pool detection for JVM1.7...Aleksandar Pokopec2011-11-111-1/+1
| | | | | | | | Changes the fork join pool detection for JVM1.7, for actors and parallel collections libraries. Review by phaller.
* AbstractPartialFunction.Paul Phillips2011-10-193-4/+3
| | | | | | | | | | | | | | | | | | | | | | | Contributed by Todd Vierling with minor mods by extempore. This is an obvious extension of AbstractFunctionN which I had some issue making work at the time. Sounds kind of pitiful given that the compiler patch is about two lines, but let's all agree to believe it was a different world then. This example program is impacted as follows: class A { def f: PartialFunction[Any, Int] = { case x: String => 1 } def g: PartialFunction[Any, Int] = f orElse { case x: List[_] => 2 } def h: PartialFunction[Any, Int] = g orElse { case x: Set[_] => 3 } } Before: 34943 bytes of bytecode After: 4217 bytes of bytecode A mere 88% reduction in size. "'Tis but a trifle!" Closes SI-5096, SI-5097.
* Removing the code which has been deprecated sin...Paul Phillips2011-08-154-62/+0
| | | | | | | Removing the code which has been deprecated since 2.8.0. Contributed by Simon Ochsenreither, although deleting code is such fun one hesitates to call it a contribution. Still, we will. Closes SI-4860, no review.
* Rename a file to celebrate our glorious ant ove...Paul Phillips2011-08-011-0/+0
| | | | | Rename a file to celebrate our glorious ant overlords, no review.
* Following up on things that -Xlint told me, som...Paul Phillips2011-07-291-3/+7
| | | | | | | | | | | | | | | Following up on things that -Xlint told me, sometimes because Mr. Linty was being sensible and other times just to shut him up so we can hear better in the future. - made xml.Equality public because it occurs in public method signatures - made some actor classes with inaccessible-unoverridable methods final - eliminated a bunch of "dead code follows" warnings by deleting the dead code which really did follow - improved the reliability of warnings about inaccessible types For the changes in actors, review by phaller.
* Added two new compiler options:Paul Phillips2011-07-291-1/+3
| | | | | | | | | | | | | | | -Ywarn-adapted-args // also included in -Xlint -Yno-adapted-args The former warns when a () is inserted or an argument list is implicitly tupled. The latter errors under the same conditions. Using these options I found several bugs in the distribution which would otherwise be nearly impossible to spot. These bugs were innocuous (I think) but similar bugs could easily be (and have been) otherwise. Certain particularly threatening scenarios are at minimum warned about regardless of options given. Closes SI-4851, no review.
* Removed classes and methods deprecated before 2.8.Paul Phillips2011-07-165-61/+3
| | | | | Contributed by Simon Ochsenreither.
* 3rd round of clean ups (see r25285, r25292)michelou2011-07-1515-244/+176
|
* Adding some Sets/Maps to perRunCaches, and elim...Paul Phillips2011-07-146-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Adding some Sets/Maps to perRunCaches, and eliminating ambiguously named imports. Did a tour of the compiler adding a few longer-lived mutable structures to the per-run cache clearing mechanism. Some of these were not a big threat, but there is (almost) literally no cost to tracking them and the fewer mutable structures which are created "lone wolf style" the easier it is to spot the one playing by his own rules. While I was at it I followed through on long held ambition to eliminate the importing of highly ambiguous names like "Map" and "HashSet" from the mutable and immutable packages. I didn't quite manage elimination but it's pretty close. Something potentially as pernicious which I didn't do much about is this import: import scala.collection._ Imagine coming across that one on lines 407 and 474 of a 1271 file. That's not cool. Some poor future programmer will be on line 1100 and use "Map[A, B]" in some function and only after the product has shipped will it be discovered that the signature is wrong and the rocket will now be crashing into the mountainside straightaway. No review.
* Fixes SI-4759Philipp Haller2011-07-071-10/+17
|
* I wrote a warning when nullary methods return U...Paul Phillips2011-04-284-6/+6
| | | | | | | | | | | | | | | I wrote a warning when nullary methods return Unit. I wimped out of including it in this patch because we had about 200 of them, and that's what is fixed in this patch. I will add the warning to some kind of "-Xlint" feature after 2.9. This is motivated at least partly by the resolution of #4506, which indicates the distinction between "def foo()" and "def foo" will continue to jab its pointy stick into our eyes, so I believe we have a minimal duty of at least following our own advice about what they mean and not making a semirandom choice as to whether a method has parens or not. Review by community.
* Updated a bunch of @deprecated annotations to h...Paul Phillips2011-04-241-1/+1
| | | | | Updated a bunch of @deprecated annotations to have a version, no review.
* Various addenda to soc's patch: regenerating Pr...Paul Phillips2011-04-141-1/+1
| | | | | | | Various addenda to soc's patch: regenerating Product/Tuple/Function classes and AnyVal sources, making versioning consistent, etc. Closes #4477, no review.
* Adds "since" field to @deprecated.Paul Phillips2011-04-149-22/+22
| | | | | | for the patch, as it's a change I've always wanted. Moving up in the glamorous world of scala commits! No review.
* Closed #4454.Philipp Haller2011-04-141-2/+3
|
* Removed uniqueness annotations. Review by rytz.Philipp Haller2011-03-172-11/+7
|
* Closes #3838. Review by prokopec.Philipp Haller2011-03-151-12/+15
|
* Applying davetron5000's actors docs patches.Aleksandar Pokopec2011-02-1520-88/+109
| | | | | Review by phaller.
* workaround for see #3936, allows building every...Lukas Rytz2011-01-262-2/+2
| | | | | | workaround for see #3936, allows building everything inside intellij. no review