summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2014 from gkossakowski/bytecode-testingGrzegorz Kossakowski2013-01-305-0/+104
|\ | | | | Add Bytecode test (ASM-based) to partest.
| * Add Bytecode test (ASM-based) to partest.Grzegorz Kossakowski2013-01-295-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new kind of test `Bytecode` that allows one to inspect bytecode generated for given piece of Scala code. The bytecode inspection is achieved by inspection of ASM trees. See the included example for details. NOTE: This commit does not introduce a new category of pratest tests. Bytecode tests should be run in `jvm` category of partest tests. Specific list of changes: * Add BytecodeTest that contains common utilities to partest * Add asm to classpath when compiling partest. That's not a new dependency as it's being already done for javac task we were running while compiling partest. * Add an example test that shows how to count null checks in given method.
* | Merge pull request #1997 from retronym/ticket/7035Paul Phillips2013-01-304-29/+38
|\ \ | | | | | | SI-7035 Centralize case field accessor sorting.
| * | SI-7035 Centralize case field accessor sorting.Jason Zaugg2013-01-284-29/+38
| | | | | | | | | | | | | | | | | | It is both burdensome and dangerous to expect callers to reorder these. This was seen in the field permutation in the unapply method; a regression in 2.10.0.
* | | Merge pull request #2008 from paulp/pr/asSeenFromOptGrzegorz Kossakowski2013-01-301-6/+6
|\ \ \ | | | | | | | | Optimization in AsSeenFromMap.
| * | | Optimization in AsSeenFromMap.Paul Phillips2013-01-291-6/+6
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Despite all the eyes which have traveled over this code, we all managed to miss this: // Note that pre and clazz are fixed at construction class AsSeenFromMap(pre: Type, clazz: Symbol) { ... def apply(tp: Type): Type = if (skipPrefixOf(pre, clazz)) tp else ... } Additionally, the exclusion condition in asSeenFrom contained a useless check, here: // !isPossiblePrefix(clazz) alone is enough pre.normalize.isTrivial && !isPossiblePrefix(clazz)
* | | Merge pull request #2020 from adriaanm/rebase-pr-1994-2.10.xAdriaan Moors2013-01-302-8/+4026
|\ \ \ | | | | | | | | [retarget #1994 to 2.10.x] SI-6726 Improving pattern matcher analysis performance
| * | | Remove gratuitous varJason Zaugg2013-01-301-1/+1
| | | | | | | | | | | | | | | | In favour of a somber val.
| * | | SI-6726 Further optimization of pattern analysisJason Zaugg2013-01-302-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually fuse `.filterNot(..).map` in dropUnit. Before: real 1m23.574s user 1m51.795s sys 0m2.634s After: real 1m4.883s user 1m30.754s sys 0m1.776s
| * | | SI-6726 Hash consing for Pattern matching Sym-sJason Zaugg2013-01-302-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the test case: https://issues.scala-lang.org/browse/SI-6726?focusedCommentId=61207&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-61207 time scalac -Ystatistics -Ystop-after:patmat sandbox/gen.scala Before: real 1m47.737s user 2m14.314s sys 0m2.783s After: real 1m23.574s user 1m51.795s sys 0m2.634s
| * | | SI-6726 Add benchmark used for testing pattern matcher.Jason Zaugg2013-01-301-0/+4005
| | | | | | | | | | | | | | | | To be manually run, results referenced in subsequent commmits.
* | | | Merge pull request #2007 from retronym/backport/1021Adriaan Moors2013-01-303-1/+12
|\ \ \ \ | | | | | | | | | | [backport] Fix for SI-6154, VerifyError originating in uncurry.
| * | | | [backport] Fix for SI-6154, VerifyError originating in uncurry.Paul Phillips2013-01-293-1/+12
| | |/ / | |/| | | | | | | | | | | | | | | | | | Lhs still might be an Ident. Miguel did all the work, I just wrote it down in code form. (cherry picked from commit 48f8235822a2a100d6c4e8d3d7349df565ac6d40)
* | | | Merge pull request #2025 from paulp/issue/6516Paul Phillips2013-01-302-1/+20
|\ \ \ \ | |_|/ / |/| | | SI-6516, macros comparing types with == instead of =:=.
| * | | SI-6516, macros comparing types with == instead of =:=.Paul Phillips2013-01-302-1/+20
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | I gift-wrapped this ticket four months ago: 'I think it will be enough to say "tpe =:= MacroContextClass.tpe" rather than == .' Indeed. Had to open my own gift. Thanks, paulp!
* | | Merge pull request #1912 from retronym/ticket/6651James Iry2013-01-292-7/+63
|\ \ \ | | | | | | | | SI-6651 Extension methods types may depend on the typed of the wrapped value
| * | | SI-6551 Expand test case into uncomfortable areas.Jason Zaugg2013-01-291-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | trait T { type U } class A(val a: T) extends AnyVal { def foo[TT <: a.U] = 0 } It works! But it's pure serendipity. After extmethods, the careful student of ASTs will find: object A { final def foo$extension[TT >: Nothing <: A.this.a.U]($this: A): Int = 0; } `A.this` doesn't belong. For now we just include this case under our test umbrella.
| * | | SI-6651 Substitute `this` in extension method sigsJason Zaugg2013-01-292-7/+56
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for the likes of: class A[X](val x: X) extends AnyVal { def foo(xy: x.Y) {} } We have to do this in both directions, when synthesizing the extension method in `Extender#transform`, and later on when Erasure tries to find the corresponding extension methods by backing out the original signatures from the signatures of the synthesized methods in the companion. In the first case, we have to be careful to use a stable reference to the `self` parameter, which can satisfy the dependent types.
* | | Merge pull request #2010 from retronym/backport/1985Jason Zaugg2013-01-292-0/+0
|\ \ \ | |/ / |/| | [backport] Disabled SI-6987.
| * | [backport] Disabled SI-6987.Paul Phillips2013-01-292-0/+0
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It causes spurious failures - a typical example: [partest] testing: [...]/files/run/t6987.scala [FAILED] [partest] did not get the string expected, full results were: [partest] Fast Scala compiler version 2.11.0-20130126-111937-f01e001c77 -- Copyright 2002-2013, LAMP/EPFL [partest] [Given arguments: -shutdown -verbose] [partest] [Transformed arguments: -shutdown -verbose -current-dir /localhome/jenkins/b/workspace/scala-checkin-manual] [partest] [VM arguments: ] [partest] java.net.ConnectException: Connection refused [partest] [Connecting to compilation daemon at port 32808 failed; re-trying...] [partest] [No compilation server running.] [partest] (cherry picked from commit 53d5df5c1d52b941732c243159de4f44456f03b4)
* | Merge pull request #1981 from retronym/backport/1187Adriaan Moors2013-01-284-7/+42
|\ \ | | | | | | [backport] SI-3577 BoundedWildcardType handling
| * | [backport] SI-3577 BoundedWildcardType handlingJason Zaugg2013-01-264-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 3c91b32d699a9e29d685ac20c9805f96c9f2db2c Author: Jason Zaugg <jzaugg@gmail.com> Date: Fri Aug 24 01:16:47 2012 +0200 Mention BoundedWildcardType in "a standard type pattern match". (cherry picked from commit 00e46b3dbcea2b72fd3941b7ffc2efba382871e9) commit 0664be2b69b1ce013e937bc93f4e84b891676f1f Author: Jason Zaugg <jzaugg@gmail.com> Date: Fri Aug 24 01:05:07 2012 +0200 Make RefChecks#validateVariance aware of BoundedWildcardType. The only test case that I know for this will be neutered by the imminent fix for SI-6258; so I haven't been able to test this. But trying this manually, you can see that this patch defers the the SI-6258 to the erasure phase. Original: scala.MatchError: ? (of class scala.reflect.internal.Types$BoundedWildcardType) at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.scala$tools$nsc$typechecker$RefChecks$RefCheckTransformer$$anon$$validateVariance$1(RefChecks.scala:894) at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.validateVariance(RefChecks.scala:965) Modified: java.lang.ClassCastException: scala.reflect.internal.Types$TypeRef$$anon$6 cannot be cast to scala.reflect.internal.Types$TypeBounds at scala.reflect.internal.Types$TypeMap.mapOver(Types.scala:4160) at scala.reflect.internal.transform.Erasure$ErasureMap.apply(Erasure.scala:156) (cherry picked from commit 2b4e7183fd24113cca5e868456668fd05c848168) commit 6ad651c94faf463133c742feb2aee59ef782ea1f Author: Jason Zaugg <jzaugg@gmail.com> Date: Fri Aug 24 00:54:59 2012 +0200 SI-3577 Make varianceInType aware of BoundedWildcardType. (cherry picked from commit 21105654c40ed0c462142bcbb6c8eced77f8b07a)
* | | Merge pull request #1936 from retronym/ticket/6891Adriaan Moors2013-01-286-3/+98
|\ \ \ | | | | | | | | SI-6891 Fix value class + tailrec crasher.
| * | | SI-6891 Fix value class + tailrec crasher.Jason Zaugg2013-01-263-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rhs.substituteSymbols(old, new) leaves us with: def loop#12225(x#12226: A#15491): scala#21.this.Unit#1615 = loop#12225(x#12226) In which the TermSymbol x#12226 has a stale info, pointing at the A#7274, the class type parameter, rather than A#15491, the corresponding type parameter of the synthetic backing method. I've improved `TreeSymSubstituter` to substitute not only `Tree#{tpe, symbol}`, but also `DefTree#sym.info`. The `pos` test that triggered the new code path are listed here: https://gist.github.com/4575687 AFAICS, no special treatment of Function, Return, or Import is needed in TreeSymSubstutor.
| * | | Ill-scoped reference checking in TreeCheckersJason Zaugg2013-01-265-2/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Find trees which have an info referring to an out-of-scope type parameter or local symbol, as could happen in the test for SI-6981, in which tree transplanting did not substitute symbols in symbol infos. The enclosed, pending test for that bug that will now fail under -Ycheck:extmethods -Xfatal-warnings. [Now checking: extmethods] [check: extmethods] The symbol, tpe or info of tree `(@scala.annotation.tailrec def loop(x: A): Unit = loop(x)) : (x: A)Unit` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: method loop, method bippy$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(val x: A = _) : A` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value x, method loop, method bippy$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(loop(x)) : (x: A)Unit` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: method loop, method bippy$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(loop) : (x: A)Unit` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: method loop, method bippy$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(x) : A` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value x, method loop, method bippy$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(<synthetic> val x2: O.Foo[A] = (x1.asInstanceOf[O.Foo[A]]: O.Foo[A])) : O.Foo[A]` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value x2, method equals$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(<synthetic> val Foo$1: O.Foo[A] = x$1.asInstanceOf[O.Foo[A]]) : O.Foo[A]` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value Foo$1, method equals$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(Foo$1) : O.Foo[A]` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value Foo$1, method equals$extension, object Foo, object O, package <empty>, package <root> error: TreeCheckers detected non-compliant trees in t6891.scala one error found
| * | | Make value classes TreeCheckers friendlyJason Zaugg2013-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | - allow for re-typechecking by disabling "redefinition of equals" errors for synthetic methods.
* | | | Merge pull request #1973 from JamesIry/SI-4602_2.10.xJames Iry2013-01-283-7/+75
|\ \ \ \ | | | | | | | | | | SI-4602 Make fsc absolutize source file names
| * | | | SI-4602 Disable unreliable test of fsc path absolutizationJames Iry2013-01-271-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The included test for fsc path absolutization almost certainly has the same reliability problem as a similar test that was disabled in https://github.com/scala/scala/pull/1985 . Disabling the test until I can figure out a reliable way to test fsc in an our continuous integration environment.
| * | | | SI-4602 Make fsc absolutize source file namesJames Iry2013-01-253-7/+75
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fsc server was using a path supplied by the client to turn things like class path values into absolute paths. But it wasn't absolutizing the source file names supplied to the compiler which lead to SI-4602. This commit adds that absolutizing bit and cleans the logic up a bit so that the settings object isn't told a path that it already knows. A test is included that simulates changing directory by forcing two different -current-dir settings on two different compile sessions on the same server process.
* | | | Merge pull request #1988 from melloc/fsc-temporary-directory-2.10.xJames Iry2013-01-281-1/+1
|\ \ \ \ | | | | | | | | | | SI-4733 - fsc no longer creates a single temp directory for all users.
| * | | | SI-4733 - fsc no longer creates a single temp directory for all users.Cody Mello2013-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsc previously created a single temporary directory called "scala-devel". This is an issue, since the directory belongs to whoever created the directory. Depending on the user's umask, this directory may only be writable for the creator. This causes problems for any other users who then try to use fsc or invoke fsc indirectly. Other programs usually solve this issue by creating a separate directory for each user, either by appending the username to a base directory name or creating a new direcotory with a random name with a program like "mktemp". This commit changes CompileSocket to use the first method. Fixes SI-4733 backport to 2.10.x
* | | | | Merge pull request #1927 from JamesIry/SI-6863_2.10.xJames Iry2013-01-283-10/+147
|\ \ \ \ \ | |_|_|_|/ |/| | | | SI-6863 Fix verify error in captured var inited from block w try/catch
| * | | | SI-6863 Fix verify error in captured var inited from expr with try/catchJames Iry2013-01-253-10/+147
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a captured var was inited from a try/catch we did something reasonable. But if the var was inited from a more complicated expression (if/else, a block, match/case, etc) that ended with a try/catch then we didn't and we were generating faulty byte code. This fix patches LambdaLift to add the missing cases. For known simple expressions, the translation is just new *Ref(expr). For try/catch, if/else, match/case, and blocks this recursively walks down the internal result expressions to translate them. E.g. if(cond) trueExpr else falseExpr becomes if(cone) translate(trueExpr) else translate(falseExpr) For unknown expression types, the translation is {val temp = expr; new *Ref(expr) }
* | | | Merge pull request #1941 from phaller/issue/6932-futures-internal-callbacksAdriaan Moors2013-01-273-3/+127
|\ \ \ \ | | | | | | | | | | SI-6932 StackOverflowError in chained Future.flatMap calls
| * | | | SI-6932 Remove Batchable trait plus minor clean-upsPhilipp Haller2013-01-211-18/+9
| | | | |
| * | | | Fix SI-6932 by enabling linearization of callback execution for the ↵Viktor Klang2013-01-213-3/+136
| | | | | | | | | | | | | | | | | | | | internal execution context of Future
* | | | | Merge pull request #1857 from retronym/ticket/6443-2.10.xAdriaan Moors2013-01-2710-7/+222
|\ \ \ \ \ | | | | | | | | | | | | SI-6443 Widen dependent param types in uncurry
| * | | | | SI-6443 Expand test coverage with varargs, by-name.Jason Zaugg2013-01-164-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These were already working, due to a serendipitous ordering of transformations. The tests will keep it this way.
| * | | | | SI-6443 Widen dependent param types in uncurryJason Zaugg2013-01-166-7/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bridge building operates on unusual method signatures: after uncurry, so parameter lists are collapsed; but before erasure, so dependently typed parameters are still around. Original: def foo(a: T)(b: a.type, c: a.U): Unit During computeBridges: (a: T, b: a.type, c: a.U)Unit This signature no longer appears to override the corresponding one in a superclass, because the types of `b` and `c` are dependent on method parameters. The root of the problem is uncurry, which leaves the trees in a poor state. This commit changes uncurry to remedy this. An example illustrates it best: // source def foo(a: A)(b: a.type): b.type = b // post uncurry before this patch. // not well typed code! def foo(a: A, b: a.type): a.type = { // post uncurry after this patch def foo(a: A, b: A): A = { val b$1 = b.asInstanceOf[a.type] b$1 }
* | | | | | Merge pull request #1977 from retronym/ticket/7018Jason Zaugg2013-01-272-7/+9
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7018 Fix memory leak in Attachments
| * | | | | | Update a checkfile from a recent fix.Jason Zaugg2013-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The build is currently broken: https://scala-webapps.epfl.ch/jenkins/view/2.10.x/job/scala-nightly-main-2.10.x/
| * | | | | | SI-7018 Fix memory leak in Attachments.Jason Zaugg2013-01-271-6/+8
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes NonEmptyAttachments a top level class so that it doesn't accidentally accumulate history via the $outer field. No test is included because I think the fix is self evident.
* | | | | | Merge pull request #1983 from paulp/pr/partest-permgenPaul Phillips2013-01-261-3/+4
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | Bumped partest MaxPermSize to 128m.
| * | | | | Bumped partest MaxPermSize to 128m.Paul Phillips2013-01-261-3/+4
|/ / / / /
* | | | | Merge pull request #1956 from JamesIry/SI-7011_2.10.xJames Iry2013-01-253-2/+10
|\ \ \ \ \ | | | | | | | | | | | | SI-7011 Fix finding constructor type in captured var definitions
| * | | | | SI-7011 Fix finding constructor type in captured var definitionsJames Iry2013-01-233-2/+10
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a captured var was initialized with an empty tree then finding the type of the empty tree was being handled improperly. The fix is to look for primary constructors on the tree's type symbol rather than the tree's symbol. A test is included. In order to make the problem more testable the debug logging of the issue is changed to a debug warn.
* | | | | Merge pull request #1946 from retronym/ticket/6231Paul Phillips2013-01-254-3/+40
|\ \ \ \ \ | | | | | | | | | | | | SI-6231 Report unsupported free var capture by a trait.
| * | | | | SI-6231 Report unsupported free var capture by a trait.Jason Zaugg2013-01-214-3/+40
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a class nested in a trait captures a free variable from the enclosing scope of the trait, the transformation to add that variable to the `init` method of the trait implementation class happens *after* the abstract trait interface has been extracted. This would lead to a crash when trying to find the corresponding interface method. This commit detects this situation and reports an implementation restriction. The enclosed test case shows a workaround. To lift this restriction, LambdaLifter should add the getters and make sure they end up in the trait interface. Looks like Martin tried this once: // LambdaLift.scala // // Disabled attempt to to add getters to freeParams // this does not work yet. Problem is that local symbols need local names // and references to local symbols need to be transformed into // method calls to setters. // def paramGetter(param: Symbol): Tree = { // val getter = param.newGetter setFlag TRANS_FLAG resetFlag PARAMACCESSOR // mark because we have to add them to interface // sym.info.decls.enter(getter) // val rhs = Select(gen.mkAttributedThis(sym), param) setType param.tpe // DefDef(getter, rhs) setPos tree.pos setType NoType // } // val newDefs = if (sym.isTrait) freeParams ::: (ps map paramGetter) else freeParams
* | | | | Merge pull request #1951 from JamesIry/SI-6987_2.10.xPaul Phillips2013-01-254-17/+75
|\ \ \ \ \ | | | | | | | | | | | | SI-6987 Fixes fsc compile server verbose output
| * | | | | SI-6987 Tests fsc verbose outputJames Iry2013-01-224-15/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes a test of fsc's verbose output. In order for it to work, CompileServer's main method had to be modified to remove a sys exit 0 at the end. It was redundant and made testing a bit harder. In order to prevent a race condition between server and client start up, this commit also adds a server callback that decrements a CountDownLatch that the main testing thread waits for. Finally, the server had to be modified to use Console.withErr and Console.withOut instead of mutating the global System.err and System.out variables. Otherwise the test would be unreliable.