summaryrefslogtreecommitdiff
path: root/test/files/jvm
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2015-01-294-20/+25
|\ | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20150129 Conflicts: build.number src/library/scala/concurrent/Future.scala versions.properties
| * Construct ClassBTypes from parsed classfilesLukas Rytz2015-01-163-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This infrastructure is required for the inliner: when inlining code from a classfile, the corresponding ClassBType is needed for various things (eg access checks, InnerClass attribute). The test creates two ClassBTypes for the same class: once using the (unpickled) Symbol, once using the parsed ASM ClassNode, and verifies that the two are the same. There's a cleanup to the InnerClass attribute: object T { class Member; def foo = { class Local } } class T For Java compatibility the InnerClass entry for Member says the class is nested in T (not in the module class T$). We now make sure to add that entry only to T, not to T$ (unless Member is actually referenced in the classfile T$, in that case it will be added, as required).
| * SI-9044 Fix order of interfaces in classfilesLukas Rytz2014-12-181-0/+6
| | | | | | | | | | | | | | | | | | | | It was reversed since ced3ca8ae1. The reason is that the backend used `mixinClasses` to obtain the parents of a class, which returns them in linearization order. `mixinClasses` als returns all ancestors (not only direct parents), which means more work for `minimizeInterfaces`. This was introduced in cd62f52 for unclear reasons. So we switch back to using `parents`.
* | Merge commit '7ba38a0' into merge/2.11.x-to-2.12.x-20150129Jason Zaugg2015-01-292-5/+5
|\| | | | | | | | | | | | | | | Conflicts: build.number src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala src/library/scala/collection/Iterator.scala versions.properties
| * Fix lambda names under delambdafy:method in innerClassAttribute testLukas Rytz2014-10-101-3/+3
| | | | | | | | This should have been done in 63207e1
| * Update check files for -Ydelambdafy:methodLukas Rytz2014-10-101-2/+2
| | | | | | | | Should have been done in 63207e1.
* | Add missing canonical combinators:Viktor Klang2014-10-205-2/+400
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `def transform[S](f: Try[T] => Try[S])(implicit executor: ExecutionContext): Future[S]` - `def transformWith[S](f: Try[T] => Future[S])(implicit executor: ExecutionContext): Future[S]` - `def flatten[S](implicit ev: T <:< Future[S]): Future[S]` - `def zipWith[U, R](that: Future[U])(f: (T, U) => R)(implicit executor: ExecutionContext): Future[R]` Add missing utilities: - `val unit: Future[Unit]` in `object Future` - `object never extends Future[Nothing]` in `object Future` - `def defaultBlockContext: BlockContext` in `object BlockContext` - `def toString: String` on stdlib implementations of `Future` Refactors: - the `scala.concurrent.Future` trait to not explicit create any `Promises`, so that implementations can control implementation type, this is mainly facilitated through adding of the `transform` and `transformWith` methods. - the implementation of `ExecutionContextImpl` has been cleaned up - the `scala.concurrent.impl.DefaultPromise` has been reimplemented to not use `sun.misc.Unsafe` Securing: - Add a self-check in `completeWith` and `tryCompleteWith` to avoid cycles in trait Promise - Capping the maximum number of threads for the global `ExecutionContext` to the max parallelism - Implementing (almost) all `Future` combinators on `transformWith` and `transform` means that `DefaultPromise` linking works on both `(flat)map` and `recover(With)` - Nested `blocking {}` should not spawn extra threads beyond the first. Removes: - the private `internalExecutor` method in favor of an import in trait `Future` - the private `internalExecutor` method in favor of an import in trait `Promise` - the `AtomicReferenceFieldUpdater` in `AbstractPromise` since we're using `Unsafe` - `scala.concurrent.impl.Future` is no longer needed Deprecates: - `Future.onSuccess` - discourage the use of callbacks (and is also redundant considering `foreach` and `onComplete`) - `Future.onFailure` - discourage the use of callbacks (and is also redundant considering `onComplete` and `failed.foreach`) - `ExecutionContext.prepare` - it was ill specced and it is too easy to forget to call it (or even know when to call it or call it more times than needed) - All classes in scala.concurrent.forkjoin. Scala 2.12 will be Java 8+ and as such the jsr166e should be used as included in java.util.concurrent. Reimplements: - `failed` - in terms of `transform` - `map` - in terms of `transform` - `flatMap` - in terms of `transformWith` - `recover` - in terms of `transform` - `recoverWith` - in terms of `transformWith` - `zip` - in terms of `flatMap` + `map` - `fallbackTo` - in terms of `recoverWith` + `recoverWith` - `andThen` - in terms of `transform` Miscellaneous: - Giving the threads of `ExecutionContext.global` sensible names - Optimizes `object Future.successful` and `object Future.failed` are now separate implementations, to optimize for the result, avoiding doing work for the "other branch". - Optimizes `compressedRoot()` by avoiding double-calls to volatile get. Documentation: - Almost all methods on `Future` and `Promise` have been revisited and had their ScalaDoc updated Tests: - Yes
* | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2014-09-173-6/+5
|\| | | | | | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20140917 Conflicts: build.xml The merge conflict was centred around the introduction of the build property `test.bc.skip`, and was straight forward to resolve.
| * SI-8568 unreachable test now passes in GenBCodeLukas Rytz2014-09-101-1/+0
| |
| * JUnit tests for dead code elimination.Lukas Rytz2014-09-102-5/+5
| | | | | | | | JUnit tests may use tools from partest-extras (ASMConverters)
* | Merge commit 'abd595d' into merge/2.11.x-to-2.12.x-20140915Jason Zaugg2014-09-161-1/+3
|\|
| * SI-8786 disable part of test that's failing the jdk8 buildLukas Rytz2014-09-041-1/+3
| |
* | Merge branch 'merge/2.10-to-2.11-sept-2' into ↵Lukas Rytz2014-09-027-39/+815
|\| | | | | | | | | | | | | merge/2.11-to-2.12-is-it-really-sept-2-already-where-was-summer Conflicts: versions.properties
| * Fix InnerClass / EnclosingMethod attributesLukas Rytz2014-09-017-39/+815
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit seems bigger than it is. Most of it is tests, and moving some code around. The actual changes are small, but a bit subtle. The InnerClass and EnclosingMethod attributes should now be close to the JVM spec (which is summarized in BTypes.scala). New tests make sure that changes to these attributes, and changes to the way Java reflection sees Scala classfiles, don't go unnoticed. A new file, BCodeAsmCommon, holds code that's shared between the two backend (it could hold more, future work). In general, the difficulty with emitting InnerClass / EnclosingMethod is that we need to find out source-level properties. We need to make sure to do enough phase-travelling, and work around destructive changes to the ownerchain in lambdalift (we use originalOwner a lot). The change to JavaMirrors is prompted by the change to the EnclosingMethod attribute, which changes Java reflection's answer to getEnclosingMethod and getEnclosingConstructor. Classes defined in field initializers no longer have an enclosing method, just an enclosing class, which broke an assumption in JavaMirrors. There's one change in erasure. Before this change, when an object declaration implements / overrides a method, and a bridge is required, then the bridge method was actually a ModuleSymbol (it would get the lateMETHOD flag and be emitted as a method anyway). This is confusing, when iterating through the members of a class, you can find two modules with the same name, and one of them doesn't have a module class. Now, such bridge methods will be MethodSymbols. Removed Symbol.originalEnclosingMethod, that is a backend thing and doesn't need to live in the symbol API.
* | Merge commit '47908f1' into ↵Lukas Rytz2014-09-026-3/+313
|\| | | | | | | | | | | | | merge/2.11-to-2.12-is-it-really-sept-2-already-where-was-summer Conflicts: src/library/scala/util/matching/Regex.scala
| * Merge pull request #3927 from lrytz/innerClassesTestLukas Rytz2014-08-123-0/+310
| |\ | | | | | | test for InnerClass and EnclosingMethod attributes
| | * test for InnerClass and EnclosingMethod attributesLukas Rytz2014-08-123-0/+310
| | | | | | | | | | | | | | | | | | Some parts of the test assert (current) buggy behavior. This is marked in the test file with TODO. It will be fixed in later work on the backend.
| * | SI-4563 friendlier behavior for Ctrl+D in the REPLAntoine Gourlay2014-07-293-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Closing the REPL with Ctrl+D does not issue a newline, so the user's prompt displays on the same line as the `scala>` prompt. This is bad. We now force a newline before closing the interpreter, and display `:quit` while we're at it so that people know how to exit the REPL (since `exit` doesn't exist anymore). The tricky part was to only add a newline when the console is interrupted, and *not* when it is closed by a command (like `:quit`), since commands are processed after their text (including newline) has been sent to the console.
* | Merge commit '01f2d27' into ↵Lukas Rytz2014-09-023-2/+4
|\| | | | | | | merge/2.11-to-2.12-is-it-really-sept-2-already-where-was-summer
| * SI-8743 Fix crasher with poly-methods annotated with @varargsJason Zaugg2014-07-233-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The code that generated the Java varargs forwarder was basing things on the `ValDef-s` of the parameters of the source method. But, their types refer to a type parameter skolems of the enclosing method, which led to a type mismatch when typechecking the forwarder. Instead, I've reworked the code to simply use the `DefDef`-s symbol's info, which *doesn't* refer to skolems. This actually simplifies the surrounding code somewhat; rather than repeated symbols in a map we can just time travel the pre-uncurry method signatures to figure out which params are releated.
* | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2014-07-143-3/+3
|\| | | | | | | merge/2.11.x-to-2.12.x-20140714
| * Merge pull request #3866 from Blaisorblade/issue/8677-backportLukas Rytz2014-07-091-0/+5
| |\ | | | | | | SI-8677 Duration: Zero - Inf should be MinusInf
| | * [backport] SI-8677 Duration: Zero - Inf should be MinusInfPaolo G. Giarrusso2014-07-041-0/+5
| | | | | | | | | | | | | | | Fixes #8677. Add basic tests. This is a backport from 2.12.x of dead39dc5f21c6eac41788e93426c50ddd398c24.
| * | Use countElementsAsString for summarized warnings.Adriaan Moors2014-07-043-3/+3
| |/
* | Merge pull request #3843 from Blaisorblade/topic/fix-minus-infAdriaan Moors2014-07-031-0/+5
|\ \ | | | | | | SI-8677 Duration: Zero - Inf should be MinusInf
| * | SI-8677 Duration: Zero - Inf should be MinusInfPaolo G. Giarrusso2014-06-281-0/+5
| | | | | | | | | | | | Fixes #8677. Add basic tests.
* | | Merge remote-tracking branch 'origin/2.11.x' into merge/2.11.x-2.12.x-20140627Jason Zaugg2014-06-275-6/+6
|\ \ \ | |/ / |/| / | |/
| * SI-8185 Correct grammar for single-warning compilation runFrançois Garillot2014-05-145-6/+6
| |
* | Merge branch '2.11.x' into 2.12.xLukas Rytz2014-05-226-0/+161
|\|
| * Move t8582 to test/files/jvmLukas Rytz2014-05-132-0/+125
| |
| * Fix BeanInfo generation for GenBCodeLukas Rytz2014-05-133-0/+32
|/
* Disable 'unreachable' test for GenBCodeLukas Rytz2014-05-081-0/+1
| | | | | | | | | | | | | GenICode has some logic to eliminate some dead code directly at code gen (introduced in b50a0d811f for SI-7006). This has not been ported over to GenBCode. GenBCode with the new optimizer (in Miguel's branch) also eliminates such dead code. Before adding such functionality to GenBCode I'd like to investigate the cost of running DCE. Maybe we can keep the code generator simple. I created SI-8568 to keep track of this.
* PR #3233 cleanupPavel Pavlov2014-02-051-1/+1
| | | | | - `::.head` became a `val`; excessive accessor removed - SerializationProxy moved to `object List`
* Merge pull request #3316 from Ichoran/topic/big-decimal-correctnessAdriaan Moors2014-01-151-1/+0
|\ | | | | Quasi-comprehensive BigDecimal soundness/correctness fix.
| * Quasi-comprehensive BigDecimal soundness/correctness fix.Rex Kerr2014-01-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes issues SI-6153, SI-6173, SI-6456, SI-6699, and SI-8116, along with a number of other similar possible issues. Relevant changes include * Changes to avoid heap explosion when working with BigInt - to isWhole - to hashCode - to equals - to BigInt's equals * Changes to enable equality matching hashCode - Only for sufficiently small BigInt - For identical values with different precision * Changes to isValidDouble - Takes precision into account now - New methods added to test whether even if the Double is not represented exactly, it's a representation of a certain type - New companion methods added to allow intended expansion of Double (binary/decimal difference) * Changes to constructor - Null arguments are not allowed (these can throw NPEs later at awkward/unexpected times) * New JUnit test to test all these things * Fixed existing tests to expect new behavior * Modified scaladocs to explain the issues * Deprecated problematic methods * Made application of MathContext more consistent (it is where you expect it and not where you don't) These changes are coordinated, for the most part, hence the monolithic commit.
* | SI-8035 Deprecate automatic () insertion in argument listsSimon Ochsenreither2014-01-095-142/+137
|/ | | | | | | | | | | | | This promotes the () insertion warning from -Ywarn-adapted-args to a deprecation warning. -Xfuture tunrs it into a compiler error. Auto tupling remains unchanged for now. The tests have been fixed the following way: - Warnings caused by general sloppiness (Try(), Future(), ...) have been fixed. - Warnings which raise interesting questions (x == (), ...) received an updated checkfile for now.
* Use t- prefix instead of si- prefix for test filesDen Shabalin2013-12-162-0/+0
|
* Merge commit '7d74884' into merge-2.10.x-to-masterJason Zaugg2013-12-062-4/+4
|\ | | | | | | | | Conflicts: test/files/jvm/scala-concurrent-tck.scala
| * SI-6913 Fixing semantics of Future fallbackTo to be according to docsHeather Miller2013-12-052-4/+4
| | | | | | | | Origin: viktorklang@1bbe854
* | SI-7999 s.u.c.NonFatal: StackOverflowError is fatalSimon Ochsenreither2013-11-221-2/+2
| | | | | | | | | | | | | | | | | | As demonstrated in https://groups.google.com/d/topic/scala-language/eC9dqTTBYHg, SOEs should be considered fatal, because all popular JVM implementations seem to run into inconsistent state (ignoring finally blocks leading to not running monitorExit, leading to locks not being unlocked, ...) if one just pushes them enough.
* | deprecate Pair and TripleDen Shabalin2013-11-201-1/+1
| |
* | SI-7958 Deprecate methods `future` and `promise` in the `scala.concurrent` ↵Philipp Haller2013-11-122-81/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | package object - The corresponding `apply` methods in the `Future` and `Promise` objects should be used instead. - Adjusted tests to use non-deprecated versions - Fixed doc comments not to use deprecated methods - Added comment about planned removal in 2.13.0
* | Collections library tidying and deprecation. Separate parts are listed below.Rex Kerr2013-11-073-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Collections library tidying, part one: scripting. Everything in scala.collection.scripting is deprecated now, along with the << method that is implemented in a few other classes. Scripting does not seem used at all, and anyone who did can easily write a wrapper that does the same thing. Deprecated *Proxy collections. The only place proxies were used in the library was in swing.ListView, and that was easy to change to a lazy val. Proxy itself is used in ScalaNumberProxy and such, so it was left undeprecated. Deprecated Synchronized* traits from collections. Synchronizability does not compose well, and it requires careful examination of every method (which has not actually been done). Places where the Scala codebase needs to be fixed (eventually) include: scala.reflect.internal.util.Statistics$QuantMap scala.tools.nsc.interactive.Global (several places) Deprecated LinkedList (including Double- and -Like variants). Interface is idiosyncratic and dangerously low-level. Although some low-level functionality of this sort would be useful, this doesn't seem to be the ideal implementation. Also deprecated the extractFirst method in Queue as it exposes LinkedList. Cannot shift internal representations away from LinkedList at this time because of that method. Deprecated non-finality of several toX collection methods. Improved documentation of most toX collection methods to describe what the expectation is for their behavior. Additionally deprecated overriding of - toIterator in IterableLike (should always forward to iterator) - toTraversable in TraversableLike (should always return self) - toIndexedSeq in immutable.IndexedSeq (should always return self) - toMap in immutable.Map (should always return self) - toSet in immutable.Set (should always return self) Did not do anything with IterableLike.toIterable or Seq/SeqLike.toSeq since for some odd reason immutable.Range overrides those. Deprecated Forwarders from collections. Forwarding, without an automatic mechanism to keep up to date with changes in the forwarded class, is inherently unreliable. Absent a mechanism to keep current, they're deprecated. ListBuffer is the only class in the collections library that uses forwarders, and that functionality can be rolled into ListBuffer itself. Deprecating immutable set/map adaptors. They're a bad idea (barring compiler support) for the same reason that all the other adaptors are a bad idea: they get out of date and probably have a variety of performance bugs. Deprecated inheritance from leaf classes in immutable collections. Inheriting from leaf-classes in immutable collections is rarely a good idea since whenever you use any interesting collections method you'll revert to the original class. Also, the methods are often designed to work with only particular behavior, and an override would be difficult (at best) to make work. Fortunately, people seem to have realized this and there are few to no cases of people extending PagedSeq and TreeSet and the like. Note that in many cases the classes will become sealed not final. Deprecated overriding of methods and inheritance from various mutable collections. Some mutable collections seem unsuited for overriding since to override anything interesting you would need vast knowledge of internal data structures and/or access to private methods. These include - ArrayBuilder.ofX classes. - ArrayOps - Some methods of BitSet (moved others from private to protected final) - Some methods of HashTable and FlatHashTable - Some methods of HashMap and HashSet (esp += and -= which just forward) - Some methods of other maps and sets (LinkedHashX, ListMap, TreeSet) - PriorityQueue - UnrolledBuffer This is a somewhat aggressive deprecation, the theory being better to try it out now and back off if it's too much than not attempt the change and be stuck with collections that can neither be safely inherited nor have implementation details changed. Note that I have made no changes--in this commit--which would cause deprecation warnings in any of the Scala projects available on Maven (at least as gathered by Adriaan). There are deprecation warnings induced within the library (esp. for classes/traits that should become static) and the compiler. I have not attempted to fix all the deprecations in the compiler as some of them touch the IDE API (but these mostly involved Synchronized which is inherently unsafe, so this should be fixed eventually in coordination with the IDE code base(s)). Updated test checks to include new deprecations. Used a higher level implementation for messages in JavapClass.
* | Add a skeletal Delambdafy phase.James Iry2013-11-011-0/+1
| | | | | | | | | | | | This commit adds a do-nothing phase called "Delambdafy" that will eventually be responsible for doing the final translation of lambdas into classes.
* | Make future-spec tests not spawn threads in constructors.James Iry2013-11-014-6/+6
| | | | | | | | | | | | | | | | | | The future-spec tests were spawning threads in object constructors which meant they were on the ragged edge of entering deadlock from the static initialization lock acquired during the static initialization blocks we use to construct object reference fields. My work on restructuring lambdas pushed it over the edge. This commit refactors the tests to use class constructors rather than object constructors.
* | Remove empty check files and flags files.Jason Zaugg2013-10-277-0/+0
| | | | | | | | for f in $(find test -name '*.check' -o -name '*.flags'); do [[ $(wc -c $f | sed -E 's/ *([0-9]+).*/\1/') == "0" ]] && rm $f; done
* | Merge remote-tracking branch 'scala/2.10.x' into merge-2.10.xGrzegorz Kossakowski2013-10-161-1/+1
|\| | | | | | | | | | | Conflicts: build.number test/files/neg/classmanifests_new_deprecations.check
* | Cull extraneous whitespace.Paul Phillips2013-09-1837-325/+317
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Prepare removal of scala-xml, scala-parser-combinatorsAdriaan Moors2013-08-2728-1214/+1
| | | | | | | | | | | | | | | | | | Every test deleted here has found its way to the respective repositories of scala-xml and scala-parser-combinators, where they will continue to be tested with partest. The modified tests became independent of these modules, as they should've been from the start.
* | New tests for name-based pattern matcher.Paul Phillips2013-08-173-0/+46
| |