Fixed KT-5223 Converter from Java should convert "throws" in method declaration
#KT-5223 Fixed
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import java.io.*
|
||||
|
||||
public class C() {
|
||||
throws(javaClass<IOException>())
|
||||
fun foo() {
|
||||
FileInputStream("foo").use { stream ->
|
||||
// reading something
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import java.io.*
|
||||
|
||||
public class C() {
|
||||
throws(javaClass<IOException>())
|
||||
fun foo() {
|
||||
FileInputStream("foo").use { input ->
|
||||
FileOutputStream("bar").use { output ->
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import java.io.*
|
||||
|
||||
public class C() {
|
||||
throws(javaClass<IOException>())
|
||||
fun foo() {
|
||||
FileInputStream("foo").use { stream -> System.out.println(stream.read()) }
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import java.io.*
|
||||
|
||||
public class C() {
|
||||
throws(javaClass<IOException>())
|
||||
fun foo() {
|
||||
try {
|
||||
FileInputStream("foo").use { stream ->
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import java.io.*
|
||||
|
||||
trait I {
|
||||
throws(javaClass<IOException>())
|
||||
public fun doIt(stream: InputStream): Int
|
||||
}
|
||||
|
||||
public class C() {
|
||||
throws(javaClass<IOException>())
|
||||
fun foo() {
|
||||
FileInputStream("foo").use { stream ->
|
||||
bar(object : I {
|
||||
throws(javaClass<IOException>())
|
||||
override fun doIt(stream: InputStream): Int {
|
||||
return stream.available()
|
||||
}
|
||||
@@ -15,6 +18,7 @@ public class C() {
|
||||
}
|
||||
}
|
||||
|
||||
throws(javaClass<IOException>())
|
||||
fun bar(i: I, stream: InputStream): Int {
|
||||
return i.doIt(stream)
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import java.io.*
|
||||
|
||||
trait I {
|
||||
throws(javaClass<IOException>())
|
||||
public fun doIt(stream: InputStream): Int
|
||||
}
|
||||
|
||||
public class C() {
|
||||
throws(javaClass<IOException>())
|
||||
fun foo(): Int {
|
||||
return FileInputStream("foo").use { stream ->
|
||||
bar(object : I {
|
||||
throws(javaClass<IOException>())
|
||||
override fun doIt(stream: InputStream): Int {
|
||||
return stream.available()
|
||||
}
|
||||
@@ -15,6 +18,7 @@ public class C() {
|
||||
}
|
||||
}
|
||||
|
||||
throws(javaClass<IOException>())
|
||||
fun bar(i: I, stream: InputStream): Int {
|
||||
return i.doIt(stream)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user