Skip to content

Commit 8bfaada

Browse files
authored
Merge pull request #1565 from Blaisorblade/warnings
Small fixes to some warnings/comment typos
2 parents 6095454 + ddbbb83 commit 8bfaada

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

interfaces/src/main/java/dotty/tools/dotc/interfaces/SourceFile.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package dotty.tools.dotc.interfaces;
22

3-
import java.io.File;
4-
53
/** A source file.
64
*
75
* User code should not implement this interface, but it may have to

src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ object Trees {
4848
* the existing tree transparently, assigning its `tpe` field,
4949
* provided it was `null` before.
5050
* - It is impossible to embed untyped trees in typed ones.
51-
* - Typed trees can be embedded untyped ones provided they are rooted
51+
* - Typed trees can be embedded in untyped ones provided they are rooted
5252
* in a TypedSplice node.
5353
* - Type checking an untyped tree should remove all embedded `TypedSplice`
5454
* nodes.
@@ -853,7 +853,7 @@ object Trees {
853853

854854
val cpy: TreeCopier
855855

856-
/** A class for copying trees. The copy methods avid creating a new tree
856+
/** A class for copying trees. The copy methods avoid creating a new tree
857857
* If all arguments stay the same.
858858
*
859859
* Note: Some of the copy methods take a context.

src/dotty/tools/dotc/transform/TreeTransform.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ object TreeTransforms {
4242
* the general dispatch overhead as opposed to the concrete work done in transformations. So that leaves us with
4343
* 0.2sec, or roughly 600M processor cycles.
4444
*
45-
* Now, to the amount of work that needs to be done. The codebase produces of about 250'000 trees after typechecking.
45+
* Now, to the amount of work that needs to be done. The codebase produces an average of about 250'000 trees after typechecking.
4646
* Transformations are likely to make this bigger so let's assume 300K trees on average. We estimate to have about 100
4747
* micro-transformations. Let's say 5 transformation groups of 20 micro-transformations each. (by comparison,
4848
* scalac has in excess of 20 phases, and most phases do multiple transformations). There are then 30M visits
@@ -208,7 +208,7 @@ object TreeTransforms {
208208
if (cls.getDeclaredMethods.exists(_.getName == name)) cls != classOf[TreeTransform]
209209
else hasRedefinedMethod(cls.getSuperclass, name)
210210

211-
/** Create an index array `next` of size one larger than teh size of `transforms` such that
211+
/** Create an index array `next` of size one larger than the size of `transforms` such that
212212
* for each index i, `next(i)` is the smallest index j such that
213213
*
214214
* i <= j

src/dotty/tools/dotc/typer/TypeAssigner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ trait TypeAssigner {
416416

417417
def assignType(tree: untpd.SeqLiteral, elems: List[Tree], elemtpt: Tree)(implicit ctx: Context) = {
418418
val ownType = tree match {
419-
case tree: JavaSeqLiteral => defn.ArrayOf(elemtpt.tpe)
419+
case tree: untpd.JavaSeqLiteral => defn.ArrayOf(elemtpt.tpe)
420420
case _ => if (ctx.erasedTypes) defn.SeqType else defn.SeqType.appliedTo(elemtpt.tpe)
421421
}
422422
tree.withType(ownType)

src/strawman/collections/CollectionStrawMan4.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ object CollectionStrawMan4 {
216216

217217
object ListBuffer extends IterableFactory[ListBuffer] {
218218
def fromIterable[B](coll: Iterable[B]): ListBuffer[B] = coll match {
219-
case pd @ View.Partitioned(partition: View.Partition[B]) =>
219+
case pd @ View.Partitioned(partition: View.Partition[B] @unchecked) =>
220220
partition.distribute(new ListBuffer[B]())
221221
new ListBuffer[B] ++= pd.forced.get
222222
case _ =>
@@ -267,7 +267,7 @@ object CollectionStrawMan4 {
267267
Array.copy(fst.elems, fst.start, elems, 0, fst.length)
268268
Array.copy(snd.elems, snd.start, elems, fst.length, snd.length)
269269
new ArrayBuffer(elems, elems.length)
270-
case pd @ View.Partitioned(partition: View.Partition[B]) =>
270+
case pd @ View.Partitioned(partition: View.Partition[B] @unchecked) =>
271271
partition.distribute(new ArrayBuffer[B]())
272272
pd.forced.get.asInstanceOf[ArrayBuffer[B]]
273273
case c if c.knownLength >= 0 =>

test/test/ContextEscapeDetector.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package test;
22

3-
import org.junit.runner.Description;
43
import org.junit.runner.Result;
54
import org.junit.runner.notification.RunListener;
65
import org.junit.Assert;
@@ -43,6 +42,7 @@ private static synchronized int contextsAlive() {
4342
return count;
4443
}
4544

45+
@SuppressWarnings("unused")
4646
private static volatile Object o = null;
4747

4848
private static synchronized void forceGCHeuristic0() {
@@ -59,7 +59,7 @@ private static synchronized void forceGCHeuristic0() {
5959

6060
private static synchronized void forceGCHeuristic1() {
6161
Object obj = new Object();
62-
WeakReference ref = new WeakReference<Object>(obj);
62+
WeakReference<Object> ref = new WeakReference<>(obj);
6363
obj = null;
6464
while (ref.get() != null) {
6565
System.gc();
@@ -69,7 +69,7 @@ private static synchronized void forceGCHeuristic1() {
6969
private static synchronized void forceGCHeuristic2() {
7070
try {
7171
Object[] arr = new Object[1024]; // upto 8 GB
72-
WeakReference ref = new WeakReference<Object>(arr);
72+
WeakReference<Object> ref = new WeakReference<>(arr);
7373
o = arr; // make sure array isn't optimized away
7474

7575
Runtime runtime = Runtime.getRuntime();

0 commit comments

Comments
 (0)