Commit Graph

1601 Commits

Author SHA1 Message Date
Ilya Gorbunov 3bedbfae33 Move kotlin.comparisons.Comparator to kotlin package and remove the former from default imports. 2016-12-15 13:39:10 +03:00
Stanislav Erokhin 457918a6dd Changed name resolution for dynamic extension. Added annotation DynamicExtension. 2016-12-14 21:36:26 +03:00
Ilya Gorbunov bc944961f1 Use internal published-api function to validate radix in string-number conversion functions.
#KT-8286
2016-12-14 17:20:44 +03:00
Mikhail Zarechenskiy c15c00677e Add operator 'rem' as extension to BigDecimal
Deprecate 'mod' operator
2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy 5a829809d9 Add operator 'rem' as extension to BigInteger
#KT-14650 Fixed

 Note that after this change behaviour of '%' on BigInteger is changed,
now it works like a proper remainder
2016-12-14 15:29:00 +03:00
Mikhael Bogdanov 95a47e56f7 InlineExposed usages are changed to PublishedApi 2016-12-09 11:55:14 +01:00
Alexey Andreev 0f813d5cfe JS: fix compiling stdlib tests in JS 2016-12-09 12:04:32 +03:00
Ilya Gorbunov 3e69820907 Fix ClosedComparableRange.contains implementation, add docs. 2016-12-08 22:13:02 +03:00
Ilya Gorbunov 8ec2a2e6fe Add NaN-propagation in coerceIn(ClosedComparableRange<Double>) 2016-12-08 22:13:00 +03:00
Ilya Gorbunov ea77673dde Reimplement coerceIn to range with new range functions: lessThanOrEquals. 2016-12-08 20:50:26 +03:00
Ilya Gorbunov d60fc7d9a8 Introduce ClosedComparableRange interface which inherits ClosedRange to provide special comparison operation for double and float. 2016-12-08 20:50:11 +03:00
Ilya Gorbunov 5773594412 Reimplement ClosedRange.contains extensions to call interface contains method. 2016-12-08 20:50:07 +03:00
Ilya Gorbunov 4721dcd07c Add specialization overloads for Float.rangeTo and Double.rangeTo to resolve them statically. 2016-12-08 20:49:10 +03:00
Ilya Gorbunov f5cc53c157 Provide ComparableRange specializations for Double and Float.
#KT-4481
2016-12-08 20:47:24 +03:00
Ilya Gorbunov eaf64fb225 MapTest: Uncomment cases that pass now, add more cases. 2016-12-08 20:34:57 +03:00
Ilya Gorbunov 2fa98323f1 Refactor: rename files. 2016-12-06 21:30:35 +03:00
Ilya Gorbunov d5f5f88cda Add number to string conversion with the specified radix.
#KT-8286
2016-12-06 21:30:35 +03:00
Ilya Gorbunov a6fb61f5c3 Fix various maven pom problems:
- Add relativePath to samples pom.
- Specify versions of plugins
2016-12-04 14:15:34 +03:00
Ilya Gorbunov 75d80acac9 Rework existing unit tests used as samples. 2016-12-02 22:41:25 +03:00
Ilya Gorbunov 57cef391ac Create a separate project for stdlib samples. 2016-12-02 22:41:25 +03:00
Ilya Gorbunov dc57d69085 Improve onEach templates.
Add new functions to reference API.
Add tests for onEach
  #KT-8220
2016-11-30 16:46:56 +03:00
Ilya Gorbunov 21fba92c93 Annotate new number parsing functions with SinceKotlin.
#KT-8286, #KT-7930
2016-11-30 02:33:51 +03:00
Ilya Gorbunov 9b421eb7a4 Throw IllegalArgumentException instead of NumberFormatException on incorrect radix. 2016-11-30 02:20:33 +03:00
Ilya Gorbunov 3c80a7056a Refactor local test dsl.
Add several cases and arabic digits conversion test.
2016-11-30 02:19:43 +03:00
Ilya Gorbunov 1b9dfffc13 Minor: normalize casing of Test annotation 2016-11-30 02:19:40 +03:00
Ilya Gorbunov 410e85ef79 Minor: extract a couple of platform-specific functions. 2016-11-30 02:19:38 +03:00
Ilya Gorbunov 4d6c5bcdcf Split API to separate overloads with radix parameter and without.
Remove unused radix parameter from toFloat and toDouble.
Update public API dump.
#KT-8286, #KT-7930
2016-11-30 02:19:36 +03:00
Ilya Gorbunov ce50c7f13d Fix in test to deal with java 6 not accepting leading plus. 2016-11-30 02:19:33 +03:00
voddan a8bd174cd0 Added tests for parsing with radix.
#KT-8286
2016-11-30 02:19:31 +03:00
voddan 0a939a647f Added optional radix parameter to string-parsing functions: String.toInt, String.toIntOrNull etc.
#KT-8286
2016-11-30 02:19:29 +03:00
voddan 87d010e038 Introduce local dsl for number parsing tests, improve test coverage.
#KT-7930
2016-11-30 02:19:27 +03:00
voddan ce9c981e26 Implemented String.toIntOrNull , String.toLongOrNull.
Rewrote `String.toShortOrNull` and `String.toByteOrNull` by delegating to `String.toIntOrNull`.
Added a regEx check into `String.toDoubleOrNull` to prevent throwing exceptions mostly.
#KT-7930
2016-11-30 02:19:26 +03:00
voddan 3d050322e0 Added String.toIntOrNull, etc
#KT-7930
2016-11-30 02:17:35 +03:00
voddan fb51d21888 Extracted string-parsing extensions and their tests into separate files. 2016-11-30 02:17:35 +03:00
Ilya Gorbunov 0eba06405a Use InputStream as another guess for estimated size in InputStream.readBytes() 2016-11-22 23:37:29 +03:00
Ilya Gorbunov e41cbe6fe1 Check that the length of a file can be represented as Int. 2016-11-22 23:37:27 +03:00
Ilya Gorbunov c90ee13656 Performance: use byte array buffer directly to read the entire contents of a file.
#KT-14883 Fixed
2016-11-22 23:37:05 +03:00
Ilya Gorbunov 6a70761783 Minor: normalize '@Test' annotation casing in all tests. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov 50cd620f92 Remove java.util.* imports from common code. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov 5c2fe13a89 Refer to java.util.Arrays fully-qualified in generated code 2016-11-16 18:47:42 +03:00
Ilya Gorbunov fae5c88f22 Remove java.util references from the common code 2016-11-16 18:47:42 +03:00
Ilya Gorbunov 63535393e7 Move Comparator to kotlin.comparisons and make it imported by default.
#KT-2084
2016-11-16 18:47:42 +03:00
Ilya Gorbunov 090bd76ac9 Introduce type aliases for jvm collections in kotlin.collections
#KT-2084
2016-11-16 18:47:42 +03:00
Ilya Gorbunov 09072f6cdc Remove toInt() conversion as it's hardly required.
#KT-14789
2016-11-15 16:38:52 +03:00
Ilya Gorbunov 8de67d039b Expose maximum version component value as a constant, increase it to 255.
Add tests for KotlinVersion, document remaining parts of API.
#KT-14789
2016-11-15 16:38:52 +03:00
Ilya Gorbunov 5f7d779370 Introduce KotlinVersion API
#KT-14789
2016-11-15 16:38:52 +03:00
Ilya Gorbunov 8feaaf4df0 Allow to annotate generated API with SinceKotlin and annotate new array functions. 2016-11-08 18:08:59 +03:00
Ilya Gorbunov dceec89572 JS: Array.toString is const, Array.contentToString is shallow, Array.contentDeepToString is deep and self-reference aware
#KT-13582
2016-11-08 17:23:45 +03:00
Ilya Gorbunov f3da656d6e contentEquals, contentHashCode, contentToString: Add js implementation and tests
#KT-13582
2016-11-08 17:23:45 +03:00
Ilya Gorbunov a868eecb1a Introduce contentEquals/HashCode/ToString for Arrays. Different methods for deep equals/hashCode/toString rather than overloads with a parameter, because most of the time it would be constant, and make these methods inline-only.
Make `contentEquals` infix function.
Add docs.
#KT-13582
2016-11-08 17:23:45 +03:00