public interface A {
}
public class B implements A {
}
...
List<B> b_list = new ArrayList<B>();
List<A> a_list = b_list;
a_list.add(new A());
B b = b_list.get(0);
function f1(a, b) {
if (a == 0) {
a *= f12() + f15(a);
b = f2(1, b);
if (b > 15) {
f4(a);
f5(b)
}
if (a > 17) {
f86(a);
}
return f6(a, b);
}
return f7(a, b);
}
public class Test
{
public static final RuntimeException fex = new RuntimeException();
public static void main(String[] args) throws Exception {
long start;
long end;
start = System.currentTimeMillis();
for (int i = 0; i < 10000; i++) {
testReturn(0);
}
end = System.currentTimeMillis();
System.out.println("Return time: " + (end - start) + "ms");
start = System.currentTimeMillis();
for (int i = 0; i < 10000; i++) {
try {
testExceptionThrow(0);
} catch (RuntimeException e) {
}
}
end = System.currentTimeMillis();
System.out.println("Exception throw time: " + (end - start) + "ms");
start = System.currentTimeMillis();
for (int i = 0; i < 10000; i++) {
try {
testExceptionCreate(0);
} catch (RuntimeException e) {
}
}
end = System.currentTimeMillis();
System.out.println("Exception create time: " + (end - start) + "ms");
}
public static void testReturn(int count) {
if (count > 1000) {
return;
} else {
testReturn(count + 1);
}
}
public static void testExceptionThrow(int count) {
if (count > 1000) {
throw fex;
} else {
testExceptionThrow(count + 1);
}
}
public static void testExceptionCreate(int count) {
if (count > 1000) {
throw new RuntimeException();
} else {
testExceptionCreate(count + 1);
}
}
}
Return time: 15ms
Exception throw time: 203ms
Exception create time: 1079ms
select *
from `table`
where id in (
<подзапрос или список для выбора id>
)
order by
case when lang = 1 then 1
when lang = 2 then 2
else 3
end asc