I'm not saying that the conclusion of the article is wrong, I'm merely trying to explain why the code blob above looks so weird.
In either case, we have the bytecode; and shouldn't what is written above compile to the same bytecode?
public class C { public int foo() { return 1; int b = 1 + 2; } }
Then compile it (javac C.java). You will get the following:
C.java:4: unreachable statement int b = 1 + 2; ^ C.java:5: missing return statement } ^ 2 errors
Therefore this code is not compileable, thus telling us that the initial code blob could never have run in the first place.
I'm not sure why the decompiler returns non-compiling java code, I just know it does.
I can imagine some poor developer, unable to figure out why it seems to always throw a StackOverflowException, putting that return statement in in frustration, and forgetting about it.
Selections from above link:
Checks that the certificate is currently valid. It is if the current date and time are within the validity period given in the certificate.
There has got to be more to their code than this. It does nothing useful except make sure a random certificate is not expired. If there is no certificate, it doesn't fail or return false or anything. What is this!?Could this be a profiler-optimized set of code that really had a LOT more code to it? But then why would the bit of random junk after the return statement exist? Did no one do a proper code-review of this???
[edit: I used JavaSE 1.5 above; but I just checked Android's version and it looks to be the same, just less verbage in the docs.]