Permalink
Browse files

Got rid of "tuple" word all over the code.

  • Loading branch information...
1 parent 0b41436 commit 5ccbce6de62b8541f0637e2b288c13d9db580f55 Evgeny Gerashchenko committed Mar 19, 2013
Showing with 35 additions and 50 deletions.
  1. 0 compiler/testData/diagnostics/tests/{tuples → }/UnitValue.kt
  2. 0 compiler/testData/renderer/{TupleTypes.kt → UnitType.kt}
  3. +6 −15 compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java
  4. +3 −3 compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveDescriptorRendererTestGenerated.java
  5. +1 −1 compiler/tests/org/jetbrains/jet/renderer/DescriptorRendererTest.java
  6. +2 −2 js/js.libraries/src/core/json.kt
  7. +1 −1 js/js.libraries/src/core/string.kt
  8. +2 −2 js/js.libraries/src/stdlib/JUMapsCode.kt
  9. +1 −1 js/js.translator/testFiles/kotlin_lib.js
  10. +1 −1 libraries/sandbox/extensionTraits/src/kotlin2/Traversable.kt
  11. +1 −1 libraries/stdlib/src/generated/_Arrays.kt
  12. +1 −1 libraries/stdlib/src/generated/_BooleanArrays.kt
  13. +1 −1 libraries/stdlib/src/generated/_ByteArrays.kt
  14. +1 −1 libraries/stdlib/src/generated/_CharArrays.kt
  15. +1 −1 libraries/stdlib/src/generated/_DoubleArrays.kt
  16. +1 −1 libraries/stdlib/src/generated/_FloatArrays.kt
  17. +1 −1 libraries/stdlib/src/generated/_IntArrays.kt
  18. +1 −1 libraries/stdlib/src/generated/_Iterables.kt
  19. +1 −1 libraries/stdlib/src/generated/_IteratorsCommon.kt
  20. +1 −1 libraries/stdlib/src/generated/_LongArrays.kt
  21. +1 −1 libraries/stdlib/src/generated/_ShortArrays.kt
  22. +4 −4 libraries/stdlib/src/kotlin/JUtilJVM.kt
  23. +1 −1 libraries/stdlib/test/MapTest.kt
  24. +1 −1 libraries/stdlib/test/js/MapJsTest.kt
  25. +0 −6 libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/KDocTemplate.kt
  26. +1 −1 libraries/tools/kotlin-stdlib-gen/src/templates/Collections.kt
@@ -33,7 +33,7 @@
@InnerTestClasses({JetDiagnosticsTestGenerated.Tests.class, JetDiagnosticsTestGenerated.Script.class})
public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEagerResolve {
@TestMetadata("compiler/testData/diagnostics/tests")
- @InnerTestClasses({Tests.Annotations.class, Tests.BackingField.class, Tests.Cast.class, Tests.CheckArguments.class, Tests.ControlFlowAnalysis.class, Tests.ControlStructures.class, Tests.DataClasses.class, Tests.DataFlow.class, Tests.DataFlowInfoTraversal.class, Tests.DeclarationChecks.class, Tests.Deparenthesize.class, Tests.Enum.class, Tests.Extensions.class, Tests.FunctionLiterals.class, Tests.Generics.class, Tests.IncompleteCode.class, Tests.Inference.class, Tests.Infos.class, Tests.Inner.class, Tests.J_k.class, Tests.Jdk_annotations.class, Tests.Library.class, Tests.NullabilityAndAutoCasts.class, Tests.NullableTypes.class, Tests.Objects.class, Tests.OperatorsOverloading.class, Tests.Overload.class, Tests.Override.class, Tests.Redeclarations.class, Tests.Regressions.class, Tests.Resolve.class, Tests.Scopes.class, Tests.SenselessComparison.class, Tests.Shadowing.class, Tests.SmartCasts.class, Tests.Substitutions.class, Tests.Subtyping.class, Tests.ThisAndSuper.class, Tests.Tuples.class, Tests.Varargs.class})
+ @InnerTestClasses({Tests.Annotations.class, Tests.BackingField.class, Tests.Cast.class, Tests.CheckArguments.class, Tests.ControlFlowAnalysis.class, Tests.ControlStructures.class, Tests.DataClasses.class, Tests.DataFlow.class, Tests.DataFlowInfoTraversal.class, Tests.DeclarationChecks.class, Tests.Deparenthesize.class, Tests.Enum.class, Tests.Extensions.class, Tests.FunctionLiterals.class, Tests.Generics.class, Tests.IncompleteCode.class, Tests.Inference.class, Tests.Infos.class, Tests.Inner.class, Tests.J_k.class, Tests.Jdk_annotations.class, Tests.Library.class, Tests.NullabilityAndAutoCasts.class, Tests.NullableTypes.class, Tests.Objects.class, Tests.OperatorsOverloading.class, Tests.Overload.class, Tests.Override.class, Tests.Redeclarations.class, Tests.Regressions.class, Tests.Resolve.class, Tests.Scopes.class, Tests.SenselessComparison.class, Tests.Shadowing.class, Tests.SmartCasts.class, Tests.Substitutions.class, Tests.Subtyping.class, Tests.ThisAndSuper.class, Tests.Varargs.class})
public static class Tests extends AbstractDiagnosticsTestWithEagerResolve {
@TestMetadata("Abstract.kt")
public void testAbstract() throws Exception {
@@ -484,6 +484,11 @@ public void testUnitByDefaultForFunctionTypes() throws Exception {
doTest("compiler/testData/diagnostics/tests/UnitByDefaultForFunctionTypes.kt");
}
+ @TestMetadata("UnitValue.kt")
+ public void testUnitValue() throws Exception {
+ doTest("compiler/testData/diagnostics/tests/UnitValue.kt");
+ }
+
@TestMetadata("UnreachableCode.kt")
public void testUnreachableCode() throws Exception {
doTest("compiler/testData/diagnostics/tests/UnreachableCode.kt");
@@ -4359,19 +4364,6 @@ public void testThisInToplevelFunction() throws Exception {
}
- @TestMetadata("compiler/testData/diagnostics/tests/tuples")
- public static class Tuples extends AbstractDiagnosticsTestWithEagerResolve {
- public void testAllFilesPresentInTuples() throws Exception {
- JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/diagnostics/tests/tuples"), Pattern.compile("^(.+)\\.kt$"), true);
- }
-
- @TestMetadata("UnitValue.kt")
- public void testUnitValue() throws Exception {
- doTest("compiler/testData/diagnostics/tests/tuples/UnitValue.kt");
- }
-
- }
-
@TestMetadata("compiler/testData/diagnostics/tests/varargs")
public static class Varargs extends AbstractDiagnosticsTestWithEagerResolve {
public void testAllFilesPresentInVarargs() throws Exception {
@@ -4476,7 +4468,6 @@ public static Test innerSuite() {
suite.addTestSuite(Substitutions.class);
suite.addTestSuite(Subtyping.class);
suite.addTestSuite(ThisAndSuper.class);
- suite.addTestSuite(Tuples.class);
suite.addTestSuite(Varargs.class);
return suite;
}
@@ -76,9 +76,9 @@ public void testKeywordsInNames() throws Exception {
doTest("compiler/testData/renderer/KeywordsInNames.kt");
}
- @TestMetadata("TupleTypes.kt")
- public void testTupleTypes() throws Exception {
- doTest("compiler/testData/renderer/TupleTypes.kt");
+ @TestMetadata("UnitType.kt")
+ public void testUnitType() throws Exception {
+ doTest("compiler/testData/renderer/UnitType.kt");
}
}
@@ -61,7 +61,7 @@ public void testEnum() throws IOException {
doTest();
}
- public void testTupleTypes() throws IOException {
+ public void testUnitType() throws IOException {
doTest();
}
@@ -14,10 +14,10 @@ public fun Json.set(paramName : String, value : Any?) : Unit = js.noImpl
library("jsonGet")
public fun Json.get(paramName : String) : Any? = js.noImpl
-library("jsonFromTuples")
+library("jsonFromPairs")
public fun json(vararg pairs : Pair<String, Any?>) : Json = js.noImpl
-library("jsonFromTuples")
+library("jsonFromPairs")
public fun json2(pairs : Array<Pair<String, Any?>>) : Json = js.noImpl
library("jsonAddProperties")
@@ -106,7 +106,7 @@ native public fun String.getBytes(charset : java.nio.charset.Charset) : ByteArra
native public fun String.getBytes(charsetName : String) : ByteArray = (this as java.lang.String).getBytes(charsetName)!!
-native public fun String.getChars(srcBegin : Int, srcEnd : Int, dst : CharArray, dstBegin : Int) : Tuple0 = (this as java.lang.String).getChars(srcBegin, srcEnd, dst, dstBegin)!!
+native public fun String.getChars(srcBegin : Int, srcEnd : Int, dst : CharArray, dstBegin : Int) : Unit = (this as java.lang.String).getChars(srcBegin, srcEnd, dst, dstBegin)!!
native public fun String.intern() : String = (this as java.lang.String).intern()!!
@@ -8,10 +8,10 @@ public fun <K, V> MutableMap<K, V>.set(key : K, value : V): Unit {
}
/**
- * Returns a new [[HashMap]] populated with the given tuple values where the first value in each tuple
+ * Returns a new [[HashMap]] populated with the given pairs where the first value in each pair
* is the key and the second value is the value
*
- * @includeFunctionBody ../../test/MapTest.kt createUsingTuples
+ * @includeFunctionBody ../../test/MapTest.kt createUsingPairs
*/
public inline fun <K,V> hashMap(vararg values: Pair<K,V>): HashMap<K,V> {
val answer = HashMap<K,V>()
@@ -531,7 +531,7 @@ var kotlin = {set:function (receiver, key, value) {
return obj.toString();
};
- Kotlin.jsonFromTuples = function (pairArr) {
+ Kotlin.jsonFromPairs = function (pairArr) {
var i = pairArr.length;
var res = {};
while (i > 0) {
@@ -343,7 +343,7 @@ public trait Traversable<T>: Iterable<T> {
}
/**
- * Convert collection of arbitrary elements to collection of tuples of the index and the element
+ * Convert collection of arbitrary elements to collection of pairs of the index and the element
*
* @includeFunctionBody ../../test/ListTest.kt withIndices
*/
@@ -360,7 +360,7 @@ public inline fun <T> Array<out T>.withIndices() : Iterator<Pair<Int, T>> {
/**
* Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- * E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ * E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
*/
public inline fun <T, R: Comparable<R>> Array<out T>.sortBy(f: (T) -> R) : List<T> {
val sortedList = toCollection(ArrayList<T>())
@@ -333,7 +333,7 @@ public inline fun BooleanArray.withIndices() : Iterator<Pair<Int, Boolean>> {
/**
* Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- * E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ * E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
*/
public inline fun <R: Comparable<R>> BooleanArray.sortBy(f: (Boolean) -> R) : List<Boolean> {
val sortedList = toCollection(ArrayList<Boolean>())
@@ -333,7 +333,7 @@ public inline fun ByteArray.withIndices() : Iterator<Pair<Int, Byte>> {
/**
* Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- * E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ * E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
*/
public inline fun <R: Comparable<R>> ByteArray.sortBy(f: (Byte) -> R) : List<Byte> {
val sortedList = toCollection(ArrayList<Byte>())
@@ -333,7 +333,7 @@ public inline fun CharArray.withIndices() : Iterator<Pair<Int, Char>> {
/**
* Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- * E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ * E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
*/
public inline fun <R: Comparable<R>> CharArray.sortBy(f: (Char) -> R) : List<Char> {
val sortedList = toCollection(ArrayList<Char>())
@@ -333,7 +333,7 @@ public inline fun DoubleArray.withIndices() : Iterator<Pair<Int, Double>> {
/**
* Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- * E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ * E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
*/
public inline fun <R: Comparable<R>> DoubleArray.sortBy(f: (Double) -> R) : List<Double> {
val sortedList = toCollection(ArrayList<Double>())
@@ -333,7 +333,7 @@ public inline fun FloatArray.withIndices() : Iterator<Pair<Int, Float>> {
/**
* Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- * E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ * E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
*/
public inline fun <R: Comparable<R>> FloatArray.sortBy(f: (Float) -> R) : List<Float> {
val sortedList = toCollection(ArrayList<Float>())
@@ -333,7 +333,7 @@ public inline fun IntArray.withIndices() : Iterator<Pair<Int, Int>> {
/**
* Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- * E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ * E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
*/
public inline fun <R: Comparable<R>> IntArray.sortBy(f: (Int) -> R) : List<Int> {
val sortedList = toCollection(ArrayList<Int>())
@@ -245,7 +245,7 @@ public inline fun <T> Iterable<T>.withIndices() : Iterator<Pair<Int, T>> {
/**
* Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- * E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ * E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
*/
public inline fun <T, R: Comparable<R>> Iterable<T>.sortBy(f: (T) -> R) : List<T> {
val sortedList = toCollection(ArrayList<T>())
@@ -245,7 +245,7 @@ public inline fun <T> Iterator<T>.withIndices() : Iterator<Pair<Int, T>> {
/**
* Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- * E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ * E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
*/
public inline fun <T, R: Comparable<R>> Iterator<T>.sortBy(f: (T) -> R) : List<T> {
val sortedList = toCollection(ArrayList<T>())
@@ -333,7 +333,7 @@ public inline fun LongArray.withIndices() : Iterator<Pair<Int, Long>> {
/**
* Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- * E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ * E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
*/
public inline fun <R: Comparable<R>> LongArray.sortBy(f: (Long) -> R) : List<Long> {
val sortedList = toCollection(ArrayList<Long>())
@@ -333,7 +333,7 @@ public inline fun ShortArray.withIndices() : Iterator<Pair<Int, Short>> {
/**
* Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- * E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ * E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
*/
public inline fun <R: Comparable<R>> ShortArray.sortBy(f: (Short) -> R) : List<Short> {
val sortedList = toCollection(ArrayList<Short>())
@@ -46,10 +46,10 @@ deprecated("Use sortedSetOf(...) instead")
public fun sortedSet<T>(comparator: Comparator<T>, vararg values: T) : TreeSet<T> = sortedSetOf(comparator, *values)
/**
- * Returns a new [[HashMap]] populated with the given tuple values where the first value in each tuple
+ * Returns a new [[HashMap]] populated with the given pairs where the first value in each pair
* is the key and the second value is the value
*
- * @includeFunctionBody ../../test/MapTest.kt createUsingTuples
+ * @includeFunctionBody ../../test/MapTest.kt createUsingPairs
*/
public fun <K,V> hashMapOf(vararg values: Pair<K,V>): HashMap<K,V> {
val answer = HashMap<K,V>(values.size)
@@ -67,7 +67,7 @@ deprecated("Use mapOf(...) or hashMapOf(...) instead")
public fun <K,V> hashMap(vararg values: Pair<K,V>): HashMap<K,V> = hashMapOf(*values)
/**
- * Returns a new [[SortedMap]] populated with the given tuple values where the first value in each tuple
+ * Returns a new [[SortedMap]] populated with the given pairs where the first value in each pair
* is the key and the second value is the value
*
* @includeFunctionBody ../../test/MapTest.kt createSortedMap
@@ -88,7 +88,7 @@ deprecated("Use sortedMapOf(...) instead")
public fun <K,V> sortedMap(vararg values: Pair<K, V>): SortedMap<K,V> = sortedMapOf(*values)
/**
- * Returns a new [[LinkedHashMap]] populated with the given tuple values where the first value in each tuple
+ * Returns a new [[LinkedHashMap]] populated with the given pairs where the first value in each pair
* is the key and the second value is the value. This map preserves insertion order so iterating through
* the map's entries will be in the same order
*
@@ -127,7 +127,7 @@ class MapTest {
assertEquals(arrayList("beer2", "Mells2"), m2.values().toList())
}
- test fun createUsingTuples() {
+ test fun createUsingPairs() {
val map = hashMap(Pair("a", 1), Pair("b", 2))
assertEquals(2, map.size)
assertEquals(1, map.get("a"))
@@ -103,7 +103,7 @@ class MapJsTest {
}
*/
- test fun createUsingTuples() {
+ test fun createUsingPairs() {
val map = hashMap(Pair("a", 1), Pair("b", 2))
assertEquals(2, map.size)
assertEquals(1, map.get("a"))
@@ -139,12 +139,6 @@ abstract class KDocTemplate() : TextTemplate() {
// TODO use drop()
val rest = arguments.subList(0, arguments.size - 1).orEmpty()
"${typeArguments(rest, "(", ")", "()")}&nbsp;<A HREF=\"${href(c)}\" title=\"${c.kind} in ${c.packageName}\">-&gt;</a>&nbsp;${link(rt)}"
- } else if (cname.startsWith("jet.Tuple")) {
- if (arguments.isEmpty()) {
- "Unit"
- } else {
- "<A HREF=\"${href(c)}\" title=\"${c.kind} in ${c.packageName}\">#</a>${typeArguments(arguments, "(", ")", "()")}"
- }
} else {
val name = if (fullName) cname else c.simpleName
"<A HREF=\"${href(c)}\" title=\"${c.kind} in ${c.packageName}\">$prefix$name</A>${typeArguments(arguments)}"
@@ -518,7 +518,7 @@ fun collections() {
f("sortBy(f: (T) -> R)") {
doc = """
Copies all elements into a [[List]] and sorts it by value of compare_function(element)
- E.g. arrayList("two" to 2, "one" to 1).sortBy({it._2}) returns list sorted by second element of tuple
+ E.g. arrayList("two" to 2, "one" to 1).sortBy({it.second}) returns list sorted by second element of pair
"""
returns("List<T>")
typeParam("R: Comparable<R>")

0 comments on commit 5ccbce6

Please sign in to comment.