j2k: Generate class literals in throws
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import java.io.*
|
||||
|
||||
public class C {
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
fun foo() {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
// reading something
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.io.*
|
||||
|
||||
public class C {
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
fun foo() {
|
||||
ByteArrayInputStream(ByteArray(10)).use { input ->
|
||||
ByteArrayOutputStream().use { output ->
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.io.*
|
||||
|
||||
public class C {
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
fun foo() {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream -> println(stream.read()) }
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.io.*
|
||||
|
||||
public class C {
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
fun foo() {
|
||||
try {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import java.io.*
|
||||
|
||||
trait I {
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
public fun doIt(stream: InputStream): Int
|
||||
}
|
||||
|
||||
public class C {
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
fun foo() {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
bar(object : I {
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
override fun doIt(stream: InputStream): Int {
|
||||
return stream.available()
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public class C {
|
||||
}
|
||||
}
|
||||
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
fun bar(i: I, stream: InputStream): Int {
|
||||
return i.doIt(stream)
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import java.io.*
|
||||
|
||||
trait I {
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
public fun doIt(stream: InputStream): Int
|
||||
}
|
||||
|
||||
public class C {
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
fun foo(): Int {
|
||||
ByteArrayInputStream(ByteArray(10)).use { stream ->
|
||||
return bar(object : I {
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
override fun doIt(stream: InputStream): Int {
|
||||
return stream.available()
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public class C {
|
||||
}
|
||||
}
|
||||
|
||||
throws(javaClass<IOException>())
|
||||
throws(IOException::class)
|
||||
fun bar(i: I, stream: InputStream): Int {
|
||||
return i.doIt(stream)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user