ValV
10/17/2018, 12:43 AMKClass
? Some special data construction for reflection? How does it work?karelpeeters
10/17/2018, 12:44 AMjava.lang.Class
but with a couple of extra functions and properties.karelpeeters
10/17/2018, 12:44 AMValV
10/17/2018, 12:49 AMValV
10/17/2018, 1:12 AMpoohbar
10/17/2018, 3:25 AMoutput.use { stream -> stream.writer().use { it.write(response) } }
keturn
10/17/2018, 3:42 AMuse
I needed to stack. I think it was with InputStream and Reader instead of Writer, but I expect the same principles apply.jo
10/17/2018, 3:51 AMjo
10/17/2018, 3:52 AMShawn
10/17/2018, 3:53 AMKClass<Foo>
or some variant thereof, but you can’t really have it as a key because type erasureShawn
10/17/2018, 3:53 AMShawn
10/17/2018, 3:54 AMShawn
10/17/2018, 3:54 AMjo
10/17/2018, 3:54 AMShawn
10/17/2018, 3:55 AMjo
10/17/2018, 3:55 AMjo
10/17/2018, 3:55 AMShawn
10/17/2018, 3:55 AMMap<KClass<T>, T>
, but where T : Any
jo
10/17/2018, 3:55 AMShawn
10/17/2018, 3:56 AMFoo::class
will yield an instance of KClass<Foo>
by the way, you can’t use it as a typejo
10/17/2018, 3:57 AMjo
10/17/2018, 3:57 AMjo
10/17/2018, 3:59 AMfun addComponent(c:Component) { ... ? ... }
jo
10/17/2018, 4:00 AMjo
10/17/2018, 4:01 AMMap<Class<Component>, Component>
jo
10/17/2018, 4:01 AMfun addComponent(c:Component) { this.components.put(c.javaClass, c) }
jo
10/17/2018, 4:01 AMmatt tighe
10/17/2018, 10:59 PMval dest = File("firstfile.txt")
val target = File("somefile.txt")
target.createNewFile()
target.remainOpenTilClosed()
dest.write("test")
assertFailsWith(SomeException::class, "Could not copy to open file") {
dest.copyTo(target, overwrite = true)
}
target.close()
Nikky
10/17/2018, 11:25 PMNikky
10/17/2018, 11:26 PMbeforeEachTest
in spek