decompiler: major line numbers fixes

This commit is contained in:
Egor.Ushakov
2014-12-25 21:36:19 +03:00
parent 4a6a658b4c
commit 4ee8ad716d
49 changed files with 1124 additions and 142 deletions

View File

@@ -0,0 +1,71 @@
package pkg;
import java.lang.Exception;
import java.lang.Override;
import java.lang.Runnable;
public abstract class TestAnonymousClass {
void foo(int i)
throws Exception {
if (i > 0) {
I r = new I() {
public void foo() throws Exception {
int a = 5;
int b = 5;
}
};
r.foo();
}
else {
final int x =5;
System.out.println(x);
}
}
public static final Runnable R3 = new Runnable() {
@Override
public void run() {
int a =5;
int b =5;
}
};
void boo() {
int a =5;
}
void zoo() {
int a =5;
}
public static final Runnable R = new Runnable() {
@Override
public void run() {
int a =5;
int b =5;
}
};
public static final Runnable R1 = new Runnable() {
@Override
public void run() {
int a =5;
int b =5;
}
};
interface I {
void foo() throws Exception;
}
private static class Inner {
private static Runnable R_I = new Runnable() {
@Override
public void run() {
int a =5;
int b =5;
}
};
}
}

View File

@@ -15,7 +15,7 @@
*/
package pkg;
public class TestDeprecations {
public abstract class TestDeprecations {
/** @deprecated */
public int byComment;
@@ -23,14 +23,36 @@ public class TestDeprecations {
public int byAnno;
/** @deprecated */
public void byComment() { }
@Deprecated
public void byAnno() { }
public void byComment() {
int a =5;
}
/** @deprecated */
public static class ByComment { }
public abstract void byCommentAbstract();
@Deprecated
public static class ByAnno { }
public void byAnno() {
int a =5;
}
@Deprecated
public abstract void byAnnoAbstract();
/** @deprecated */
public static class ByComment {
int a =5;
void foo() {
int x = 5;
}
}
@Deprecated
public static class ByAnno {
int a =5;
void foo() {
int x = 5;
}
}
}

View File

@@ -0,0 +1,26 @@
package pkg;
import java.lang.Override;
import java.lang.Runnable;
public abstract class TestLocalClass {
void foo() {
int a =5;
class Local{
void foo() {
int b = 5;
int v = 5;
}
};
Local l = new Local();
l.foo();
}
void boo() {
int a =5;
}
void zoo() {
int a =5;
}
}

View File

@@ -0,0 +1,19 @@
package pkg;
import java.lang.Override;
import java.lang.Runnable;
public class TestThrowException {
Runnable r;
public TestThrowException(int a) {
if (a > 0) {
throw new IllegalArgumentException("xxx");
}
r = new Runnable() {
@Override
public void run() {
int a = 5;
}
};
}
}

View File

@@ -15,6 +15,9 @@
*/
package pkg;
import java.lang.Exception;
import java.lang.RuntimeException;
public class TestTryCatchFinally {
public void test1(String x) {
try {
@@ -32,6 +35,17 @@ public class TestTryCatchFinally {
}
}
int foo(int a) throws Exception {
if (a < 1) {
throw new RuntimeException();
} else if ( a <5) {
return a;
}
else {
throw new Exception();
}
}
public int test(String a) {
try {
return Integer.parseInt(a);