Skip to content

Commit 2d0aaf5

Browse files
committed
capitalizes “s” in tostring
As suggested by the reviewers, tostringXXX variables in TypeToStrings.scala have been renamed to toStringXXX.
1 parent 35300b4 commit 2d0aaf5

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/reflect/scala/reflect/internal/tpe/TypeToStrings.scala

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ private[internal] trait TypeToStrings {
1010

1111
/** The maximum number of recursions allowed in toString
1212
*/
13-
final val maxTostringRecursions = 50
13+
final val maxToStringRecursions = 50
1414

15-
private var _tostringRecursions = 0
16-
def tostringRecursions = _tostringRecursions
17-
def tostringRecursions_=(value: Int) = _tostringRecursions = value
15+
private var _toStringRecursions = 0
16+
def toStringRecursions = _toStringRecursions
17+
def toStringRecursions_=(value: Int) = _toStringRecursions = value
1818

19-
private var _tostringSubjects = HashSet[Type]()
20-
def tostringSubjects = _tostringSubjects
19+
private var _toStringSubjects = HashSet[Type]()
20+
def toStringSubjects = _toStringSubjects
2121

2222
protected def typeToString(tpe: Type): String =
23-
if (tostringSubjects contains tpe) {
23+
if (toStringSubjects contains tpe) {
2424
// handles self-referential anonymous classes and who knows what else
2525
"..."
2626
}
27-
else if (tostringRecursions >= maxTostringRecursions) {
27+
else if (toStringRecursions >= maxToStringRecursions) {
2828
devWarning("Exceeded recursion depth attempting to print " + util.shortClassOfInstance(tpe))
2929
if (settings.debug)
3030
(new Throwable).printStackTrace
@@ -33,11 +33,11 @@ private[internal] trait TypeToStrings {
3333
}
3434
else
3535
try {
36-
tostringRecursions += 1
37-
tostringSubjects += tpe
36+
toStringRecursions += 1
37+
toStringSubjects += tpe
3838
tpe.safeToString
3939
} finally {
40-
tostringSubjects -= tpe
41-
tostringRecursions -= 1
40+
toStringSubjects -= tpe
41+
toStringRecursions -= 1
4242
}
4343
}

src/reflect/scala/reflect/runtime/JavaUniverseForce.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ trait JavaUniverseForce { self: runtime.JavaUniverse =>
4141
// inaccessible: this._lubResults
4242
// inaccessible: this._glbResults
4343
// inaccessible: this._indent
44-
// inaccessible: this._tostringRecursions
45-
// inaccessible: this._tostringSubjects
44+
// inaccessible: this._toStringRecursions
45+
// inaccessible: this._toStringSubjects
4646
// inaccessible: this.atomicIds
4747
// inaccessible: this.atomicExistentialIds
4848
// inaccessible: this._recursionTable

src/reflect/scala/reflect/runtime/SynchronizedTypes.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ private[reflect] trait SynchronizedTypes extends internal.Types { self: SymbolTa
8181
override def indent = _indent.get
8282
override def indent_=(value: String) = _indent.set(value)
8383

84-
private lazy val _tostringRecursions = mkThreadLocalStorage(0)
85-
override def tostringRecursions = _tostringRecursions.get
86-
override def tostringRecursions_=(value: Int) = _tostringRecursions.set(value)
84+
private lazy val _toStringRecursions = mkThreadLocalStorage(0)
85+
override def toStringRecursions = _toStringRecursions.get
86+
override def toStringRecursions_=(value: Int) = _toStringRecursions.set(value)
8787

88-
private lazy val _tostringSubjects = mkThreadLocalStorage(new mutable.HashSet[Type])
89-
override def tostringSubjects = _tostringSubjects.get
88+
private lazy val _toStringSubjects = mkThreadLocalStorage(new mutable.HashSet[Type])
89+
override def toStringSubjects = _toStringSubjects.get
9090

9191
/* The idea of caches is as follows.
9292
* When in reflexive mode, a cache is either null, or one sentinal

0 commit comments

Comments
 (0)