Given a class containing a method switching on an enum, like this: 1: public class WeirdConstructorLinenumber 2: { 3: public void consider(java.math.RoundingMode mode) { 4: switch ( mode ) {} 5: } 6: } javac generates a default constructor as expected. But the generated constructor returns from line 4 (which really belongs to the "consider" method). $ javac WeirdConstructorLinenumber.java $ javap -c -l -classpath . WeirdConstructorLinenumber Compiled from "WeirdConstructorLinenumber.java" public class WeirdConstructorLinenumber { public WeirdConstructorLinenumber(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return LineNumberTable: line 1: 0 line 4: 4 [...] }
|