IDEA-131754 Catch and finally blocks have no line information

This commit is contained in:
Egor.Ushakov
2015-01-14 14:28:55 +03:00
parent 5a96486853
commit 9b32709856
6 changed files with 40 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -416,6 +416,7 @@ public class DeadCodeHelper {
if (sameRanges) {
seq.addSequence(next.getSeq());
block.getInstrOldOffsets().addAll(next.getInstrOldOffsets());
next.getSeq().clear();
removeEmptyBlock(graph, next, true);

View File

@@ -16,7 +16,7 @@ public class TestClassLoop {
return;
}
} finally {
System.out.println("1");
System.out.println("1");// 38
}
}
}
@@ -30,7 +30,7 @@ public class TestClassLoop {
System.out.println("1");// 49
break;
} finally {
if(var0) {
if(var0) {// 52
System.out.println("3");// 53
continue;
}
@@ -54,6 +54,9 @@ class 'pkg/TestClassLoop' {
4 10
d 10
f 14
26 18
27 18
2a 18
}
method 'testFinallyContinue ()V' {
@@ -64,6 +67,7 @@ class 'pkg/TestClassLoop' {
e 29
11 29
13 29
26 32
2a 33
2d 33
2f 33
@@ -74,6 +78,8 @@ Lines mapping:
23 <-> 6
29 <-> 11
33 <-> 15
38 <-> 19
45 <-> 25
49 <-> 30
52 <-> 33
53 <-> 34

View File

@@ -22,9 +22,9 @@ public class TestClassSimpleBytecodeMapping {
try {
Integer.parseInt(var1);// 34
} catch (Exception var6) {
System.out.println(var6);
System.out.println(var6);// 36
} finally {
System.out.println("Finally");
System.out.println("Finally");// 38
}
}
@@ -80,6 +80,11 @@ class 'pkg/TestClassSimpleBytecodeMapping' {
method 'test2 (Ljava/lang/String;)V' {
1 22
11 24
15 24
23 26
24 26
27 26
}
method 'run (Ljava/lang/Runnable;)V' {
@@ -114,6 +119,8 @@ Lines mapping:
27 <-> 16
28 <-> 17
34 <-> 23
36 <-> 25
38 <-> 27
44 <-> 44
49 <-> 33
54 <-> 38

View File

@@ -9,7 +9,7 @@ public class TestClassVar {
try {
System.out.println();// 29
} finally {
if(this.field_boolean) {
if(this.field_boolean) {// 32
System.out.println();// 33
}
@@ -46,6 +46,8 @@ class 'pkg/TestClassVar' {
3 7
8 9
b 9
1f 11
20 11
26 12
29 12
}
@@ -73,6 +75,7 @@ class 'pkg/TestClassVar' {
Lines mapping:
26 <-> 8
29 <-> 10
32 <-> 12
33 <-> 13
40 <-> 22
45 <-> 26

View File

@@ -16,6 +16,7 @@ class 'pkg/TestSynchronizedMapping' {
method 'test (I)I' {
3 4
5 5
a 5
}
method 'test2 (Ljava/lang/String;)V' {

View File

@@ -11,7 +11,7 @@ public class TestTryCatchFinally {
;
}
} finally {
System.out.println("finally");
System.out.println("finally");// 34
}
}
@@ -31,9 +31,9 @@ public class TestTryCatchFinally {
int var2 = Integer.parseInt(var1);// 51
return var2;
} catch (Exception var6) {
System.out.println("Error" + var6);
System.out.println("Error" + var6);// 53
} finally {
System.out.println("Finally");
System.out.println("Finally");// 55
}
return -1;
@@ -48,6 +48,9 @@ class 'pkg/TestTryCatchFinally' {
14 8
17 8
19 8
2b 13
2d 13
30 13
}
method 'foo (I)I' {
@@ -63,15 +66,25 @@ class 'pkg/TestTryCatchFinally' {
method 'test (Ljava/lang/String;)I' {
1 30
4 30
10 33
1a 33
23 33
26 33
34 35
35 35
38 35
}
}
Lines mapping:
24 <-> 6
27 <-> 9
34 <-> 14
39 <-> 20
40 <-> 21
41 <-> 22
42 <-> 23
45 <-> 25
51 <-> 31
53 <-> 34
55 <-> 36