== doSmth == fun doSmth() {} --------------------- ===================== == doSmth1 == fun doSmth1() {} --------------------- ===================== == doSmth2 == fun doSmth2() {} --------------------- ===================== == cond == fun cond() {} --------------------- ===================== == testCopy1 == fun testCopy1() : Int { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 } } --------------------- doSmth NEW() doSmth() COPY { doSmth() } COPY doSmth1 NEW() doSmth1() COPY { doSmth1() } COPY doSmth2 NEW() doSmth2() COPY { doSmth2() } COPY 1 NEW() try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 } NEW(, , ) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 } } COPY ===================== == testCopy2 == fun testCopy2() { while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } } } --------------------- cond NEW() cond() COPY doSmth NEW() doSmth() COPY { doSmth() } COPY doSmth1 NEW() doSmth1() COPY { doSmth1() } COPY doSmth2 NEW() doSmth2() COPY { doSmth2() } COPY cond NEW() cond() COPY try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } NEW(, , ) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } } COPY ===================== == testCopy3 == fun testCopy3() { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); } } --------------------- doSmth NEW() doSmth() COPY { doSmth() } COPY doSmth1 NEW() doSmth1() COPY { doSmth1() } COPY doSmth2 NEW() doSmth2() COPY { doSmth2() } COPY cond NEW() cond() COPY try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); } NEW(, , ) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); } } COPY ===================== == doTestCopy4 == fun doTestCopy4(list: List?) : Int { try { doSmth() } finally { if(list != null) { } } } --------------------- doSmth NEW() doSmth() COPY { doSmth() } COPY list NEW() != NEW(, ) null NEW() list != null COPY try { doSmth() } finally { if(list != null) { } } COPY { try { doSmth() } finally { if(list != null) { } } } COPY =====================