J2K: fixed conversion of Throwable.getMessage(), Throwable.getCause(), Map.Entry.getKey() and Map.Entry.getValue()

This commit is contained in:
Valentin Kipyatkov
2015-10-20 13:59:17 +03:00
parent 8dde7497e0
commit 36ea9cfbfc
4 changed files with 50 additions and 7 deletions
@@ -16,7 +16,7 @@ class A {
int h = map.entrySet().size();
}
void bar(List<String> list) {
void bar(List<String> list, HashMap<String, Integer> map) {
char c = "a".charAt(0);
byte b = new Integer(10).byteValue();
int i = new Double(10.1).intValue();
@@ -24,7 +24,19 @@ class A {
long l = new Double(10.1).longValue();
short s = new Double(10.1).shortValue();
String removed = list.remove(10);
Boolean isRemoved = list.remove("a");
try {
String removed = list.remove(10);
Boolean isRemoved = list.remove("a");
}
catch(Exception e) {
System.err.println(e.getMessage());
throw new RuntimeException(e.getCause());
}
for (Map.Entry<String, Integer> entry : map.entrySet()) {
String key = entry.getKey();
Integer value = entry.getValue();
entry.setValue(value + 1);
}
}
}
@@ -16,7 +16,7 @@ internal class A {
val h = map.entries.size
}
fun bar(list: MutableList<String>) {
fun bar(list: MutableList<String>, map: HashMap<String, Int>) {
val c = "a"[0]
val b = 10.toByte()
val i = 10.1.toInt()
@@ -24,7 +24,18 @@ internal class A {
val l = 10.1.toLong()
val s = 10.1.toShort()
val removed = list.removeAt(10)
val isRemoved = list.remove("a")
try {
val removed = list.removeAt(10)
val isRemoved = list.remove("a")
} catch (e: Exception) {
System.err.println(e.message)
throw RuntimeException(e.cause)
}
for (entry in map.entries) {
val key = entry.key
val value = entry.value
entry.setValue(value + 1)
}
}
}