apatrida
06/21/2016, 12:19 AMapatrida
06/23/2016, 9:20 PM1.19.0
released which adds immutable protectors for existing collections, based on a SO answer by @miensol provides a light-weight delegate around collections that prevents any avenue of modification including casting to a mutable type then modifying. And Klutter goes a step further by protecting sub collections such as iterator, listIterator, entrySet, etc. All of those doors are closed and using Kotlin delegation for most methods you take no hit in performance. Simply call myCollection.asImmutable()
and the result is the same interface but protected.
Code to steal, or use the uy.kohesive.klutter:klutter-core-jdk6:1.19.0
module:
https://github.com/kohesive/klutter/blob/master/core-jdk6/src/main/kotlin/uy/klutter/core/common/Immutable.kt
And with tests showing some of the tricks that allowed modifications before, but now do not, along with the blocked casts and calls using these wrappers.
https://github.com/kohesive/klutter/blob/master/core-jdk6/src/test/kotlin/uy/klutter/core/collections/TestImmutable.ktapatrida
06/24/2016, 2:53 PM1.20.0
is on the way with:
* BREAKING CHANGE: from 1.19.x renamed `asImmutable()` to `asReadOnly()`
* BREAKING CHANGE: from 1.19.x renamed `Immutable*` collection wrappers to `ReadOnly*`
* Added marker interface ReadOnly to the read only collection wrappers
* For List, Map and Set added extensions `toImmutable()` which makes a copy first then protects the items from change by wrapping with `ReadOnly*` wrappers. Only cruel reflection tricks can break them.
* Adding `equals`, `hashCode` and `toString` for `ReadOnly*` collections
apatrida
06/24/2016, 3:01 PMapatrida
06/26/2016, 4:08 PM>> Since Injekt and Kodein both ended up in a very similar implementation (object registry approach to injection), it makes little sense in having two flavours of the same library for Kotlin. Therefore Injekt is deferring to Kodein. Since Injekt has no known bugs, there is no fear in continuing to use it (and I will fix anyting that shows up), but for additional functionality see Kodein instead.Libraries such as Klutter will create Kodein modules for their injection modules, same for Kovert. And Typesafe configuration injection from Klutter will also be ported over to Kodein for future releases.
apatrida
06/26/2016, 4:09 PMAndreas Sinz
07/17/2016, 11:17 AMapatrida
07/21/2016, 3:10 PMjvsegarra
07/23/2016, 3:40 PMyasyd
10/25/2016, 2:39 PMapatrida
10/25/2016, 2:58 PMyasyd
10/25/2016, 3:52 PMapatrida
10/25/2016, 7:25 PMyasyd
10/26/2016, 7:14 AMapatrida
10/26/2016, 7:22 PMyasyd
10/27/2016, 8:35 PMkirillrakhman
11/14/2016, 5:55 PMapatrida
11/15/2016, 6:13 PMkirillrakhman
11/15/2016, 7:01 PMorangy
kirillrakhman
12/22/2016, 1:43 PMaltero
01/19/2017, 1:44 PMapatrida
03/27/2017, 1:09 AMapatrida
03/27/2017, 1:09 AMapatrida
04/07/2017, 1:53 AMjkwatson
04/07/2017, 2:55 AMmesquka
04/26/2017, 2:22 PMpedro
05/07/2017, 7:50 PMkane.oriley
05/22/2017, 5:44 AMarthur
06/08/2017, 3:08 PM