From b8203c8968d9934b91e468790c84a5d9bf76d806 Mon Sep 17 00:00:00 2001
From: "Paolo G. Giarrusso"
Date: Thu, 6 Oct 2016 21:33:18 +0200
Subject: [PATCH 1/4] Fix typos
---
src/dotty/tools/dotc/ast/Trees.scala | 4 ++--
src/dotty/tools/dotc/transform/TreeTransform.scala | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/dotty/tools/dotc/ast/Trees.scala b/src/dotty/tools/dotc/ast/Trees.scala
index 70701ecd773f..27973c3e96ba 100644
--- a/src/dotty/tools/dotc/ast/Trees.scala
+++ b/src/dotty/tools/dotc/ast/Trees.scala
@@ -48,7 +48,7 @@ object Trees {
* the existing tree transparently, assigning its `tpe` field,
* provided it was `null` before.
* - It is impossible to embed untyped trees in typed ones.
- * - Typed trees can be embedded untyped ones provided they are rooted
+ * - Typed trees can be embedded in untyped ones provided they are rooted
* in a TypedSplice node.
* - Type checking an untyped tree should remove all embedded `TypedSplice`
* nodes.
@@ -855,7 +855,7 @@ object Trees {
val cpy: TreeCopier
- /** A class for copying trees. The copy methods avid creating a new tree
+ /** A class for copying trees. The copy methods avoid creating a new tree
* If all arguments stay the same.
*
* Note: Some of the copy methods take a context.
diff --git a/src/dotty/tools/dotc/transform/TreeTransform.scala b/src/dotty/tools/dotc/transform/TreeTransform.scala
index 52a3ad94e41a..45fa3d607b7b 100644
--- a/src/dotty/tools/dotc/transform/TreeTransform.scala
+++ b/src/dotty/tools/dotc/transform/TreeTransform.scala
@@ -42,7 +42,7 @@ object TreeTransforms {
* the general dispatch overhead as opposed to the concrete work done in transformations. So that leaves us with
* 0.2sec, or roughly 600M processor cycles.
*
- * Now, to the amount of work that needs to be done. The codebase produces of about 250'000 trees after typechecking.
+ * Now, to the amount of work that needs to be done. The codebase produces an average of about 250'000 trees after typechecking.
* Transformations are likely to make this bigger so let's assume 300K trees on average. We estimate to have about 100
* micro-transformations. Let's say 5 transformation groups of 20 micro-transformations each. (by comparison,
* scalac has in excess of 20 phases, and most phases do multiple transformations). There are then 30M visits
@@ -208,7 +208,7 @@ object TreeTransforms {
if (cls.getDeclaredMethods.exists(_.getName == name)) cls != classOf[TreeTransform]
else hasRedefinedMethod(cls.getSuperclass, name)
- /** Create an index array `next` of size one larger than teh size of `transforms` such that
+ /** Create an index array `next` of size one larger than the size of `transforms` such that
* for each index i, `next(i)` is the smallest index j such that
*
* i <= j
From efd60bbd2f9c02d34e296f2932665b8ebe733f61 Mon Sep 17 00:00:00 2001
From: "Paolo G. Giarrusso"
Date: Thu, 6 Oct 2016 16:48:11 +0200
Subject: [PATCH 2/4] Fix compilation warnings
---
.../main/java/dotty/tools/dotc/interfaces/SourceFile.java | 2 --
test/test/ContextEscapeDetector.java | 6 +++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/interfaces/src/main/java/dotty/tools/dotc/interfaces/SourceFile.java b/interfaces/src/main/java/dotty/tools/dotc/interfaces/SourceFile.java
index 0e16d3ea4ba9..6c72a5125b0d 100644
--- a/interfaces/src/main/java/dotty/tools/dotc/interfaces/SourceFile.java
+++ b/interfaces/src/main/java/dotty/tools/dotc/interfaces/SourceFile.java
@@ -1,7 +1,5 @@
package dotty.tools.dotc.interfaces;
-import java.io.File;
-
/** A source file.
*
* User code should not implement this interface, but it may have to
diff --git a/test/test/ContextEscapeDetector.java b/test/test/ContextEscapeDetector.java
index c7768fd57647..78d293a5df89 100644
--- a/test/test/ContextEscapeDetector.java
+++ b/test/test/ContextEscapeDetector.java
@@ -1,6 +1,5 @@
package test;
-import org.junit.runner.Description;
import org.junit.runner.Result;
import org.junit.runner.notification.RunListener;
import org.junit.Assert;
@@ -43,6 +42,7 @@ private static synchronized int contextsAlive() {
return count;
}
+ @SuppressWarnings("unused")
private static volatile Object o = null;
private static synchronized void forceGCHeuristic0() {
@@ -59,7 +59,7 @@ private static synchronized void forceGCHeuristic0() {
private static synchronized void forceGCHeuristic1() {
Object obj = new Object();
- WeakReference ref = new WeakReference