yeah, don't take too much notice of that. i noticed that if you disassemble a "throw", it doesn't have a return. but the a=a does. maybe its requirement of bytecode that a method that does return, finishes with return byte code. but its like Java strings being a char array with a size. there's no need to terminate it. it cant run off the end.
On Aug 26, 7:53 pm, Fabrizio Giudici <fabrizio.giud...@tidalwave.it> wrote: > Christian Catchpole wrote: > > Compile this.. (any package you like, or no package at all) > > > public class Rethrow { > > public static void unchecked(Throwable t) { > > t=t; > > } > > } > > > javap reports the byte code as.. > > > public static void unchecked(java.lang.Throwable); > > Code: > > Stack=1, Locals=1, Args_size=1 > > 0: aload_0 > > 1: astore_0 > > 2: return > > I'm surprised - I expected that the compiler would optimize out the > useless operation and only output the return... > > -- > Fabrizio Giudici - Java Architect, Project Manager > Tidalwave s.a.s. - "We make Java work. Everywhere." > weblogs.java.net/blog/fabriziogiudici -www.tidalwave.it/blog > fabrizio.giud...@tidalwave.it - mobile: +39 348.150.6941 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to javaposse@googlegroups.com To unsubscribe from this group, send email to javaposse+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---